Hi,
I am brand new to emoncms so bear with me. I am running into some issues with the configuration of emonhub. My general setup is as follows:
- emonTx 3.4 with 3xCT’s connected to 3 phases (240v, AU)
- 9V AC power pack for the emonTx
- direct serial connection to RPi3 running emonPi SD image
- emonTx using 3-phase approximation sketch example with config changed to Serial (I think)
I have been able to get the emonTx to transmit over serial to the Pi and can confirm with Minicom that data is being transmitted successfully to the Pi (see below).
I have modified the emonhub conf to the following:
[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]
[[Serial]]
type = EmonHubSerialInterfacer
[[[init_settings]]]
com_port = /dev/ttyAMA0
com_baud = 115200
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
subchannels = ToRFM12,
[[MQTT]]
Type = EmonHubMqttInterfacer
[[[init_settings]]]
mqtt_host = 127.0.0.1
mqtt_port = 1883
mqtt_user = emonpi
mqtt_passwd = (removed)
[[[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/
#My local emonCMS
#[[emonCMS]]
# Type = EmonHubEmoncmsHTTPInterfacer
# [[[init_settings]]]
# [[[runtimesettings]]]
# pubchannels = ToRFM12,
# subchannels = ToEmonCMS,
# url = http://127.0.0.1/emoncms
# apikey = (removed)
# senddata = 1
# sendstatus = 1
#######################################################################
####################### Nodes #######################
#######################################################################
[nodes]
## See config user guide: http://github.com/openenergymonitor/emonhub/blob/master/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
##Other nodes removed from this section that appear in the actual file
[[11]]
nodename = 3phase
[[[rx]]]
#names = powerL1, powerL2, powerL3, power4, Vrms, temp1, temp2, temp3, temp4, temp5, temp6
names = powerL1, powerL2, powerL3, power4, Vrms
datacode = h
#scales = 1,1,1,1,0.01,0.1,0.1,0.1,0.1,0.1,0.1
scales = 1,1,1,1,0.01
#units =W,W,W,W,V,C,C,C,C,C,C
units =W,W,W,W,V
The output to emonhub.log is:
2017-02-12 14:47:13,842 DEBUG MQTT CONACK => Return code: 0
2017-02-12 14:47:13,943 INFO MQTT on_subscribe
2017-02-12 15:06:21,965 DEBUG MainThread MQTT Subscribed to channel' : ToEmonCMS
2017-02-12 15:06:27,254 DEBUG MainThread SIGINT received.
2017-02-12 15:06:27,254 INFO MainThread Exiting hub...
2017-02-12 15:06:27,309 INFO MainThread Exit completed
2017-02-12 15:06:27,784 INFO MainThread EmonHub emonHub 'emon-pi' variant v1.2
2017-02-12 15:06:27,785 INFO MainThread Opening hub...
2017-02-12 15:06:27,785 INFO MainThread Logging level set to DEBUG
2017-02-12 15:06:27,786 INFO MainThread Creating EmonHubMqttInterfacer 'MQTT'
2017-02-12 15:06:27,787 INFO MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883 mqtt_user=emonpi
2017-02-12 15:06:27,788 DEBUG MainThread MQTT Subscribed to channel' : ToEmonCMS
2017-02-12 15:06:27,889 INFO MQTT Connecting to MQTT Server
2017-02-12 15:06:27,892 INFO MQTT connection status: Connection successful
2017-02-12 15:06:27,892 DEBUG MQTT CONACK => Return code: 0
2017-02-12 15:06:27,993 INFO MQTT on_subscribe
2017-02-12 15:06:58,604 DEBUG MainThread MQTT Subscribed to channel' : ToEmonCMS
2017-02-12 15:07:03,164 DEBUG MainThread SIGINT received.
2017-02-12 15:07:03,164 INFO MainThread Exiting hub...
2017-02-12 15:07:03,224 INFO MainThread Exit completed
2017-02-12 15:07:03,637 INFO MainThread EmonHub emonHub 'emon-pi' variant v1.2
2017-02-12 15:07:03,638 INFO MainThread Opening hub...
2017-02-12 15:07:03,638 INFO MainThread Logging level set to DEBUG
2017-02-12 15:07:03,638 INFO MainThread Creating EmonHubMqttInterfacer 'MQTT'
2017-02-12 15:07:03,639 INFO MainThread MQTT Init mqtt_host=127.0.0.1 mqtt_port=1883 mqtt_user=emonpi
2017-02-12 15:07:03,641 DEBUG MainThread MQTT Subscribed to channel' : ToEmonCMS
2017-02-12 15:07:03,742 INFO MQTT Connecting to MQTT Server
2017-02-12 15:07:03,744 INFO MQTT connection status: Connection successful
2017-02-12 15:07:03,745 DEBUG MQTT CONACK => Return code: 0
2017-02-12 15:07:03,846 INFO MQTT on_subscribe
As you can see from the log it emonhub doesn’t appear to be receiving any data. Can someone give me a steer in the right direction?
A couple of related queries:
- should I delete all the unwanted nodes from the conf file?
- how do I set up a local connection to emoncms (not .org) do I need an API key etc or is it done over the local MQTT connection?
Thanks.