Avoiding wireless connections - EmonTX serial RPiZero solution

Thanks All. I’m afraid the stacksverflow.com thread is above my knowledge so haven’t changed any code. If this PiZero / emonTx is producing a duff character I wonder why the other three aren’t? They were all set up following the same steps.

Meanwhile, this is the current emonHub output:

2020-11-07 09:37:33,385 INFO     MainThread Setting MQTT node_JSON_enable: 1
2020-11-07 09:37:33,397 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2020-11-07 09:37:33,401 DEBUG    MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2020-11-07 09:37:33,403 DEBUG    MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2020-11-07 09:37:33,404 WARNING  MainThread Setting emoncmsorg apikey: obscured
2020-11-07 09:37:33,406 INFO     MainThread Setting emoncmsorg url: https://emoncms.org
2020-11-07 09:37:33,408 INFO     MainThread Setting emoncmsorg senddata: 1
2020-11-07 09:37:33,420 INFO     MainThread Setting emoncmsorg sendstatus: 1
2020-11-07 09:41:35,600 INFO     MainThread Logging level set to INFO
2020-11-07 09:41:40,898 INFO     MainThread Logging level set to DEBUG
2020-11-07 09:41:40,913 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-07 09:41:58,925 DEBUG    MainThread Signal 15 received.
2020-11-07 09:41:59,051 INFO     MainThread Exiting hub...
2020-11-07 09:41:59,330 INFO     MainThread Exit completed
2020-11-07 09:42:11,951 INFO     MainThread EmonHub emonHub (emon-pi variant) v2.1.5
2020-11-07 09:42:11,954 INFO     MainThread Opening hub...
2020-11-07 09:42:11,956 INFO     MainThread Logging level set to DEBUG
2020-11-07 09:42:11,958 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-07 09:42:11,968 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-07 09:42:11,983 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT'
2020-11-07 09:42:11,989 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-07 09:42:12,000 DEBUG    MainThread Setting MQTT subchannels: ['ToEmonCMS']
2020-11-07 09:42:12,002 INFO     MainThread Setting MQTT node_JSON_enable: 1
2020-11-07 09:42:12,011 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2020-11-07 09:42:12,014 DEBUG    MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2020-11-07 09:42:12,016 DEBUG    MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2020-11-07 09:42:12,018 WARNING  MainThread Setting emoncmsorg apikey: obscured
2020-11-07 09:42:12,040 INFO     MainThread Setting emoncmsorg url: https://emoncms.org
2020-11-07 09:42:12,042 INFO     MainThread Setting emoncmsorg senddata: 1
2020-11-07 09:42:12,044 INFO     MainThread Setting emoncmsorg sendstatus: 1

I am able to interact with the emonHub (& emonCMS etc) fine, so comms at a certain level are working, but the emonHub log suggests that the process(es) just get stuck after a short period following a soft Re-Start. No data has arrived on my emonPi’s emonCMS.

Exactly my point - if the EmonTX only sends data within utf-8, then there should be no reason to change the char set.

There is definitely something afoot, I just don’t think the char set is set wrong (see above).

Hopefully that isn’t all you are getting :slight_smile:

I think you are running the newer Image based on RaspberryOS, I wonder if something has changed in the serial configuration. We currently do;

as part of the install.

However, if 3 are OK and one not, it implies a local problem.

First point is to check header soldering on the Pi and the cable crimps.

I’ll say this again the connection to the Pi is via Wi-Fi and nothing to do with the connection between the Pi and the EmonTX.

What you could look at is the system log to see if there are any other issues.

sudo journalctl -f

And check at the emonTx end as well - get it out of its case and carefully look at everything.

Is there a local source of interference that could be getting onto that serial connection?

I may have missed something, but it is; I have just logged back in and the EmonHub log of the PiZero in question is still the same as earlier today (see above). Clicking Restart brings up the same return.

2020-11-07 09:42:12,042 INFO     MainThread Setting emoncmsorg senddata: 1
2020-11-07 09:42:12,044 INFO     MainThread Setting emoncmsorg sendstatus: 1
2020-11-07 14:19:05,296 DEBUG    MainThread Signal 15 received.
2020-11-07 14:19:05,607 INFO     MainThread Exiting hub...
2020-11-07 14:19:05,745 INFO     MainThread Exit completed
2020-11-07 14:19:17,963 INFO     MainThread EmonHub emonHub (emon-pi variant) v2.1.5
2020-11-07 14:19:17,966 INFO     MainThread Opening hub...
2020-11-07 14:19:17,968 INFO     MainThread Logging level set to DEBUG
2020-11-07 14:19:17,971 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-07 14:19:17,976 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-07 14:19:17,995 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT'
2020-11-07 14:19:18,009 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-07 14:19:18,011 DEBUG    MainThread Setting MQTT subchannels: ['ToEmonCMS']
2020-11-07 14:19:18,013 INFO     MainThread Setting MQTT node_JSON_enable: 1
2020-11-07 14:19:18,021 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2020-11-07 14:19:18,025 DEBUG    MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2020-11-07 14:19:18,027 DEBUG    MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2020-11-07 14:19:18,028 WARNING  MainThread Setting emoncmsorg apikey: obscured
2020-11-07 14:19:18,051 INFO     MainThread Setting emoncmsorg url: https://emoncms.org
2020-11-07 14:19:18,052 INFO     MainThread Setting emoncmsorg senddata: 1
2020-11-07 14:19:18,054 INFO     MainThread Setting emoncmsorg sendstatus: 1

LOG LEVEL: DEBUG 

Typing cat /etc/os-release returns this:

[email protected]:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
[email protected]:~ $ 

OK, hands up, I hadn’t realised this (or at least hadn’t internalised it!), as I had assumed (yes, I know, I know) that the two devices communicated via the Rx & Tx pins (and to a lesser extent the RST pin). But I know now :crazy_face:

