Collect data from RPI3 to Emoncms

In your sketch, you have:

  Serial.print("6");
  Serial.print(" ");
 ...
  Serial.print(power1);         // Apparent power 
  Serial.print(" ");
...
  Serial.print(power2);         // Apparent power
  Serial.print(" ");
...
  Serial.print(power3);         // Apparent power
  Serial.print(" ");
...
  Serial.print(power4);         // Apparent power
  Serial.print(" ");

  Serial.println();    

That will print, for example

6 123.45 234.56 345.67 456.78 :leftwards_arrow_with_hook:

So that emonhub correctly interprets the data, you must have exactly the same number of data as you have in your sketch. You have 4 items of data. The NodeID is not data.

Therefore, you must have:

[[6]]
    nodename = Arduino1
    [[[rx]]]
       names = power1, power2, power3, power4
       datacode = 0
       scales = 1,1,1,1
       units =W,W,W,W

You must have “datacode = 0” because the numbers are readable by a person - they are not byte data that must be decoded.

@pb66 - Am I correct here?

@Robert.Wall ,

I’ve tested what you’ve said and i have the same issue in the emonhub config (cf my previous screen of the logs).

Mainly yes, except the “datacodes = 0” is the default of the serial interfacer and the scales (of 1) and units don’t have any effect so all that is needed is

[[6]]
    nodename = Arduino1
    [[[rx]]]
       names = power1, power2, power3, power4
1 Like

Please stop posting pictures of logs or code if you can!

As I’ve asked and explained more than once, it is much better for you and us if you copy and paste code and logs etc.

If you read what your logs say, both attempts to create interfacers (one for each Arduino) fails with the same error message

so the best pace to look for the issue is the [[[runtimesettings]]] in emonhuub.conf, if you are unsure, post the conf here for us to see (text please not a picture!).

I have also explained a couple of times, that you do not need the rfm2pi interfacer if you are not using an rfm2pi or emonpi, so you can delete that interfacer from emonhub.conf completely or a easy tip, just add a “#” (hash symbol) to the beginning of the “Type=EmonHubJeeInterfacer” line to disable it without deleting the config eg

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

disabling this interfacer will tidy up your emonhub.log and make it easier to read.

Hi,

I’m really sorry for the pictures , this is the runtimesettings in emonhub.conf:

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

I’ve disabled the EmonHubJeeInterfacer like you’ve recommended and it’s more clear like you said , i’ve now this:

2019-06-21 11:19:44,231 INFO     MainThread Setting MQTT nodevar_format_basetopic: emon/
2019-06-21 11:19:44,232 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg' 
2019-06-21 11:19:44,233 DEBUG    MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2019-06-21 11:19:44,233 DEBUG    MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2019-06-21 11:19:44,234 INFO     MainThread Setting emoncmsorg url: https://emoncms.org
2019-06-21 11:19:44,234 INFO     MainThread Setting emoncmsorg senddata: 1
2019-06-21 11:19:44,235 INFO     MainThread Setting emoncmsorg apikey: set
2019-06-21 11:19:44,235 INFO     MainThread Setting emoncmsorg sendstatus: 1
2019-06-21 11:24:50,464 INFO     MainThread EmonHub emonHub emon-pi variant v2.1.2
2019-06-21 11:24:50,464 INFO     MainThread Opening hub...
2019-06-21 11:24:50,465 INFO     MainThread Logging level set to DEBUG
2019-06-21 11:24:50,465 INFO     MainThread Creating EmonHubSerialInterfacer 'ArduinoOnUSB0' 
2019-06-21 11:24:50,468 DEBUG    MainThread Opening serial port: /dev/ttyACM0 @ 9600 bits/s
2019-06-21 11:24:50,469 ERROR    MainThread Unable to create 'ArduinoOnUSB0' interfacer: 'runtimesettings'
2019-06-21 11:24:50,469 INFO     MainThread Creating EmonHubSerialInterfacer 'ArduinoOnUSB1' 
2019-06-21 11:24:50,471 DEBUG    MainThread Opening serial port: /dev/ttyACM1 @ 9600 bits/s
2019-06-21 11:24:50,472 ERROR    MainThread Unable to create 'ArduinoOnUSB1' interfacer: 'runtimesettings'
2019-06-21 11:24:50,473 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT' 
2019-06-21 11:24:50,475 DEBUG    MainThread Setting MQTT subchannels: ['ToEmonCMS']
2019-06-21 11:24:50,476 DEBUG    MainThread Setting MQTT pubchannels: ['ToRFM12']
2019-06-21 11:24:50,476 INFO     MainThread Setting MQTT nodevar_format_enable: 1
2019-06-21 11:24:50,477 INFO     MainThread Setting MQTT node_format_enable: 1
2019-06-21 11:24:50,477 INFO     MainThread Setting MQTT nodevar_format_basetopic: emon/
2019-06-21 11:24:50,478 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg' 
2019-06-21 11:24:50,479 DEBUG    MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2019-06-21 11:24:50,479 DEBUG    MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2019-06-21 11:24:50,479 INFO     MainThread Setting emoncmsorg url: https://emoncms.org
2019-06-21 11:24:50,480 INFO     MainThread Setting emoncmsorg senddata: 1
2019-06-21 11:24:50,480 INFO     MainThread Setting emoncmsorg apikey: set
2019-06-21 11:24:50,480 INFO     MainThread Setting emoncmsorg sendstatus: 1

Thanks for your help and sorry again for the pictures ^^‘’

There should be more than one runtimesettings in emonhub.conf, each interfacer has it’s own runtimesettings section. I’m guessing what you’ve posted has nothing to do with either of the Arduino serial interfacers as you have previously confirmed the following

. . . and now I see where the issue is! That should be runtimesettings not runtinesettings, a typo from one of my previous examples (now fixed!).

1 Like

Thanks for all your help , it seems like i’m receiving data perfectly now :smiley: , i just need to check if this is the data that i want.

Thanks again

1 Like