I'm resetting up some older hardware. I've created an Ubuntu machine with emoncms running and that appears to work fine and an pi with the RFM12Pi V2 which I can log into as well.
I have an older emonTx V3 which is flashing the red light every 10 seconds which I believe means that it is transmitting.
The issue is I've installed everything as per the setups but it shows that all the nodes are inactive. I'm not sure where to go from here?
Thanks Josh
All I get on the pi logs:
2016-01-08 20:17:48,268 INFO emoncmsorg sending: http://192.168.80.24/emoncms/myip/set.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y 2016-01-08 20:17:48,294 WARNING emoncmsorg emoncmsorg couldn't send to server, HTTPError: 406 2016-01-08 20:18:06,648 INFO emoncmsorg sending: http://192.168.80.24/emoncms/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[]&sentat=1452284286 2016-01-08 20:18:06,667 WARNING emoncmsorg send failure: wanted 'ok' but got 'Error: Format error, json string supplied is not valid
My emonhub config:
[[emoncmsorg]]
Type = EmonHubEmoncmsHTTPInterfacer
[[[init_settings]]]
[[[runtimesettings]]]
pubchannels = ToRFM12,
subchannels = ToEmonCMS,
url = http://192.168.80.24/emoncms
apikey = XXXWritekeyXXX
senddata = 1
sendstatus = 1
Re: Troubleshooting inactive nodes
The emonhub log shows that there is no data being sent in the request. Are there any logs corresponding to data received from the RFM12Pi? Did you setup the EmonHubJeeInterfacer? It should look similar to this:
[[RFM2Pi]]
Type = EmonHubJeeInterfacer
[[[init_settings]]]
com_port = /dev/ttyAMA0
com_baud = 38400
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
subchannels = ToRFM12,
# datacode = B #(default:h)
# scale = 100 #(default:1)
group = 210 #(default:210)
frequency = 433 #(default:433)
baseid = 5 #(emonPi default:5)
quiet = false #(default:true)
calibration = 230V #(UK/EU: 230V, US: 110V)
# interval = 300 #(default:0)
# nodeoffset = 32 #(default:0)
Re: Troubleshooting inactive nodes
I believe it is, I've attached the whole thing below. I get a little green flash about every ten seconds next to the RF ACT LED on the RFMPi.
I get the red flash every ten seconds on the emonTX V3.
I just don't know what to test next or what to try to see what is happening.
Thanks Josh
edit: found more info at the start of the log file:
2015-11-27 20:04:47,411 INFO MainThread EmonHub Pre-Release Development Version (rc2.0?)
2015-11-27 20:04:47,414 INFO MainThread Opening hub...
2015-11-27 20:04:47,416 INFO MainThread Logging level set to DEBUG
2015-11-27 20:04:47,419 INFO MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2015-11-27 20:04:47,425 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2015-11-27 20:04:49,432 WARNING MainThread Device communication error - check settings
2015-11-27 20:04:49,435 INFO MainThread Setting RFM2Pi frequency: 433 (4b)
2015-11-27 20:04:50,438 INFO MainThread Setting RFM2Pi group: 210 (210g)
2015-11-27 20:04:51,442 INFO MainThread Setting RFM2Pi quiet: 0 (0q)
2015-11-27 20:04:52,446 INFO MainThread Setting RFM2Pi baseid: 5 (5i)
2015-11-27 20:04:53,456 INFO MainThread Setting RFM2Pi calibration: 230V (1p)
2015-11-27 20:04:54,460 DEBUG MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2015-11-27 20:04:54,464 DEBUG MainThread Interfacer: Subscribed to channel' : ToRFM12
2015-11-27 20:04:54,466 DEBUG MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2015-11-27 20:04:54,479 DEBUG MainThread Interfacer: Subscribed to channel' : ToRFM12
2015-11-27 20:04:54,506 INFO MainThread Creating EmonHubMqttInterfacer 'MQTT'
2015-11-27 20:04:54,521 INFO MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883
2015-11-27 20:04:54,547 DEBUG MainThread MQTT Subscribed to channel' : ToEmonCMS
2015-11-27 20:04:54,557 INFO MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2015-11-27 20:04:54,564 DEBUG MainThread emoncmsorg Subscribed to channel' : ToEmonCMS
2015-11-27 20:04:54,667 INFO MQTT Connecting to MQTT Server
2015-11-27 20:04:54,702 INFO MQTT connection status: Connection successful
2015-11-27 20:04:54,705 DEBUG MQTT CONACK => Return code: 0
2015-11-27 20:04:54,826 INFO MQTT on_subscribe
Below is what is shown on the emonHub config editor.
#######################################################################
####################### emonhub.conf #########################
#######################################################################
###
### SPECIMEN emonHub configuration file
### Note that when installed from apt, a new config file is written
### by the debian/postinst script, so changing this file will do
### nothing in and of itself.
###
### Each Interfacer and each Reporter has
### - a [[name]]: a unique string
### - a type: the name of the class it instantiates
### - a set of init_settings (depends on the type)
### - a set of runtimesettings (depends on the type)
### Both init_settings and runtimesettings sections must be defined,
### even if empty. Init settings are used at initialization,
### and runtime settings are refreshed on a regular basis.
### Many settings below are "commented out" as they are not mandatory and
### have been included as a template or to provide alternative options
### removing the leading # will enable the setting and override the default
### Default settings are shown as comments on the same line as the setting
### eg #(default:xyz) "xyz" is set if the setting is "commented out".
###
### All lines beginning with '###' are comments and can be safely removed.
###
#######################################################################
####################### emonHub settings #######################
#######################################################################
[hub]
### loglevel must be one of DEBUG, INFO, WARNING, ERROR, and CRITICAL
### see here : http://docs.python.org/2/library/logging.html
loglevel = DEBUG #(default:WARNING)
#######################################################################
####################### Interfacers #######################
#######################################################################
[interfacers]
### This interfacer manages the RFM2Pi module
[[RFM2Pi]]
Type = EmonHubJeeInterfacer
[[[init_settings]]]
com_port = /dev/ttyAMA0
com_baud = 38400
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
subchannels = ToRFM12,
# datacode = B #(default:h)
# scale = 100 #(default:1)
group = 210 #(default:210)
frequency = 433 #(default:433)
baseid = 5 #(emonPi default:5)
quiet = false #(default:true)
calibration = 230V #(UK/EU: 230V, US: 110V)
# interval = 300 #(default:0)
# nodeoffset = 32 #(default:0)
### This interfacer manages the RFM2Pi module
[[MQTT]]
Type = EmonHubMqttInterfacer
[[[init_settings]]]
mqtt_host = 127.0.0.1
mqtt_port = 1883
[[[runtimesettings]]]
pubchannels = ToRFM12,
subchannels = ToEmonCMS,
basetopic = emonhub/
[[emoncmsorg]]
Type = EmonHubEmoncmsHTTPInterfacer
[[[init_settings]]]
[[[runtimesettings]]]
pubchannels = ToRFM12,
subchannels = ToEmonCMS,
url = http://192.168.80.24/emoncms
apikey = xxAPIwritekeyxx
senddata = 1
sendstatus = 1
#######################################################################
####################### Nodes #######################
#######################################################################
[nodes]
### List of nodes by node ID
### 'datacode' is default for node and 'datacodes' are per value data codes.
### if both are present 'datacode' is ignored in favour of 'datacodes'
### eg node 99 would expect 1 long and 4 ints, unless the "datacodes" line
### was removed, then "datacode" would make it expect any number of longs,
### likewise per value "scales" will override default node "scale", the number
### of "scales" must match the number of values or frame will be discarded.
[[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
[[19]]
nodename = emonTH_1
firmware = emonTH_DHT22_DS18B20.ino
hardware = emonTH_(Node_ID_Switch_DIP1:OFF_DIP2:OFF)
[[[rx]]]
names = temperature, external temperature, humidity, battery
datacode = h
scales = 0.1,0.1,0.1,0.1
units = C,C,%,V
[[20]]
nodename = emonTH_2
firmware = emonTH_DHT22_DS18B20.ino
hardware = emonTH_(Node_ID_Switch_DIP1:ON_DIP2:OFF)
[[[rx]]]
names = temperature, external temperature, humidity, battery
datacode = h
scales = 0.1,0.1,0.1,0.1
units = C,C,%,V
[[21]]
nodename = emonTH_3
firmware = emonTH_DHT22_DS18B20.ino
hardware = emonTH_(Node_ID_Switch_DIP1:OFF_DIP2:ON)
[[[rx]]]
names = temperature, external temperature, humidity, battery
datacode = h
scales = 0.1,0.1,0.1,0.1
units = C,C,%,V
[[22]]
nodename = emonTH_4
firmware = V1_5_emonTH_DHT22_DS18B20.ino
hardware = emonTH_(Node_ID_Switch_DIP1:ON_DIP2:ON)
[[[rx]]]
names = temperature, external temperature, humidity, battery
datacode = h
scales = 0.1,0.1,0.1,0.1
units = C,C,%,V
[[10]]
nodename = emonTx_1
firmware =V1_6_emonTxV3_4_DiscreteSampling
hardware = emonTx_(NodeID_DIP_Switch1:OFF)
[[[rx]]]
names = power1, power2, power3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse #Firmware V1.6
#names = power1, power2, power3, power4, Vrms, temp #Firmware =<V1.4 (un-comment)
datacode = h
scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1 #Firmware V1.6
units =W,W,W,W,V,C,C,C,C,C,C,p #FirmwareV1.6
#scales = 1,1,1,1,0.01,0.1 #Firmware =<V1.4 (un-comment)
#units =W,W,W,W,V,C #Firmware =<V1.4 (un-comment)
[[9]]
nodename = emonTx_2
firmware =V1_6_emonTxV3_4_DiscreteSampling
hardware = emonTx_(NodeID_DIP_Switch1:ON)
[[[rx]]]
names = power1, power2, power3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6, pulse #Firmware V1.6
#names = power1, power2, power3, power4, Vrms, temp #Firmware =<V1.4 (un-comment)
datacode = h
scales = 1,1,1,1,0.01,0.1,0.1, 0.1,0.1,0.1,0.1,1 #Firmware V1.6
units =W,W,W,W,V,C,C,C,C,C,C,p #FirmwareV1.6
#scales = 1,1,1,1,0.01,0.1 #Firmware =<V1.4 (un-comment)
#units =W,W,W,W,V,C #Firmware =<V1.4 (un-comment)
Re: Troubleshooting inactive nodes
Okay looks a bit better now, I've changed the Baud rate to 9600 after reading a few other issues and I get some other info now:
2016-01-09 03:54:31,298 DEBUG RFM2Pi 6 NEW FRAME : 10 249 253 254 3 36 0 0 0 251 93 0 0
2016-01-09 03:54:31,315 WARNING RFM2Pi 6 Scales ['1', '1', '1', '1', '0.01', '0.1', '0.1', '0.1', '0.1', '0.1', '0.1', '1'] for RX data : [249, 253, 254, 3, 36, 0, 0, 0, 251, 93, 0, 0] not suitable
2016-01-09 03:54:42,273 DEBUG RFM2Pi 7 NEW FRAME : 10 8 254 230 3 38 0 0 0 17 94 0 0
2016-01-09 03:54:42,283 WARNING RFM2Pi 7 Scales ['1', '1', '1', '1', '0.01', '0.1', '0.1', '0.1', '0.1', '0.1', '0.1', '1'] for RX data : [8, 254, 230, 3, 38, 0, 0, 0, 17, 94, 0, 0] not suitable
I'll do some more digging around when I get time, I think I may have to do more settings to the Emonhub Config.
Josh
Re: Troubleshooting inactive nodes
I can see by the logs this is the "emonpi" variant of emonhub but the first line of your log shows "EmonHub Pre-Release Development Version (rc2.0?)" which means this is the very first "emonpi" release before the version was corrected.
I would strongly recommend updating before too much digging as it may of been fixed in production.
Tell us more about your set up, this seems an odd version to be using for a remote install since it is focused on a close local (same machine) link to the nodes module in emoncms. The original emonhub version is a direct replacement for the oemgateway you had previously.
The error seems to suggest the 12 scales do not match the 12 values, In fact I believe the confusion is because the emonTx is sending 12 bytes for 6 values and the datacodes test is being side stepped by the "datacode = h".
The scales test is then failing with a less than helpful log that should say the Scales ['1', '1', '1', '1', '0.01', '0.1', '0.1', '0.1', '0.1', '0.1', '0.1', '1'] for Values : [-504, 998, 38, 0, 240.81, 0] not suitable.
Try setting " scales = 1,1,1,1,0.01,0.1 " for node 10 or alternatively just comment out the scales line so that the default " scale = 1 " gets applied and you do the scaling in emoncms as before.
Paul
Re: Troubleshooting inactive nodes
Okay I'll give updating a go and changing some values when I get a chance.
My setup is:
EmonTx V3
Raspberry Pi with RFM12Pi
Ubuntu VM with emonCMS installed.
I bought all this about 2 years ago before the emonPi came out but moved house recently and am trying to reinstall everything. Was all working fine before the more.
Josh