# ESP32 SerialToSerialBT example & BluetoothSerial.h

**URL:** <https://forum.arduino.cc/t/esp32-serialtoserialbt-example-bluetoothserial-h/1366570>\
**Category:** Programming\
**Created:** [March 23, 2025, 8:09pm UTC](https://forum.arduino.cc/t/esp32-serialtoserialbt-example-bluetoothserial-h/1366570 "2025-03-23T20:09:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cgriswold52](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cgriswold52/32/272313_2.png) [@cgriswold52](https://forum.arduino.cc/u/cgriswold52)\
**Post date:** [March 23, 2025, 8:09pm UTC](https://forum.arduino.cc/t/esp32-serialtoserialbt-example-bluetoothserial-h/1366570/1 "2025-03-23T20:09:26Z")

</div>

I've been trying to run the ESP32 SerialToSerialBT example included with the current IDE. I installed the current BluetoothSerial library from the library manager. The compile is failing on all the method calls such as  
BluetoothSerial SerialBT;  
and  
SerialBT.begin("ESP32test", true)  
I looked in the header file, BluetoothSerial.h, and none of the method calls are there. It appears to be designed for a game controller.

It there an error here, or is this newbe missing something

Thanks in advance for your help

---

<div class="post-metadata">

**Author:** ![horace](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/horace/32/1014299_2.png) [@horace](https://forum.arduino.cc/u/horace)\
**Post date:** [March 23, 2025, 8:23pm UTC](https://forum.arduino.cc/t/esp32-serialtoserialbt-example-bluetoothserial-h/1366570/2 "2025-03-23T20:23:30Z")

</div>

which ESP32 are you using, e.g. an ESP32, ESP32S3, ESP32C3, etc?  
if I set Tools\>Board to "ESP32 Dev module" the program File\>Examples\>BluetoothSerial\>SerialToSerialBT compiles and loads OK

then Android phone pairs with "ESP32-BT-Slave"  
and communicates with [Serial Bluetooth Terminal](https://play.google.com/store/apps/details?id=de.kai_morich.serial_bluetooth_terminal&hl=en-US) app

---

<div class="post-metadata">

**Author:** ![cattledog](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cattledog/32/217816_2.png) [@cattledog](https://forum.arduino.cc/u/cattledog)\
**Post date:** [March 23, 2025, 8:38pm UTC](https://forum.arduino.cc/t/esp32-serialtoserialbt-example-bluetoothserial-h/1366570/3 "2025-03-23T20:38:00Z")

</div>

> [@cgriswold52](#):
>
> I installed the current BluetoothSerial library from the library manager

Is this the library you loaded?

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/0/f/2/0f2e364a4a47929689c4e5c16ecdba51890ab9b7.png)

Are you trying to connect the ESP 32 to an iphone?

The ESP32 SerialToSerialBT example uses the Serial Bluetooth library bundled with the esp32 package used to run an ESP 32 with the Arduino core for that device. To connect two ESP32 devices with classic bluetooth no other library is needed.

As @horace asked, what ESP32 are you using, as not all the model support classic bluetooth.

---

<div class="post-metadata">

**Author:** ![cgriswold52](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cgriswold52/32/272313_2.png) [@cgriswold52](https://forum.arduino.cc/u/cgriswold52)\
**Post date:** [March 24, 2025, 10:12am UTC](https://forum.arduino.cc/t/esp32-serialtoserialbt-example-bluetoothserial-h/1366570/4 "2025-03-24T10:12:43Z")

</div>

Upon further research, I realized the my ESP32C6 does not support Bluetooth classic.  
My project is Simultaneous Location and Mapping, SLAM, robot. Arduino microcontrollers do not have enough power so I'm trying to connect to Python on a laptop. I thought that Bluetooth would be a lightweight, easy solution.  
There is an older ESP32 variant from Adafruit that does support classic Bluetooth which I've ordered and will try next week.  
While i know that I should have realized that there are limited ESP32s that support classic, I'm a bit annoyed that there are supplied examples that won't work and a library file, BluetoothSerial.h, which apparently has the same name as another library file for a different purpose, a time wasting trap for unsuspecting newbes

---

<div class="post-metadata">

**Author:** ![horace](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/horace/32/1014299_2.png) [@horace](https://forum.arduino.cc/u/horace)\
**Post date:** [March 24, 2025, 3:55pm UTC](https://forum.arduino.cc/t/esp32-serialtoserialbt-example-bluetoothserial-h/1366570/5 "2025-03-24T15:55:22Z")

</div>

there is an equivalent to Bluetooth Classic Serial for BLE  
try File\>Examples\>BLE\>UART  
creates "UART Service" you can connect too it using [Serial Bluetooth Terminal](https://play.google.com/store/apps/details?id=de.kai_morich.serial_bluetooth_terminal&hl=en-US) app  
just checked - works OK with a ESP32C6

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [September 20, 2025, 3:56pm UTC](https://forum.arduino.cc/t/esp32-serialtoserialbt-example-bluetoothserial-h/1366570/6 "2025-09-20T15:56:07Z")

</div>

Closed on September 20, 2025, 3:56pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