I will unplug the emonTx & PiZero & open the case and re-check the wires etc. The only thing that is different to the other PiZero’s that might be causing interference is the (un-insulated) corrugated tin roof that it is near; I will bring it down from the purlin and see if that helps.

sudo journalctl -f

This brings up the following (and then “loops” the last few lines). Not sure why it is unable to resolve host emonTxPiZero1 as is shows that name at the cursor prompt. But then this is again at the edge of my knowledge.

[email protected]:~ $ sudo journalctl -f
sudo: unable to resolve host emonTxPiZero1: No address associated with hostname
-- Logs begin at Sat 2020-11-07 11:20:12 GMT. --
Nov 07 14:33:01 emonTxPiZero1 systemd[1]: emonPiLCD.service: Succeeded.
Nov 07 14:33:01 emonTxPiZero1 systemd[1]: emonPiLCD.service: Service RestartSec=100ms expired, scheduling restart.
Nov 07 14:33:01 emonTxPiZero1 systemd[1]: emonPiLCD.service: Scheduled restart job, restart counter is at 32335.
Nov 07 14:33:01 emonTxPiZero1 systemd[1]: Stopped emonPi LCD driver.
Nov 07 14:33:01 emonTxPiZero1 systemd[1]: Starting emonPi LCD driver...
Nov 07 14:33:01 emonTxPiZero1 systemd[1]: Started emonPi LCD driver.
Nov 07 14:33:02 emonTxPiZero1 sudo[31786]:       pi : unable to resolve host emonTxPiZero1
Nov 07 14:33:02 emonTxPiZero1 sudo[31786]:       pi : problem with defaults entries ; TTY=pts/0 ; PWD=/home/pi ; USER=root ;
Nov 07 14:33:02 emonTxPiZero1 sudo[31786]:       pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/journalctl -f
Nov 07 14:33:02 emonTxPiZero1 sudo[31786]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
Nov 07 14:33:08 emonTxPiZero1 python3[31783]: emonPiLCD logging to: /var/log/emonpilcd/emonpilcd.log
Nov 07 14:33:08 emonTxPiZero1 python3[31783]: I2C LCD NOT DETECTED on either 0x['27', '3f'] ...exiting LCD script
Nov 07 14:33:08 emonTxPiZero1 systemd[1]: emonPiLCD.service: Succeeded.
Nov 07 14:33:08 emonTxPiZero1 systemd[1]: emonPiLCD.service: Service RestartSec=100ms expired, scheduling restart.
Nov 07 14:33:08 emonTxPiZero1 systemd[1]: emonPiLCD.service: Scheduled restart job, restart counter is at 32336.
Nov 07 14:33:08 emonTxPiZero1 systemd[1]: Stopped emonPi LCD driver.
Nov 07 14:33:08 emonTxPiZero1 systemd[1]: Starting emonPi LCD driver...
Nov 07 14:33:09 emonTxPiZero1 systemd[1]: Started emonPi LCD driver.
Nov 07 14:33:14 emonTxPiZero1 python3[31810]: emonPiLCD logging to: /var/log/emonpilcd/emonpilcd.log
Nov 07 14:33:14 emonTxPiZero1 python3[31810]: I2C LCD NOT DETECTED on either 0x['27', '3f'] ...exiting LCD script
Nov 07 14:33:14 emonTxPiZero1 systemd[1]: emonPiLCD.service: Succeeded.
Nov 07 14:33:15 emonTxPiZero1 systemd[1]: emonPiLCD.service: Service RestartSec=100ms expired, scheduling restart.
Nov 07 14:33:15 emonTxPiZero1 systemd[1]: emonPiLCD.service: Scheduled restart job, restart counter is at 32337.
Nov 07 14:33:15 emonTxPiZero1 systemd[1]: Stopped emonPi LCD driver.
Nov 07 14:33:15 emonTxPiZero1 systemd[1]: Starting emonPi LCD driver...
Nov 07 14:33:15 emonTxPiZero1 systemd[1]: Started emonPi LCD driver.
Nov 07 14:33:20 emonTxPiZero1 python3[31831]: emonPiLCD logging to: /var/log/emonpilcd/emonpilcd.log
Nov 07 14:33:20 emonTxPiZero1 python3[31831]: I2C LCD NOT DETECTED on either 0x['27', '3f'] ...exiting LCD script
Nov 07 14:33:21 emonTxPiZero1 systemd[1]: emonPiLCD.service: Succeeded.
Nov 07 14:33:21 emonTxPiZero1 systemd[1]: emonPiLCD.service: Service RestartSec=100ms expired, scheduling restart.
Nov 07 14:33:21 emonTxPiZero1 systemd[1]: emonPiLCD.service: Scheduled restart job, restart counter is at 32338.
Nov 07 14:33:21 emonTxPiZero1 systemd[1]: Stopped emonPi LCD driver.
Nov 07 14:33:21 emonTxPiZero1 systemd[1]: Starting emonPi LCD driver...
Nov 07 14:33:21 emonTxPiZero1 systemd[1]: Started emonPi LCD driver.
Nov 07 14:33:27 emonTxPiZero1 python3[31850]: emonPiLCD logging to: /var/log/emonpilcd/emonpilcd.log
Nov 07 14:33:27 emonTxPiZero1 python3[31850]: I2C LCD NOT DETECTED on either 0x['27', '3f'] ...exiting LCD script
Nov 07 14:33:28 emonTxPiZero1 systemd[1]: emonPiLCD.service: Succeeded.
Nov 07 14:33:28 emonTxPiZero1 systemd[1]: emonPiLCD.service: Service RestartSec=100ms expired, scheduling restart.
Nov 07 14:33:28 emonTxPiZero1 systemd[1]: emonPiLCD.service: Scheduled restart job, restart counter is at 32339.
Nov 07 14:33:28 emonTxPiZero1 systemd[1]: Stopped emonPi LCD driver.
Nov 07 14:33:28 emonTxPiZero1 systemd[1]: Starting emonPi LCD driver...
Nov 07 14:33:28 emonTxPiZero1 systemd[1]: Started emonPi LCD driver.
Nov 07 14:33:34 emonTxPiZero1 python3[31871]: emonPiLCD logging to: /var/log/emonpilcd/emonpilcd.log
Nov 07 14:33:34 emonTxPiZero1 python3[31871]: I2C LCD NOT DETECTED on either 0x['27', '3f'] ...exiting LCD script
Nov 07 14:33:34 emonTxPiZero1 systemd[1]: emonPiLCD.service: Succeeded.
Nov 07 14:33:35 emonTxPiZero1 systemd[1]: emonPiLCD.service: Service RestartSec=100ms expired, scheduling restart.
Nov 07 14:33:35 emonTxPiZero1 systemd[1]: emonPiLCD.service: Scheduled restart job, restart counter is at 32340.
Nov 07 14:33:35 emonTxPiZero1 systemd[1]: Stopped emonPi LCD driver.
Nov 07 14:33:35 emonTxPiZero1 systemd[1]: Starting emonPi LCD driver...
Nov 07 14:33:35 emonTxPiZero1 systemd[1]: Started emonPi LCD driver.

