I’ve got an emonPiv1, an emonTx3 and an emonth (with 3 sensors) some of which I have had since about 2015! (and has been working wonderfully).
I try and keep them up to date, but the last time I tried to update to the latest SD card image, I had real difficulty - I think due to conflicts with the software and the hardware firmware and radio formats. In the end, I ended up cloning my old SD card, and writing that to a new card.
To try and avoid a repeat, and whilst everything is working, I wanted to ask if there is any guide or instructions for updating firmware on emonpi v1 and emontx3?
I’m relatively happy updating the software, but not sure where to start with the firmware. I’m not even sure how to check what versions I’m on to start with.
Without connecting a programmer and hoping the device (emonTx V3 & emonTH V?) spits out some useful information at startup (the best), or checking the data packet structure being received in emonHub and then seeing which software versions fit, it’s down to what was the default on the day you bought each device.
I wrote some notes and explanations about the compatibility problems when I published the full suite of software to work with the emonPiCM, but it was never officially adopted and “The Shop” went with the Low Power Labs library. The two r.f. protocols are incompatible so you either update your emonPi and then “downdate” it to use the obsolescent JeeLabs library (and not change your emonTx & emonTH), or you update everything - which you can do by updating your emonPi first and then connect your emonTx & emonTH via a programmer to the USB port on the emonPi and use it to upload the LPL software. If your emonTH has got 3 external sensors connected, then you might need custom software (I think the emonTH sketch loaded in your emonPi after you update it - and certainly the update published today - will only send the data for the first external one it finds unless it’s been changed and we’ve not been told, which is more than likely. I think you’ll need to find the file inside your emonPi, edit and recompile it and then upload to your emonTH).
Hi Robert,
I have no doubt that your explanation is spot-on, but I fear that such an update would be far too scary and error prone for someone like me.
I too have a “vintage” emonPi that has been in-service and untouched for many years and I have been very reluctant to mess with the software until it breaks.
What would interest me is if I could send all my kit back to the shop for a service and software/firmware update. Is this service available?
I don’t know, something similar is sometimes offered when a problem surfaces with a new version of the default software (like today and the emonTH battery problem), but I’ve never seen it offered as a standard service. You’d better ask: [email protected]
It’s not all that scary, you don’t have to install the Arduino IDE, the software is pre-compiled and exists in the downloaded image, the upload software likewise, and you choose what you upload within emonCMS on the Admin → Update page
(Those settings won’t work - the emonPi is out in the garage, nothing is plugged in and I’m not going out there to do anything , but that’s about all there is to it.)
I have a UART programmer from when I updated the emonth firmware, so I will spend some time playing with that to see if I can remember how it works, and get the firmware info from the devices.
Also - thanks for the reminder on the emonth - I had forgotten that there was playing needed to get the 3 sensors working.
All this is in aid of getting ahead of the next SD card failure and trying to take some time to work out what to do, rather than being in the middle ‘just get it working’ mode.
#define EXTERNAL_TEMP_SENSORS 4
(and change your emonhub.conf file to suit),
The hard part then is to either copy the file to the correct place in the emonPi and compile it there, or compile it on your machine and then upload the compiled .hex file to somewhere convenient and then use the update tool as per the last line in my screenshot above. Unfortunately, I don’t know where the ‘correct place’ is and as far as I know, it’s not documented anywhere. I’ve never attempted to compile on an emonPi but the instructions are here: emonth2/firmware at master · openenergymonitor/emonth2 · GitHub From this, I assume a compiler is already included in the SD Image.
If you get it wrong, you can always go back to the old firmware.
Pi first: take a backup, if you have 10 years of data this might take a while. I would then get a new SD card and flash the latest EmonPi image. Swap the cards over (you can always go back) and restore the backup. Check the data is all still there, but likely you lost the emontx as your pi is now on the latest RF format for the radio and the emontx is on the old one.
If you have the usb to uart cable just bring the emontx 3 to the EmonPi (note, you should really unclip the CT clamps not just unplug them if the circuits are still under load as they could get damaged) and connect the emontx to the EmonPi with the uart cable. Use the settings menu to flash the emontx with the latest radio format and it shoi come back.
You will then be down to the emonth, I don’t have one but you got some good advice above.
If moving the emontx is a problem, you can always flash the old radio format to the EmonPi - that’s how mines currently running (EmonPi 2016 with 2Emontx3 and 1EmonTX4 direct usb connect).
The docs are a bit confusing if you have old and new mixed, but it is all there in the doc wiki if you need it and the pi menu that now lets you flash the EmonPi firmware or the emontx direct via usb makes it quick to change things back if you need to.
THEY ARE NOT CLAMPS Clamps are what carpenters and toolmakers use.
…and leave the a.c. adapter (and USB power supply if it uses one) behind, it will get power from the emonPi.
Long-term, it’s going to be preferable to move to LPL rather than backdating to the old JeeLib format transmissions.
I’ve made some progress, but have also come up against some problems - if you could help or point me in the right direction that would be most appreciated.
I have a new SD card, which I first installed the emonSD-01Feb24 image on, but that kept erroring when I booted, so I switched, and built the card from scratch using the EmonCMS Install Scripts.
I’ve got to the point where that has booted, and I have created a user, but:
I don’t see any inputs - get “No inputs created” on the inputs page
Emonhub can’t open serial ports 2025-04-24 13:19:07,805 INFO MainThread EmonHub v2.7.2 2025-04-24 13:19:07,806 INFO MainThread Opening hub... 2025-04-24 13:19:07,806 INFO MainThread Running as user: pi 2025-04-24 13:19:07,808 ERROR MainThread Could not open serial port: /dev/ttyAMA0 @ 9600 bits/s (retry every 10s) 2025-04-24 13:19:07,810 ERROR MainThread Could not open serial port: /dev/ttyUSB0 @ 9600 bits/s (retry every 10s) 2025-04-24 13:19:07,822 ERROR MainThread Unable to create 'SPI' interfacer: [Errno 2] No such file or directory
the emonPiLCD service failed to load
I’m just using the default EmonHub config, and haven’t attempted to restore the backup as I wanted to check it was going to work first.
I’ve tried changing the com_baud, to 9600 and 38400, but it didn’t make a difference.
Also tried copying in the Emonhub config from the ‘old’ setup, but, again, didn’t work.
I tried again with my ‘old’ EmonHub config, and then powered down, and restarted, and I seem to have some inputs.
I still have the issue with the emonPiLCD service. I tried to update it, and part way through got this error:
Collecting adafruit-circuitpython-ssd1306
Using cached https://www.piwheels.org/simple/adafruit-circuitpython-ssd1306/adafruit_circuitpython_ssd1306-2.12.19-py3-none-any.whl (7.6 kB)
Collecting Pillow
Downloading pillow-11.2.1.tar.gz (47.0 MB)
ERROR: Could not install packages due to an OSError: [Errno 28] No space left on device
━━━━━━━━━━━━━ 15.7/47.0 MB 14.5 MB/s eta 0:00:03
Will see if I can find anything out about that, and then try restoring my backup.
From what I can see, I’m on all the original radio versions, so next step will be that upgrade…
I have absolutely no idea what’s happening there, or why. Could it be the ‘wrong’ (incompatible) version of Python? I take it this is with the ‘scripts’ build? Have you, or should you, expand any of the partitions on the SD card?
I have the Feb 24 version SD download running on a very old (pre-WiFi) RPi fitted with a WiFi dongle, with no problems. The version you built should be the same. Note: you need to rename the zero length file, with today’s date as its name, to emonSD-01Feb24 or you’ll have trouble if/when you come to update it. (See Newest emonSD release? - #6 by Robert.Wall)
The clue to “Could not install…” is [Errno 28] No space left on device so the partition it wants to install it on is full (or when it tries to unzip, it’s full).
I suspect you’re wasting your time with restoring until you get a running ‘off the shelf’ version.
pip is trying to unzip into /var/tmp or /tmp, I forget which. On the emonPi both of these are tmpfs (RAM-based) filesystems to save wear on the SD card. You can temporarily (until next reboot) increase the size of the filesystem with something like mount -o remount,size=300M /tmp (or /var/tmp, as I say I can’t remember). Or there is a variable to tell pip which TMP space to use, so you could google for that. Good luck!