Update EmonPi Button or Update EmonBase Button?

Discovered something today that I felt I should share or at least make note of somewhere.

It seems the update routines for the emonSD image are not the same when triggered from either the “Update emonPi” or “Update emonBase” buttons as we/I suspected…

Ideally they would be identical except for the firmware part and that was how it was originally afaicr.

This bit of code will select whether to update the RFM69Pi FW or the emonPi FW depending on whether the update flag from emoncms containd the text “rfm69pi” or not.

The rfm69piupdate,sh file is more or less as expected, it gets the latest FW from github, stops emonhub, uploads the FW to the RFM69Pi and then restarts emonhub.

However, the emonpiupdate file isn’t so straight forward. It seems to have a few “bonus bits” in it.

Firstly it upgrades paho-mqtt .

Then it goes on to stop emonhub, uploads FW to the emonPi add-on board and restrts emonHub…

And then it goes on to
“# Add bash prompt RW / RO emonPi file-system indicator”,
“# Move ~/.npm folder to RW folder ~/data/npm to allow npm packages to be installed when emonPi is in RO mode”
and “# Install / update nodeRED emonPixel & Emoncms nodes”

which means we have a double standard of emonSD images that differs depending on not only the HW the user is using but also on whether they want the FW updated. Of the 4 use cases, only 2 are getting the full package of updates and a simple difference of having an rfm12 or an rfm69 based emonBase could result in different bash prompts, mqtt functionality in Python, NPM functionality and possibly miss out on nodeRED with the emonPixel and emoncms nodes too.