That really doesn’t need to be running

sudo systemctl stop emonPiLCD.service
sudo systemctl disable emonPiLCD.service
sudo systemctl mask emonPiLCD.service

Try pressing the EmonTX reset, while watching this syslog.

No that isn’t going to be the problem.

That implies there is nothing coming from the EmonTX.

How is this pairing powered? PiZero powering the EmonTX or the other way round?

Try a different power supply.

You could try stopping emonhub and connecting to the TX with miniterm.

3 posts were split to a new topic: emonPiLCD Service keeps restarting on non-emonpi

The LCD issue is unrelated (I expect).

Are the things to try / look at.

Sorry for the delayed response, but I’ve almost got to the point that I don’t know where to start. I have just shut down the PiZ through the emonCMS / Admin page, but before I did so I downloaded the emonHub log - see below. What is strange is that since ~ 00:00 on the 9th Nov it has “almost” been running correctly, albeit nothing arrived in that period on my emonPi. Note: although one CT input has been attached, no current is flowing through it as I am still waiting for my barn inverter to be fixed and that is the only thing this emonTx is monitoring.

Anyhow, to confirm that the PiZ is powered by the emonTx; the emonTx is powered by an IDEAL -POWER AC/DC, output 5V 2A, and also an IDEAL POWER 9VAS 6VA brick. I am 99% sure that both came from the OEM shop.

Delving in to places I have not been to before, the contents of /etc/hostname is just emonTx_PiZero_1 and /etc/hosts is …

127.0.0.1	localhost
::1		localhost ip6-localhost ip6-loopback
ff02::1		ip6-allnodes
ff02::2		ip6-allrouters

127.0.1.1	emonTx_PiZero_1

I can’t remember exactly when or where I gave the name emonTx_PiZero_1 but I do recall the other three are similarly named but with _2, _3 & _4.

I changed the “name” of the PiZ within my Unifi USG’s control panel to “emonTx PiZero (top barn)” and given it a static IP; I have done this with all of my devices, including the other 3 emonTx/PiZ combo’s. Looking again within the USG control panel I see that the Hostname of the other three is just emonpi; might this discrepancy be an issue / the cause? But if so, why are the other three running fine, and even this one was running OK for several / many days.

2020-11-08 10:00:09,033 DEBUG    MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2020-11-08 10:00:09,035 DEBUG    MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2020-11-08 10:00:09,037 WARNING  MainThread Setting emoncmsorg apikey: obscured
2020-11-08 10:00:09,041 INFO     MainThread Setting emoncmsorg url: https://emoncms.org
2020-11-08 10:00:09,042 INFO     MainThread Setting emoncmsorg senddata: 1
2020-11-08 10:00:09,044 INFO     MainThread Setting emoncmsorg sendstatus: 1
2020-11-08 10:01:29,981 DEBUG    MainThread Signal 15 received.
2020-11-08 10:01:30,002 INFO     MainThread Exiting hub...
2020-11-08 10:01:30,207 INFO     MainThread Exit completed
2020-11-08 10:04:15,906 INFO     MainThread EmonHub emonHub (emon-pi variant) v2.1.5
2020-11-08 10:04:15,909 INFO     MainThread Opening hub...
2020-11-08 10:04:15,911 INFO     MainThread Logging level set to DEBUG
2020-11-08 10:04:15,914 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-08 10:04:15,919 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-08 10:04:15,924 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT'
2020-11-08 10:04:15,931 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-08 10:04:15,933 DEBUG    MainThread Setting MQTT subchannels: ['ToEmonCMS']
2020-11-08 10:04:15,935 INFO     MainThread Setting MQTT node_JSON_enable: 1
2020-11-08 10:04:15,938 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2020-11-08 10:04:15,942 DEBUG    MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2020-11-08 10:04:15,944 DEBUG    MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2020-11-08 10:04:15,946 WARNING  MainThread Setting emoncmsorg apikey: obscured
2020-11-08 10:04:15,948 INFO     MainThread Setting emoncmsorg url: https://emoncms.org
2020-11-08 10:04:15,950 INFO     MainThread Setting emoncmsorg senddata: 1
2020-11-08 10:04:15,951 INFO     MainThread Setting emoncmsorg sendstatus: 1
2020-11-08 10:22:59,211 DEBUG    MainThread Signal 15 received.
2020-11-08 10:22:59,372 INFO     MainThread Exiting hub...
2020-11-08 10:22:59,590 INFO     MainThread Exit completed
2020-11-08 10:28:36,479 INFO     MainThread EmonHub emonHub (emon-pi variant) v2.1.5
2020-11-08 10:28:36,487 INFO     MainThread Opening hub...
2020-11-08 10:28:36,497 INFO     MainThread Logging level set to DEBUG
2020-11-08 10:28:36,501 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-08 10:28:36,509 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-08 10:28:36,532 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT'
2020-11-08 10:28:36,539 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-08 10:28:36,551 DEBUG    MainThread Setting MQTT subchannels: ['ToEmonCMS']
2020-11-08 10:28:36,553 INFO     MainThread Setting MQTT node_JSON_enable: 1
2020-11-08 10:28:36,556 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2020-11-08 10:28:36,559 DEBUG    MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2020-11-08 10:28:36,571 DEBUG    MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2020-11-08 10:28:36,573 WARNING  MainThread Setting emoncmsorg apikey: obscured
2020-11-08 10:28:36,575 INFO     MainThread Setting emoncmsorg url: https://emoncms.org
2020-11-08 10:28:36,577 INFO     MainThread Setting emoncmsorg senddata: 1
2020-11-08 10:28:36,579 INFO     MainThread Setting emoncmsorg sendstatus: 1
2020-11-08 10:28:59,264 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 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()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 10: invalid start byte

