Very new to Pi but I love it.
I have a Eastron SDM120 modbus with a RS485 usb and connected it to my Pi 3 B+.
I installed https://www.domoticz.com/wiki/Eastron_SDM120C and made a dummy.
If I type
Code: Select all
sdm120c -a 1 -b 9600 -P N -S 2 -z 1 -j 20 /dev/ttyUSB1
Code: Select all
pi@raspberrypi:~ $ sdm120c -a 1 -b 9600 -P N -S 2 -z 1 -j 20 /dev/ttyUSB1
Voltage: 233.00 V
Current: 2.81 A
Power: 572.80 W
Active Apparent Power: 650.77 VA
Reactive Apparent Power: 308.70 VAR
Power Factor: 0.88
Phase Angle: 0.00 Degree
Frequency: 49.95 Hz
Import Active Energy: 887773 Wh
Export Active Energy: 82687 Wh
Total Active Energy: 970460 Wh
Import Reactive Energy: 607963 VARh
Export Reactive Energy: 114013 VARh
Total Reactive Energy: 721976 VARh
OK
Code: Select all
Python 3.5.3 (/usr/bin/python3)
>>> %Run sdm120.sh
Traceback (most recent call last):
File "/home/pi/domoticz/scripts/sdm120.sh", line 18
CURRENT=$($SDM120 $TTY -p -q -z 10 | awk '{print $1}') #get current from sdm120c
^
SyntaxError: invalid syntax
>>>