Null feeds after restoring update

Can anyone help? I imaged a new SD card with the latest image, and used the USB restore option to load my old backup. However, now the emonpi feeds come up as “NULL”.
When I put a fresh SD card in, the inputs read fine, but restoring the backup makes the feeds become null. I’d rather keep my backup with years of data and all my setups already done.

(Edit: I flashed the firmware with LPL before I understood that I probably want Jeelab, and now choosing Jeelab doesn’t do anything (it doesn’t flash). If I understand correctly, this only seems to affect the radio, so it shouldn’t matter?)

nodename=emonpi in /opt/openenergymonitor/emonhub/conf/emonhub.conf is the same on fresh install or restored version.
I’ve done a hard power cycle.
The LCD screen doesn’t seem to be reporting the Power 1 & Power 2 values either, if that means something.

Emonhub log looks ok:

2024-10-29 08:57:15,365 DEBUG    MQTT       Publishing: emon/emontxshield/current1 18.36
2024-10-29 08:57:15,367 DEBUG    MQTT       Publishing: emon/emontxshield/current2 15.81
2024-10-29 08:57:15,368 DEBUG    MQTT       Publishing: emon/emontxshield/current3 12.55
2024-10-29 08:57:15,369 DEBUG    MQTT       Publishing: emon/emontxshield/current4 12.53
2024-10-29 08:57:15,371 DEBUG    MQTT       Publishing: emon/emontxshield/current5 13.62
2024-10-29 08:57:15,373 DEBUG    MQTT       Publishing: emon/emontxshield/vrms 243.1
2024-10-29 08:57:15,375 DEBUG    MQTT       Publishing: emon/emontxshield/power1 4463.42
2024-10-29 08:57:15,376 INFO     MQTT       Publishing 'node' formatted msg
2024-10-29 08:57:15,377 DEBUG    MQTT       Publishing: emonhub/rx/6/values 18.36,15.81,12.55,12.53,13.62,243.1,4463.42
2024-10-29 08:57:16,641 DEBUG    SerialDirect 267 NEW FRAME : 18.45 15.49 12.54 12.15 13.45 246.44 4546.65
2024-10-29 08:57:16,642 DEBUG    SerialDirect 267 Timestamp : 1730152636.641179
2024-10-29 08:57:16,643 DEBUG    SerialDirect 267 From Node : 6
2024-10-29 08:57:16,643 DEBUG    SerialDirect 267    Values : [18.45, 15.49, 12.54, 12.15, 13.45, 246.44, 4546.65]
2024-10-29 08:57:16,644 DEBUG    SerialDirect 267 Sent to channel(start)' : ToEmonCMS
2024-10-29 08:57:16,644 DEBUG    SerialDirect 267 Sent to channel(end)' : ToEmonCMS
2024-10-29 08:57:16,788 DEBUG    MQTT       Publishing: emon/emontxshield/current1 18.45
2024-10-29 08:57:16,789 DEBUG    MQTT       Publishing: emon/emontxshield/current2 15.49
2024-10-29 08:57:16,790 DEBUG    MQTT       Publishing: emon/emontxshield/current3 12.54
2024-10-29 08:57:16,790 DEBUG    MQTT       Publishing: emon/emontxshield/current4 12.15
2024-10-29 08:57:16,791 DEBUG    MQTT       Publishing: emon/emontxshield/current5 13.45
2024-10-29 08:57:16,792 DEBUG    MQTT       Publishing: emon/emontxshield/vrms 246.44
2024-10-29 08:57:16,793 DEBUG    MQTT       Publishing: emon/emontxshield/power1 4546.65
2024-10-29 08:57:16,793 INFO     MQTT       Publishing 'node' formatted msg
2024-10-29 08:57:16,794 DEBUG    MQTT       Publishing: emonhub/rx/6/values 18.45,15.49,12.54,12.15,13.45,246.44,4546.65
2024-10-29 08:57:17,850 DEBUG    SerialDirect 268 NEW FRAME : 18.42 15.53 12.52 12.69 13.52 241.25 4443.77
2024-10-29 08:57:17,851 DEBUG    SerialDirect 268 Timestamp : 1730152637.850536
2024-10-29 08:57:17,852 DEBUG    SerialDirect 268 From Node : 6
2024-10-29 08:57:17,852 DEBUG    SerialDirect 268    Values : [18.42, 15.53, 12.52, 12.69, 13.52, 241.25, 4443.77]
2024-10-29 08:57:17,852 DEBUG    SerialDirect 268 Sent to channel(start)' : ToEmonCMS
2024-10-29 08:57:17,853 DEBUG    SerialDirect 268 Sent to channel(end)' : ToEmonCMS
2024-10-29 08:57:18,001 DEBUG    MQTT       Publishing: emon/emontxshield/current1 18.42
2024-10-29 08:57:18,003 DEBUG    MQTT       Publishing: emon/emontxshield/current2 15.53
2024-10-29 08:57:18,004 DEBUG    MQTT       Publishing: emon/emontxshield/current3 12.52
2024-10-29 08:57:18,006 DEBUG    MQTT       Publishing: emon/emontxshield/current4 12.69
2024-10-29 08:57:18,008 DEBUG    MQTT       Publishing: emon/emontxshield/current5 13.52
2024-10-29 08:57:18,009 DEBUG    MQTT       Publishing: emon/emontxshield/vrms 241.25
2024-10-29 08:57:18,010 DEBUG    MQTT       Publishing: emon/emontxshield/power1 4443.77
2024-10-29 08:57:18,011 INFO     MQTT       Publishing 'node' formatted msg
2024-10-29 08:57:18,012 DEBUG    MQTT       Publishing: emonhub/rx/6/values 18.42,15.53,12.52,12.69,13.52,241.25,4443.77

