[Interest] BLE : Bonding and ble security

Jérôme Godbout godboutj at amotus.ca
Mon Aug 17 15:25:23 CEST 2020


Hi,
If you are using Qt and Android for the application. I did found over time to have a reliable behavior with Android connection step, you kind of need to slow things down on Android platform (this doesn’t apply to Windows, Mac, iOS). I delayed my task by 500 ms after connecting and doing anything (services discovery, pairing, authenticate… under Android. Also do this when I disconnect (garbage collector issue?!) and avoid reconnecting too quickly. This have solve many problems I had under Android. Android Bluetooth LE stack is really bad before Android 8. If you can, try to make things work with a recent device and Android 8+, then patch the behavior for older device if you can.

I also found that a few manufacturer have more issue (but this might just be a specific product, I don’t have enough data to make sure this is happening all the time):

  *   Google Nexus 7", Android 6.0.1  can raise undocumented Error 34 (0x22) GATT CONN LMP TIMEOUT
  *   LG K4 LTE, Android 5.1.1  Debugger doesn’t run too well
  *   Lenovo (cheap tablet, I don’t remember the actual model #) the advertising is a big mess (some low level filtering, making beacon continuous discovery impossible).
  *   Samsung many older version had some debugger issue (missing or renamed tools)

If you Android BLE start behaving heraldically, turn off the BLE and wait at least 20s before activating again. Seem like the garbage collector/clean up task is fairly slow.

Hope this might help you.
Jerome


[cid:image001.jpg at 01D67477.6634E0C0]
une compagnie  [cid:image002.jpg at 01D67477.6634E0C0]
RAPPROCHEZ LA DISTANCE
Jérôme Godbout
Développeur Logiciel Sénior /
Senior Software Developer
p: +1 (418) 800-1073 ext.:109
amotus.ca<http://www.amotus-solutions.com/>
statum-iot.com<http://statum-iot.com/>
[cid:image003.png at 01D67477.6634E0C0]<https://www.facebook.com/LesSolutionsAmotus/> [cid:image004.png at 01D67477.6634E0C0] <https://www.linkedin.com/company/amotus-solutions/>  [cid:image005.png at 01D67477.6634E0C0] <https://twitter.com/AmotusSolutions>  [cid:image006.jpg at 01D67477.6634E0C0] <https://www.youtube.com/channel/UCoYpQgsmj1iJZyDjTQ3x8Ig>
COVID-19 : we are glad to inform you that Amotus<https://www.amotus-solutions.com/> are up and running with limited impact on our performance. We will keep you informed of any changes as they occur.
COVID-19 : nous sommes fiers d’informer nos collaborateurs que Amotus<COVID-19%20mesures%20:%20nous%20sommes%20fier%20d’informer%20nos%20collaborateurs%20que%20Dimonoff/Amotus%20opère%20et%20que%20l’impact%20des%20nouvelles%20facçon%20de%20faire%20mise%20en%20place%20tend%20à%20minister%20l’impact%20sur%20notre%20productivité.> opèrent adéquatement et que l’impact sur notre productivité est minimisé. Nous vous tiendrons au courant de tout changement.

From: Interest <interest-bounces at qt-project.org> On Behalf Of Simon FEUTRIER
Sent: August 17, 2020 3:48 AM
To: interest at qt-project.org
Subject: [Interest] BLE : Bonding and ble security

Hi,

That is the first time I use this mailing list, so tell me if I'm doing anything wrong when using it. Thanks !

Now my problem.

I'm developing a Qt application that communicates with a BLE device. It worked perfectly until I tried to add some security. When I turned on "Just Works" security mode (device side), I was not able anymore to write in a characteristic (or read) from my Qt application.

I compared the Bluetooth messages sent from Qt app and from the android app nfr Connect and I see that automatically, the nrf Connect app sends a bonding request when it fails to write.
Qt does not do this. That is the only difference that makes the android app working but not my Qt app.

I finally made it work once : I start my Qt App, pair my BLE device with Windows parameters and then it works one time only (after that I need to unpair my device from Windows parameters and redo the same process). It only works if it has been paired with Windows parameters...

I could not find anything about bonding in the API or security mode settings.
Any idea ? Should I post it as a bug or am I missing something ?

Thanks,

Regards,

Simon Feutrier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200817/7e212bf8/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 98353 bytes
Desc: image001.jpg
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200817/7e212bf8/attachment-0003.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 1427 bytes
Desc: image002.jpg
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200817/7e212bf8/attachment-0004.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 730 bytes
Desc: image003.png
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200817/7e212bf8/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 929 bytes
Desc: image004.png
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200817/7e212bf8/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 839 bytes
Desc: image005.png
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200817/7e212bf8/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.jpg
Type: image/jpeg
Size: 1167 bytes
Desc: image006.jpg
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20200817/7e212bf8/attachment-0005.jpg>


More information about the Interest mailing list