Issues upgrading emoncms and some fixes

Hi there, I decided it was time to upgrade my emonbase, which is running “low-write 9.7.9 2017.01.05”; and emonSD-07Nov16 and had a few issues which I have solved and thought I would share in case others encounter the same problem. I started by making a copy of the SD Card, and I was looking forward to using the built-in upgrade option within the emoncms web interface Setup>Administration>Update Now

A window appeared showing the output from the update process, and there were various errors so I started to investigate on OEM site. It took me a while before I realised the output that appeared in the window was actually from the last time I updated in 2017! Yes there is a date which said “Mon 30 Jan 22:39:50 UTC 2017” but as it was from 18 months ago, I assumed it was some reference to the old version, and not the date that the update process ran. After all, it appeared in the update window, which I thought was the result of me pressing the update button, so it must be messages from today ? Well I now believe that the window just shows what is in /home/pi/data/emonpiupdate.log which in my case had not been updated…

And the reason the log file had not been updated, was that service-runner was not running on my Pi (this is my test Pi, that doesn’t process real data and at some point I had stopped service-runner). I manually started service-runner, and the update started running. I presume that clicking the update button must just set a flag in a file that service-runner monitors, so by restarting service-runner it launched the update in the background. Thankfully it was all logged to the emonpiupdate.log so I could still check the results.

[During my investigations, I was confused by various posts and the FAQ that explained the difference between the “emonPi Update” button and “EmonBase Update” button, because my version had neither of these buttons, but it had a button called “Update Now”. The “Update Now” button was replaced in version 9.8.0 with the two new buttons, and I had been using 9.7.9 so I had the one old button. Perhaps worth a brief mention in the FAQ for anyone else updating a system from pre-Jan 2017 (I read several posts from people who were updating systems for first time in 3 years)]

After the update finished, the emoncms web interface only showed a message about needing to update settings.php, and suggested comparing the current file to a default.settings.php. When I did this compare I found the default file did not have the standard userids and passwords for the various services (php, redis, mqtt) which were in my settings.php file. But I found a post on OEM that suggested using default.emonpi.settings.php. I compared this to my settings file, and all the userids & passwords matched, and the only difference was some new settings for Cassandra and some colour themes. So I copied the emonpi.settings over my settings.php and then the web interface loaded.

Except I couldn’t login due to the “Database error, you may need to run database update” error. Thankfully I found this post and ran the update from command line, and was then able to login. It appeared that the reason the DB update was not run by the update process was due to the issue with settings.php.
emonpiupdate.txt (64.4 KB)



As an additional thought, does updating this way update REDIS and PHP?

Should there be something in the documentation about doing that if not?

Just a little more digging for my own interest, I find PHP5.6 is end of life very soon (running on my original main system). I suspect the REDIS version is also old.

Is there a recommended version for each of these?

Perhaps as part of the upgrade process, users should be warned that some of the underlying elements need to be updated.

Hmm, I had assumed the update process would be updating any of those underlying external services, but looking back, only paho-mqtt was upgraded.

So I echo Brian’s question - are we supposed to update these external modules ourselves, or will a future emoncms update upgrade items like redis, node-red etc?

Node-red is a tricky one. IME updating it is fraught!

You are likely to also have the issue that you are running on Jessie rather than Stretch. The only way forward there is to migrate rather than update once @TrystanLea has sorted out the base image.

… and the only reason that got updated is because you originally had only one update button, if you were to update now and use the “update emonBase” button (I assume you have and emonbase not and emonpi from your opening line) paho-mqtt would not get updated, that is exclusive to “update emonpi” button users only (see Update EmonPi Button or Update EmonBase Button? - #15 by pb66).

[edit] Likewise with the nodered-emoncms-module, that only gets installed via the “update emonpi” button too.

1 Like

Thanks Paul, I had read lots of posts that lead me to believe the only difference between the emonbase and emonpi buttons was whether the RFM firmware was updated.

However, one of the main reasons I started this update was I had hoped it would update Node-Red, as the Node-Red twitter module needs to be updated to comply with the new Twitter API. I guess i’ll need to progress that myself