EmonScripts on RPi5 with SSD

I’m building up a system to monitor my central heating heat battery, with an Eastron SDM230 energy meter, and Sharky 774 heat meter. I want a local dashboard so I’ve put together a RPi5 with a Touch Display 2, a M.2 HAT and a NVMe SSD. As I don’t want to run emon from an SD card I have gone the EmonScripts route. I’ve imaged the SSD with the full desktop environment version of Raspberry Pi OS, and then pulled the build scripts from the stable branch on GitHub. As I’m working with an SSD I’ve not tried to implement the SD card preparation steps on the SSD.

The EmonScripts mostly appears to work, apart from looking like it can’t compile mosquitto.c:

/bin/bash /opt/openenergymonitor/EmonScripts/install/Mosquitto-PHP/libtool --tag=CC --mode=compile cc -I. -I/opt/openenergymonitor/EmonScripts/install/Mosquitto-PHP -I/usr/include/php/2024092>
libtool: compile: cc -I. -I/opt/openenergymonitor/EmonScripts/install/Mosquitto-PHP -I/usr/include/php/20240924 -I/usr/include/php/20240924/main -I/usr/include/php/20240924/TSRM -I/usr/inclu>
/opt/openenergymonitor/EmonScripts/install/Mosquitto-PHP/mosquitto.c: In function ‘php_mosquitto_strerror_wrapper’:
/opt/openenergymonitor/EmonScripts/install/Mosquitto-PHP/mosquitto.c:892:19: error: initialization of ‘int’ from ‘char *’ makes integer from pointer without a cast [-Wint-conversion]
892 | int ret = strerror_r(err, buf, 256);
| ^~~~~~~~~~
make: *** [Makefile:208: mosquitto.lo] Error 1

I’ve taken a look at the Issues in GitHub and can see that 201 looks like a different compile error with mosquitto.c.

Suggestions for next steps?

Welcome, Iain, to the OEM forum. I’m afraid I can’t help you directly - with only what you’ve copied above to look at, to me it’s either a problem with the Mosquitto source code that’s been looked at and updated - but the update hasn’t been picked up by Trystan (who looks after emonScripts), or it’s something that needs attention by Mosquitto.

@TrystanLea ?

Mine compiles fine with a warning, but I’m just building from the raw source on a bare system, not using emonScripts so it may be a different compiler version and configuration.

Easy fix if you don’t mind getting into the source. The value is discarded anyway, so you can (probably!) change line 892 in mosquitto.c to (void)strerror_r(err, buf, 256);. Not tested with the system, as a disclaimer!

Thanks for the pointer @awjlogan

I re-imaged the SSD back to Pi OS and started again. I edited the init.sh script to not run main.sh, so I could edit mosquitto.sh to not clone the Mosquitto-PHP repo. That allowed me to manually clone the repo, edit mosquitto.c to correct for the previous compile error. I then ran main.sh which seemed to make it through the whole process without falling over. :+1:

I’m now in the state where OEM is running on the RPi and I can get to the web UI. However… emonhub refuses to start up:

it looks up to date:

and I’ve tried to start it manually:

emonhub is crucial to my installation, as it’s the route in for energy data from the Eastron SDM230.

Any more suggestions for what I should do next?

1 Like