Updating Emoncms

Hi,
I noticed this morning on the Open Energy Monitor website that the latest Emonpi firmware includes support for a GSM modem. I therefore decided to upgrade my firmware as I have been looking for a remote solution for monitoring a 50kW PV array which has no phone line connection, and since I already have an Emonpi monitoring my energy generation and use at home where I have a 20kW array I thought simply moving my existing Emonpi would be a great solution.
So, I plunged in to try to find out instructions on how to update the firmware. As a non-programmer, the process of trying to find out how to do stuff with my Emonpi has always been unbelievably daunting, which is the main reason why, once I got it set up and working about 9 months ago I haven’t tinkered with any settings!
I found what I was looking for at Import / Backup - Guide | OpenEnergyMonitor. I started following the video guide. The first thing I noticed was that I needed to be running a newer version of Emoncms - mine is 8.5. Clicking on update Emoncms the cron timer popup appears, however clicking on the log file link goes to a blank page and the system fails to update. Frustration started to creep in.
I then started searching for how to update Emoncms. Everywhere I looked the instructions started with entering code into a command line such as at emoncms/install_Wheezy.md at 3a8ff37f2c05fb5af24bf47d86822be1c58d24c3 · emoncms/emoncms · GitHub. I vaguely remembered accessing my Emonpi in this way when I was setting it up but I couldn’t remember how. And there is no explanation with the instructions - one stated words to the effect of “hit ctrl-alt-T to enter the command line window”. Doing so did nothing.
So I started searching some more and found a guide to manually updating firmware etc using the Arduino platform at Setting up the Arduino Environment for Windows (7, 8.1 & 10) | Archived Forum. My Emonpi came with a pre-loaded sd card so I never had to do anything with Arduino when I first set it up but I thought, what the hell, it might help me to learn a bit more about how the thing works if I go through the process of doing a manual update. So I started following the instructions and installed Arduino. I ignored the bit about the USB drivers as I hoped I’d be able to access my Emonpi via the Ethernet which is how it is connected to my network. So now I start reading about downloading files. Doing this via a web browser sounded tedious so I followed the links to using Git Hub but that sounds horribly complicated for me.
So now I have reached my wits’ end. All I want to do is update the firmware on my Emonpi sio that I can hook up a GSM dongle (which I have now ordered from Amazon). Will someone please help me to do this!!!
I am running Windows 10, the version of Emoncms is 8.5. I am using an optical sensor to read my PV generation meter and a CT sensor to read household consumption. I use the My Solar app to access the data and everything there functions as it should. I hope all the other information needed is included here. Sorry for the rambling but I am trying to show how tortuous this whole process has been for me. I enjoy the fact that when my Emonpi is working it just works, however the process of trying to alter anything is just incredibly frustrating. I really wish the programmers working on the project could see how hard it is for a non-programmer like me to understand!

Update: When I went to access my Emonpi via my web browser after the above it wouldn’t connect. So I reset it by holding the reset button in for 5 seconds then I turned it off at the wall then on again. Now it is connected but there are no feeds.

Update:
I brought my Emonpi indoors from the shed where the PV inverter is located to see if I could work things out with the unit beside me.
I once again tried hitting Update in Admin vbiew after logging into the emonpi.
This time the LCD screen indicated that an update was taking place and after it rebooted itself generated the following log file which seems to indicate that the update has been performed:

(Post continues below log file)

Filesystem is unlocked - Write access
type ' rpi-ro ' to lock
Stopping system emonPiLCD daemon:.
Starting emonPi Update >

Mon Jun 27 16:26:03 UTC 2016

EUID: 1000

emonSD-17Jun2015

git pull /home/pi/emonpi
Already up-to-date.
git pull /home/pi/RFM2Pi
Already up-to-date.
git pull /home/pi/emonhub
Already up-to-date.
git pull /home/pi/backup
Already up-to-date.

Start emonPi Atmega328 firmware update:

=================================
EmonPi update started
=================================

EUID: 1000

Requirement already satisfied (use --upgrade to upgrade): xmltodict in /usr/local/lib/python2.7/dist-packages
Cleaning up...
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/local/lib/python2.7/dist-packages
Cleaning up...
Stopping OpenEnergyMonitor emonHub: emonhub has been stopped ok.
Start ATmega328 serial upload using avrdude with latest.hex
Discrete Sampling
avrdude -c arduino -p ATMEGA328P -P /dev/ttyAMA0 -b 115200 -U flash:w:/home/pi/emonpi/firmware/compiled/latest.hex
avrdude-original: Using autoreset DTR on GPIO Pin 7

avrdude-original: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude-original: Device signature = 0x1e950f
avrdude-original: NOTE: FLASH memory has been specified, an erase cycle will be performed
                  To disable this feature, specify the -D option.
avrdude-original: erasing chip
avrdude-original: reading input file "/home/pi/emonpi/firmware/compiled/latest.hex"
avrdude-original: input file /home/pi/emonpi/firmware/compiled/latest.hex auto detected as Intel Hex
avrdude-original: writing flash (19554 bytes):

Writing | ################################################## | 100% 2.72s

avrdude-original: 19554 bytes of flash written
avrdude-original: verifying flash memory against /home/pi/emonpi/firmware/compiled/latest.hex:
avrdude-original: load data flash data from input file /home/pi/emonpi/firmware/compiled/latest.hex:
avrdude-original: input file /home/pi/emonpi/firmware/compiled/latest.hex auto detected as Intel Hex
avrdude-original: input file /home/pi/emonpi/firmware/compiled/latest.hex contains 19554 bytes
avrdude-original: reading on-chip flash data:

