I am trying to figure out a way to determine the best way that communication status with a modbus device,
either via TCP or Serial RS485/232 can be read or inferred.
Currently, it appears there are NO modbus status registers available.
Ideally, _each_ modbus requestor should have an individual status register associated with it which can be queried
Alternatively a status register for each modbus slave device should be available to be queried.
It appears that when using the Test Button in the WebUI, that the status is read and displayed, but not made available for
IoT status
As it is when comms die, the last read data values remain forever.
I was thinking one could come up with some shell-script kludgeware to do some error checking, but I know of no hooks in shell-script land...
I'm thinking those data points could be klobbered to zero periodically in thingsboard, but that's super-ugly and puts a lot of needless noise into the data.
Any ideas ?
I suggest setting aside 2 chunks of modbus registers
1 chunk of 32 registers into which overall status for all defined slave devices would be written
0xffff denotes device not configured
0x0000 denotes status OK
0xttss denotes tt=seconds since non-zero status, ss=last modbus status code
for keener-points 1 more chunk of 128 registers into which status for individual requestors would be written
- same scheme as above