2020-11-08 10:28:59,428 WARNING  MainThread SerialTx thread is dead.
2020-11-08 10:28:59,430 WARNING  MainThread Attempting to restart thread SerialTx (thread has been restarted 0 times...)
2020-11-08 10:28:59,434 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-08 10:28:59,438 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-08 10:28:59,443 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-08 10:29:07,257 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 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()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 1: invalid start byte

2020-11-08 10:29:07,354 WARNING  MainThread SerialTx thread is dead.
2020-11-08 10:29:07,357 WARNING  MainThread Attempting to restart thread SerialTx (thread has been restarted 1 times...)
2020-11-08 10:29:07,363 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-08 10:29:07,371 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-08 10:29:07,378 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-08 10:30:01,164 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 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()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xea in position 1: invalid continuation byte

2020-11-08 10:30:01,247 WARNING  MainThread SerialTx thread is dead.
2020-11-08 10:30:01,249 WARNING  MainThread Attempting to restart thread SerialTx (thread has been restarted 2 times...)
2020-11-08 10:30:01,252 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-08 10:30:01,256 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-08 10:30:01,261 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-08 10:30:03,566 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 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()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 12: invalid continuation byte

2020-11-08 10:30:03,734 WARNING  MainThread SerialTx thread is dead.
2020-11-08 10:30:03,737 WARNING  MainThread Attempting to restart thread SerialTx (thread has been restarted 3 times...)
2020-11-08 10:30:03,742 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-08 10:30:03,748 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-08 10:30:03,754 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-08 10:30:08,355 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 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()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xab in position 2: invalid start byte

2020-11-08 10:30:08,519 WARNING  MainThread SerialTx thread is dead.
2020-11-08 10:30:08,521 WARNING  MainThread Attempting to restart thread SerialTx (thread has been restarted 4 times...)
2020-11-08 10:30:08,527 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-08 10:30:08,531 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-08 10:30:08,536 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-08 10:30:08,650 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 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()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdd in position 2: invalid continuation byte

2020-11-08 10:30:08,741 WARNING  MainThread SerialTx thread is dead.
2020-11-08 10:30:08,743 WARNING  MainThread Attempting to restart thread SerialTx (thread has been restarted 5 times...)
2020-11-08 10:30:08,746 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-08 10:30:08,750 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-08 10:30:08,754 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-08 10:30:09,992 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 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()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 1: invalid continuation byte

2020-11-08 10:30:10,090 WARNING  MainThread SerialTx thread is dead.
2020-11-08 10:30:10,092 WARNING  MainThread Attempting to restart thread SerialTx (thread has been restarted 6 times...)
2020-11-08 10:30:10,095 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-08 10:30:10,099 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-08 10:30:10,104 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-08 10:30:43,136 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 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()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x81 in position 1: invalid start byte

2020-11-08 10:30:43,155 WARNING  MainThread SerialTx thread is dead.
2020-11-08 10:30:43,158 WARNING  MainThread Attempting to restart thread SerialTx (thread has been restarted 7 times...)
2020-11-08 10:30:43,162 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-08 10:30:43,170 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-08 10:30:43,176 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-08 10:30:44,051 DEBUG    SerialTx   input value is not numeric: 
2020-11-08 10:30:44,054 DEBUG    SerialTx   7 NEW FRAME : Settings:
2020-11-08 10:30:44,057 DEBUG    SerialTx   7 Timestamp : 1604831444.048042
2020-11-08 10:30:44,059 DEBUG    SerialTx   7 From Node : Serial_PiZero_barn
2020-11-08 10:30:44,062 DEBUG    SerialTx   7    Values : [0]
2020-11-08 10:30:44,064 DEBUG    SerialTx   7 Sent to channel(start)' : ToEmonCMS
2020-11-08 10:30:44,067 DEBUG    SerialTx   7 Sent to channel(end)' : ToEmonCMS
2020-11-08 10:30:44,177 INFO     MQTT       Connecting to MQTT Server
2020-11-08 10:30:44,276 DEBUG    emoncmsorg Buffer size: 1
2020-11-08 10:30:44,367 INFO     MQTT       connection status: Connection successful
2020-11-08 10:30:44,371 DEBUG    MQTT       CONACK => Return code: 0
2020-11-08 10:30:44,396 DEBUG    SerialTx   invalid input name:  Band 433 MHz

Calibration
2020-11-08 10:30:44,477 INFO     MQTT       on_subscribe
2020-11-08 10:30:45,886 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 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()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

