Does this even work on a Raspberry Zero !?

The difference isn’t in the W, it’s in the 1 or 2.

So originally it was a PiZ 1 - this had no wifi.

Then came the PiZ 1 W which had the antennae on the board. Should be no difference to the first version with a dongle.

Then came the PiZ 2W which is the newer architecture.

Simon

Or simply use PHP 8.0 until the foundation sort out the issues there?

Simon

Thanks @borpin running that test build and all your notes on what went wrong.
Sounds like in absence of a fix for the 8.1 issue using 8.0 may not be a bad idea for the next emonSD release?

I’ve just merged your pull requests, I will do a stable release

Did you see the log2ram update as well? There are a few PRs spread about that interact - not just the EmonScripts ones. :slight_smile:

Can you test logrotate before creating the Image as I think there might still be issues there as the services create log folders sometimes and those permissions might not be correct. Logrotate is picky now.

@TrystanLea - did you manage to do the build on the zero? If you have worked things out and want someone to test things, then as I said earlier I’d be glad to help. In my own interests of course, as I’d like to run my new system on a Zero… :smiley:

Simon

@Bramco

I’ll not get to test it until next week. Assuming you are content to get the partitions setup, then

  1. Download the script but use the master branch not the stable branch (edit the curl command).

  2. Edit init.sh to master branch.

  3. Run init script. It does an OS upgrade. Hook the Pi up to a monitor so you can see what is happening (if it goes pear shaped).

  4. Stop the install script y,

  5. Edit the config file and replace all instances of stable with master for the git repos.

  6. Set install WiFi and LCD to false. (also demandshaper)

  7. Edit the php.sh script replacing 8.1 with 8.0 and comment out the to[ if statement so as to not add this alternative package to the package lists.

Then you should be good to go.

This worked for me until I rebooted and Wi-Fi went all to pot which I have not been able to resolve yet.

If this works we can see about updating the php.sh script to allow for the differences.

[edited 10/02 16:00]
Added some info to process.

Hi Brian,

We’ve got family here this weekend but if I get a chance I’ll run things through. Will report back.

Simon

1 Like

@borpin @TrystanLea

I created the partitions etc. Altered fstab. Then pulled the ‘master’ version of the install file.

Ran that, then edited main.sh. Had to change the username and I also commented out the wifi line and the lcd line. Then changed to 8.0 in the php.sh file.

Things still went haywire as php 8.0 was being installed. See below.

It’s weird but the illegal instructions seem to be in the script file after a sub-process in dpkg exits.

Get:9 https://packages.sury.org/php bullseye/main armhf php8.0 all 1:8.0.27-4+0~20230207.49+debian11~1.gbpe27adc [35.4 kB]
Fetched 3,633 kB in 3s (1,058 kB/s)
apt-listchanges: Reading changelogs...
(Reading database ... 47579 files and directories currently installed.)
Preparing to unpack .../libpcre2-8-0_10.40-1+0~20220713.16+debian11~1.gbpb6cec5_armhf.deb ...
Unpacking libpcre2-8-0:armhf (10.40-1+0~20220713.16+debian11~1.gbpb6cec5) over (10.36-2+deb11u1) ...
*E: Sub-process /usr/bin/dpkg exited unexpectedly*
*/opt/openenergymonitor/EmonScripts/install/php.sh: line 21:  9800 Illegal instruction     sudo apt-get install -y php8.0-mysql*
/opt/openenergymonitor/EmonScripts/install/php.sh: line 23:  9801 Illegal instruction     sudo apt-get install -y php8.0-gd php8.0-curl php-pear php8.0-dev php8.0-common php8.0-mbstring
/opt/openenergymonitor/EmonScripts/install/php.sh: line 25:  9802 Illegal instruction     sudo pecl channel-update pecl.php.net
-------------------------------------------------------------
Redis configuration
-------------------------------------------------------------
/opt/openenergymonitor/EmonScripts/install/redis.sh: line 7:  9806 Illegal instruction     sudo apt-get install -y redis-server
-------------------------------------------------------------

/opt/openenergymonitor/EmonScripts/install/redis.sh: line 23:  9807 Illegal instruction     git clone https://github.com/phpredis/phpredis
/opt/openenergymonitor/EmonScripts/install/redis.sh: line 13: cd: phpredis: No such file or directory
/opt/openenergymonitor/EmonScripts/install/redis.sh: line 14: phpize: command not found
/opt/openenergymonitor/EmonScripts/install/redis.sh: line 15: ./configure: No such file or directory
make: *** No targets specified and no makefile found.  Stop.
/opt/openenergymonitor/EmonScripts/install/redis.sh: line 23:  9811 Illegal instruction     sudo make install
-------------------------------------------------------------
/opt/openenergymonitor/EmonScripts/install/redis.sh: line 19: php: command not found
/opt/openenergymonitor/EmonScripts/install/redis.sh: line 23:  9817 Done                    printf "extension=redis.so"
      9818 Illegal instruction     | sudo tee /etc/php/$PHP_VER/mods-available/redis.ini 1>&2
/opt/openenergymonitor/EmonScripts/install/redis.sh: line 23:  9819 Illegal instruction     sudo phpenmod redis
/opt/openenergymonitor/EmonScripts/install/redis.sh: line 25:  9820 Illegal instruction     sudo pip3 install redis
/

Yes I did the same and realised you need to completely remove the lines that change the package file in the php.sh script.

If it changes the package files it pulls php8.0 from that repo not the default repo. None of the repo will now work on ARMv6 chips (RPiOS made a change their end).

Can you also paste preformatted text (code/bash output etc) using the Ctl-E formatting (Preformatted in ribbon), please?

@borpin

Hi Brian, will do on the ctrl E.

Can you post the changes to the php.sh script here, or will you change it on git? I’ll give it another go when I get the change.

Simon

I have edited the process above 10 Feb 16:00

I won’t change it on git for now, ideally we will look and see if it ARMv6 or v7 so automate it.

Just comment out these lines

I’m just about to rerun myself.

[edit]
Just a note - if you want to create a file of the log messages, use

command 2>&1 | tee /path/to/logfile

[edit2]
Two Three Four things not working yet (Nobody expects the Spanish Inquisition)

  1. emonhub log not being created (sudo mkdir /var/log/emohub/)
  2. Remove Journal file location (sudo rm -r /var/log/journal/)
  3. The log2ram /etc/logrotate.d/00_olddir file is still throwing a parse error when logrotate is run. Appears editing the file, add a line at the bottom and then closing it again seems to fix it.
  4. Demandshaper is a cpu hog so stop and disable it (I suggest).

You must reboot after install.

But I have a running system on a PiZero

[edit3]

After pulling the right init.sh, you need to edit it to the master branch (I need to run the install process again :man_shrugging:)

The new answer is yes.

I have pushed a couple of changes to git to allow it to install onto PiZeros. Broadly following the discoveries here.

Docs to follow.

Great stuff Brian, thanks for working through this - I won’t be able to run a test now until Tuesday - need the screen and it’s been coopted by the family :frowning:

Simon

I think this is reasonably robust now. It just takes a while to do the first boot so be patient there. The install seems to work fine if you do all the bits (almost forgot a couple last time).

Those Git fixes are yet to be merged so need to do the manual fixes for now.

Thanks for the all the effort you put into this. I look forward to trying it out once it is noob friendly :slight_smile:

1 Like

Brian, thanks for all the effort put into this.
I’d be reasonably confident I could build on a piz-1w.
Will it still break if apt upgrade is done ?

If I took the lazy mans way out used a July21 emonsd, will it break if upgraded, or have all your now-merged changes prevented that ?

Nothing merged yet.

The Jul21 is not a Bullseye based release, which is half the reason for the Nov22 release. Jul21 is an old Raspbian base system that is really out of date now. Over 600 packages need updated and that isn’t good.

Thanks again Brian, that helps me.

As I only need emonhub for the MBUS hat, I’ll start with RaspPiOs 32bit Lite, and manually install only emonhub using emonscripts (making relevant mods to ensure it doesn’t pull php8.1).

I’ll see how that goes

Alan

Good news.
Following the instructions above, on top of a base RaspPiOs 32bit Lite, worked like a charm.
I have a working emonhub ( I chose not to install the rest of emon* as I don’t need that).

This is a nice little solution for the M-BUS hat, and a nice bonus is sticking a USB Jeenode in one of the USB ports allows it to be a great RF relay for some dead spots in my house.

Thanks Brian (and everyone) for all the work on this.

Alan

16 posts were split to a new topic: Odd error in single senor config in emonhub