Emoncms log looks ok:

> <details><summary>LAST ENTRIES ON THE LOG FILE</summary><br />
2024-10-28 20:31:23.022|WARN|PHPFina.php|get_meta() meta file does not exist '/var/opt/emoncms/phpfina/127.meta'<br />
2024-10-28 20:31:23.022|WARN|PHPFina.php|get_meta() meta file does not exist '/var/opt/emoncms/phpfina/128.meta'<br />
2024-10-28 20:31:23.023|WARN|PHPFina.php|get_meta() meta file does not exist '/var/opt/emoncms/phpfina/129.meta'<br />
2024-10-28 20:31:23.023|WARN|PHPFina.php|get_meta() meta file does not exist '/var/opt/emoncms/phpfina/132.meta'<br />
2024-10-28 20:31:23.023|WARN|PHPFina.php|get_meta() meta file does not exist '/var/opt/emoncms/phpfina/133.meta'<br />
2024-10-28 20:31:54.-458|WARN|PHPFina.php|get_meta() meta file does not exist '/var/opt/emoncms/phpfina/129.meta'<br />
2024-10-28 20:31:54.-457|WARN|PHPFina.php|get_meta() meta file does not exist '/var/opt/emoncms/phpfina/132.meta'<br />
2024-10-28 20:31:54.-457|WARN|PHPFina.php|get_meta() meta file does not exist '/var/opt/emoncms/phpfina/133.meta'<br />
2024-10-28 20:32:14.260|WARN|emoncms_mqtt.php|Starting MQTT Input script<br />
2024-10-28 20:32:14.425|WARN|emoncms_mqtt.php|Not connected, retrying connection<br />
2024-10-28 20:32:14.436|WARN|emoncms_mqtt.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2024-10-28 20:35:12.-215|WARN|emoncms_mqtt.php|Starting MQTT Input script<br />
2024-10-28 20:35:12.-141|WARN|emoncms_mqtt.php|Not connected, retrying connection<br />
2024-10-28 20:35:12.-128|WARN|emoncms_mqtt.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2024-10-28 20:51:07.473|WARN|emoncms_mqtt.php|Starting MQTT Input script<br />
2024-10-28 20:51:07.-363|WARN|emoncms_mqtt.php|Not connected, retrying connection<br />
2024-10-28 20:51:07.-341|WARN|emoncms_mqtt.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2024-10-28 21:10:15.200|ERROR|index.php|Not Authenticated|admin/update<br />
2024-10-28 21:26:36.016|WARN|emoncms_mqtt.php|Starting MQTT Input script<br />
2024-10-28 21:26:36.349|WARN|emoncms_mqtt.php|Not connected, retrying connection<br />
2024-10-28 21:26:36.372|WARN|emoncms_mqtt.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2024-10-28 21:51:31.-298|WARN|emoncms_mqtt.php|Starting MQTT Input script<br />
2024-10-28 21:51:31.-136|WARN|emoncms_mqtt.php|Not connected, retrying connection<br />
2024-10-28 21:51:31.-113|WARN|emoncms_mqtt.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2024-10-28 21:52:07.408|ERROR|index.php|Not Authenticated|feed/view</details><br />

