Just checking on what code I am running, I realised that the stable release of emonhub
is way behind the master
.
I suggest you checkout the master branch.
cd /opt/openenergymonitor/emonhub
git fetch --all
git checkout master
git pull
Just checking on what code I am running, I realised that the stable release of emonhub
is way behind the master
.
I suggest you checkout the master branch.
cd /opt/openenergymonitor/emonhub
git fetch --all
git checkout master
git pull
Sorry - I tried all combos of `, `` and < but didn’t use three ```. Will make a note for the future …
Herewith the emonhub.conf from the emonTx, copy / pasted after having stopped emonhub and during the running of the miniterm routine
#######################################################################
####################### emonhub.conf #########################
#######################################################################
### 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
### 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
[[[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)
[[SerialTx]]
Type = EmonHubTx3eInterfacer
[[[init_settings]]]
com_port= /dev/ttyAMA0
com_baud = 115200
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
nodeoffset = 0
nodename = Serial_PiZero_barn
[[MQTT]]
Type = EmonHubMqttInterfacer
[[[init_settings]]]
mqtt_host = 192.168.2.50
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 = power1, power2, power3, power4, vrms
datacode = h
scales = 1,1,1,1,0.01
units = W,W,W,W,V
[[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
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
[[10]]
nodename = emontx1
[[[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.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
[[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
[[15]]
nodename = emontx3cm15
[[[rx]]]
names = MSG, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse
datacodes = L,h,h,h,h,h,l,l,l,l,h,h,h,L
scales = 1,0.01,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1
units = n,V,W,W,W,W,Wh,Wh,Wh,Wh,C,C,C,p
whitening = 1
[[16]]
nodename = emontx3cm16
[[[rx]]]
names = MSG, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse
datacodes = L,h,h,h,h,h,l,l,l,l,h,h,h,L
scales = 1,0.01,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1
units = n,V,W,W,W,W,Wh,Wh,Wh,Wh,C,C,C,p
whitening = 1
[[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
Not knowingly (didn’t know I ought to have, and don’t know how to anyway. I most likely did shut the PiZero down a couple of times since the initial set up though.
Where would I do that? I can’t see anything RF related in the emonHub.conf (On the other three emonTx’s I have elsewhere (currently connected to ESP8266’s) I have fitted a “blanking” plate to the RF screw, but obviously didn’t have a fourth for this one.
Herewith the miniterm results (hmmm, despite three ``` top & bottom this next section doesn’t get abbreviated. Sorry!) …
Last login: Sun Oct 11 12:14:13 on ttys002
Julians-42-iMac:~ jjb$ ssh [email protected]
[email protected]'s password:
Linux emonpi 5.4.51+ #1333 Mon Aug 10 16:38:02 BST 2020 armv6l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Oct 11 12:14:30 2020 from 192.168.2.30
pi@emonpi:~ $ sudo systemctl stop emonhub.service
pi@emonpi:~ $ miniterm --rtscts /dev/ttyAMA0 115200
--- Miniterm on /dev/ttyAMA0 115200,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
MSG:45,Vrms:247.75,P1:0,E1:0,pulse:1
MSG:46,Vrms:247.81,P1:0,E1:0,pulse:1
MSG:47,Vrms:248.02,P1:0,E1:0,pulse:1
MSG:48,Vrms:248.16,P1:0,E1:0,pulse:1
MSG:49,Vrms:248.05,P1:0,E1:0,pulse:1
MSG:50,Vrms:248.21,P1:0,E1:0,pulse:1
MSG:51,Vrms:248.11,P1:0,E1:0,pulse:1
MSG:52,Vrms:247.98,P1:0,E1:0,pulse:1
MSG:53,Vrms:247.92,P1:0,E1:0,pulse:1
MSG:54,Vrms:248.04,P1:0,E1:0,pulse:1
MSG:55,Vrms:247.91,P1:0,E1:0,pulse:1
MSG:56,Vrms:247.65,P1:0,E1:0,pulse:1
MSG:57,Vrms:247.77,P1:0,E1:0,pulse:1
MSG:58,Vrms:247.81,P1:0,E1:0,pulse:1
MSG:59,Vrms:247.76,P1:0,E1:0,pulse:1
MSG:60,Vrms:247.64,P1:0,E1:0,pulse:1
MSG:61,Vrms:247.82,P1:0,E1:0,pulse:1
MSG:62,Vrms:247.62,P1:0,E1:0,pulse:1
MSG:63,Vrms:247.64,P1:0,E1:0,pulse:1
MSG:64,Vrms:247.72,P1:0,E1:0,pulse:1
MSG:65,Vrms:247.60,P1:0,E1:0,pulse:1
MSG:66,Vrms:247.45,P1:0,E1:0,pulse:1
MSG:67,Vrms:247.50,P1:0,E1:0,pulse:1
MSG:68,Vrms:247.56,P1:0,E1:0,pulse:1
MSG:69,Vrms:247.41,P1:0,E1:0,pulse:1
MSG:70,Vrms:247.41,P1:0,E1:0,pulse:1
MSG:71,Vrms:247.34,P1:0,E1:0,pulse:1
MSG:72,Vrms:247.82,P1:0,E1:0,pulse:1
MSG:73,Vrms:247.84,P1:0,E1:0,pulse:1
MSG:74,Vrms:247.82,P1:0,E1:0,pulse:1
MSG:75,Vrms:247.81,P1:0,E1:0,pulse:1
MSG:76,Vrms:248.00,P1:0,E1:0,pulse:1
MSG:77,Vrms:248.14,P1:0,E1:0,pulse:1
MSG:78,Vrms:248.20,P1:0,E1:0,pulse:1
MSG:79,Vrms:248.13,P1:0,E1:0,pulse:1
MSG:80,Vrms:248.17,P1:0,E1:0,pulse:1
MSG:81,Vrms:248.15,P1:0,E1:0,pulse:1
MSG:82,Vrms:248.00,P1:0,E1:0,pulse:1
MSG:83,Vrms:248.02,P1:0,E1:0,pulse:1
MSG:84,Vrms:248.01,P1:0,E1:0,pulse:1
MSG:85,Vrms:248.13,P1:0,E1:0,pulse:1
MSG:86,Vrms:248.08,P1:0,E1:0,pulse:1
MSG:87,Vrms:248.14,P1:0,E1:0,pulse:1
MSG:88,Vrms:247.32,P1:0,E1:0,pulse:1
MSG:89,Vrms:246.31,P1:0,E1:0,pulse:1
MSG:90,Vrms:246.09,P1:0,E1:0,pulse:1
MSG:91,Vrms:245.98,P1:0,E1:0,pulse:1
MSG:92,Vrms:246.17,P1:0,E1:0,pulse:1
MSG:93,Vrms:246.19,P1:0,E1:0,pulse:1
MSG:94,Vrms:245.99,P1:0,E1:0,pulse:1
MSG:95,Vrms:246.25,P1:0,E1:0,pulse:1
MSG:96,Vrms:246.11,P1:0,E1:0,pulse:1
MSG:97,Vrms:245.76,P1:0,E1:0,pulse:1
MSG:98,Vrms:245.87,P1:0,E1:0,pulse:1
MSG:99,Vrms:246.16,P1:0,E1:0,pulse:1
MSG:100,Vrms:245.97,P1:0,E1:0,pulse:1
MSG:101,Vrms:245.71,P1:0,E1:0,pulse:1
MSG:102,Vrms:245.53,P1:0,E1:0,pulse:1
After doing the above, I rebooted the PiZero and then ran that code via ssh on the PiZero.
Last login: Mon Oct 12 13:21:17 on ttys000
Julians-42-iMac:~ jjb$ ssh [email protected]
[email protected]'s password:
Linux emonpi 5.4.51+ #1333 Mon Aug 10 16:38:02 BST 2020 armv6l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Oct 12 13:21:35 2020 from 192.168.2.30
pi@emonpi:~ $ cd /opt/openenergymonitor/emonhub
pi@emonpi:/opt/openenergymonitor/emonhub $ git fetch --all
Fetching origin
pi@emonpi:/opt/openenergymonitor/emonhub $ git checkout master
Branch 'master' set up to track remote branch 'master' from 'origin'.
Switched to a new branch 'master'
pi@emonpi:/opt/openenergymonitor/emonhub $ git pull
Already up to date.
pi@emonpi:/opt/openenergymonitor/emonhub $
After this, I rebooted the PiZero once again; within the Inputs page on the main emonPi I deleted 159 old / stale Input lines within the PiZero “node”. That left Vrms, P1, E1, pulse which updated every 10(?) seconds. But after a while more weird ones started to appear again (ms and G for example). Subsequently, the updating interval on the good ones became slightly erratic
Does any of that help? Have to say I’m a bit lost !!!
Do you have debugging messages coming out of your emonTx?
It looks as if you might have some “human readable” output from the emonTx as well as the format (“MSG:45,Vrms:247.75,P1:0,E1:0,pulse:1”) intended for machine consumption. That’s the only way things like “ms” can be transmitted.
“E1MSG” looks like there are some missing characters in the data. You could try reducing the baud rate on the serial connection between the emonTx and the Pi Zero.
Another thought - is the “Tx” line (actually a wrongly labelled Rx input) on the emonTx connected from your Pi Zero? That has caused trouble with non-Shop ESP8266’s in the past - but not exactly the same trouble as you’re reporting.
Sorry, I missed this bit. Having restarted the PiZero, I pressed the Tx reset button, and this is the last bits of the emonHub log.
2020-10-12 14:12:20,058 INFO MainThread Setting RFM2Pi baseid: 5 (5i)
2020-10-12 14:12:21,062 INFO MainThread Setting RFM2Pi frequency: 433 (4b)
2020-10-12 14:12:22,065 INFO MainThread Setting RFM2Pi group: 210 (210g)
2020-10-12 14:12:23,068 INFO MainThread Setting RFM2Pi quiet: 1 (1q)
2020-10-12 14:12:24,072 INFO MainThread Setting RFM2Pi calibration: 230V (1p)
2020-10-12 14:12:25,076 DEBUG MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2020-10-12 14:12:25,077 DEBUG MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2020-10-12 14:12:25,089 INFO MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-10-12 14:12:25,094 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-10-12 14:12:25,102 INFO MainThread Creating EmonHubMqttInterfacer 'MQTT'
2020-10-12 14:12:25,124 DEBUG MainThread Setting MQTT pubchannels: ['ToRFM12']
2020-10-12 14:12:25,126 DEBUG MainThread Setting MQTT subchannels: ['ToEmonCMS']
2020-10-12 14:12:25,128 INFO MainThread Setting MQTT node_format_enable: 1
2020-10-12 14:12:25,129 INFO MainThread Setting MQTT nodevar_format_enable: 1
2020-10-12 14:12:25,141 INFO MainThread Setting MQTT nodevar_format_basetopic: emon/
2020-10-12 14:12:25,145 INFO MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2020-10-12 14:12:25,148 DEBUG MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2020-10-12 14:12:25,160 DEBUG MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2020-10-12 14:12:25,162 WARNING MainThread Setting emoncmsorg apikey: obscured
2020-10-12 14:12:25,164 INFO MainThread Setting emoncmsorg url: https://emoncms.org
2020-10-12 14:12:25,167 INFO MainThread Setting emoncmsorg senddata: 1
2020-10-12 14:12:25,169 INFO MainThread Setting emoncmsorg sendstatus: 1
2020-10-12 14:12:34,868 WARNING SerialTx Exception caught in SerialTx thread. Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 501, in read
'device reports readiness to read but returned no data '
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/openenergymonitor/emonhub/src/emonhub_interfacer.py", line 32, in wrapper
return func(*args)
File "/opt/openenergymonitor/emonhub/src/emonhub_interfacer.py", line 99, in run
rxc = self.read()
File "/opt/openenergymonitor/emonhub/src/interfacers/EmonHubTx3eInterfacer.py", line 46, in read
self._rx_buf = self._rx_buf + self._ser.readline().decode()
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 509, in read
raise SerialException('read failed: {}'.format(e))
serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
2020-10-12 14:12:34,886 WARNING MainThread SerialTx thread is dead.
2020-10-12 14:12:34,889 WARNING MainThread Attempting to restart thread SerialTx (thread has been restarted 0 times...)
2020-10-12 14:12:34,904 INFO MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-10-12 14:12:34,908 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-10-12 14:12:41,171 DEBUG SerialTx invalid input name:
2020-10-12 14:13:01,484 WARNING RFM2Pi Exception caught in RFM2Pi thread. Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 501, in read
'device reports readiness to read but returned no data '
serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/openenergymonitor/emonhub/src/emonhub_interfacer.py", line 32, in wrapper
return func(*args)
File "/opt/openenergymonitor/emonhub/src/emonhub_interfacer.py", line 99, in run
rxc = self.read()
File "/opt/openenergymonitor/emonhub/src/interfacers/EmonHubJeeInterfacer.py", line 85, in read
self._rx_buf = self._rx_buf + self._ser.readline().decode()
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 509, in read
raise SerialException('read failed: {}'.format(e))
serial.serialutil.SerialException: read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
2020-10-12 14:13:01,579 DEBUG SerialTx 9 NEW FRAME : MSG:1,Vrms:246.21,P1:0,E1:0,pulse:1
2020-10-12 14:13:01,605 DEBUG SerialTx 9 Timestamp : 1602508381.578269
2020-10-12 14:13:01,607 DEBUG SerialTx 9 From Node : Serial_PiZero_barn
2020-10-12 14:13:01,630 DEBUG SerialTx 9 Values : [1, 246.21, 0, 0, 1]
2020-10-12 14:13:01,632 DEBUG SerialTx 9 Sent to channel(start)' : ToEmonCMS
2020-10-12 14:13:01,635 DEBUG SerialTx 9 Sent to channel(end)' : ToEmonCMS
2020-10-12 14:13:01,643 WARNING MainThread RFM2Pi thread is dead.
2020-10-12 14:13:01,645 WARNING MainThread Attempting to restart thread RFM2Pi (thread has been restarted 0 times...)
2020-10-12 14:13:01,649 INFO MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2020-10-12 14:13:01,665 INFO MQTT Connecting to MQTT Server
2020-10-12 14:13:01,695 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2020-10-12 14:13:01,770 DEBUG emoncmsorg Buffer size: 1
2020-10-12 14:13:01,812 INFO MQTT connection status: Connection successful
2020-10-12 14:13:01,815 DEBUG MQTT CONACK => Return code: 0
2020-10-12 14:13:01,932 INFO MQTT on_subscribe
2020-10-12 14:13:03,703 WARNING MainThread Device communication error - check settings
2020-10-12 14:13:03,706 INFO MainThread Setting RFM2Pi baseid: 5 (5i)
2020-10-12 14:13:04,709 INFO MainThread Setting RFM2Pi frequency: 433 (4b)
2020-10-12 14:13:05,713 INFO MainThread Setting RFM2Pi group: 210 (210g)
2020-10-12 14:13:06,717 INFO MainThread Setting RFM2Pi quiet: 1 (1q)
2020-10-12 14:13:07,721 INFO MainThread Setting RFM2Pi calibration: 230V (1p)
2020-10-12 14:13:08,724 DEBUG MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2020-10-12 14:13:08,726 DEBUG MainThread Setting RFM2Pi subchannels: ['ToRFM12']
Hi @Robert.Wall - I think our messages crossed.
It could well be that I mis-wired the connection between the PiZero and the emonTx, but I am 99% sure I followed the second diagram in @pb66 's post here. 4 CT emonBase using emonTx and Pi Zero W - #17 by pb66
But I will make up a second set and see if that changes anything.
I don’t think it will, and it’s pretty clear that’s not your problem. So don’t.
There’s an historical problem:
On @pb66’s diagram, the mistake is off the diagram inside the emonTx, where the Tx and Rx pins are wrongly labelled - the emonTx’s “Tx” pin receives data, and its “Rx” pin transmits data. So Paul’s diagram is correct, but you don’t need the Tx - Tx wire, the violet wire in your picture, in normal use.
The problem with the ESP8266 (different device, same purpose) was it sent unwanted data TO the emonTx and reconfigured it, hence that connection doesn’t exist in the shop-prepared ESP8266 conversions. Until you want to recalibrate or reconfigure your emonTx, you are only interested in one-way data - out of the emonTx (on its “Rx” pin) and into the Pi Zero on its Rx pin.
I’ll revise that - I don’t think it is the first part at all. “ms” is a legitimate part of the desired output: “Vrms”, so I think you’re looking for something that’s interrupting the data and causing the interfacer to interpret an isolated “ms” - having lost its “Vr” off the front - as another data item.
One thing you need to be aware of is if you’ve got two things inside your Pi trying to use the same port, the messages will get mixed up. That’s why Brian says to stop emonHub before you connect miniterm/minicom, and restart it when you’ve disconnected.
So if you are talking to the emonTx via the purple wire and it replies and emonHub is still running, whatever the emonTx says will get mixed in with its normal output - not a problem for you - but emonHub will do its best to interpret the mixed-up data.
So I think your problem is either, the data is getting mixed up causing part-messages to be interpreted wrongly, or the Pi Zero is missing a few characters here and there, likewise causing the data to be mis-interpreted.
I have no idea why, it now looks like it is all working, but only intermittently. Trouble is, I can’t work out what causes the drop outs.
It could be physical (90 deg PiZero header soldered on by me / wires crimped badly / etc), but I have even swapped in a Raspberry Pi 4 with pre-soldered headers and shop bought wires, but that still doesn’t make things work.
Following on from doing this earlier …
Did I need to actively re-start it, and if so can I just use the orange Restart button within the emonTx’s emonHub page?
No looks fine.
You often don’t need to, but it does ensure everything is fresh.
sudo systemctl restart emonhub.service
No you need to do it with miniterm running.
You also need to turn RF Off especially if you have not attached an antenna.
Where would I do that? I can’t see anything RF related in the emonHub.conf
I’ll show you - you will see a config menu when you press the reset while miniterm
is running.
It looks as if you might have some “human readable” output from the emonTx
emonhub is not very discerning in this regard (there is an issue open), part of the reason I suggested a JSON output directly from emonTX. It does pick up odd bits of text, usually at startup that appear as inputs. The repeated restarts due to the exceptions isn’t helping.
Another thought - is the “Tx” line (actually a wrongly labelled Rx input) on the emonTx connected from your Pi Zero?
Wiring looks correct to me (ref EmonTX to Rpi - Direct Serial Connection - #61 by borpin)
I do wonder if there is a poor connection though.
2020-10-12 14:12:34,868 WARNING SerialTx Exception caught in SerialTx thread. Traceback (most recent call last): File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 501, in read 'device reports readiness to read but returned no data ' serial.serialutil.SerialException: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
Clearly there is a serial comms problem.
The other thing to run is
tail -f /var/log/emonhub/emonhub.log | grep "NEW FRAME"
However there is clearly something wrong with the serial comms (hence all the exceptions).
suggestion
[[RFM2Pi]]
Interfacer - it isn’t needed as the Pi does not have an RFM board.Following on from doing this earlier …
To test, stop emonhub -
sudo systemctl stop emonhub.service
and open a terminalDid I need to actively re-start it, and if so can I just use the orange Restart button within the emonTx’s emonHub page?
You do need to restart it, but a reboot will do that else just the opposite of stop sudo systemctl start emonhub.service
Stopping it just means there is only one thing reading the serial port.
Just leave miniterm running for a while and look for bad data and a correctly incrementing MSG count.
GOT IT (I think)
@haffle the RFM interfacer is trying to access the same com_port
.
Remove the RFM interfacer from the emonhub.conf file.
GOT IT (I think)
Amazing! It now works - thank you SO much!!!
I let it run overnight having #'d out the RFM section in the emonTx’s emonHub config, and no “rogue” inputs were sent or received. Thank you!
Moving on to deployment, how or where do I get the emonTx c/w PiZero to send the same Inputs across to the emonPi as other emonTx (c/w ESP8266’s) do? IE, how to get it to send CT1, CT2, CT3 etc. I am unclear what the relationship is between the list of Inputs on the emonTx (along with their various “nodes”(?) such as T1, T2, pulse etc), and what appears on the emonPi’s section where the emonTx reports in to. At present, all of the entries within the emonTx are n/a (in red), whereas in the emonPi the emonTx is feeding through 5 entries in green (MSG, Vrms etc).
The screen grab below shows both, and the second image is a screen grab from the emonTx/PiZero’s emonHub log.
This is the current emonHub config (emonTx / PiZero)
#######################################################################
####################### emonhub.conf #########################
#######################################################################
### 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
### 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
# [[[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)
[[SerialTx]]
Type = EmonHubTx3eInterfacer
[[[init_settings]]]
com_port= /dev/ttyAMA0
com_baud = 115200
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
nodeoffset = 0
nodename = Serial_PiZero_barn
[[MQTT]]
Type = EmonHubMqttInterfacer
[[[init_settings]]]
mqtt_host = 192.168.2.50
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 = power1, power2, power3, power4, vrms
datacode = h
scales = 1,1,1,1,0.01
units = W,W,W,W,V
[[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
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
[[10]]
nodename = emontx1
[[[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.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
[[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
[[15]]
nodename = emontx3cm15
[[[rx]]]
names = MSG, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse
datacodes = L,h,h,h,h,h,l,l,l,l,h,h,h,L
scales = 1,0.01,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1
units = n,V,W,W,W,W,Wh,Wh,Wh,Wh,C,C,C,p
whitening = 1
[[16]]
nodename = emontx3cm16
[[[rx]]]
names = MSG, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse
datacodes = L,h,h,h,h,h,l,l,l,l,h,h,h,L
scales = 1,0.01,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1
units = n,V,W,W,W,W,Wh,Wh,Wh,Wh,C,C,C,p
whitening = 1
[[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
Moving on to deployment, how or where do I get the emonTx c/w PiZero to send the same Inputs across to the emonPi as other emonTx (c/w ESP8266’s) do? IE, how to get it to send CT1, CT2, CT3 etc.
It doesn’t as it is different release of the firmware, but that doesn’t matter as you just convert those inputs to a feed. The “P” is the power (W) and the “E” is Wh which is an accumulating figure (until next reboot/reset of EmonTX). If you add more CTs, you need to power off/on the EmonTX to detect further CTs which will be reported as P2, E2 etc.
Personally I use the WhAcc input process and scale that to give the kWh Feed.
[edit]
node_format_enable = 1 nodevar_format_enable = 1
You don’t need to enable both these, in fact you will bet better off using the new JSON format node_JSON_enable = 1
as I mentioned above (although this is currently only in the master branch).
The reason is, each MQTT Publish takes time and potentially, the first topic posted could land on a different ‘slot’ in emoncms. By sending all the data as a single publish it is guaranteed to stay together (especially as it can be timestamped).
Thanks for that.
Another question: within the EmonTx (c/w PiZ)'s emonCMS / WiFi, is the section effectively redundant as the PiZ has taken over wifi comms have been offloaded on to the PiZ, or is it still important? (I have tried re-Scanning, but it never finds an alternative SSID).
I have had trouble changing the wifi network from my office SSID to the barn SSID, and not sure whether to do this within emonCMS / WiFI or via ssh sudo raspi-config
For the next devices I will rig up a tempo WAN with the desired end use SSID to make this switch unnecessary.
within the EmonTx (c/w PiZ)'s emonCMS / WiFi, is the section effectively redundant as the PiZ has taken over wifi comms have been offloaded on to the PiZ, or is it still important?
The emoncms accessed via the IP of the PIZ, will show you the WiFi setup of that PiZ.
The scan work for me. I need to click it twice…
To help me - and hopefully others in the future - I am in the midst of writing up a Dummies Guide for how to switch over to using a Pi Zero. I am part way through setting up my second one, but am a bit stuck once again.
I have done almost all of the setting up, and copied the emonHub config from the PiZ #1 (that works fine & continues to report through to my main emonPi) to a second one (PiZ #2), just changing the [[SerialTx]] nodename from nodename = Serial_PiZero_barn
to nodename = Serial_PiZero_hotwater
. However, the PiZ #2 is not reporting through to the emonPi, and the emonHub config log isn’t looking good.
2020-10-16 09:43:31,997 DEBUG MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2020-10-16 09:43:32,009 WARNING MainThread Setting emoncmsorg apikey: obscured
2020-10-16 09:43:32,011 INFO MainThread Setting emoncmsorg url: https://emoncms.org
2020-10-16 09:43:32,013 INFO MainThread Setting emoncmsorg senddata: 1
2020-10-16 09:43:32,014 INFO MainThread Setting emoncmsorg sendstatus: 1
2020-10-16 09:44:33,867 DEBUG MainThread Setting MQTT timestamped: False
2020-10-16 09:44:33,879 DEBUG MainThread Setting MQTT pubchannels: ['ToRFM12']
2020-10-16 09:44:33,881 INFO MainThread Setting MQTT node_format_enable: 1
2020-10-16 09:44:33,882 INFO MainThread Setting MQTT nodevar_format_enable: 1
2020-10-16 09:44:33,884 INFO MainThread Setting MQTT nodevar_format_basetopic: emon/
2020-10-16 09:44:40,587 DEBUG MainThread Signal 15 received.
2020-10-16 09:46:21,793 INFO MainThread EmonHub emonHub (emon-pi variant) v2.1.5
2020-10-16 09:46:21,796 INFO MainThread Opening hub...
2020-10-16 09:46:21,803 INFO MainThread Logging level set to DEBUG
2020-10-16 09:46:21,805 INFO MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-10-16 09:46:21,821 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-10-16 09:46:21,829 INFO MainThread Creating EmonHubMqttInterfacer 'MQTT'
2020-10-16 09:46:21,842 DEBUG MainThread Setting MQTT pubchannels: ['ToRFM12']
2020-10-16 09:46:21,844 DEBUG MainThread Setting MQTT subchannels: ['ToEmonCMS']
2020-10-16 09:46:21,846 INFO MainThread Setting MQTT node_format_enable: 1
2020-10-16 09:46:21,858 INFO MainThread Setting MQTT nodevar_format_enable: 1
2020-10-16 09:46:21,860 INFO MainThread Setting MQTT nodevar_format_basetopic: emon/
2020-10-16 09:46:21,869 INFO MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2020-10-16 09:46:21,872 DEBUG MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2020-10-16 09:46:21,874 DEBUG MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2020-10-16 09:46:21,876 WARNING MainThread Setting emoncmsorg apikey: obscured
2020-10-16 09:46:21,888 INFO MainThread Setting emoncmsorg url: https://emoncms.org
2020-10-16 09:46:21,889 INFO MainThread Setting emoncmsorg senddata: 1
2020-10-16 09:46:21,893 INFO MainThread Setting emoncmsorg sendstatus: 1
I have obviously forgotten to do something somewhere, but not sure where. Comms are good, I can log in to the PiZ #2 via the dashboard and via ssh. But it is not getting through to the emonPi, despite having an effectively identical emonHub conf, with only a nodename changed.
Use the JSON format as I suggested above (twice). It is better as it is a single MQTT publish.
Possibly 2 issues;
Do you see the serial data stream from the EmonTX when using Miniterm?
Is the EmonTX running the same firmware version?
note You never came back and I didn’t walk you through actually turning off the RF - it would be better to do so.
Use the JSON format as I suggested above (twice). It is better as it is a single MQTT publish.
I think I now have (see conf below), & I restarted emonHub.conf on both PiZ #1 & #2b; had to pop out for an hour, and now both are getting through to the main emonPi’s Inputs page
I will update my crib sheet & start again with PiZ #3
Possibly 2 issues; Do you see the serial data stream from the EmonTX when using Miniterm?
Earlier today I did run (via ssh to PiZ #2) miniterm /dev/ttyAMA0 115200
and miniterm --rtscts /dev/ttyAMA0 115200
but that didn’t seem to help; part of the problem is that I don’t know what miniterm is / does, so will go away and read up about it …
Is the EmonTX running the same firmware version?
Comparing all the version numbers in the emonCMS Admin section of both Pi Zeros, and all seem to be exactly the same
note You never came back and I didn’t walk you through actually turning off the RF - it would be better to do so.
I half hoped that by hashing out the RFM2PI section within the emonTX’s emonHub conf meant that the issue of RF would go away (& it did with PiZ #1), but will re-read your comments and revert.
For clarity, herewith my emonHub conf from the emonTx / PiZ #1. It is the same was for PiZ #2 except for the nodename.
#######################################################################
####################### emonhub.conf #########################
#######################################################################
### 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
### 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
# [[[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)
[[SerialTx]]
Type = EmonHubTx3eInterfacer
[[[init_settings]]]
com_port= /dev/ttyAMA0
com_baud = 115200
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
nodeoffset = 0
nodename = Serial_PiZero_hotwater
[[MQTT]]
Type = EmonHubMqttInterfacer
[[[init_settings]]]
mqtt_host = 192.168.2.50
mqtt_port = 1883
mqtt_user = emonpi
mqtt_passwd = emonpimqtt2016
[[[runtimesettings]]]
subchannels = ToEmonCMS,
timestamped = True
node_JSON_enable = 1
node_JSON_basetopic = emon/
#
# Type = EmonHubMqttInterfacer
# [[[init_settings]]]
# mqtt_host = 192.168.2.50
# 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 = power1, power2, power3, power4, vrms
datacode = h
scales = 1,1,1,1,0.01
units = W,W,W,W,V
[[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
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
[[10]]
nodename = emontx1
[[[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.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
[[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
[[15]]
nodename = emontx3cm15
[[[rx]]]
names = MSG, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse
datacodes = L,h,h,h,h,h,l,l,l,l,h,h,h,L
scales = 1,0.01,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1
units = n,V,W,W,W,W,Wh,Wh,Wh,Wh,C,C,C,p
whitening = 1
[[16]]
nodename = emontx3cm16
[[[rx]]]
names = MSG, Vrms, P1, P2, P3, P4, E1, E2, E3, E4, T1, T2, T3, pulse
datacodes = L,h,h,h,h,h,l,l,l,l,h,h,h,L
scales = 1,0.01,1,1,1,1,1,1,1,1,0.01,0.01,0.01,1
units = n,V,W,W,W,W,Wh,Wh,Wh,Wh,C,C,C,p
whitening = 1
[[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
Earlier today I did run (via ssh to PiZ #2)
miniterm /dev/ttyAMA0 115200
andminiterm --rtscts /dev/ttyAMA0 115200
but that didn’t seem to help; part of the problem is that I don’t know what miniterm is / does, so will go away and read up about it …
So this is important. If you stop emonhub (as mentioned above) and then run miniterm, you should see the data printed out.
Then press the reset for the emonTX and you will see some configuration text, the firmware version and a settings menu.
Comparing all the version numbers in the emonCMS Admin section of both Pi Zeros, and all seem to be exactly the same
You cannot see the emonTX firmware version except as above directly from miniterm.
Some changes require emonhub to be restarted.