Hi all,
I have a smart meter, and I can connect to it using the serial port, using openhab3 (openhabian 3.1 on rpi 4b)
Also, I can successfully read several registers on the same Poller for value types “uint16”. ( Check powermeter.things voltage and current data things)
Sadly, I am not able to do the same for “uint32” value types. Just if I create an individual poller for each register I can read the uint32 values.
Bridge modbus:serial:powermeter [ port="/dev/ttyAMA0" ,id=1 , baud=9600, stopBits="1.0", parity="none", dataBits=8, encoding="rtu" ]{
Bridge poller instantaneous [ start=108, length=2, refresh=5000, type="input" ]{
Thing data voltage [ readStart="108", readValueType="uint16", readTransform="JS(divide_by_10.js)"]
Thing data current [ readStart="109", readValueType="uint16", readTransform="JS(divide_by_10.js)"]
}
Bridge poller instantaneouspower [ start=121, length=4, refresh=5000, type="input" ]{
Thing data power_import [ readStart="121", readValueType="uint32"]
Thing data power_export [ readStart="122", readValueType="uint32"]
}
}
I have tried with several length values, without luck.
The smart meter documentation shows the following information:
Data type definition:
I have tried to read the same input registers with mbpoll with the following result:
openhabian@openhabian:~ $ mbpoll -m rtu -a 1 -b 9600 -d 8 -P none -v -s 1 -t 3:int -c 1 -1 -r 122 -o 10 -0 -B /dev/ttyAMA0
debug enabled
Set rtu stop bits=1
Set function=3
Set format=int
Set number of values=1
Set start reference=122
Set timeout=10
Set device=/dev/ttyAMA0
Opening /dev/ttyAMA0 at 9600 bauds (N, 8, 1)
Set response timeout to 10 sec, 0 us
Protocol configuration: Modbus RTU
Slave configuration...: address = [1]
start reference = 122, count = 1
Communication.........: /dev/ttyAMA0, 9600-8N1
t/o 10.00 s, poll rate 1000 ms
Data type.............: 32-bit integer (big endian), input register table
-- Polling slave 1...
[01][04][00][7A][00][02][50][12]
Waiting for a confirmation...
<01><04><06><00><00><02><7D><03><63><B1><EA>
Message length not corresponding to the computed length (11 != 9)
Read input register failed: Invalid data
I would like to avoid individual pollers by the register. The Smart meter does not like too many requests.
Thank you
Pedro