Looks like a Mosquitto issue - the data seems to be arriving via emonhub OK.

Odd that it says it is connected then isn’t. Looks like the connection is dropping.

Get something like MQTT.fx from the WindowsStore (assuming you are using Windows), connect to Mosquitto (MQTT Broker) on the EmonPi and see if the data is arriving.

If it is, there is an issue with the PHP script - @TrystanLea

Here’s what I’ve tried:

  • tried putting my old microSD card in. No good - same issue, null on emonpi feeds.
  • tried connecting using mqtt.fx and mqtt explorer. Couldn’t connect using pi/emonsd, emoncms login (same as web login) or a mqtt user I set up as per this post. I keep getting “connection refused: not authorized”.

My only thought is that I’ve damaged something physically taking the case off to change the SD card, but it works on a fresh SD card image.

I just realised my one-wire temp sensor has stopped working too. But it’s still logging ESPEasy data coming in from other devices over wifi.

Edit: OK, I found the mqtt user/pass in /etc/emonhub/emonhub.conf. I was able to connect using MQTT Explorer, and while I can’ see anything I understand, it does keep getting more messages every few seconds, so I assume that’s working.
I then had a look at emonhub.conf, as I thought the /dev/ttyAMA0 vs ACM0 was an issue. I tried swapping from ACM0 to AMA0 (as running “dmesg | grep tty” suggested I need ttyAMA0), and variously tried swapping baud 9600 for 38400 and vice versa, but saw no change. I think this file is my problem. Here is my emonhub.conf file, and below is the log:

