Page 1 of 1

Arduino Bluetooth Classic

Posted: Wed Sep 16, 2020 3:59 pm
by Gilbert
Hi,

I'm new to ESP32. I have some experience programming Atmel micros in assembler and C using AVR Studio and in Cpp using Arduino IDE.
So far I managed to create a working application for ESP32 to communicate with BT serial monitor on my Android phone.
But...
  • I'd like to secure the pairing with my phone (in fact any phone) using a PIN. I found some code samples and I browsed through the Arduino BluetoothSerial library code on Github, but setting the pin and enabling (or not) SSP doesn't have any effect. My phone simply pairs with ESP32 without asking for a PIN. Any help would be very welcome

Re: Arduino Bluetooth Classic

Posted: Sun Sep 20, 2020 8:55 am
by Gilbert
New discovery: I decided to use Bluetooth serial monitor for Windows on my desktop because its more convenient. Hence I had to pair ESP32 with my PC. Surprise: the PC asked for my PIN code when I tried to pair it. I tried a couple of times, I also tried a wrong code to see what happens and all of that works as expected.
Conclusion: PIN doesn't work at all with Android (in my case Android version 10) and it does work with Windows 10 (version 1909).
I hope this gives you some clues...

Re: Arduino Bluetooth Classic

Posted: Sun Sep 20, 2020 9:08 pm
by mrburnette
https://www.ellisys.com/technology/een_bt07.pdf
The Bluetooth specification defines two standard pairing procedures, LMP-pairing (aka PIN-code based), and SSP. Non- standard pairing methods are also possible, but require both devices to be from the same manufacturer. The result of any pairing method is the same though: creating the shared Link Key.
For ESP32, this document will discuss Espressif's implemention of BLE:
https://www.espressif.com/sites/default ... ure_en.pdf

Re: Arduino Bluetooth Classic

Posted: Mon Sep 21, 2020 8:45 am
by Gilbert
Thanks for sharing all the details, but I'm not a BT expert and don't intend to become one ;-).
I just expect SSP to work, regardless which host attempts to pair with ESP32.
I'll do another experiment later today using my old tablet running on Android 4.4.

Re: Arduino Bluetooth Classic

Posted: Tue Sep 22, 2020 9:31 am
by Gilbert
Same on my Android tablet (running Android 5.1): no PIN asked when trying to pair with ESP32.

Re: Arduino Bluetooth Classic

Posted: Thu Oct 08, 2020 6:45 am
by Gilbert
For ESP32, this document will discuss Espressif's implemention of BLE:
This isn't about using BLE, I'm using BT Classc.