Old Open Energy Monitor hardware with Raspberry Pi 4

I put together an energy monitoring system in 2014 to monitor my solar production. It worked well but after a few years the Raspberry Pi board that I used with it died. I still have an EmonTX Arduino Shield, an EmonTH and an EmonTX stand alone board. I also have three RFM12B to Raspberry Pi boards.

I have recently purchased a new Raspberry Pi 4 and I’d like to see if I can use it to resurrect my solar energy monitor. Can anyone tell me if any of the latest builds will still work with the RFM12b transceiver? If so, which one?

Hello @TomT

I think this firmware available from the Emoncms update tool might work:

The older firmware’s are also available here:

Thanks Trystan. I’ve downloaded and installed the firmware for the EmonTX and the Arduino shield. It took me a bit to find the #define for the Rfm69 and turn it off so my , but it looks like they’re working now. At least the serial monitor is throwing out valid data.

I’ve downloaded the SD card image for the Pi. Getting it working seems more involved than it did 10 years ago, but it also looks like you’ve added some great versatility to it. Looking forward to getting it up and running!

Hi Trystan,

I downloaded version emonSD-01Feb24 and it seemed to start successfully. Once it was up and running I updated everything using the Full Update button just to be sure.

I have not been able to update the firmware on the rfm12 board. It doesn’t seem to be able to communicate via the serial port. Logs are here:

<details><summary>LAST ENTRIES ON THE LOG FILE</summary><br />
-------------------------------------------------------------<br />
rfm12pi_jeelib Firmware Upload<br />
-------------------------------------------------------------<br />
Downloading firmware from: <br />
https://raw.githubusercontent.com/openenergymonitor/RFM2Pi/master/firmware/RFM69CW_RF_Demo_ATmega328/RFM12_Demo_ATmega328.cpp.hex<br />
<br />
Downloaded file: <br />
-rw-r--r-- 1 pi pi 25K Apr 14 20:09 /opt/openenergymonitor/data/firmware/rfm12pi_jeelib.hex<br />
<br />
EmonHub is running, stopping EmonHub<br />
<br />
Uploading rfm12pi_jeelib on serial port ttyAMA0<br />
Attempt 1...<br />
<br />
avrdude -Cavrdude.conf -v -pATMEGA328P -carduino -D -P/dev/ttyAMA0 -b38400 -Uflash:w:/opt/openenergymonitor/data/firmware/rfm12pi_jeelib.hex:i <br />
<br />
avrdude-original: Version 7.1<br />
                  Copyright the AVRDUDE authors;<br />
                  see https://github.com/avrdudes/avrdude/blob/main/AUTHORS<br />
<br />
                  System wide configuration file is /opt/openenergymonitor/EmonScripts/update/avrdude.conf<br />
avrdude-original yywarning() warning: ATmega329's flash writepage misses a necessary address bit a13 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:5932]<br />
avrdude-original yywarning() warning: ATmega649's flash writepage misses a necessary address bit a14 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:6158]<br />
avrdude-original yywarning() warning: AT90PWM2's eeprom writepage misses a necessary address bit a8 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:9348]<br />
avrdude-original yywarning() warning: ATtiny44's eeprom writepage misses a necessary address bit a7 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11206]<br />
avrdude-original yywarning() warning: ATtiny84's eeprom writepage misses a necessary address bit a8 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11390]<br />
avrdude-original yywarning() warning: a4 would normally be expected to be a5 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]<br />
avrdude-original yywarning() warning: a3 would normally be expected to be a4 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]<br />
avrdude-original yywarning() warning: a2 would normally be expected to be a3 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]<br />
avrdude-original yywarning() warning: a1 would normally be expected to be a2 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]<br />
avrdude-original yywarning() warning: a0 would normally be expected to be a1 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]<br />
avrdude-original yywarning() warning: too few opcode bits in instruction [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11675]<br />
avrdude-original yywarning() warning: ATtiny43u's eeprom read misses a necessary address bit a5 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11694]<br />
avrdude-original yywarning() warning: ATmega32U4's eeprom writepage misses a necessary address bit a2 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:11880]<br />
avrdude-original yywarning() warning: AT90USB1286's eeprom writepage misses a necessary address bit a11 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:12275]<br />
avrdude-original yywarning() warning: ATtiny1634's flash writepage misses a necessary address bit a5 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:15031]<br />
avrdude-original yywarning() warning: mcuid -1 for ATtiny402w is out of range [0..2039], use a free number >= 372 [/opt/openenergymonitor/EmonScripts/update/avrdude.conf:15497]<br />
                  User configuration file is /root/.avrduderc<br />
                  User configuration file does not exist or is not a regular file, skipping<br />
<br />
                  Using Port                    : /dev/ttyAMA0<br />
                  Using Programmer              : arduino<br />
                  Overriding Baud Rate          : 38400</details><br />

I was unable to upload firmware to my EmonTH, so I’m not using that yet. Will work on that later.

I’m also not currently using my EmonTX Shield.

