emonTx4, emonPi2, emonTx5 14th May 2024 firmware release

Yes - thank you for adding your knowledge.

I think that producing a detailed OEM hardware and firmware/software history may require quite a lot of research. The topic mentioned could provide an initial framework, then a detailed search of the openenergymonitor github site and the forums can be used to fill in some details. This would probably need someone with a better knowledge of github than I have! And a lot of detail will still be missing unfortunately, for example obsoletion dates, which may require searching the forums.

For example, for the emonTx3 hardware, the openenergymonitor/emontx3/hardware repository lists seven different versions with rough dates, but I think(?) only V3.2.x and 3.4.x were shipped.

For the firmware, openenergymonitor/emontx3/releases lists 10 versions with dates, but again I don’t know which versions were ā€˜shipped’.

Then all the present and past OEM products would need to be looked at …

So I think the OEM hardware and firmware/software history might need a volunteer OEM Historian!

Hi Robert - I was referring to the post by Trystan of the new functionality in the Serial Config Monitor where there’s a parameter called Pulse Period. Surely related but not sure it’s the same thing.

Without tracing through the sketch you’re using and emonCMS, I don’t know, but I think it’s a reasonable assumption and he’s shortened the name for brevity - but in the process made it less clear what it is.

The original algorithm didn’t always work as required, so emonLibCM was changed in August 2018 to the present definition: as implied by the name, it is the minimum period that a stable pulse must exist in order to be counted. Its purpose, as I alluded to above, is to prevent contact bounce being counted as separate pulses - which does happen with any sort of mechanical switch, reed relays included.

The library treats a period of zero as a special case and disables the timers completely, so if you have a ā€˜bounce-free’ output - e.g. from the optical sensor or a transistor or opto-isolator in a meter, then you should set the period to zero and it will count on the transition of either the leading or trailing edge of the pulse, (almost) irrespective of the pulse duration, according to how you set it up with the API call.

1 Like

Yes, I appreciate this, but it’s a one-off effort. The alternative is, each time there’s a query that necessitates knowing which version of hardware or software is in use, a small but often non-trivial set of information has to be tracked down and searched to find the relevant bit(s).

It was some time after I joined OEM that I managed to persuade people to include version numbers and dates in the ā€˜standard’ sketches - something that’s common in industry.

@Robert.Wall @rupert @awjlogan would one of you be able to tell me how to flash new firmware to a TX4 when the serial config tool/emoncms is not available.

I am just connecting via USB to the TX4 from a Pi.

Is this any help?

It includes sections on

  1. updating from an emonPi/emonBase,
  2. uploading pre-compiled using EmonScripts,
  3. uploading pre-compiled manually using avrdude
  4. compile and Upload using PlatformIO
  5. compile and Upload using Arduino IDE.
    I’ve only used 1) and 5)

It is a start, but not completely. Firmware — OpenEnergyMonitor 0.0.1 documentation

git clone https://github.com/openenergymonitor/EmonScripts

./EmonScripts/emonupload2.py

Traceback (most recent call last):
  File "/home/pi/./EmonScripts/emonupload2.py", line 13, in <module>
    with open("firmware_available.json") as jsonFile:
         ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'firmware_available.json'

As an ex - mainly hardware engineer, it’s getting beyond my pay grade now! Perhaps the stuff you need need isn’t on git hub or isn’t where the docs say it should be?

1 Like

For anyone else finding this and being frustrated - assuming you have Python installed

First clone the EmonScripts repo - in this case simply to the home directory of the user pi

git clone https://github.com/openenergymonitor/EmonScripts

Next install avrdude

git clone https://github.com/openenergymonitor/avrdude-rpi.git ~/avrdude-rpi && ~/avrdude-rpi/install

Next edit the upload script to fix two path errors.

# Load firmware list from firmware_available.json
with open("EmonScripts/firmware_available.json") as jsonFile:
# Upload firmware
cmd = ' avrdude -CEmonScripts/update/avrdude.conf -v -p' + f.core + ' -carduino -D -P' + str(serial_port) + ' -b' + str(f.baud) + ' -Uflash>

It should now work and give you the menu driven installer

If I though a PR to the docs would get merged I might do one :frowning:

I have never used a Pi, only a laptop with the Arduino IDE plus DxCore installed.
All you need then is a USB lead, download the two ā€œ.inoā€ files, compile and upload. No other scripts or tools required. And you don’t need Git to download the files (just copy the ā€œrawā€ version).

But if you don’t want the IDE (including all the various libraries), complie etc, then this will work with the pre-built firmware :slight_smile: