Page 1 of 1

Send and receive from rs232 serial port

Posted: Wednesday 28 December 2022 20:08
by Supertramp4
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.

Re: Send and receive from rs232 serial port

Posted: Thursday 29 December 2022 1:02
by waltervl
Did you see this application: https://github.com/njfaria/SolPipLog
Could be compatible with your inverter.
The application can send data over MQTT. With Node Red or a plugin like MQTTMAPPER you could read those into Domoticz.

Reading the serial port directly from dzvents/Lua is probably doable but I could not find an example.