Error When Trying to use Bluetooth on ESP32

This is the error I got:

E (20801) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (20801) task_wdt: - IDLE0 (CPU 0)
E (20801) task_wdt: Tasks currently running:
E (20801) task_wdt: CPU 0: btController
E (20801) task_wdt: CPU 1: IDLE1
E (20801) task_wdt: Aborting.
abort() was called at PC 0x4015efa8 on core 0

ELF file SHA256: 0000000000000000

Backtrace: 0x4008ec74:0x3ffbf330 0x4008eef1:0x3ffbf350 0x4015efa8:0x3ffbf370 0x4008d625:0x3ffbf390 0x4003c9fd:0x3ffcf490 0x4005516e:0x3ffcf4b0 0x40172aa2:0x3ffcf4d0 0x401635cb:0x3ffcf510 0x40163b44:0x3ffcf530 0x4008ff66:0x3ffcf560

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10944
load:0x40080400,len:6388
entry 0x400806b4

This is the code:

/**
 * This example turns the ESP32 into a Bluetooth LE keyboard that writes the words, presses Enter, presses a media key and then Ctrl+Alt+Delete
 */
#include <BleKeyboard.h>

BleKeyboard bleKeyboard;

void setup() {
  Serial.begin(115200);
  Serial.println("Starting BLE work!");
  bleKeyboard.begin();
}

void loop() {
  if(bleKeyboard.isConnected()) {
    Serial.println("Sending 'Hello world'...");
    bleKeyboard.print("Hello world");

    delay(1000);

    Serial.println("Sending Enter key...");
    bleKeyboard.write(KEY_RETURN);

    delay(1000);

    Serial.println("Sending Play/Pause media key...");
    bleKeyboard.write(KEY_MEDIA_PLAY_PAUSE);

    delay(1000);

    Serial.println("Sending Ctrl+Alt+Delete...");
    bleKeyboard.press(KEY_LEFT_CTRL);
    bleKeyboard.press(KEY_LEFT_ALT);
    bleKeyboard.press(KEY_DELETE);
    delay(100);
    bleKeyboard.releaseAll();
  }

  Serial.println("Waiting 5 seconds...");
  delay(5000);
}

What is the decoded debug message when you send the backtrace info to the ESP32 Exception Decoder, look it up on the internet and install it to the Arduino IDE?

I fixed it somehow, when I switched to nano for another project and came back it was working...

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