I am looking at measuring the consumption of a 3phase (4 wire) supply using a recently purchased emontx, for which I really need to disable the 433 MHz Radio and use the Serial interface directly to a Raspberry Pi (perhaps using EmonCMS), however there appear to be a few issues with this approach that I need to get to grips with.
I cannot fathom out which Libraries are required to build the Arduino sketch (I’m trying to use the latest Arduino IDE V1.8.13 on Ubuntu 20.04) - The ‘emontx-3-phase-userguide.pdf’ tells me I need 4 Arduino Standard Libraries (Wire / SPI / CRC16 / EEPROM) but I am unable to identify these from the dozens of libs that have some match for these words. Plus an another ‘OneWire’ (not even looked for this yet).
The serial data format from the 3phase Firmware that was shipped on the device (reports are being V1.4 but I suspect is really V1.6) does not seem to recognised by EmonHub - I have seen conflicting information on how to configure this,I tried this in my emonhub.conf
in the [interfacers] section:
[[SerialDirect]]
Type = EmonHubSerialInterfacer
[[[init_settings]]]
com_port = /dev/ttyAMA0 # or /dev/ttyAMA0 or/dev/ttyACM0 etc
com_baud = 9600 # to match the baud of the connected device
[[[runtimesettings]]]
pubchannels = ToEmonCMS,
and in the [node] section
[[99]]
nodename = emontx-serial
[[[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
But the emonhub logs shows:
2020-11-24 10:26:23,925 WARNING MainThread SerialDirect thread is dead.
2020-11-24 10:26:23,926 WARNING MainThread Attempting to restart thread SerialDirect (thread has been restarted 0 times…)
2020-11-24 10:26:23,927 INFO MainThread Creating EmonHubSerialInterfacer ‘SerialDirect’
2020-11-24 10:26:28,679 WARNING SerialDirect Exception caught in SerialDirect thread. Traceback (most recent call last):
File “/home/pi/git/emonhub/src/emonhub_interfacer.py”, line 32, in wrapper
return func(*args)
File “/home/pi/git/emonhub/src/emonhub_interfacer.py”, line 99, in run
rxc = self.read()
File “/home/pi/git/emonhub/src/interfacers/EmonHubSerialInterfacer.py”, line 90, in read
c.nodeid = int(f[0])
ValueError: invalid literal for int() with base 10: ‘246.46’