2024-10-29 22:19:40,974 DEBUG    MainThread Signal 15 received.
2024-10-29 22:19:41,054 INFO     MainThread Exiting hub...
2024-10-29 22:19:41,303 INFO     MainThread Exit completed
2024-10-29 22:19:42,744 INFO     MainThread EmonHub v2.6.15
2024-10-29 22:19:42,745 INFO     MainThread Opening hub...
2024-10-29 22:19:42,746 INFO     MainThread Running as user: pi
2024-10-29 22:19:42,746 INFO     MainThread Logging level set to DEBUG
2024-10-29 22:19:42,749 INFO     MainThread Creating EmonHubSerialInterfacer 'SerialDirect'
2024-10-29 22:19:42,752 ERROR    MainThread Could not open serial port: /dev/ttyACM0 @ 9600 bits/s (retry every 10s)
2024-10-29 22:19:42,753 DEBUG    MainThread Setting SerialDirect nodeoffset: 6
2024-10-29 22:19:42,754 DEBUG    MainThread Setting SerialDirect pubchannels: ['ToEmonCMS']
2024-10-29 22:19:42,756 INFO     MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2024-10-29 22:19:42,758 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2024-10-29 22:19:44,759 WARNING  MainThread Device communication error - check settings
2024-10-29 22:19:44,760 INFO     MainThread Setting RFM2Pi baseid: 5 (5i)
2024-10-29 22:19:45,761 INFO     MainThread Setting RFM2Pi frequency: 433 (4b)
2024-10-29 22:19:46,762 INFO     MainThread Setting RFM2Pi group: 210 (210g)
2024-10-29 22:19:47,764 INFO     MainThread Setting RFM2Pi quiet: 1 (1q)
2024-10-29 22:19:48,765 INFO     MainThread Setting RFM2Pi calibration: 230V (1p)
2024-10-29 22:19:49,765 DEBUG    MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2024-10-29 22:19:49,766 DEBUG    MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2024-10-29 22:19:49,767 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT'
2024-10-29 22:19:49,769 DEBUG    MainThread Setting MQTT pubchannels: ['ToRFM12']
2024-10-29 22:19:49,769 DEBUG    MainThread Setting MQTT subchannels: ['ToEmonCMS']
2024-10-29 22:19:49,770 INFO     MainThread Setting MQTT node_format_enable: 1
2024-10-29 22:19:49,770 INFO     MainThread Setting MQTT nodevar_format_enable: 1
2024-10-29 22:19:49,771 INFO     MainThread Setting MQTT nodevar_format_basetopic: emon/
2024-10-29 22:19:49,772 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2024-10-29 22:19:49,773 DEBUG    MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2024-10-29 22:19:49,774 DEBUG    MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2024-10-29 22:19:49,774 WARNING  MainThread Setting emoncmsorg apikey: obscured
2024-10-29 22:19:49,775 INFO     MainThread Setting emoncmsorg url: https://emoncms.org
2024-10-29 22:19:49,775 INFO     MainThread Setting emoncmsorg senddata: 1
2024-10-29 22:19:49,776 INFO     MainThread Setting emoncmsorg sendstatus: 1
2024-10-29 22:19:49,776 INFO     MainThread Setting emoncmsorg sendnames: 0
2024-10-29 22:19:49,776 INFO     MainThread Setting emoncmsorg compress: 0
2024-10-29 22:19:49,778 DEBUG    MainThread Automatic configuration of nodes disabled

Edit 2: I’ve tried numerous emonhub.conf versions, and I can’t crack it. I also tried “sudo mosquitto_passwd /etc/mosquitto/passwd emonpi” and set the password as per the emonhub.conf, but it didn’t change anything.
The data is there, it’s just not writing. From system information page:
feedwriter Active Running - sleep 300s 117 feed points pending write

Please post your attachments here. As the FAQ says, if they disappear from the 3rd party place, all value to future readers of this thread will be be lost.

Sounds like you are very close @Orionn

What hardware do you have there emonPi v1 /2, emonBase?

If it’s an emonPi v2, com_baud should be: 115200

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

If it’s an emonPi v1 or emonBase you can change this to 38400…

Sorry, yes, file attachments are literally the first thing in the FAQ. :blush:

I’m using an emonPi1. I have a home-made emonTx connected via USB. I have just realised that there is only 1 feed still working - an ESPEasy ESP8266. My Tasmota smart hubs aren’t registering input, and neither is my emonTx over USB.

Here is my emonhub.conf before I started messing around with it:

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

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

[interfacers]

### This interfacer manages the Arduino with external inputs
[[SerialDirect]]
     Type = EmonHubSerialInterfacer
      [[[init_settings]]]
           com_port = /dev/ttyACM0      # or /dev/ttyAMA0 or/dev/ttyACM0 etc
           com_baud = 9600              # to match the baud of the connected device         
      [[[runtimesettings]]]
           pubchannels = ToEmonCMS,
           nodeoffset = 6

