Community
OpenEnergyMonitor

Community

Update EmonTX firmware

I have an EmonTx I bought in Jan 2014. text of order says ‘emonTx V3 - Fully Assembled’

I remember updating the sketch to pick up a number of temperature sensors (which are working fine), but the sketch has long since gone with a dead laptop.

I followed the link to the firmware on github from https://guide.openenergymonitor.org/technical/compiling/ (paragraph 2) but that is a 404 and I also seem to remember that there was some discussion about updated firmware for some versions of the EmonTX.

Whilst my usual thing is “if not broken don’t fix”, I have noticed that the EmonTx seems to send the data at between 11-12 seconds (according to the emonhub log), so a frame gets ‘dropped’ every 5 or 6 frames by emoncms (sampling at 10 seconds). It has probably always been doing that - I have never noticed before (yes I know 4 years).

So my plan is to have a look at this, update the firmware and see if it is my temp sensors causing the problem.

So first question is, what is the right firmware?

I don’t know which V3’s were shipped when, do you know whether it’s a V3.2 or a V3.4?

The V3.2 uses the obsolete RFu328, where the Radio module is piggy-backed on the processor module, which is piggy-backed on the main p.c.b, whereas the V3.4 has the processor surface-mounted direct onto the main board.

The reason for asking is the sketch, fundamentally the same, need compiling with different libraries.

No Idea. Do I need to open it up and see?
Opened up and it is a 3.2. I thought so as I remember that I was a little bit annoyed that the new version came out a few weeks later.

I’ll use PlatformIO if possible to do the update.

I thought there was a good chance - that’s why I asked.

I can’t help with platformio - the reason why is well documented.

The sketch will be one of the bottom two here

either the “DiscreteSampling” for the ‘plain vanilla’, or the “continous_kwhtotals” [sic] if you want the integration to calculate energy done in the emonTx. You can tell what you have from the data it sends. The ‘discretesampling’ sends 4 powers, voltage, 6 temperatures and a pulse count; the kWh sends a message serial number, 4 powers and 4 energies.

I suspect this may be what I am using but I have 8 temperature sensors attached.

@Robert.Wall - skipping through the code, it looks like it will just detect the number of sensors attached. Am I reading this correctly?

You will need to edit the max number to allow up to 8 sensors, the max is currently 7 (defined as “6” you need at least “7”)

Thanks. I’d picked out numSensors

All I’ve got to do now is work out how to load the Jeelib library (once I’ve found it).

numSensors is the number of sensors found/occupied up to a max of MaxOnewire

I think you have to use https://github.com/openenergymonitor/RFu_jeelib for the RFu328 based emonTx’s

1 Like

Yes, you must not change it from RFu_jeelib to ordinary Jeelib. The full instructions for doing it by hand - installing the the proven Arduino IDE and getting the libraries - are in Learn → Electricity Monitoring → Arduino IDE.

(If you get the ordinary JeeLib, it won’t use it unless you edit the sketch and specifically include it.)

If you have 8 sensors, MaxOnewire needs to be 8, they’re numbered 0 - 7 in the C language.

It’s now been fixed, and the guide has been updated to remove reference to setting the RF node ID as this can now be easily done via the serial config. Thanks for letting me know about the 404.

1 Like

@Robert.Wall, I am at last getting around to fixing the issues I have with my EmonTX (8 sensors overrun the 10s).

I’ve removed the temp sensors from the EmonTX completely so would now like to replace the firmware.

Is it possible to use the CM Library / Firmware on a V3.2 or should I just use the stock 3.2 firmware?

I don’t see why not, it’ll run - and I did a lot of the testing - on a V2 because that gave me access to a lot of DIO that I could hang a 'scope on to look at the timing.

But beware the sketch is really nothing like an emonLib(DS) sketch, your starting point should be one of my demo sketches. The timing was calculated for a maximum of 6 temperature sensors, I think you might be OK with 8 temperature sensors but I have only 3, so I haven’t proved it. If you find problems, I’ll look again at it.

(What happens is it anticipate when a report of all the values will happen, and just in time fires off a “Convert the temperatures” request at all the sensors. Then it fetches the temperatures from each sensor in turn after it’s processed the powers and pulse count - that is, it lets the sensors get on with the reading and converting part in their own time, rather than holding everything up while each does its thing, then it comes back for the answers. I did it that way so that the temperatures are the most recent available, they’re all read at the same instant, and it only marginally affects the other operations.)

I’ve taken them off the EmonTX completely and they are now hooked up to a WEMOS D1 and ESPHome (really easy to do).

All I want to use it for now is the power measurement. I’ve got an AC adapter for it.