Monitoring System Firmware Update

My energy monitoring and control system currently includes:

  • 2 x emonTxV3.4.3 (with modified firmware based on emonTxV3.4 CM V2.0);
  • 3 x emonTHV2 (with firmware V3.2.4); and
  • an emonbase (RPi 5 fitted with RFM69PI V3.1 RF expansion board)

I would like to add an additional emonTH to the system, with 4 external DS18B20 temperature sensors or possibly modify one of the existing ones to use the 4 external sensors.

Review of the documentation indicates that, in either case, I will need to update the firmware of the emonTH to achieve this.

I have successfully modified and updated the firmware on the emonTx units previously using the Arduino IDE and a CP2102 USB-to-UART Bridge Controller. In preparing to update one of my existing emonTH units I have successfully read the serial output recently using this setup.

In exploring the available firmware for the emonTH (v4.2.1 at https://github.com/openenergymonitor/emonth2/tree/master/firmware), and attempting to retain the JeeLib Classic radio format that all my other devices use, I encountered several errors related to RF69_433_92MHZ not being defined in the version of the rfmTxLib.h file at https://github.com/openenergymonitor/rfmTxLib/blob/main/rfmTxLib.h.

Clearing out all references to RF69_433_92MHZ, the sketch compiled successfully however I’m not confident this will be the last of my problems with maintaing my existing configuration and it may be time to update everything to latest firmware configuration - including the Low Power Labs radio format.

So, assuming I am not the only person out there in this situation, I have the following questions:

1. Is updating all the above equipment to the latest firmware configuration, including the Low Power Labs radio format, possible?

2. Noting my preference to add an additional component the system, is updating all the above equipment to the latest firmware configuration, including the Low Power Labs radio format, recommended?

3. Is there a guide somewhere on how to it?

Welcome back.

Yes, it should be possible, but it is probably the most risky way. Ultimately though, probably the best long-term. The show-stopper would be a Hope RFM12B radio module in one of the devices - you should not have one, but it would be worth checking. There are pictures here: RFM12B & RFM69CW Wireless Transceiver Modules — OpenEnergyMonitor 0.0.1 documentation. You should be able to visually identity that you have all RFM69CW modules - these do all the processing that the original JeeLib did and a lot more besides, including encrypting the data.

Not that I know of. All the information is certainly on this site somewhere, either in Docs (the starting place) or buried in the forum, and if it’s there, your problem will be finding it. :anguished:

What exactly did you do to the emonTx’s? Presumably you’re reasonably happy with working with the C language and the Arduino IDE, do you think you can merge that change into the present default sketches?

Thank you Robert.

Nothing ground breaking:

  • added the supply frequency and power factors to the transmitted data;
  • increased the number of external temperature sensors to 4; and
  • reported the state of the digital input (normally used for pulse counting) to send on the state of some voltage free contacts in another nearby device.

I’ve had a look at the V2.4.0 version at https://github.com/openenergymonitor/emontx3/tree/master/firmware/emonTx34/emonTx34_CM and it appears as though it has not significantly changed the underlying code structure; so I think so.

The question will be how to sequence the equipment changes so I can test along the way while minimising the risks of not being able to revert and rendering everything useless. It is the RFM69PI expansion board that I am nervous about. It took some time to get it to work with the RPi5 and the shop does not appear to be selling this board or an equivalent at present. Can the RFM69PI board be easily changed between JeeLib Classic and Low Power Labs format?

No, not easily - you need to upload code to the on-board processor.
It appears I was wrong. It’s not difficult, it is actually documented (but they never tell us when the docs are updated) emonBase with RFM69Pi (ATmega328) — OpenEnergyMonitor 0.0.1 documentation

If you get its successor, the RFM69SPI, there is no separate processor on the module, it’s all done inside the RPi, so swapping back should be easy, if the JeeLib software exists in the RPi - but I don’t actually know. The shop page for the emonBase says “by default the new version of the emonBase with the RFMSPI is NOT compatible with older hardware e.g emonTx V3. Please contact us if you would like a version which is compatible with older hardware.” I think this is a half-truth - I think it really means the radio protocol is not compatible. So this has to be one for @TrystanLea to answer.

I can’t see a way that you can test as you go, unless you get a second emonBase with the RFM69SPI. Then, you could use this to test the first emonTx you change, then the second, then the emonTH’s, meanwhile sending the data back to the original emonBase via your LAN.

If you let the shop know when you order the emonTH can be supplied with the correct FW for 4x DS18B20s. So it will be plug and play with your existing setup.

This might be the easiest way to go in the short term but I suspect that, as @Robert.Wall suggested, it will be better in the long run to migrate the system to the Low Power Labs radio format.
I am confident in updating the firmware of my current emonTx and emonTH units, I have done this before. It is the is the RFM69PI that I am unsure of. Can the RFM69PI be reliably reconfigured to the different radio formats using the update firmware functionality in EmonCMS - specifically reverting it to the JeeLib Classic format?

If so, then I think I will have a go at updating one of my emonTHs to the new radio format and testing it before committing to updating the emonTxs as well. The configuration of a new emonTH will then depend on the outcome …

All I can say is if you select JeeLib, the choice is this

So it would appear that the answer is yes. I haven’t got a working emonBase, so I can’t try it.

I think your route is, update an emonTH. You’ll know something has changed if it stops reporting. If this happens, update your emonBase. If the emonTH appears there and everything else disappears, all is well and you can follow with everything else. If not, I’d revert the emonBase and see if you still have the emonTx’s. I think this is the safest route.

Qualified Success.

  1. Updated one emonTH with V4.2.1 firmware configured for JeeLib Classic. Data recieved by the emonBase. This was a good sign.
  2. Updated same emonTH with V4.2.1 formware configured for Low Power Labs. Updated rfm69pi configured for Low Power Labs. EmonTH data recieved by emonBase. Also good.
  3. Updated rfm69pi configured for JeeLib Classic. Data recieved by other existing emonTH and emonTx. Good.
  4. Updated emonTH with V4.2.1 firmware configured for JeeLib Classic. NO data from this emonTH recieved by emonBase. Not good.
  5. Changed both emonTH and rfm69pi to Low Power Labs again and emonTH data recieved by emonBase. Good.
  6. Changed both emonTH and rfm69pi to JeeLib Classic again. No data from this emonTH recieved by the emonBase. Not good. Data recieved by other existing emonTH and emonTx. Good.

Tried many times to revert the emonTH to Jeelib Classic. No success.

This is the output of the emonTH from the serial monitor at startup.

OpenEnergyMonitor.org
emonTH FW: V4.2.1
Loaded EEPROM config
Group 210, Node 24, Band 433 MHz
pulses enabled = 0
pulse period = 50 ms
DS18B20 enabled = 0
RF on
Serial on
RF power = 7 dBm
RadioFormat: JeeLib Classic
Init RFM...
RFM Started
Int SI7021..
SI7021 Started, ID: 21
temp:21.85,humidity:57.89
Serial on
'+++' then [Enter] for config mode, waiting 3s...
Continuing without entering config mode...
temp:218,humidity:578,batt:28
temp:218,humidity:578,batt:29

but nothing from node 24 in the emonHub log.

All the above was conducted with the programmer connected to the emonTH. Disappointed, I decided to draft this post, to ask for help, expecting to have to come back another day.

Unplugged the programmer and, lo and behold, data from node 24 turned up in emonHub.

Swapped things back and forth again a couple of times to confirm. No data in JeeLib Classic configuration with the programmer connected. Data appears when the programmer is removed and the emonTH restarted. Not quite as expected, but worth proceeding.

So I think I will have a go at one of the emonTxs next.

I don’t understand why you want to go back to JeeLib, once you’ve proved you converted your emonBase successfully. My primary concern was the processor in the RFM69Pi is not an ATMega 328P, hence I would expect you to have struggled to update it using the Arduino IDE and uploading the compiled code to it via the RPi. Now that you’ve by-passed that, I think you will not have a problem with the emonTH’s and emonTx’s, because even if you ignore the pre-compiled upload from your emonBase and use the Ardiono IDE, it’s the same procedure as you’ve used before - the only difference is you’ll need the LPL library file when you compile.

The reversion is just to allow some time to set up the change for the emonTxs without losing all my monitoring functionality for too long.