adafruit / Adafruit_CircuitPython_BLE

Bluetooth Low Energy (BLE) library for CircuitPython
MIT License
124 stars 57 forks source link

Slow connection #145

Closed kivicode closed 2 months ago

kivicode commented 2 years ago

Hello, I'm trying to stream some data over the BLE-UART (board: Adafruit Feather Sense with nRf52840).

However, the problem is that I can't reach any speeds higher than ~1 Kb/s. I suspect it is related to the TX buffer size, but I can't find where to set it. Is there a way to increase the connection speed to approach the ones from nrf52840's documentation (150+ Kb/s)?

tannewt commented 2 years ago

For testing, you can change it here: https://github.com/adafruit/Adafruit_CircuitPython_BLE/blob/main/adafruit_ble/services/nordic.py#L39

I'm not sure how Characteristic buffer is packing bytes into outgoing packets.

I think we automatically negotiate large MTUs and short connection intervals. They are worth checking though because they will depend on the client. https://circuitpython.readthedocs.io/en/latest/shared-bindings/_bleio/index.html#bleio.Connection