2020-11-08 10:30:45,949 WARNING  MainThread SerialTx thread is dead.
2020-11-08 10:30:45,951 WARNING  MainThread Attempting to restart thread SerialTx (thread has been restarted 8 times...)
2020-11-08 10:30:45,954 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-08 10:30:45,959 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-08 10:30:45,963 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-08 10:31:03,760 DEBUG    SerialTx   input value is not numeric: 
2020-11-08 10:31:03,762 DEBUG    SerialTx   27 NEW FRAME : Settings:
2020-11-08 10:31:03,764 DEBUG    SerialTx   27 Timestamp : 1604831463.759952
2020-11-08 10:31:03,766 DEBUG    SerialTx   27 From Node : Serial_PiZero_barn
2020-11-08 10:31:03,767 DEBUG    SerialTx   27    Values : [0]
2020-11-08 10:31:03,769 DEBUG    SerialTx   27 Sent to channel(start)' : ToEmonCMS
2020-11-08 10:31:03,771 DEBUG    SerialTx   27 Sent to channel(end)' : ToEmonCMS
2020-11-08 10:31:03,931 INFO     MQTT       Publishing: emonhub/rx/Serial_PiZero_barn/values 0
2020-11-08 10:31:03,936 DEBUG    MQTT       Publishing: emon/Serial_PiZero_barn {"Settings": 0, "time": 1604831463.759952}
2020-11-08 10:31:04,089 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 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()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 4: invalid continuation byte

2020-11-08 10:31:04,266 WARNING  MainThread SerialTx thread is dead.
2020-11-08 10:31:04,268 WARNING  MainThread Attempting to restart thread SerialTx (thread has been restarted 9 times...)
2020-11-08 10:31:04,271 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-08 10:31:04,275 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-08 10:31:04,279 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-08 10:31:14,333 DEBUG    emoncmsorg Buffer size: 1
2020-11-09 00:02:19,382 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 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()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xeb in position 2: invalid continuation byte

2020-11-09 00:02:19,432 WARNING  MainThread SerialTx thread is dead.
2020-11-09 00:02:19,434 WARNING  MainThread Attempting to restart thread SerialTx (thread has been restarted 10 times...)
2020-11-09 00:02:19,437 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-09 00:02:19,441 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-09 00:02:19,445 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-09 00:03:18,679 DEBUG    SerialTx   input value is not numeric: 
2020-11-09 00:03:18,681 DEBUG    SerialTx   33 NEW FRAME : Settings:
2020-11-09 00:03:18,683 DEBUG    SerialTx   33 Timestamp : 1604880198.678688
2020-11-09 00:03:18,685 DEBUG    SerialTx   33 From Node : Serial_PiZero_barn
2020-11-09 00:03:18,686 DEBUG    SerialTx   33    Values : [0]
2020-11-09 00:03:18,688 DEBUG    SerialTx   33 Sent to channel(start)' : ToEmonCMS
2020-11-09 00:03:18,690 DEBUG    SerialTx   33 Sent to channel(end)' : ToEmonCMS
2020-11-09 00:03:18,800 INFO     MQTT       Publishing: emonhub/rx/Serial_PiZero_barn/values 0
2020-11-09 00:03:18,808 DEBUG    MQTT       Publishing: emon/Serial_PiZero_barn {"Settings": 0, "time": 1604880198.6786876}
2020-11-09 00:03:18,973 DEBUG    emoncmsorg Buffer size: 1
2020-11-09 00:03:19,017 DEBUG    SerialTx   invalid input name:  Band 433 MHz

Calibration
2020-11-09 00:03:20,528 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 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()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

2020-11-09 00:03:20,689 WARNING  MainThread SerialTx thread is dead.
2020-11-09 00:03:20,690 WARNING  MainThread Attempting to restart thread SerialTx (thread has been restarted 11 times...)
2020-11-09 00:03:20,694 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-09 00:03:20,699 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-09 00:03:20,703 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-09 00:04:39,183 DEBUG    SerialTx   input value is not numeric: 
2020-11-09 00:04:39,186 DEBUG    SerialTx   53 NEW FRAME : Settings:
2020-11-09 00:04:39,189 DEBUG    SerialTx   53 Timestamp : 1604880279.183048
2020-11-09 00:04:39,208 DEBUG    SerialTx   53 From Node : Serial_PiZero_barn
2020-11-09 00:04:39,211 DEBUG    SerialTx   53    Values : [0]
2020-11-09 00:04:39,224 DEBUG    SerialTx   53 Sent to channel(start)' : ToEmonCMS
2020-11-09 00:04:39,226 DEBUG    SerialTx   53 Sent to channel(end)' : ToEmonCMS
2020-11-09 00:04:39,356 INFO     MQTT       Publishing: emonhub/rx/Serial_PiZero_barn/values 0
2020-11-09 00:04:39,360 DEBUG    MQTT       Publishing: emon/Serial_PiZero_barn {"Settings": 0, "time": 1604880279.1830475}
2020-11-09 00:04:39,423 DEBUG    emoncmsorg Buffer size: 1
2020-11-09 00:04:39,545 DEBUG    SerialTx   invalid input name:  Band 433 MHz

Calibration
2020-11-09 00:04:41,022 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 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()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

