We have a Python application that connects to 10 BLE devices at a time and performs a manufacturing test. Here is the work flow of the test:
- Connects to the first of 10 devices.
- Reads and writes to a few characteristics one of which reboots the peripheral device
- Reconnects to device 1, enables notifications on 1 characteristic, and listens for ~170-200k of data
- Disconnects from device 1, turns device 1 off, and repeats step 1-3 on the next device
As we progress through the devices the data transfer for each device slows gradually, the first device is fast, the second device slightly slower etc, even though we are disconnecting from each device after performing the test. We assume that there may be something related to our usage that is causing this slowdown, however after reviewing the relatively small amount of code in the project we haven't been able to explain anything in the Python code that could be causing the slowdown.
We've tried turning each device off as we test to ensure low interference, removing cached devices from the Central, and restarting the bluetooth service in between tests. After testing these changes, the sudo service bluetooth restart is the only solution that will mitigate the delay growth during data transmission.
We are looking for any ideas on solutions to the described situation or debug techniques. Thank you in advance!
Versions used: Ubuntu 20.04, Bluezero 0.4.0, bluez 5.53" (edited)