Not had a chance to investigate, but emonhub died on me. There were a number of exceptions before this.
It has been running for weeks - possibly months (since the last power cut). I do think this is a pretty old version though - actually a beta of the Python3.
I’ll reinstall tomorrow and see what happens.
pi@raspberrypi:/opt/openenergymonitor/emonhub $ git show
commit 6975b0d36099f43871c47b8639dcfd6c05532ef9 (HEAD -> python3, origin/python3)
Author: Bruce Duncan <[email protected]>
Date: Tue Dec 10 13:48:31 2019 +0000
Use a beta version number.
diff --git a/src/emonhub.py b/src/emonhub.py
index 52243c4..d7112bd 100755
--- a/src/emonhub.py
+++ b/src/emonhub.py
@@ -49,7 +49,7 @@ Controlled by the user via EmonHubSetup
class EmonHub:
- __version__ = "emonHub emon-pi variant v3"
+ __version__ = "emonHub emon-pi variant v3-beta"
def __init__(self, setup):
"""Setup an OpenEnergyMonitor emonHub.
Logs around the crash.
2021-01-09 14:17:41,974 WARNING MainThread emoncmsorg thread is dead.
2021-01-09 14:17:41,977 WARNING MainThread Attempting to restart thread emoncmsorg (thread has been restarted 96 times...
2021-01-09 14:17:41,984 INFO MainThread Setting RFM2Pi quiet: 1 (1q)
2021-01-09 14:17:42,050 DEBUG RFM2Pi acknowledged command: > 1q
2021-01-09 14:17:42,989 INFO MainThread Setting RFM2Pi calibration: 230V (1p)
2021-01-09 14:17:43,064 DEBUG RFM2Pi acknowledged command: > 1p
2021-01-09 14:17:43,529 DEBUG RFM2Pi acknowledged command: <nn> i - set node ID (standard node ids are 1..26)
2021-01-09 14:17:43,654 DEBUG RFM2Pi acknowledged command: <n> b - set MHz band (4 = 433, 8 = 868, 9 = 915)
2021-01-09 14:17:43,785 DEBUG RFM2Pi acknowledged command: <nnn> g - set network group (RFM12 only allows 212, 0 = any)
2021-01-09 14:17:43,910 DEBUG RFM2Pi acknowledged command: <n> c - set collect mode (advanced, normally 0)
2021-01-09 14:17:43,996 INFO MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2021-01-09 14:17:44,002 DEBUG MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2021-01-09 14:17:44,005 DEBUG MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2021-01-09 14:17:44,008 INFO MainThread Setting emoncmsorg apikey: set
2021-01-09 14:17:44,010 INFO MainThread Setting emoncmsorg url: http://192.168.7.47/emoncms
2021-01-09 14:17:44,013 INFO MainThread Setting emoncmsorg senddata: 1
2021-01-09 14:17:44,023 INFO MainThread Setting emoncmsorg sendstatus: 1
2021-01-09 14:17:44,043 DEBUG RFM2Pi acknowledged command: ...,<nn> a - send data packet to node <nn>, with ack
2021-01-09 14:17:44,167 DEBUG RFM2Pi acknowledged command: ...,<nn> s - send data packet to node <nn>, no ack
2021-01-09 14:17:44,355 DEBUG RFM2Pi acknowledged command: <n> l - turn activity LED on DIG8 on or off
2021-01-09 14:17:44,581 DEBUG RFM2Pi device settings updated: 69 i5 g210 @ 433 MHz Lock: 1
2021-01-09 14:17:51,720 DEBUG RFM2Pi 741116 NEW FRAME : 10 145 4 0 0 0 0 0 0 128 92 48 117 48 117 48 117 48 117 48 117 48 117 0 0 0 0
2021-01-09 14:17:51,731 DEBUG RFM2Pi 741116 Timestamp : 1610201871.7198367
2021-01-09 14:17:51,734 DEBUG RFM2Pi 741116 From Node : 10
2021-01-09 14:17:51,737 DEBUG RFM2Pi 741116 Values : [1169, 0, 0, 0, 236.8, 300, 300, 300, 300, 300, 300, 0]
2021-01-09 14:17:51,740 DEBUG RFM2Pi 741116 Sent to channel(start)' : ToEmonCMS
2021-01-09 14:17:51,743 DEBUG RFM2Pi 741116 Sent to channel(end)' : ToEmonCMS
2021-01-09 14:17:51,989 INFO MQTT Connecting to MQTT Server
2021-01-09 14:17:51,993 INFO MQTT-193 Connecting to MQTT Server
2021-01-09 14:17:52,007 INFO MQTT-193 Could not connect...
2021-01-09 14:17:52,011 INFO MQTT Could not connect...
2021-01-09 14:17:52,035 DEBUG emoncmsorg Buffer size: 1
2021-01-09 14:17:52,038 INFO emoncmsorg sending: http://192.168.7.47/emoncms/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1610201871.7198367,10,1169,0,0,0,236.8,300,300,300,300,300,300,0]]&sentat=1610201872
2021-01-09 14:17:52,078 WARNING emoncmsorg emoncmsorg couldn't send to server: HTTPConnectionPool(host='192.168.7.47', port=80): Max retries exceeded with url: /emoncms/input/bulk.json?apikey=XXXXXX(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0xb3822d10>: Failed to establish a new connection: [Errno 101] Network is unreachable'))
2021-01-09 14:17:52,084 WARNING emoncmsorg Exception caught in emoncmsorg 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 127, in run
self.action()
File "/opt/openenergymonitor/emonhub/src/emonhub_interfacer.py", line 198, in action
self.flush()
File "/opt/openenergymonitor/emonhub/src/emonhub_interfacer.py", line 216, in flush
if self._process_post(databuffer):
File "/opt/openenergymonitor/emonhub/src/interfacers/EmonHubEmoncmsHTTPInterfacer.py", line 71, in _process_post
reply = self._send_post(post_url, {'data': data_string, 'sentat': str(sentat)})
File "/opt/openenergymonitor/emonhub/src/emonhub_interfacer.py", line 257, in _send_post
return reply.text
UnboundLocalError: local variable 'reply' referenced before assignment
2021-01-09 14:17:52,096 WARNING MainThread emoncmsorg thread is dead.
2021-01-09 14:17:52,099 WARNING MainThread Attempting to restart thread emoncmsorg (thread has been restarted 97 times...
2021-01-09 14:17:52,106 INFO MainThread Setting RFM2Pi quiet: 1 (1q)
2021-01-09 14:17:52,156 DEBUG RFM2Pi acknowledged command: > 1q
2021-01-09 14:17:53,111 INFO MainThread Setting RFM2Pi calibration: 230V (1p)
2021-01-09 14:17:53,169 DEBUG RFM2Pi acknowledged command: > 1p
2021-01-09 14:17:53,636 DEBUG RFM2Pi acknowledged command: <nn> i - set node ID (standard node ids are 1..26)
2021-01-09 14:17:53,761 DEBUG RFM2Pi acknowledged command: <n> b - set MHz band (4 = 433, 8 = 868, 9 = 915)
2021-01-09 14:17:53,890 DEBUG RFM2Pi acknowledged command: <nnn> g - set network group (RFM12 only allows 212, 0 = any)
2021-01-09 14:17:54,015 DEBUG RFM2Pi acknowledged command: <n> c - set collect mode (advanced, normally 0)
2021-01-09 14:17:54,118 INFO MainThread Creating EmonHubEmoncmsHTTPInterfacer 'emoncmsorg'
2021-01-09 14:17:54,124 DEBUG MainThread Setting emoncmsorg pubchannels: ['ToRFM12']
2021-01-09 14:17:54,135 DEBUG MainThread Setting emoncmsorg subchannels: ['ToEmonCMS']
2021-01-09 14:17:54,137 INFO MainThread Setting emoncmsorg apikey: set
2021-01-09 14:17:54,140 INFO MainThread Setting emoncmsorg url: http://192.168.7.47/emoncms
2021-01-09 14:17:54,153 INFO MainThread Setting emoncmsorg senddata: 1
2021-01-09 14:17:54,156 INFO MainThread Setting emoncmsorg sendstatus: 1
2021-01-09 14:17:54,166 DEBUG RFM2Pi acknowledged command: ...,<nn> a - send data packet to node <nn>, with ack
2021-01-09 14:17:54,290 DEBUG RFM2Pi acknowledged command: ...,<nn> s - send data packet to node <nn>, no ack
2021-01-09 14:17:54,448 DEBUG RFM2Pi acknowledged command: <n> l - turn activity LED on DIG8 on or off
2021-01-09 14:17:54,696 DEBUG RFM2Pi device settings updated: 69 i5 g210 @ 433 MHz Lock: 1
2021-01-11 20:28:54,257 INFO MainThread EmonHub emonHub emon-pi variant v3-beta
2021-01-11 20:28:54,274 INFO MainThread Opening hub...
2021-01-11 20:28:54,277 INFO MainThread Logging level set to DEBUG