Arduino Bluetooth Classic

Gilbert
Posts: 39
Joined: Wed Sep 16, 2020 2:58 pm

Arduino Bluetooth Classic

Postby Gilbert » Wed Sep 16, 2020 3:59 pm

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

Gilbert
Posts: 39
Joined: Wed Sep 16, 2020 2:58 pm

Re: Arduino Bluetooth Classic

Postby Gilbert » Sun Sep 20, 2020 8:55 am

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...

mrburnette
Posts: 22
Joined: Mon Feb 12, 2018 6:50 pm

Re: Arduino Bluetooth Classic

Postby mrburnette » Sun Sep 20, 2020 9:08 pm

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

Gilbert
Posts: 39
Joined: Wed Sep 16, 2020 2:58 pm

Re: Arduino Bluetooth Classic

Postby Gilbert » Mon Sep 21, 2020 8:45 am

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.

Gilbert
Posts: 39
Joined: Wed Sep 16, 2020 2:58 pm

Re: Arduino Bluetooth Classic

Postby Gilbert » Tue Sep 22, 2020 9:31 am

Same on my Android tablet (running Android 5.1): no PIN asked when trying to pair with ESP32.

Gilbert
Posts: 39
Joined: Wed Sep 16, 2020 2:58 pm

Re: Arduino Bluetooth Classic

Postby Gilbert » Thu Oct 08, 2020 6:45 am

For ESP32, this document will discuss Espressif's implemention of BLE:
This isn't about using BLE, I'm using BT Classc.

Who is online

Users browsing this forum: No registered users and 74 guests