ESP32-C3-Mini-1 Bluetooth Serial

Hi everybody,

I want to develop a system and want to design it with ESP32-C3-mini-1 module. I need to use Bluetooth SPP protocol to communicate with PC as serial port. I got error when I try to upload sample code.



#include "BluetoothSerial.h"
BluetoothSerial SerialBT;





void setup() {
  Serial.begin(115200);
  SerialBT.begin("TARNAVI");
  delay(2000);
  
}


void loop() {
  
  
  SerialBT.println("Test Mini");
  delay(1000);
  
}



Error Output

c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `.L0 ':
C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:713: undefined reference to `esp_spp_disconnect'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `_stop_bt':
C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:714: undefined reference to `esp_spp_deinit'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `.L0 ':
C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:189: undefined reference to `esp_spp_write'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:153: undefined reference to `esp_bt_gap_set_pin'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:650: undefined reference to `esp_bt_gap_register_callback'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `_init_bt':
C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:658: undefined reference to `esp_spp_register_callback'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:664: undefined reference to `esp_spp_init'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:686: undefined reference to `esp_bt_gap_set_security_param'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:691: undefined reference to `esp_bt_gap_set_cod'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `.LVL474':
C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:265: undefined reference to `esp_bt_gap_set_scan_mode'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `esp_spp_cb':
C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:271: undefined reference to `esp_spp_start_srv'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:283: undefined reference to `esp_spp_disconnect'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:364: undefined reference to `esp_spp_connect'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:391: undefined reference to `esp_spp_disconnect'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `.L0 ':
C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:126: undefined reference to `esp_bt_gap_resolve_eir_data'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `get_name_from_eir':
C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:130: undefined reference to `esp_bt_gap_resolve_eir_data'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `.L0 ':
C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:456: undefined reference to `esp_bt_gap_cancel_discovery'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: libraries\BluetoothSerial\BluetoothSerial.cpp.o: in function `esp_bt_gap_cb':
C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:455: undefined reference to `esp_spp_start_discovery'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:522: undefined reference to `esp_bt_gap_pin_reply'
c:/users/htacc/appdata/local/arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: C:\Users\htacc\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\BluetoothSerial\src/BluetoothSerial.cpp:530: undefined reference to `esp_bt_gap_ssp_confirm_reply'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board ESP32C3 Dev Module.

What should I do?

1 Like

The ESP32-C3 only supports Bluetooth 5 (BLE) not Buletooth Classic

Is there any way to communicate over bluetooth as serial with BLE 5?

BLE is much more complex than Bluetooth Classic
have a look a Examples>ESP32 BLE Arduino>BLE_uart more details on Github ESP32_BLE_client_uart

Please explain what you mean by "as Serial".

You can certainly set up a UART service between a peripheral and central and exchange short text messages, but it is not a simple as the classic bluetooth.

I have a windows application written on C# and has serial port capability. I want to use Bluetooth of ESP32. I normally use Atmega 328P with HC-05 and pair with PC. After pairing, I saw bluetooth connection as Com port and choose com port on c# app. I want to do it with ESP32-C3-mini-1 because it is very small and powerful Module. If not, which module of ESP can I use? ESP32-Wroom-32 series is little bit big for my new case. I need to make it very small.

Thanks

The Adafruit Huzzah32 is pretty small. Downside is you have to use a usb adaptor and manually trigger upload mode.

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