2020-11-09 00:04:41,028 WARNING  MainThread SerialTx thread is dead.
2020-11-09 00:04:41,030 WARNING  MainThread Attempting to restart thread SerialTx (thread has been restarted 12 times...)
2020-11-09 00:04:41,033 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-09 00:04:41,038 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-09 00:04:41,042 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-09 00:05:39,021 DEBUG    SerialTx   input value is not numeric: 
2020-11-09 00:05:39,023 DEBUG    SerialTx   73 NEW FRAME : Settings:
2020-11-09 00:05:39,025 DEBUG    SerialTx   73 Timestamp : 1604880339.021083
2020-11-09 00:05:39,027 DEBUG    SerialTx   73 From Node : Serial_PiZero_barn
2020-11-09 00:05:39,028 DEBUG    SerialTx   73    Values : [0]
2020-11-09 00:05:39,030 DEBUG    SerialTx   73 Sent to channel(start)' : ToEmonCMS
2020-11-09 00:05:39,032 DEBUG    SerialTx   73 Sent to channel(end)' : ToEmonCMS
2020-11-09 00:05:39,161 INFO     MQTT       Publishing: emonhub/rx/Serial_PiZero_barn/values 0
2020-11-09 00:05:39,165 DEBUG    MQTT       Publishing: emon/Serial_PiZero_barn {"Settings": 0, "time": 1604880339.0210834}
2020-11-09 00:05:39,342 DEBUG    emoncmsorg Buffer size: 1
2020-11-09 00:05:39,350 DEBUG    SerialTx   invalid input name:  Band 433 MHz

Calibration
2020-11-09 00:05:40,854 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 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()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

2020-11-09 00:05:41,008 WARNING  MainThread SerialTx thread is dead.
2020-11-09 00:05:41,009 WARNING  MainThread Attempting to restart thread SerialTx (thread has been restarted 13 times...)
2020-11-09 00:05:41,013 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-09 00:05:41,017 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-09 00:05:41,021 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-09 00:05:49,776 DEBUG    SerialTx   invalid input name:  i1Cal
2020-11-09 00:05:59,202 DEBUG    SerialTx   90 NEW FRAME : MSG:1,Vrms:0.00,P1:0,E1:0,T1:0.00,T2:0.00,T3:0.00,pulse:1
2020-11-09 00:05:59,204 DEBUG    SerialTx   90 Timestamp : 1604880359.201675
2020-11-09 00:05:59,206 DEBUG    SerialTx   90 From Node : Serial_PiZero_barn
2020-11-09 00:05:59,208 DEBUG    SerialTx   90    Values : [1, 0, 0, 0, 0, 0, 0, 1]
2020-11-09 00:05:59,210 DEBUG    SerialTx   90 Sent to channel(start)' : ToEmonCMS
2020-11-09 00:05:59,211 DEBUG    SerialTx   90 Sent to channel(end)' : ToEmonCMS
2020-11-09 00:05:59,451 INFO     MQTT       Publishing: emonhub/rx/Serial_PiZero_barn/values 1,0,0,0,0,0,0,1
2020-11-09 00:05:59,455 DEBUG    MQTT       Publishing: emon/Serial_PiZero_barn {"MSG": 1, "Vrms": 0, "P1": 0, "E1": 0, "T1": 0, "T2": 0, "T3": 0, "pulse": 1, "time": 1604880359.201675}
2020-11-09 00:06:08,040 DEBUG    SerialTx   91 NEW FRAME : MSG:2,Vrms:0.00,P1:0,E1:0,T1:0.00,T2:0.00,T3:0.00,pulse:1
2020-11-09 00:06:08,042 DEBUG    SerialTx   91 Timestamp : 1604880368.039376
2020-11-09 00:06:08,044 DEBUG    SerialTx   91 From Node : Serial_PiZero_barn
2020-11-09 00:06:08,046 DEBUG    SerialTx   91    Values : [2, 0, 0, 0, 0, 0, 0, 1]
2020-11-09 00:06:08,047 DEBUG    SerialTx   91 Sent to channel(start)' : ToEmonCMS
2020-11-09 00:06:08,050 DEBUG    SerialTx   91 Sent to channel(end)' : ToEmonCMS
2020-11-09 00:06:08,171 INFO     MQTT       Publishing: emonhub/rx/Serial_PiZero_barn/values 2,0,0,0,0,0,0,1
2020-11-09 00:06:08,176 DEBUG    MQTT       Publishing: emon/Serial_PiZero_barn {"MSG": 2, "Vrms": 0, "P1": 0, "E1": 0, "T1": 0, "T2": 0, "T3": 0, "pulse": 1, "time": 1604880368.0393758}
2020-11-09 00:06:09,383 DEBUG    emoncmsorg Buffer size: 2
2020-11-09 00:06:17,009 DEBUG    SerialTx   92 NEW FRAME : MSG:3,Vrms:0.00,P1:0,E1:0,T1:0.00,T2:0.00,T3:0.00,pulse:1
2020-11-09 00:06:17,012 DEBUG    SerialTx   92 Timestamp : 1604880377.007843
2020-11-09 00:06:17,013 DEBUG    SerialTx   92 From Node : Serial_PiZero_barn
2020-11-09 00:06:17,015 DEBUG    SerialTx   92    Values : [3, 0, 0, 0, 0, 0, 0, 1]
2020-11-09 00:06:17,017 DEBUG    SerialTx   92 Sent to channel(start)' : ToEmonCMS
2020-11-09 00:06:17,019 DEBUG    SerialTx   92 Sent to channel(end)' : ToEmonCMS
2020-11-09 00:06:17,111 INFO     MQTT       Publishing: emonhub/rx/Serial_PiZero_barn/values 3,0,0,0,0,0,0,1
2020-11-09 00:06:17,115 DEBUG    MQTT       Publishing: emon/Serial_PiZero_barn {"MSG": 3, "Vrms": 0, "P1": 0, "E1": 0, "T1": 0, "T2": 0, "T3": 0, "pulse": 1, "time": 1604880377.0078433}
2020-11-09 00:06:25,875 DEBUG    SerialTx   93 NEW FRAME : MSG:4,Vrms:0.00,P1:0,E1:0,T1:0.00,T2:0.00,T3:0.00,pulse:1
2020-11-09 00:06:25,877 DEBUG    SerialTx   93 Timestamp : 1604880385.873888
2020-11-09 00:06:25,878 DEBUG    SerialTx   93 From Node : Serial_PiZero_barn
2020-11-09 00:06:25,880 DEBUG    SerialTx   93    Values : [4, 0, 0, 0, 0, 0, 0, 1]
2020-11-09 00:06:25,883 DEBUG    SerialTx   93 Sent to channel(start)' : ToEmonCMS
2020-11-09 00:06:25,885 DEBUG    SerialTx   93 Sent to channel(end)' : ToEmonCMS
2020-11-09 00:06:26,162 INFO     MQTT       Publishing: emonhub/rx/Serial_PiZero_barn/values 4,0,0,0,0,0,0,1
2020-11-09 00:06:26,166 DEBUG    MQTT       Publishing: emon/Serial_PiZero_barn {"MSG": 4, "Vrms": 0, "P1": 0, "E1": 0, "T1": 0, "T2": 0, "T3": 0, "pulse": 1, "time": 1604880385.873888}
2020-11-09 00:06:39,392 DEBUG    emoncmsorg Buffer size: 2

