I have a simple Bluetooth project where I am simply trying to send strings out. I have verified that PIO and packages are all up to date and even forced a manual install of BluetoothSerial.h. My problem is that while the build completes, the linker throws a long list of errors. Below is my main.cpp, platformio.ini and a sample of the long list of linker errors.
I hope someone can tell me how to fix this!
main.cpp:
#include <Arduino.h>
#include <BluetoothSerial.h>BluetoothSerial SerialBT;
void setup()
{
Serial.begin(115200);
SerialBT.begin(“ESP32-Server”);
}void loop()
{
// Send data to the connected device
SerialBT.println(“Hello from ESP32!”);
delay(1000);
}
platformio.ini:
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
Some of the long list of linker errors:
c:/users/al testani/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib9cf\libBluetoothSerial.a(BluetoothSerial.cpp.o):(.literal._ZL8_stop_btv+0x18): undefined reference to `esp_spp_disconnect'
c:/users/al testani/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib9cf\libBluetoothSerial.a(BluetoothSerial.cpp.o):(.literal._ZL8_stop_btv+0x1c): undefined reference to `esp_spp_deinit'
c:/users/al testani/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib9cf\libBluetoothSerial.a(BluetoothSerial.cpp.o):(.literal._ZL16_spp_send_bufferv+0x8): undefined reference to `esp_spp_write'
c:/users/al testani/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib9cf\libBluetoothSerial.a(BluetoothSerial.cpp.o):(.literal._ZL8btSetPinv+0xc): undefined reference to `esp_bt_gap_set_pin'c:/users/al testani/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib9cf\libBluetoothSerial.a(BluetoothSerial.cpp.o):(.literal._ZN15BluetoothSerial5beginE6Stringb+0x24): undefined reference
to `esp_bt_gap_register_callback'
c:/users/al testani/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib9cf\libBluetoothSerial.a(BluetoothSerial.cpp.o):(.literal._ZN15BluetoothSerial5beginE6Stringb+0x28): undefined reference
to `esp_spp_register_callback'
c:/users/al testani/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib9cf\libBluetoothSerial.a(BluetoothSerial.cpp.o):(.literal._ZN15BluetoothSerial5beginE6Stringb+0x2c): undefined reference
to `esp_spp_init'
c:/users/al testani/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib9cf\libBluetoothSerial.a(BluetoothSerial.cpp.o):(.literal._ZN15BluetoothSerial5beginE6Stringb+0x30): undefined reference
to `esp_bt_gap_set_security_param'
c:/users/al testani/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib9cf\libBluetoothSerial.a(BluetoothSerial.cpp.o):(.literal._ZN15BluetoothSerial5beginE6Stringb+0x34): undefined reference
to `esp_bt_gap_set_cod'
c:/users/al testani/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib9cf\libBluetoothSerial.a(BluetoothSerial.cpp.o):(.literal._ZL10esp_spp_cb18esp_spp_cb_event_tP18esp_spp_cb_param_t+0x28): undefined reference to `esp_bt_gap_set_scan_mode'
c:/users/al testani/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib9cf\libBluetoothSerial.a(BluetoothSerial.cpp.o):(.literal._ZL10esp_spp_cb18esp_spp_cb_event_tP18esp_spp_cb_param_t+0x2c): undefined reference to `esp_spp_start_srv'
c:/users/al testani/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib9cf\libBluetoothSerial.a(BluetoothSerial.cpp.o):(.literal._ZL10esp_spp_cb18esp_spp_cb_event_tP18esp_spp_cb_param_t+0x30): undefined reference to `esp_spp_connect'c:/users/al testani/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\lib9cf\libBluetoothSerial.a(BluetoothSerial.cpp.o):(.literal._ZL13esp_bt_gap_cb21esp_bt_gap_cb_event_tP21esp_bt_gap_cb_param_t+0x20): undefined reference to `esp_bt_gap_resolve_eir_data'