I have built a new Emoncms system using a RPi 2B with the emonSD-10Nov22 image and using a LeChacal RPICT3V1 board to collect readings from 3 CTs around our solar installation.
I configured Emonhub based on information provided by LeChacal and it basically appears to be working as expected. However, the message above appears after 5 successfully received/processed packets and the SerialDirect thread restarts - as a result the ‘errored’ packet is lost.
I appreciate that this is similar to a recent topic, but I think it is somewhat different.
I’ve attached an excerpt from the log showing what’s happening and would appreciate any advice. emonhub_log.txt (8.6 KB)
2023-02-14 17:25:17,535 WARNING SerialDirect Exception caught in SerialDirect thread. Traceback (most recent call last):
File "/opt/openenergymonitor/emonhub/src/emonhub_interfacer.py", line 31, in wrapper
return func(*args)
File "/opt/openenergymonitor/emonhub/src/emonhub_interfacer.py", line 103, in run
rxc = self.read()
File "/opt/openenergymonitor/emonhub/src/interfacers/EmonHubSerialInterfacer.py", line 95, in read
c.nodeid = int(f[0])
ValueError: invalid literal for int() with base 10: '#'
Can you rule out the serial is actually sending a # as that is what the error seems to think has been sent.
Try stopping emonhub and see what is being sent by the serial input.
It seems the CT board was being reset periodically from the Pi causing it to send spurious data.
The 1-wire interface is enabled in the emonSD build; I’ve now disabled it and all is well.
(The guys at LeChacal pointed me to the relevant section of their FAQ to confirm and resolve this).
Apologies for this and thanks again; I can now get on with configuring the logging I am looking for.
Try using the OEM interfacer, it may deal with bad strings better.
I’d also enable JSON format for the MQTT data. Too many individual topics can cause issues for emoncms. It looks the same at the other end (you then get the same time for all the items of data).