Async DataRequest #177
Replies: 2 comments 4 replies
-
Not quite. Zigpy does not like the BUFFER_FULL callback. But I'm sure there would be a way around this:
|
Beta Was this translation helpful? Give feedback.
-
I have been playing around quite a bit with a few different issues and managed to reduce my "test automation" time from 8s to ~2.5s. Just to be clear: the automation simply toggles a hand full of lights on and then off again (and waits for the responses). I fiddled around with the send_packet function and ended up using source routing as primary attempt to reach the device. This seems to be extremely reliable and much faster. I also changed the DataRequestSrcRtg to be async in both, zipgy and the firmware. Is the source routing approach discouraged for a specific reason? |
Beta Was this translation helpful? Give feedback.
-
Hey @puddly!
We were talking about async Data Requests over @ #174
I wanted to follow up on the idea and added a few lines (the else block) to the firmware in Application/mt/mt_af.c:
which in turn lets me add the following to zigpy-znp (in api.py in def request()):
And it seems to work!
It now saves ~ 50 ms per request in the sync lock which can add up to a lot (especially when toggling a lot of lights or when polling fires many requests at once; often have this because I have about 15 smart plugs that measure electricity, 2 attributes per plug makes 30 simultaneous requests which would delay everything for abtou 1.5 seconds). With the "synchronous" request less than 1 ms is spent in the lock.
Would love to hear your thoughts
Beta Was this translation helpful? Give feedback.
All reactions