Send and receive from rs232 serial port
Posted: Wednesday 28 December 2022 20:08
Hi, I have a conversol solar inverter, which only communicates via rs232. I would like to get the data into domoticz, but need a few pointers to get me started.
Could someone suggest the best way of achieving the following:-
Every 10 seconds
-ttyUSB0 ( 2400,N,8,1)
-Send ascii string of "QPIGS"
-wait for ascii response ( which ends with 0x0d )
-Decode response of several values
-Send ascii string of "QPIGS2"
-wait for ascii response ( which ends with 0x0d )
-Decode response of several values
Can this be done via dzvents lua script?
If anyone can offer any advice, or a skeleton example, that would be most appreciated.
Could someone suggest the best way of achieving the following:-
Every 10 seconds
-ttyUSB0 ( 2400,N,8,1)
-Send ascii string of "QPIGS"
-wait for ascii response ( which ends with 0x0d )
-Decode response of several values
-Send ascii string of "QPIGS2"
-wait for ascii response ( which ends with 0x0d )
-Decode response of several values
Can this be done via dzvents lua script?
If anyone can offer any advice, or a skeleton example, that would be most appreciated.