Idling, a Pi Zero draws 50 to 70 mA, which is right at the max spec’d value of an emonTx power supply. During startup, the Zero draws 120-140 mA. Can’t be good in either case, especially the second one.

Ref: EmonTx V3.4 - OpenEnergyMonitor Wiki
Important note regarding powering with AC: powering via AC is recommended only for standard emonTx operation without auxiliary sensors (apart from a maximum of 4 DS18B20 temperature sensors) or equipment (e.g. relay modules) connected. Correct operation via the AC supply is critically dependent upon using the correct AC-AC adapter. If you are using the recommended AC-AC adapter and the current draw exceeds 10 mA and the mains supply is below the minimum allowable, then circuit operation will be impaired, adversely affecting the accuracy of the emonTx. To avoid damage to the emonTx V3 circuits, the current drawn from the AC circuit should never exceed 60mA

https://www.jeffgeerling.com/blogs/jeff-geerling/raspberry-pi-zero-power


Additional info:
https://www.raspberrypi.org/forums/viewtopic.php?t=127210

Two things, probably related. Hostnames cannot contain an underscore! Letters, digits and minus signs only.

Secondly the error refers to a different hostname, which accounts for why it can’t find it. Most likely the hostname it is using is the result of stripping out the illegal characers, which then doesn’t match the original. Alternatively, you have the legal form stored somewhere else.

Either way, fix your hostname to be the legal form and try again.

1 Like

I think you’re thinking of when just an AC:AC is used to power the emontx, Julian has stated he is using a 5V 2A AC:DC in addition to the 9V AC:AC. I expect the PiZ is taking 5V from the FTDI port and that is direct from the 5V rail of the emonTx, ie direct from the 2A PSU.

Julian, you have many occurrences of this

which the 1st line is correct as “Settings:” is indeed not numeric. Why you are getting that instead of numeric values I do not know, what firmware are you running on the emonTx?

If there is text or rather symbols like that arriving unexpectedly, that may explain the UnicodeDecodeError: 'utf-8' codec can't decode byte errors if something out of the usual is arriving.

Can you try disconnecting the Tx-Tx line if you have one and haven’t already disconnected it? Just in case emonhub is triggering a “settings” response from the emonTx somehow.

Yep. Your’re right, and he did.

That said, the point I should’ve made is:
(also from the wiki article)
If more than 10 mA of current is required, it is recommended to remove jumper 2 (JP2) and power the emonTx via the 5V mini-USB connector. When JP2 is removed, the AC-AC adapter (if connected) will be used only to provide an AC voltage sample, i.e. it will not power the emonTx.

1 Like

Coming back on several points …

  1. Removing the 5V & GND wires between the emonTx & the Pi Zero’s header, and powering the Pi via a 5V 1A power brick didn’t solve the problem (but will leave it this way until I can find a better brick, as the PiZ specs say 1.2A is “recommended”)

  2. I have changed the hostname from emonTx_PiZero_1 to emontxpizero1 & rebooted both the Pi and emonHub on the emonTx.

  3. The emonTx is running

Administration | App v2.2.3 | Backup v2.2.4 | EmonHub Config v2.0.5 | Dashboard v2.0.9 | DemandShaper v2.1.2 | Device v2.0.7 | EventProcesses | Feed | Graph v2.0.9 | Input | Postprocess v2.1.4 | CoreProcess | Schedule | Network Setup v1.0.0 | sync | Time | User | Visualisation | WiFi v2.0.3
  1. I have removed the Tx > Tx wire and rebooted both devices, and still nothing coming through to the emonPi. This is the emonHub log from the emonTx.
