jmccrohan / pysolarmanv5

A python module to interact with Solarman Data Logging Sticks
MIT License
124 stars 27 forks source link

Double CRC handling #66

Closed githubDante closed 1 month ago

githubDante commented 1 month ago

The discussion in https://github.com/jmccrohan/pysolarmanv5/issues/62 reveals that some data loggers/inverters apply double CRC over the modbus frame making it unreadable by the standard libraries. Therefore, some bytes must be removed in order the RTU frame to conform to the protocol.

githubDante commented 1 month ago

My tree is messed up too much from what I see. Don't know why all these extra commits are showing up here.

davidrapan commented 1 month ago

But this way it is going to call the 'parse_response_adu' twice during every struct.error. Isn't that somehow wasteful?

githubDante commented 1 month ago

But this way it is going to call the 'parse_response_adu' twice during every struct.error. Isn't that somehow wasteful?

The check by length will reduce the calls. Otherwise, yes, it will be called even when the response is a modbus exception.

jmccrohan commented 1 month ago

Merged, thanks to both of you for your input on this.

I will tidy up the docs and prepare a new release.