MTU exchange happens before pairing, causing peripherals to disconnect#10915
MTU exchange happens before pairing, causing peripherals to disconnect#10915fede2cr wants to merge 2 commits into
Conversation
|
Are we violating the bluetooth spec or just confusing these pedals? |
|
I don't know enough about ble spec to know if it was currently broken. I think this patch can be described as a compatibility workaround for these devices, or as a parity patch, in the sense that the Chocotone which is a similar pedal-control software but based in c++ (arduino esp32 code v3.1.2) does negotiation in this way, which is what I used to understand and sniff why circuitpython wasn't connecting with this devices. |
|
I am not ignoring this but would want to try it with some more conventional BLE devices as well. |
|
I don't own many BLE (client) devices, but I can get some for testing. What would be a good test? Pairing? |
|
I just want to understand whether this is security pairing or you are just talking about connection. Do the pedals require some action on their side to do pairing? Are you calling Some simple devices include heart rate monitors and oximeters. Some use the the standard HRM and Pulse Oximeter services, and some use some ad hoc protocol. There are also standard services for bicycle sensors. I have a Schosche heart rate monitor I bought years ago that is standard and can use https://github.com/adafruit/Adafruit_CircuitPython_BLE_Heart_Rate/. https://github.com/adafruit/Adafruit_CircuitPython_BLE_iBBQ worked in the past for iBBQ thermometers. https://github.com/adafruit/Adafruit_CircuitPython_BLE_BerryMed_Pulse_Oximeter worked for a certain brand of pulse oximeter, but these vary a lot. On the other hand someone usually reverse engineers them and you can find info relatively easily. Bicycle sensors don't have as much churn. https://github.com/adafruit/Adafruit_CircuitPython_BLE_Cycling_Speed_and_Cadence works with several. |
I haven't tested backporting this against released versions, will try to backport if devs agree it makes sense
I'm building a circuitpython library to talk with commercial "guitar" pedals (Valeton GP-5, Sonicake Smart Box so far) over BLE, to control them with cpy pedalboards. With both I get disconnect errors while trying to pair with them.
This patch changes the order, so that SMP security is initiated before MTU exchange, this allows the devices to pair properly.
Tested only in esp32-s3 qt with these two devices, not sure if it breaks pairing with other BLE devices.