2020-11-10 16:45:38,344 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-10 16:45:38,346 DEBUG    MainThread Setting MQTT subchannels: ['ToEmonCMS']
2020-11-10 16:45:38,348 INFO     MainThread Setting MQTT node_JSON_enable: 1
2020-11-10 16:45:38,361 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2020-11-10 16:45:38,364 DEBUG    MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2020-11-10 16:45:38,366 DEBUG    MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2020-11-10 16:45:38,368 WARNING  MainThread Setting emoncmsorg apikey: obscured
2020-11-10 16:45:38,370 INFO     MainThread Setting emoncmsorg url: https://emoncms.org
2020-11-10 16:45:38,382 INFO     MainThread Setting emoncmsorg senddata: 1
2020-11-10 16:45:38,389 INFO     MainThread Setting emoncmsorg sendstatus: 1
2020-11-10 16:47:15,460 DEBUG    MainThread Signal 15 received.
2020-11-10 16:47:15,517 INFO     MainThread Exiting hub...
2020-11-10 16:47:15,729 INFO     MainThread Exit completed
2020-11-10 17:00:28,671 INFO     MainThread EmonHub emonHub (emon-pi variant) v2.1.5
2020-11-10 17:00:28,684 INFO     MainThread Opening hub...
2020-11-10 17:00:28,687 INFO     MainThread Logging level set to DEBUG
2020-11-10 17:00:28,689 INFO     MainThread Creating EmonHubTx3eInterfacer 'SerialTx'
2020-11-10 17:00:28,714 DEBUG    MainThread Opening serial port: /dev/ttyAMA0 @ 115200 bits/s
2020-11-10 17:00:28,719 INFO     MainThread Creating EmonHubMqttInterfacer 'MQTT'
2020-11-10 17:00:28,735 DEBUG    MainThread Setting MQTT timestamped: True
2020-11-10 17:00:28,737 DEBUG    MainThread Setting MQTT subchannels: ['ToEmonCMS']
2020-11-10 17:00:28,739 INFO     MainThread Setting MQTT node_JSON_enable: 1
2020-11-10 17:00:28,748 INFO     MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2020-11-10 17:00:28,751 DEBUG    MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2020-11-10 17:00:28,762 DEBUG    MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2020-11-10 17:00:28,764 WARNING  MainThread Setting emoncmsorg apikey: obscured
2020-11-10 17:00:28,766 INFO     MainThread Setting emoncmsorg url: https://emoncms.org
2020-11-10 17:00:28,768 INFO     MainThread Setting emoncmsorg senddata: 1
2020-11-10 17:00:28,770 INFO     MainThread Setting emoncmsorg sendstatus: 1

LOG LEVEL: DEBUG 

But more importantly you no longer have the “settings:” values coming through, nor the UnicodeDecodeError: and if you had the emonLCD service running the hostname error would probably be ok now too. So progress is being made.

What firmware are you running on the emonTx?

Are you familiar with Miniterm?

If so, you could stop the emonhub service and access the emontx via miniterm to see what is going on there. Say if you need more detailed steps.

@Robert.Wall might recognise the “settings:” text perhaps? I do not I’m afraid.

That might well be an emonTx running Trystan’s CM sketch - but I don’t know where “time” has come from, that’s definitely not coming from a sketch that I recognise. If the Pi Zero has added it, then it’s probably OK. Unlike the r.f. packet, the serial output only sends values for the items in use, so it’s really not all that helpful.

I’m afraid that with everything else I’m doing for OEM behind the scenes, I’ve lost track of the original problem.

That, because of the misleading labelling on the emonTx, means that it won’t receive and react to any incoming serial data. Which might be a good thing if that data is valid but not good calibration data.

If the emonTx sends values that are zero (as distinct from no values), it might be a symptom of the calibration having been corrupted. It would send no current and energy values, but it would send the message number and the voltage, even if that were exactly zero.

Beware though, the corruption (if there is corruption) could have happened before that wire was removed.

Disconnecting the 5V wire and running the Zero via a separate power supply isn’t a bad idea, but…
I’d recommend leaving the GND connected between the two devices. Bonding devices together to
ensure a common reference point keeps weird things from happening to signal levels.

1 Like

No that’s the emoncms modules, the firmware is installed on the emonTx itself and may only be identifiable by using miniterm wilst the emonTx is connected to the zero or using a usb programmer (if you have one) on another PC.

On power-up, and if you have an appropriate monitoring device - as Paul says a programmer and the Arduino IDE on a PC or miniterm and the Pi Zero - connected to the FTDI serial port, the emonTx should display this message or one similar:

emonTx V3.4 EmonLibCM Continuous Monitoring V1.9
OpenEnergyMonitor.org
Node: 15 Freq: 433MHz Group: 210
NO CT's detected

alternatively as appropriate

CT1 detected, i1Cal:90.91
CT2 detected, i2Cal:90.91

etc

Yes the time:timestamp is added by emonhub, the mqtt interfacer does it if the json format output is selected.

The bit I don’t get is the

It clearly shows a payload of “settings:” being received and I cannot find that printed from the DS sketch and in the CM sketch it is the first line of the list_calibration function, but since I can see no way in the sketch to set the verbose bool true it would seem that the list_calibration can only be triggered by a “l” serial command and the tx-tx line is apparently removed so that isn’t possible. Or at least that’s the impression I get from the latest CM FW but we don’t know what it’s actually running yet.

I am fairly confident it must be CM since not only is there a “settings:” string but also a “Band 433 MHz” string too which is the 4th line printed by that same function in the CM sketch.

It would seem the Tx3e thread is constantly crashing due to some text chars and it’s as if it keeps restarting the serial comms and occasionally it gets a little bit further before crashing. Do you know if earlier revisions were more verbose on the serial output?

We need to know that last bit.

No sketch has ever sent any data other than the “normal” output of voltages, currents, powers, energies, temperatures or pulses after the initial power-up sequence.

For a sketch with the on-line calibration, that mode must be activated by the “+++” access code during the first 10 s of its life, and only then will it respond to, and in most cases reply to, one of the configuration or calibration commands, such as l.

No, it must be restarting “r” the whole sketch - or the watchdog is doing it. But again, if it’s seeing a r, it needs “+++” sent to get into a position to see it. If either of those is happening, the message count will always start again from zero.

So, was that before the Tx-Tx wire was disconnected? I think that answer must be “yes”. And it still begs the question, is the Pi zero sending “+++” like the ESP8266 must be doing to create what’s beginning to look like the same problem? With the on-line calibration, any serial connected device connected to the emonTx must send NOTHING except the listed configuration and calibration commands.

I’ve no idea how to track versions through Github, or even if it’s possible. But from memory, that output, like the measurement output, has been fairly consistent, and the change notes in the sketch make no mention of a change to the output text. Gwil tries to let me know when a version is first shipped, so if we know the date the sketch was shipped or received, I might be able to tie it to a version number from that.