Hi,
I have used ESP32 ling time back and now I have a chance to use it again. My project requires both Wi-Fi and Bluetooth to work to gather so I thought ESP32 would be a great choice. But only after digging deep inside I understood that ESP32 has BLE and it is very different from normal Serial Bluetooth Hardware like HC-05 or HC-06.
I just want a simple program using which I can toggle an LED from ESP32, I should be able to built on top of it from there. Can someone guide me on getting started with Bluetooth using ESP32
Hi Aswinth, Thanks for the quick reply.
I have added the board details to Arduino long before, so I did not have that library installed by default. So I downloaded the folder from GIT and pasted in my lib location and I still get errors.
The error occurs with BluetoothSerial Library only other example programs like BLE_notify BLE_server etc are working properly and I am even able to connect and pair with the ESP32 from my phone
Hi Violet,
The reason for the problem is that you are using the old board details for ESP32. Now Espriff has added its support to Arduino IDE so you can directly install the board from Arduino Board Manager.
I suppose that you have used GIT to install ESP32 board earlier
Hi Aswinth Thanks a ton...
Yes I did install using the GIT software. So, I removed the espriff folder from hardware folder in Arduino directory and installed the ESP32 board from Board manager in Arduino.
Then after selecting the ESP32 Dev Board using Toold menu, I found that there was an example program with BluetoothSerial Library I just uploaded and viola it works like a charm.
I am also happy that ESP32 can send and receive strings on the whole unlike HC-05 which can send only one char at a time the library is awesome. Also the uploading time has also improved it is much faster now than the old GIT style.
Thanks again..
Aswinth Raj
PermalinkHi Violet,
Do not worry, you do not have to use BLE if your project does not require it. ESP32 supports both Bluetooth Low Energy (BLE) and Classic Bluetooth.
The one that you use with HC-05 is classic Bluetooth, so to use classic Bluetooth with ESP32 you can make use of the BluetoothSerial library from espressif itself. Once you include the library you can code it similar to using HC-05. I am pasting the example sketch below
If you have installed the ESP32 support for Arduino recently then this library should have been added by default
- Log in or register to post comments
Joined August 16, 2016 1000Tuesday at 12:29 AM