Reading | ################################################## | 100% 2.08s

avrdude-original: verifying ...
avrdude-original: 19554 bytes of flash verified


Start emonhub update script:

=================================
EmonPi update started
=================================
Running emonhub automatic node addition script
EUID: 1000
EUID: 1000
[[5]]
[[5]]
[[5]]
[[5]]
[[5]]
Node 5 already present
[[6]]
[[6]]
[[6]]
[[6]]
Node 6 already present
[[7]]
[[7]]
[[7]]
[[7]]
Node 7 already present
[[8]]
[[8]]
[[8]]
[[8]]
Node 8 already present
[[9]]
[[9]]
[[9]]
[[9]]
[[9]]
Node 9 already present
[[10]]
[[10]]
[[10]]
[[10]]
[[10]]
Node 10 already present
[[11]]
[[11]]
[[11]]
[[11]]
Node 11 already present
[[19]]
[[19]]
[[19]]
[[19]]
[[19]]
Node 19 already present
[[20]]
[[20]]
[[20]]
[[20]]
[[20]]
Node 20 already present
[[21]]
[[21]]
[[21]]
[[21]]
[[21]]
Node 21 already present
[[22]]
[[22]]
[[22]]
[[22]]
[[22]]
Node 22 already present
[[23]]
[[23]]
[[23]]
[[23]]
[[23]]
Node 23 already present
[[24]]
[[24]]
[[24]]
[[24]]
[[24]]
Node 24 already present
[[25]]
[[25]]
[[25]]
[[25]]
[[25]]
Node 25 already present
[[26]]
[[26]]
[[26]]
[[26]]
[[26]]
Node 26 already present

Start emoncms update:

=================================
Emoncms update started

Mon Jun 27 16:26:18 UTC 2016

EUID: 1000
Checking cron tab for service runner entry...
service runner crontab entry already installed
git pull /var/www/emoncms
* low-write
Already up-to-date.

git pull /var/www/emoncms/Modules/nodes
* master
Already up-to-date.

git pull /var/www/emoncms/Modules/app
* master
Already up-to-date.

git pull /var/www/emoncms/Modules/config
* master
Already up-to-date.

git pull /var/www/emoncms/Modules/wifi
* master
Already up-to-date.
git pull /var/www/emoncms/Modules/dashboard
* low-write
Already up-to-date.

git pull /var/www/emoncms/Modules/graph
* master
Already up-to-date.

git pull /home/pi/postprocess
Already on 'emonpi'
Already up-to-date.
git pull /home/pi/backup
* master
Already up-to-date.

Copy new default.emonpi.settings.php to settings.php & make backup old.emonpi.settings.php

Update Emoncms database
[]

Restarting Services...
Restarting OpenEnergyMonitor emonHub: emonhub has been restarted ok.
Log is turned off
Restarting feedwriterUnable to load configuration file: /home/pi/data/emonhub.conf

Log is turned off
Restarting emoncms-nodes


set log rotate config owner to root
Restarting Services...


Job is already running!
Start emonPi LCD service
Starting system emonPiLCD daemon:.

...................
emonPi update done
Mon Jun 27 16:27:21 UTC 2016

Filesystem is locked - Read Only access
type ' rpi-rw ' to unlock

However when logged into the Emonpi it still shows that it is running firmware version 8.5 low-write. I thought the latest versions were 9+? Can anyone advise?

Hi Andrew,

Sorry to hear your having trouble.

GSM support is provided by the emonPi on the latest SD card image (emonSD-03-MAY16). You will need to upgrade to the latest SD card image. by download the image (4GB) and flashing to a fresh SD card. ‘Firmware’ is the code running on the embedded 8-bit AVR on the emonPi PCB, there are no recent updates to the emonPi firmware

Follow the instructions on the download page:

Alternatively, we sell a pre-loaded SD card in the shop : http://shop.openenergymonitor.com/emonsd-pre-loaded-raspberry-pi-sd-card/

I would highly recommend updating to the latest image, there have been lots of improvements and bug fixes. Once you are running the new image, follow the setup guide:

and see the data migration instructions on the import / export / backup page Import / Backup - Guide | OpenEnergyMonitor

Hi Glyn. Thanks for your helpful reply.
I shall purchase a new card. I haven’t seen any instructions on physically installing it - I take it I have to dismantle the EmonPi enclosure?
Will this also update my Emoncms to 9.x?

Hi Glyn,
I see from your reply in the other thread I posted in that the image will update my Emoncms to version 9. It is a great shame it isn’t made clear elsewhere that hitting update when running v8.5 will not do this. It would have saved me a lot of trouble yesterday as the start of my difficulty was the remark in the video on backing up data (which we are advised to do before updating the SD card image) which said to make sure you’re running the latest version of Emoncms…

Correct, remove the end-plate on the CT connection side. You will require a T20 screwdriver See video showing inside the emonPi: https://guide.openenergymonitor.org/technical/#hardware-overview. If you want to send the emonPi back to us we would be happy to perform the upgrade free of charge.

I will add a note to the documentation to state that upgrade fro 8 to 9 can only be done by moving to the new sd card image.

Thanks Glyn - I’ve ordered the card so I should have my GSM remote monitoring set up soon!
Incidentally I couldn’t find the card in the shop by browsing through the categories - I could only find it by following your link or searching in the shop.

1 Like