sunspec / pysunspec2

SunSpec Python library for interfacing with SunSpec devices.
Apache License 2.0
57 stars 21 forks source link

Socket timeout not handled as an address error during model scan #56

Closed bobfox closed 2 years ago

bobfox commented 2 years ago

If a TCP socket timeout occurs during a model scan, the scan is aborted rather than moving to the next address. Some devices may not generate an exception when accessing an invalid address.

Update to treat a timeout during scan as an address access error and move to the next address candidate. This will create a longer total timeout since three addresses will be tried. Since this will add a delay for each address tried, make 40000 the first address tried as it is the most common SunSpec base address.