I’ve updated the firmware to my EmonTX stand-alone board with the latest from git. I’m using the version with the temperature sensor but I’ve been working with the sensor unplugged as it seems I might have a damaged the DS18 sensor. I’m also working without any CT’s attached. The Arduino IDE serial monitor shows 0 for power for all 3 inputs and a small decimal for voltage.

I did have to tweak the config file. I set up my EmonTX node at id 10.

#######################################################################
#######################      emonhub.conf     #########################
#######################################################################
### emonHub configuration file, for info see documentation:
### https://github.com/openenergymonitor/emonhub/blob/emon-pi/configuration.md
#######################################################################
#######################    emonHub  settings    #######################
#######################################################################

[hub]
    ### loglevel must be one of DEBUG, INFO, WARNING, ERROR, and CRITICAL
    loglevel = DEBUG
    autoconf = 0
### Uncomment this to also send to syslog
# use_syslog = yes
#######################################################################
#######################       Interfacers       #######################
#######################################################################

[interfacers]
    ### This interfacer manages the RFM12Pi/RFM69Pi/emonPi module
    [[EmonPi2]]
        Type = EmonHubOEMInterfacer
        [[[init_settings]]]
            com_port = /dev/ttyAMA0
            com_baud = 115200
        [[[runtimesettings]]]
            pubchannels = ToEmonCMS,
            subchannels = ToRFM12,
    
#    [[USB0]]
#        Type = EmonHubOEMInterfacer
#        [[[init_settings]]]
#            com_port = /dev/ttyUSB0
#            com_baud = 115200
#        [[[runtimesettings]]]
#            pubchannels = ToEmonCMS,
#            subchannels = ToRFM12,
#            nodename = emonTx4
    
#    [[SPI]]
#        Type = EmonHubRFM69LPLInterfacer
#        [[[init_settings]]]
#            nodeid = 5
#            networkID = 210
#            resetPin = 24
#            selPin = 16
#        [[[runtimesettings]]]
#            pubchannels = ToEmonCMS,
    

    [[emoncmsorg]]
        Type = EmonHubEmoncmsHTTPInterfacer
        [[[init_settings]]]
        [[[runtimesettings]]]
            pubchannels = ToRFM12,
            subchannels = ToEmonCMS,
            url = https://emoncms.org
            apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
            senddata = 1    # Enable sending data to Emoncms.org
            sendnames = 1    # Send full input names (compression will be automatically enabled)
            interval = 30    # Bulk send interval to Emoncms.org in seconds

[[RFM2Pi]]
    Type = EmonHubJeeInterfacer
    [[[init_settings]]]
        com_port = /dev/ttyAMA0
        com_baud = 9600                        # 9600 for old RFM12Pi
    [[[runtimesettings]]]
        pubchannels = ToEmonCMS,
        subchannels = ToRFM12,

        group = 210
        frequency = 433
        baseid = 5                              # emonPi / emonBase nodeID
        quiet = true                            # Report incomplete RF packets (no implemented on emonPi)
        calibration = 110V                      # (UK/EU: 230V, US: 110V)
        # interval =  0                         # Interval to transmit time to emonGLCD (seconds)

[[MQTT]]

    Type = EmonHubMqttInterfacer
    [[[init_settings]]]
        mqtt_host = 127.0.0.1
        mqtt_port = 1883
        mqtt_user = emonpi
        mqtt_passwd = emonpimqtt2016

    [[[runtimesettings]]]
        pubchannels = ToRFM12,
        subchannels = ToEmonCMS,

        # emonhub/rx/10/values format
        # Use with emoncms Nodes module
        node_format_enable = 1
        node_format_basetopic = emonhub/

        # emon/emontx/power1 format - use with Emoncms MQTT input
        # http://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.md
        nodevar_format_enable = 1
        nodevar_format_basetopic = emon/

#    [[DS18B20]]
#        Type = EmonHubDS18B20Interfacer
#        [[[init_settings]]]
#        [[[runtimesettings]]]
#            pubchannels = ToEmonCMS,
#            read_interval = 10
#            nodename = sensors
#            # ids = 28-000008e2db06, 28-000009770529, 28-0000096a49b4
#            # names = ambient, cyl_bot, cyl_top

#######################################################################
#######################          Nodes          #######################
#######################################################################

## See config user guide: https://github.com/openenergymonitor/emonhub
## If autoconf is enabled above, node configuration will automatically
## populate based on templates listed in available.conf

[nodes]
[[10]]
    nodename = emonTx_1
#    firmware =V1_6_emonTxV3_4_DiscreteSampling
    hardware = emonTx_1
    [[[rx]]]
       names = power1, power2, power3, Vrms
#       names = power1, power2, power3, Vrms, temp
       datacode = h
       scales = 1,1,1,0.01
       units =W,W,W,V
#       scales = 1,1,1,0.01,0.1
 #      units =W,W,W,V,C

Now for my issue. Once I boot, Emoncms reports finding my EmonTX and bringing up the inputs. The input values are updated a few times, but soon after boot stop updating. Some times I can get them to update by restarting emonhub. Log file is attached.

emonhub gone haywire.log.txt (31.5 KB)

Any suggestions?