1

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:

  1.  Connects to the first of 10 devices.
  2.  Reads and writes to a few characteristics one of which reboots the peripheral device
  3.  Reconnects to device 1, enables notifications on 1 characteristic, and listens for ~170-200k of data
  4.  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)

Owen
  • 11
  • 2
  • You could try to use the btmon tool as logging, to see if you can see something interesting, or use an air sniffer to investigate further. Note that it might be your Bluetooth controller's radio scheduler that you should blame. – Emil Mar 20 '21 at 02:52
  • You may try starting bluez daemon in debug mode with `-d`, as described here: https://stackoverflow.com/questions/37003147/i-want-to-enable-debug-messages-on-bluez This could show if the Bluetooth host (BlueZ) is aware of any issues when connecting to next devices. – Filip Kubicz Jun 10 '21 at 19:27
  • You can also try disabling the notification on characteristic before disconnecting from the device. – Filip Kubicz Jun 10 '21 at 19:33

0 Answers0