sde1000 / python-dali

Library for controlling DALI lighting systems
Other
150 stars 71 forks source link

Improve LUBA serial driver error handling #111

Closed sl-wallace closed 1 year ago

sl-wallace commented 1 year ago

Through further testing with the LUBA driver in real-world situations it was observed that some better error handling is needed. In particular, the LUBA "event info" data was being ignored, but this is quite useful to determine whether a received message is useful and should be decoded or if there was an error of some kind. Errors are now logged more succinctly.

There were also rare times when the implementation would end up in a state that resulted in old responses being used for new queries. This caused big problems with higher-level applications. It's still not clear how to reproduce these issues, but clearing the received DALI response buffer when starting a new transmission should fix these the problem. A "critical" level log message is emitted when a received response is dropped from the queue through this new mechanism - it shouldn't ever happen, but sometimes seems to occur after specific bus contention issues.