Why would you expect to find anything wpa_supplicant-related in /boot?
I would of expected putting a wpa_supplicant file in /boot “to work” too, the only reason it didn’t work on earlier images was that they booted in RO mode so the OS couldn’t over write the existing file with the one found in /boot. Although I would expect issues with the OEM WiFi setup due to permission issues, but the wifi should connect ok even if the wifi setup page isn’t able to modify it moving forward.
I don’t see anything there that looks WiFi related, other than your " ._wpa_supplicant.conf" file.
-
Because that is where you are supposed to put it if you want the OS to use a preset wpa_supplicant from the next boot.
-
Because that is/was “the fix” and the best way to ensure easy access to the wifi settings when there is no Ethernet to get around being “locked out” due to a network change of SSID or PSK, you can just whip out the SD card and edit any text file in the /boot partition from any OS, it doesn’t need to be mounted as a Linux file-system.
By putting the wpa_supplicant.conf file on the boot partition under any other name, strictly NOT “wpa_supplicant.conf” it will always be accessible and will not trigger an over write at boot time.
Numpty question: JFTAOD, and I don’t even know if it matters, but when I uploaded the wpa_supplicant.conf file to the SD card it was called just that … ie: wpa.suplicant.conf ; not sure why it now says _wpa_supplicant.conf . Or does this happen as part of the overwrite during boot?
The wpa_supplicant.conf
file that gets used is the one in /etc/wpa_supplicant/
. The one with the same name in /boot/
is used at first boot time to set that one up if you need wireless to work from first boot, just the same as the empty ssh
file in /boot
.
See the documentation at Raspberry Pi Documentation - Configuration and linked documents.
It seems like emon… has some kind of grossly bodged arrangements on top, but I know nothing about them.
Correct, I don’t need to look at the documentation, I’ve been using these for years and fully understand how they work.
The emonSD image does have “other routes” to editing the wpa_supplicant.conf and I’m not able to comment on the intricacies of the current setup, but have simply highlighted the necessary “Pi zero” fix for previous emonSD images. It’s a fix that resolved all the previous hurdles (No Ethernet, emon “pi” user access for the wifi module plus manual sdcard access for when there is no Ethernet and the wifi creds need changing) that (I believe) would still work with the current image.
I was using this method way before it was needed for the emonSD images as it was more convenient for several reasons, like taking a demo unit from site to site and not needing to hook up Ethernet to get on the client’s wifi etc. Martin Harizanoff (original RFM2Pi developer) also used the same approach.
Wild accusation. Can you support that with evidence (other than hearsay)?
OK - a bit more progress. I can now access the Pi Zero through both ssh and via a browser. I have the emoncms splash screen, asking for a Username & Password (to log in), or to Register.
Do I want to register with a new Username etc? That seems counterintuitive (as I want this to be a daughter / slave to my emonPi & it’s account etc). Or do I create a new User, and then somehow connect the two later?
TIA
If this is just a slave device to a central master then it might be useful to Ser up a user just to be able to edit emonhub.conf, perform updates, check admin stats etc via the web GUI. Just because you create a user, doesn’t mean you must collect/save data, although many would argue a redundant copy of the data might one day be useful if you have a major issue and lose data.
Thanks @pb66 ; I have now set it up with a new username etc, and have successfully run a Full Update within the Pi Zero’s Emoncms > Admin.
This next question is so embarrassingly basic, but how do I now set the emonTx that is hard wired to the Zero to talk to the main emonPi? I have two unknown Inputs within the emonPi’s emoncms, but I am fairly sure they are rogue and shouldn’t be there (& in the past I have just ignored them).
Maybe I just add a copy/duplicated/ammended section within the emonPi’s emonhub, giving it a new Node No, such as
[[7]]. **CHANGE THIS 7 TO AN UNUSED NUMBER, SUCH AS 50**
nodename = emontx4 **CHANGE THIS TO A NEW NAME, SUCH AS emontx6**
[[[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
But then how to get the emonTx / Pi Zero to talk to the emonPi?
No such thing as a stupid question (unless you have been told the answer before).
Did you use miniterm to set the serial to be on?
Did you set up an interfacer for the serial data? If not it is in the thread.
Are you going to use the emoncms on the PiZ at all? If not, in emonhub config, just point the MQTT interfacer to the main emoncms host IP.
Set the base topic to be emon/TX2/
or what ever so it loads the values into a node called TX2.
Just leave it as emon/
.
I’m running a modified MQTT interfacer (PR submitted ages ago) so I cannot be absolutely certain the config parameters are correct. If not you will see errors in the logs.
Note - I don’t think it affects you, but you can’t transmit a NodeID greater than 30 from the emonTx itself. Once it’s past the radio hop (that’s a JeeLib limitation), the choice is open up to 255 (I think).
[Edit] Node 50 would come out as Node 18 ( = 50 & 31 - the bit-wise AND) ]
Your options are quite similar to when you were first setting up these with the emonESP, you can choose MQTT and/or HTTP, either sends direct to any emoncms instances of your choice. The main difference is that you can have as many target emoncms’s as you wish because you are using emonhub at the source end and that emonhub will buffer the data where as the emonESP couldn’t. This is of great help if you need to take the server (master) device offline for any reason and/or you have LAN outages eg router update or power interruptions etc. However, only the buffered HTTP data is of any use since the MQTT data is not (currently) timestamped in emonhub, it gets timestamped on arrival at emoncms, not much use for data acquired an hour ago and only just being sent due to a network issue. I would therefore always recommend using HTTP for any data being posted remotely ie any dependence on outside HW use HTTP only use MQTT for posting data on the same machine (if you must).
There will be no need to make any changes at the master emonhub.conf as the data is going direct from the slave emonhub to the master emoncms.
Re-awakening this, as I’m embarrassed to admit that the last three posts confused me no end and I gave up
But I’ve started all over again, and have wired a Pi Zero W on to an emonTx, created a new emonCMS user and am (hopefully) back to where I was, in that it all works but I now need to get it to talk to my main emonPi.
Umm, no; where does one do that? Via ssh, or within emonCMS? I did type miniterm --rtscts /dev/ttyAMA0 115200
in Terminal and then started a stream of MSG:331,Vrms:248.22,P1:0,E1:0,pulse:1
etc, which looks encouraging. But those values don’t show up within the emonTx/PiZero’s emonCMS Input page; should they? (I have not attached any CT wires to the emonTx yet as they are in a barn, and I’m setting this up in my office).
Would this be within the emonTx/PiZero’s emonHub?
This is the contents of my main emonPi’s emonHub… one of the emontx nodes will be the one I now want to substitute my emonTx / PiZero with, but not sure how to identify which one - nor how to get the offset right…
TIA
PS: I had thought that I wouldn’t use the emonCMS within the Pi Zero at all other than for updating etc.
[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 = 0 # Interval to transmit time to emonGLCD (seconds)
[[MQTT]]
Type = EmonHubMqttInterfacer
[[[init_settings]]]
mqtt_host = 127.0.0.1
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 = 161655fd5290e7668f30614ade671c3a
senddata = 1 # Enable sending data to Emoncms.org
sendstatus = 1 # Enable sending WAN IP to Emoncms.org MyIP > https://emoncms.org/myip/list
sendinterval= 10 # 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
datacode = h
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
datacode = h
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
[[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.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
[[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.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
[[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.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
[[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.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
[[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
[[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
Good start.
On the basis you did this on the Pi, connected to the emonTX, this data stream is what you will collect and send to the emonPi. The way to do that is by configuring emonhub which is easily done via the emoncms UI on the Pi connected to the emonTX.
So what you need to tell emohub to do, is read the data off the serial interface and send it to the EmonPi.
Under the [interfacers]
section;
[[SerialTx]]
Type = EmonHubTx3eInterfacer
[[[init_settings]]]
com_port= /dev/ttyAMA0
com_baud = 115200
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
nodeoffset = 0
nodename = Serial_PiZ
You now need to configure sending it to the emonPi via MQTT (you could do it via HTTP if you wish)
[[MQTT-emonPi]]
Type = EmonHubMqttInterfacer
[[[init_settings]]]
mqtt_host = 192.168.7.243
mqtt_port = 1883
mqtt_user = emonpi
mqtt_passwd = emonpimqtt2016
[[[runtimesettings]]]
subchannels = ToEmonCMS,
timestamped = True
node_JSON_enable = 1
node_JSON_basetopic = emon/
I’ve set this to use the new JSON format so it goes as a single MQTT publish.
Thanks @borpin ; I think I am nearly there, and the emonTx c/w PiZero is now reporting through to the main emonPi. I haven’t attached any sensors yet (they are in a barn and I’m setting things up in my office).
But I do have a bit of an issue; whilst the “usual” nodes are reporting & updating in green (P1, E1, pulse etc), the list of unknown nodes is growing (& multiplying) rapidly. There were perhaps 20 last night, and this morning there are dozens - to many to number. Some have not updated for 13 hours, and others on a sliding scale back to several minutes. Taking those that start with MSG
as an example, there is MSG, MSGs, MSG1, MSGulse, pMSG, MSGse, pulseMSGulse, & more.
I have attached the tail end of the emonHub log below (from the PiZero; does it help to identify what is going on / wrong?
2020-10-12 08:35:48,826 WARNING MainThread SerialTx thread is dead.
2020-10-12 08:35:48,828 WARNING MainThread Attempting to restart thread SerialTx (thread has been restarted 937 times...
2020-10-12 08:35:48,843 INFO MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-10-12 08:35:48,847 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-10-12 08:35:48,863 WARNING MainThread RFM2Pi thread is dead.
2020-10-12 08:35:48,865 WARNING MainThread Attempting to restart thread RFM2Pi (thread has been restarted 470 times...
2020-10-12 08:35:48,868 INFO MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2020-10-12 08:35:48,883 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2020-10-12 08:35:50,888 WARNING MainThread Device communication error - check settings
2020-10-12 08:35:50,891 INFO MainThread Setting RFM2Pi baseid: 5 (5i)
2020-10-12 08:35:51,894 INFO MainThread Setting RFM2Pi frequency: 433 (4b)
2020-10-12 08:35:52,898 INFO MainThread Setting RFM2Pi group: 210 (210g)
2020-10-12 08:35:53,902 INFO MainThread Setting RFM2Pi quiet: 1 (1q)
2020-10-12 08:35:54,906 INFO MainThread Setting RFM2Pi calibration: 230V (1p)
2020-10-12 08:35:55,909 DEBUG MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2020-10-12 08:35:55,911 DEBUG MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2020-10-12 08:35:58,615 WARNING SerialTx Exception caught in SerialTx thread. Traceback (most recent call last):
File "/opt/openenergymonitor/emonhub/src/emonhub_interfacer.py", line 32, in wrapper
return f(*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()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x81 in position 1: invalid start byte
2020-10-12 08:35:58,686 WARNING MainThread SerialTx thread is dead.
2020-10-12 08:35:58,688 WARNING MainThread Attempting to restart thread SerialTx (thread has been restarted 938 times...
2020-10-12 08:35:58,714 INFO MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-10-12 08:35:58,718 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-10-12 08:35:59,730 DEBUG emoncmsorg Buffer size: 1
2020-10-12 08:36:08,633 DEBUG SerialTx 3954 NEW FRAME : ulse:1
2020-10-12 08:36:08,635 DEBUG SerialTx 3954 Timestamp : 1602488168.6324863
2020-10-12 08:36:08,636 DEBUG SerialTx 3954 From Node : Serial_PiZero_barn
2020-10-12 08:36:08,638 DEBUG SerialTx 3954 Values : [1]
2020-10-12 08:36:08,655 DEBUG SerialTx 3954 Sent to channel(start)' : ToEmonCMS
2020-10-12 08:36:08,657 DEBUG SerialTx 3954 Sent to channel(end)' : ToEmonCMS
2020-10-12 08:36:08,654 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 f(*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 08:36:08,816 WARNING MainThread RFM2Pi thread is dead.
2020-10-12 08:36:08,818 WARNING MainThread Attempting to restart thread RFM2Pi (thread has been restarted 471 times...
2020-10-12 08:36:08,832 INFO MainThread Creating EmonHubJeeInterfacer 'RFM2Pi'
2020-10-12 08:36:08,834 DEBUG MQTT Publishing: emon/Serial_PiZero_barn/ulse 1
2020-10-12 08:36:08,851 INFO MQTT Publishing: emonhub/rx/Serial_PiZero_barn/values 1
2020-10-12 08:36:08,855 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 38400 bits/s
2020-10-12 08:36:10,860 WARNING MainThread Device communication error - check settings
2020-10-12 08:36:10,863 INFO MainThread Setting RFM2Pi baseid: 5 (5i)
2020-10-12 08:36:11,866 INFO MainThread Setting RFM2Pi frequency: 433 (4b)
2020-10-12 08:36:12,870 INFO MainThread Setting RFM2Pi group: 210 (210g)
2020-10-12 08:36:13,874 INFO MainThread Setting RFM2Pi quiet: 1 (1q)
2020-10-12 08:36:14,877 INFO MainThread Setting RFM2Pi calibration: 230V (1p)
2020-10-12 08:36:15,882 DEBUG MainThread Setting RFM2Pi pubchannels: ['ToEmonCMS']
2020-10-12 08:36:15,884 DEBUG MainThread Setting RFM2Pi subchannels: ['ToRFM12']
2020-10-12 08:36:18,651 WARNING SerialTx Exception caught in SerialTx thread. Traceback (most recent call last):
File "/opt/openenergymonitor/emonhub/src/emonhub_interfacer.py", line 32, in wrapper
return f(*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()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x83 in position 1: invalid start byte
2020-10-12 08:36:18,669 WARNING MainThread SerialTx thread is dead.
2020-10-12 08:36:18,681 WARNING MainThread Attempting to restart thread SerialTx (thread has been restarted 939 times...
2020-10-12 08:36:18,686 INFO MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-10-12 08:36:18,701 DEBUG MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-10-12 08:36:28,598 DEBUG SerialTx 3955 NEW FRAME : 239.40,P1:0,E1:0,pulse:1
2020-10-12 08:36:28,628 DEBUG SerialTx 3955 Timestamp : 1602488188.5973969
2020-10-12 08:36:28,640 DEBUG SerialTx 3955 From Node : Serial_PiZero_barn
2020-10-12 08:36:28,642 DEBUG SerialTx 3955 Values : [0, 0, 1]
2020-10-12 08:36:28,643 DEBUG SerialTx 3955 Sent to channel(start)' : ToEmonCMS
2020-10-12 08:36:28,645 DEBUG SerialTx 3955 Sent to channel(end)' : ToEmonCMS
2020-10-12 08:36:28,797 DEBUG MQTT Publishing: emon/Serial_PiZero_barn/P1 0
2020-10-12 08:36:28,803 DEBUG MQTT Publishing: emon/Serial_PiZero_barn/E1 0
2020-10-12 08:36:28,812 DEBUG MQTT Publishing: emon/Serial_PiZero_barn/pulse 1
2020-10-12 08:36:28,815 INFO MQTT Publishing: emonhub/rx/Serial_PiZero_barn/values 0,0,1
2020-10-12 08:36:29,825 DEBUG emoncmsorg Buffer size: 2
2020-10-12 08:36:48,577 DEBUG SerialTx 3957 NEW FRAME : MSG1,P1:0,E1:0,pulse:1
2020-10-12 08:36:48,579 DEBUG SerialTx 3957 Timestamp : 1602488208.5762572
2020-10-12 08:36:48,598 DEBUG SerialTx 3957 From Node : Serial_PiZero_barn
2020-10-12 08:36:48,607 DEBUG SerialTx 3957 Values : [0, 0, 1]
2020-10-12 08:36:48,617 DEBUG SerialTx 3957 Sent to channel(start)' : ToEmonCMS
2020-10-12 08:36:48,629 DEBUG SerialTx 3957 Sent to channel(end)' : ToEmonCMS
2020-10-12 08:36:48,775 DEBUG MQTT Publishing: emon/Serial_PiZero_barn/P1 0
2020-10-12 08:36:48,783 DEBUG MQTT Publishing: emon/Serial_PiZero_barn/E1 0
2020-10-12 08:36:48,791 DEBUG MQTT Publishing: emon/Serial_PiZero_barn/pulse 1
2020-10-12 08:36:48,794 INFO MQTT Publishing: emonhub/rx/Serial_PiZero_barn/values 0,0,1
2020-10-12 08:36:58,583 DEBUG SerialTx 3958 NEW FRAME : lse:1
2020-10-12 08:36:58,585 DEBUG SerialTx 3958 Timestamp : 1602488218.5826514
2020-10-12 08:36:58,587 DEBUG SerialTx 3958 From Node : Serial_PiZero_barn
2020-10-12 08:36:58,588 DEBUG SerialTx 3958 Values : [1]
2020-10-12 08:36:58,601 DEBUG SerialTx 3958 Sent to channel(start)' : ToEmonCMS
2020-10-12 08:36:58,603 DEBUG SerialTx 3958 Sent to channel(end)' : ToEmonCMS
2020-10-12 08:36:58,782 DEBUG MQTT Publishing: emon/Serial_PiZero_barn/lse 1
2020-10-12 08:36:58,789 INFO MQTT Publishing: emonhub/rx/Serial_PiZero_barn/values 1
2020-10-12 08:36:59,886 DEBUG emoncmsorg Buffer size: 2
2020-10-12 08:37:18,613 DEBUG SerialTx 3960 NEW FRAME : 0,pulse:1
2020-10-12 08:37:18,615 DEBUG SerialTx 3960 Timestamp : 1602488238.613277
2020-10-12 08:37:18,617 DEBUG SerialTx 3960 From Node : Serial_PiZero_barn
2020-10-12 08:37:18,619 DEBUG SerialTx 3960 Values : [1]
2020-10-12 08:37:18,631 DEBUG SerialTx 3960 Sent to channel(start)' : ToEmonCMS
2020-10-12 08:37:18,633 DEBUG SerialTx 3960 Sent to channel(end)' : ToEmonCMS
2020-10-12 08:37:19,027 DEBUG MQTT Publishing: emon/Serial_PiZero_barn/pulse 1
2020-10-12 08:37:19,035 INFO MQTT Publishing: emonhub/rx/Serial_PiZero_barn/values 1
On a brighter note, I downloaded the stl files for an emonTx box from Thingiverse ( emonTx V3 Electricity Monitoring Transmitter Case by ElectricApple - Thingiverse ) yesterday; I raised the sides by 10mm and increased the programming pins slot height by 5mm so that I could fit the return wires back through the case. Seems to work well. I used some brass standoff pins to fix the Pi Zero by one corner. Apologies for the colour, but I’m using up a spool of unwanted green
I’m now printing the lid; I haven’t worked out how to make the “tongue” 10mm taller so will just have to put up with a gap above the RF screw for now.
For future iterations (I have two more to do) I could probably get away with raising the sides less - maybe even only 3-4mm depending on length of standoffs used. I did stick a heat sink on to the PiZero’s CPU to help with cooling as well.
! !For future reference, when posting code or bash output, please put in 3 ‘backticks’ (found at the top left of the keyboard normally) on a line on their own, then the code, then 3 more backticks on a line following the code.
```
code
```
If it is something like php you can add a language identifier that after the first 3 backticks so ```php

Taking those that start with
MSG
as an example, there is MSG, MSGs, MSG1, MSGulse, pMSG, MSGse, pulseMSGulse,
I think this is being caused by the serial output from the emonTX being garbled but still decoded.
To test, stop emonhub - sudo systemctl stop emonhub.service
and open a terminal
miniterm --rtscts /dev/ttyAMA0 115200
You will see the serial data output. Leave this for a while and see if there are any bad messages.
--- Miniterm on /dev/ttyAMA0 115200,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
MSG:364158,Vrms:244.49,P1:569,E1:689721,pulse:1
MSG:364159,Vrms:244.65,P1:569,E1:689723,pulse:1
MSG:364160,Vrms:244.91,P1:570,E1:689724,pulse:1
If you press the reset button on the TX, you will get the initial config info as well. Please post that.
Please also post your full emonhub.conf
please.
[edit]
Did you restart emonhub service?
[edit2]
You also need to turn RF Off especially if you have not attached an antenna.
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
Did you restart emonhub service?
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.
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 (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
I suggest you checkout the master branch.
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 !!!