### This interfacer manages the RFM12Pi/RFM69Pi/emonPi module
[[RFM2Pi]]
    Type = EmonHubJeeInterfacer
    [[[init_settings]]]
        com_port = /dev/ttyAMA0
        com_baud = 38400                        # 9600 for old RFM12Pi
    [[[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                         # 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/

[[emoncmsorg]]
    Type = EmonHubEmoncmsHTTPInterfacer
    [[[init_settings]]]
    [[[runtimesettings]]]
        pubchannels = ToRFM12,
        subchannels = ToEmonCMS,
        url = https://emoncms.org
        apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
        senddata = 1                    # Enable sending data to Emoncms.org
        sendstatus = 1                  # Enable sending WAN IP to Emoncms.org MyIP > https://emoncms.org/myip/list
        sendinterval= 30                # Bulk send interval to Emoncms.org in seconds

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

[nodes]

## See config user guide: https://github.com/openenergymonitor/emonhub/blob/emon-pi/conf/emonhub.conf

[[5]]
    nodename = emonpi
    [[[rx]]]
        names = power1,power2,power1pluspower2,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

[[6]]
    nodename = emontxshield
    [[[rx]]]
       names = current1, current2, current3, current4, current5, vrms, power1
       datacode = 0      # not essential as "0" is default datacode for serial interfacer
       scales = 1,1,1,1,1,1,1         # not essential as "1" is default scale for serial interfacer
       units = A,A,A,A,A,V,W

And here is my current version:

#######################################################################
#######################      emonhub.conf     #########################
#######################################################################
### emonHub configuration file, for info see documentation:
### https://docs.openenergymonitor.org/emonhub/configuration.html
#######################################################################
#######################    emonHub  settings    #######################
#######################################################################

[hub]
    ### loglevel must be one of DEBUG, INFO, WARNING, ERROR, and CRITICAL
    loglevel = DEBUG
    autoconf = 1
### 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 = 38400
        [[[runtimesettings]]]
            pubchannels = ToEmonCMS,
            subchannels = ToRFM12,
    
  
    [[SPI]]
        Type = EmonHubRFM69LPLInterfacer
        [[[init_settings]]]
            nodeid = 5
            networkID = 210
        [[[runtimesettings]]]
            pubchannels = ToEmonCMS,
    
[[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
    
    [[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 = 0
            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/
            
            # Single JSON payload published  - use with Emoncms MQTT
            node_JSON_enable = 0
            node_JSON_basetopic = emon/
    
    [[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

#######################################################################
#######################          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]

## See config user guide: https://github.com/openenergymonitor/emonhub/blob/emon-pi/conf/emonhub.conf

[[5]]
    nodename = emonpi
    [[[rx]]]
        names = power1,power2,power1pluspower2,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

[[6]]
    nodename = emontxshield
    [[[rx]]]
       names = current1, current2, current3, current4, current5, vrms, power1
       datacode = 0      # not essential as "0" is default datacode for serial interfacer
       scales = 1,1,1,1,1,1,1         # not essential as "1" is default scale for serial interfacer
       units = A,A,A,A,A,V,W

OK, it’s not (just) the emonhub.conf that’s the problem. I flashed a new card and plugged it in, confirmed the emonpi feeds were registering, and copied emonhub.conf. I then put that working config onto a card with a restored backup, and it did NOT work. So there’s something else afoot.

Here is the working emonhub.conf that I got from a fresh install. The only thing I had changed from default was the emontx config (node 6).

#######################################################################
#######################      emonhub.conf     #########################
#######################################################################
#this is from a fresh install as of 30/10/2024. Inputs are working, until I try copying across a backup.

## **LEGACY CONFIG: For use with 17thJune2015 emonPi/emonBase image and older **
## (check image version by looking for file in /boot)
## Uses old CSV MQTT topic structure compatible with Emoncms Nodes
## Does not use MQTT server authentication

### 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 #(default:WARNING)
### Uncomment this to also send to syslog
# use_syslog = yes

#######################################################################
#######################       Interfacers       #######################
#######################################################################

[interfacers]
### This interfacer manages the RFM12Pi/RFM69Pi/emonPi module
[[RFM2Pi]]
   Type = EmonHubJeeInterfacer
   [[[init_settings]]]
      com_port = /dev/ttyAMA0
      com_baud = 38400                      # 9600 for old RFM12Pi modules
   [[[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 = 230V                      # (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 = ''
      mqtt_passwd = ''

   [[[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/

      # Single JSON payload published  - use with Emoncms MQTT
      node_JSON_enable = 0
      node_JSON_basetopic = emon/

[[emoncmsorg]]
   Type = EmonHubEmoncmsHTTPInterfacer
   [[[init_settings]]]
   [[[runtimesettings]]]
      pubchannels = ToRFM12,
      subchannels = ToEmonCMS,
      url = https://emoncms.org
      apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      senddata = 0                    # Enable sending data to Emoncms.org
      sendstatus = 1                  # Enable sending WAN IP to Emoncms.org MyIP > https://emoncms.org/myip/list
      interval = 30                   # Bulk send interval to Emoncms.org in seconds

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

[nodes]

## See config user guide: https://github.com/openenergymonitor/emonhub/blob/emon-pi/configuration.md

[[5]]
   nodename = emonpi
   [[[rx]]]
      names = power1,power2,power1pluspower2,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

[[6]]
    nodename = emontxshield
    [[[rx]]]
       names = current1, current2, current3, current4, current5, vrms, power1
       datacode = 0      # not essential as "0" is default datacode for serial interfacer
       scales = 1,1,1,1,1,1,1         # not essential as "1" is default scale for serial interfacer
	   units = A,A,A,A,A,V,W

[[7]]
   nodename = emontx4
   [[[rx]]]
      names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
      datacodes = h,h,h,h,h,h,h,h,h,h,h,L
      scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
      units =W,W,W,W,V,C,C,C,C,C,C,p

[[8]]
   nodename = emontx3
   [[[rx]]]
      names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
      datacodes = h,h,h,h,h,h,h,h,h,h,h,L
      scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
      units =W,W,W,W,V,C,C,C,C,C,C,p

[[9]]
   nodename = emontx2
   [[[rx]]]
      names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
      datacode = h
      scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
      units =W,W,W,W,V,C,C,C,C,C,C,p

[[10]]
   nodename = emontx1
   [[[rx]]]
      names = power1, power2, power3, power4, vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
      datacode = h
      scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1
      units =W,W,W,W,V,C,C,C,C,C,C,p

[[11]]
   nodename = 3phase
   [[[rx]]]
      names = powerL1, powerL2, powerL3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
      datacodes = h,h,h,h,h,h,h,h,h,h,h,L
      scales = 1,1,1,1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,1
      units =W,W,W,W,V,C,C,C,C,C,C,p

[[12]]
   nodename = 3phase2
   [[[rx]]]
      names = powerL1, powerL2, powerL3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
      datacodes = h,h,h,h,h,h,h,h,h,h,h,L
      scales = 1,1,1,1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,1
      units =W,W,W,W,V,C,C,C,C,C,C,p

[[13]]
   nodename = 3phase3
   [[[rx]]]
      names = powerL1, powerL2, powerL3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
      datacodes = h,h,h,h,h,h,h,h,h,h,h,L
      scales = 1,1,1,1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,1
      units =W,W,W,W,V,C,C,C,C,C,C,p

[[14]]
   nodename = 3phase4
   [[[rx]]]
      names = powerL1, powerL2, powerL3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse
      datacodes = h,h,h,h,h,h,h,h,h,h,h,L
      scales = 1,1,1,1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,1
      units =W,W,W,W,V,C,C,C,C,C,C,p

[[19]]
   nodename = emonth1
   [[[rx]]]
      names = temperature, external temperature, humidity, battery
      datacode = h
      scales = 0.1,0.1,0.1,0.1
      units = C,C,%,V

[[20]]
   nodename = emonth2
   [[[rx]]]
      names = temperature, external temperature, humidity, battery
      datacode = h
      scales = 0.1,0.1,0.1,0.1
      units = C,C,%,V

[[21]]
   nodename = emonth3
   [[[rx]]]
      names = temperature, external temperature, humidity, battery
      datacode = h
      scales = 0.1,0.1,0.1,0.1
      units = C,C,%,V

[[22]]
   nodename = emonth4
   [[[rx]]]
      names = temperature, external temperature, humidity, battery
      datacode = h
      scales = 0.1,0.1,0.1,0.1
      units = C,C,%,V

[[23]]
   nodename = emonth5
   [[[rx]]]
      names = temperature, external temperature, humidity, battery, pulsecount
      datacodes = h,h,h,h,L
      scales = 0.1,0.1,0.1,0.1,1
      units = C,C,%,V,p

[[24]]
   nodename = emonth6
   [[[rx]]]
      names = temperature, external temperature, humidity, battery, pulsecount
      datacodes = h,h,h,h,L
      scales = 0.1,0.1,0.1,0.1,1
      units = C,C,%,V,p

[[25]]
   nodename = emonth7
   [[[rx]]]
      names = temperature, external temperature, humidity, battery, pulsecount
      datacodes = h,h,h,h,L
      scales = 0.1,0.1,0.1,0.1,1
      units = C,C,%,V,p

[[26]]
   nodename = emonth8
   [[[rx]]]
      names = temperature, external temperature, humidity, battery, pulsecount
      datacodes = h,h,h,h,L
      scales = 0.1,0.1,0.1,0.1,1
      units = C,C,%,V,p

Do I understand correctly that the data is being received in emonhub, it’s just that it’s not appearing in emoncms? E.g I see the following log entries suggesting that data is getting as far as being published via MQTT by emonHub…?

Is the data still getting this far?

Yes. That’s a home-made emonTx shield, connecting via USB. It’s inputs are working, and updating the feed.
The issue is with the emonPi. All inputs are getting nothing in the Inputs screen - it’s showing “n/a NULL” for power1, power2, vrms, pulsecount.
(I can’t find the one-wire temp sensor in the input screen, but that was working before I tried upgrading, too.)

I’ve checked, and all plugs are connected and pushed in firmly. I didn’t remove them when changing the flash card, so they’re all plugged in the right spots.

Ok so no sign of emonPi data in emonHub either…

I would try re-uploading the emonPi v1 firmware from Admin > Update > Firmware.

Hopefully that will nudge it into action…

OK, problem fixed.

When I loaded the fresh sd card, it warned me to update before I restore the backup. Then the backup said it didn’t update the firmware - so I clicked on update firmware, choosing “emonpi1” and the first option (lpl - my 1st mistake). When I later realised I needed the jeelabs firmware, somehow (presumably from restoring the backup) my emonhub.conf had ttyAMC0 instead of ttyAMA0, so when I tried to load the jeelabs firmware, I got no output (it just did nothing).

So once I got the emonhub.conf talking to the (sub-board?), I was able to flash the jeelabs firmware back. I could now see emonpi data coming through in emonhub logs, but it still wasn’t registering. Back to emonhub.conf, I realised that the mqtt user/pass was set as blank. I updated that to emonpimqtt2016, and now everything is working.

Thanks so much to @TrystanLea and @borpin. I thought my 7 year old emonpi had run it’s course, but your support has helped me to keep it chugging along for a while more yet. :grin:

I’m not convinced the migration process moves the emonhub.conf file correctly @TrystanLea.

I’ve pushed a fix that should fix the issue that you identified @borpin fix emonhub.conf install · emoncms/backup@4740b57 · GitHub

1 Like