Is there a way to reduce the latency in start_notify()?
See original GitHub issue- bleak version: 0.14.2
- Python version: 3.7.11
- Operating System: Windows 10
- BlueZ version (
bluetoothctl -v
) in case of Linux: N/A
Description
Hi,
I am running Bleak on Windows 10 (central) reading 9DOF IMU data (packed into 1 GATT characteristic) from Arduino Nano 33 BLE. I have noticed that there is an average of 180ms -200ms latency between when the IMU characteristic is updated and when the python program is notified in the start_notify()
callback. I measured this latency by comparing the Arduino Serial Monitor time stamp (connected to the same Windows 10 machine) and the time stamp in the start_notify()
callback for the corresponding record. When I switched to polling the characteristic in a while
loop with asyncio.sleep(0)
, the latency drops to an average of 20-25ms. Is polling the best practice in minimizing the latency of reading characteristic value updates?
Issue Analytics
- State:
- Created a year ago
- Comments:7
Top Results From Across the Web
5 Ways to Reduce Bluetooth Latency - MakeUseOf
Luckily, Bluetooth devices aren't doomed to latency and lag. There are a few ways you can reduce Bluetooth latency.
Read more >Re: Overhead reduction in LE connection establishment — Linux ...
I would like to > know if it's possible to remove those operations through ... (the central > calls StartNotify() as soon as...
Read more >How to reduce BLE notification latency - ST Community
I would like to reduce the latency as much as possible for sending notifications between the 2 boards. Currently, I'm able to start...
Read more >965316 - startNotifications() throws GATT Error: Not Paired ...
2. Click button to prompt device pair window. 3. Find device and click 'pair'. 4. Open JavaScript console and notice the Gatt Error....
Read more >How to improve network latency in 3 steps - TechTarget
What is network latency and how do you reduce it? What are the causes of latency and the problems that can result from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you very much @dlech!
Based on the Bluetooth traffic captured in Wireshark, the polling version, as expected, can only poll every ~110ms due to the extra “handshakes” around read requests whereas notify version continuously receives data packets from the peripheral. After I performed optional driver updates on my Windows 10, the latency for the notify version is at a more acceptable 25-30ms level. One thing to note is that my Bluetooth driver appeared to be the same version after the updates so I am not sure if the latency was fixed due to the restart or updated shared DLLs.
Yes, see https://bleak.readthedocs.io/en/latest/troubleshooting.html#capture-bluetooth-traffic