Should I update Emon Pi firmware to CM, and how?

I have just an emonpi, no other kit, so I don’t use radio to transfer info.

I regularly update the software on the pi via the admin page on its website. I do a “full update”. I recently noticed that this doesn’t update the firmware, so after a bit of reading, I decided to update to the Continuous monitoring version, chosing
port ttyAMA0, hardware emonpi, radio format RFM69 Low power labs, Firmware …continuous monitoring… V1.1.4.

The update process shows on screen, then it appears to load and run. However, once installed, the main display I use, “MySolar” does not update at all; graphs do not update and the current power levels freeze.

Reverting the firmware to Jeelib Classic, V2.9.3, the display starts updating again.

Looking on the forums, I found this:
Updating an emonPi to emonPi_CM

This suggests that it’s not as simple as just updating the firmware, but also that some configuration needs to be chnaged, but I’m not sure what.

I think I’ve read that the discrete sampling branch isn’t going be updated any more, so I guess it makes sense to update to the continuous monitoring version.

Is that the case?

If that’s so, what do I need to do after updating the firmware, to get displays working again?

I have no knowledge of the LPL software, it sounds as if the values sent by the front end haven’t retained compatibility in number or position with the version that works for you.

The place to start looking will be the emonhub.conf file, I suggest you compare the file that works with the outputs generated by the software that doesn’t.

Briefly, The emonPi has two main parts -

  1. The emonPi Board. This has an ATMega328 microcontroller chip on it, which makes the measurements using the CT1, CT2, 9V AC Sample, and the RJ45 I/O inputs. It also manages the RFM69 radio. The ATMega328 is where the firmware update is applied.

  2. the Raspberry Pi, which runs the software. The emonPi Board is plugged into the Pi. The Pi receives the measurements from the ATMega328, stores and processes them and generates the Apps, such as “MySolar”.

The V1.1.4 firmware update to the ATMega328 gives the Continuous Monitoring (CM) version, and updates the radio format to LPL. It also changes the communication speed and content between the emonPi Board and the Pi. This is necessary to include the extra data from the CM version (Msg, pulse2count, E1, E2). The serial rate between the emonPi Board and the Pi has also increased from 38400 to 115200 baud.

The result is that the Pi cannot understand the V1.1.4 data, and the apps etc get no data.

To fix this, the settings in emonHub on the Pi must be edited - for more information see
https://docs.openenergymonitor.org/emonhub/index.html

and in particular
https://docs.openenergymonitor.org/emonhub/configuration.html#editing-the-emonhub-configuration-file

To correct the serial baud rate change, the emonPi [Interfacers] Configuration entry needs to be updated to:

[[emonpi]]
    Type = EmonHubOEMInterfacer
    [[[init_settings]]]
        com_port = /dev/ttyAMA0
        com_baud = 115200
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        subchannels = ToRFM12,   

        group = 210
        frequency = 433
        baseid = 5                              # emonPi / emonBase nodeID
        calibration = 230V                      # (UK/EU: 230V, US: 110V)
        quiet = true                            # Disable quite mode (default enabled) to enable RF packet debugging, show packets which fail crc
        # interval =  300     

To correct the different message content, the emonPi [Nodes] Configuration entry needs to be updated to:

[[5]]
    nodename = emonpi
    [[[rx]]]
       names = Msg, power1,power2,power1pluspower2,vrms,t1,t2,t3,t4,t5,t6,pulse1count,pulse2count,E1,E2
       datacodes = L, h, h, h, h, h, h, h, h, h, h, L, L, l, l
       scales = 1, 1,1,1, 0.01, 0.01,0.01,0.01,0.01,0.01,0.01, 1, 1, 1,1
       units = n,W,W,W,V,C,C,C,C,C,C,p,p,Wh,Wh

if you are new to editing the settings in emonHub, you can copy the original settings and then paste the copy underneath the original settings . The original settings can then be commented out by adding a hash symbol # at the start of each line. Then the copy can be edited to update it (or you could use the entries above instead of an edited copy of the original - I think they are correct!). If something goes wrong you still have a copy of the original that you can un-comment.

For example, the commented out original for the emonPi [Nodes] Configuration entry would look something like (note the firmware and hardware lines are optional, so may not be present):

#[[5]]
#    nodename = emonPi
#    firmware = emonPi_RFM69CW_RF12Demo_DiscreteSampling.ino
#    hardware = emonpi
#    [[[rx]]]
#        names = power1,power2,power1_plus_power2,Vrms,T1,T2,T3,T4,T5,T6,pulseCount
#        datacodes = h, h, h, h, h, h, h, h, h, h, L
#        scales = 1,1,1,0.01,0.1,0.1,0.1,0.1,0.1,0.1,1
#        units = W,W,W,V,C,C,C,C,C,C,p

After doing the firmware update and the emonHub changes, it should all start workiing again - fingers crossed!

I don’t know anything about the future of the discrete sampling branch.

Hope this helps …

P.S. You may find that the emonPi LCD display puts the measurements in the wrong place after the upgrade, as I did …

1 Like

Thanks, I’ll have a look and see if I can get that going.

:slight_smile:

Hello @steve-oemon Yes I think it’s worthwhile updating :slight_smile:

As you have no other kit, that makes it much more straightforward. @rupert’s reply covers the changes required.

Interested to hear if you can notice any improvements in the measurements.