EmonTx v2.4 shield to emonpi via USB

I am trying to get emonpi on my raspberry pi using ( emonSD-26Oct17.img updated to low-write 9.8.31 | 2018.06.21) to read my emontx shield + Leonardo using (emonTxFirmware/emonTxV3_DirectSerial.ino at master · openenergymonitor/emonTxFirmware · GitHub ) via usb cable.

I followed a lot of https://community.openenergymonitor.org/t/serial-direct-connection-between-pi-and-emontx-shield/2611/63 which helped greatly

Using this script on the pi

#!/usr/bin/python
import serial, string
output = " "
ser = serial.Serial('/dev/ttyACM0', 9600, 8, 'N', 1, timeout=1)  
while True:
  print "----"
  while output != "":
output = ser.readline()
print output
  output = " "

I get a reading of

6 579.17 782.01 878.11 276.54 41.62
6 584.23 749.91 878.98 273.30 41.79
6 585.42 747.07 885.86 269.33 41.84
6 607.19 748.19 889.32 269.67 42.39
6 582.72 750.78 1000.26 278.32 41.73
6 585.07 747.13 891.93 268.31 41.83

on Putty

Therefore I know that emonpi is receiving the info from the arduino

next I tried Emonhub.conf

[interfacers]
[[RFM2Pi]] 
    Type = EmonHubSerialInterfacer
    [[[init_settings]]]
        com_port = /dev/ttyACM0
        com_baud = 9600
    [[[runtimesettings]]]
#        group = 210
#        frequency = 433
#        baseid = 15

If I use [[Serial]] , emonhub doesn’t show starting like Lazlo mentioned in the above linked forum

My log says

2018-07-24 15:40:38,279 DEBUG    MainThread SIGINT received.
2018-07-24 15:40:38,485 INFO     MainThread Exiting hub...
2018-07-24 15:40:38,637 INFO     MainThread Exit completed
2018-07-24 15:41:04,617 INFO     MainThread EmonHub emonHub emon-pi variant v2.1.1
2018-07-24 15:41:04,640 INFO     MainThread Opening hub...
2018-07-24 15:41:04,643 INFO     MainThread Logging level set to DEBUG
2018-07-24 15:41:04,688 INFO     MainThread Creating EmonHubSerialInterfacer 'RFM2Pi' 
2018-07-24 15:41:04,749 DEBUG    MainThread Opening serial port: /dev/ttyACM0 @ 9600 bits/s
2018-07-24 15:41:04,782 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT' 
2018-07-24 15:41:04,823 DEBUG    MainThread Setting MQTT subchannels: ['ToEmonCMS']
2018-07-24 15:41:04,841 DEBUG    MainThread Setting MQTT pubchannels: ['ToRFM12']
2018-07-24 15:41:04,844 INFO     MainThread Setting MQTT nodevar_format_enable: 1
2018-07-24 15:41:04,900 INFO     MainThread Setting MQTT node_format_enable: 1
2018-07-24 15:41:04,903 INFO     MainThread Setting MQTT nodevar_format_basetopic: emon/
2018-07-24 15:41:04,950 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg' 
2018-07-24 15:41:04,956 DEBUG    MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2018-07-24 15:41:04,958 DEBUG    MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2018-07-24 15:41:05,020 INFO     MainThread Setting emoncmsorg url: https://emoncms.org
2018-07-24 15:41:05,023 INFO     MainThread Setting emoncmsorg senddata: 1
2018-07-24 15:41:05,025 INFO     MainThread Setting emoncmsorg apikey: set
2018-07-24 15:41:05,028 INFO     MainThread Setting emoncmsorg sendstatus: 1

Any ideas?

Got sorted,
used in emonhub.conf

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

Also the nodeid in the Arduino sketch must be 6

[[6]]
nodename = emontxshield
[[[rx]]]
   names = power1, power2, power3, power4, vrms
   datacode = h
   scales = 1,1,1,1,0.01
   units =W,W,W,W,V

Hope this helps someone else

You could also have changed the nodeID in emonHub to match the nodeID that was used in the sketch, with the proviso that you must not specify the same nodeID twice in emonHub.