Bluetooth connection automatically dropping between ESP-WROOM-32 and Windows 11 configured laptop

Hello, I've recently purchased an ESP-WROOM-32 to work on a wirelessly controlled robot. I wish to establish a classic bluetooth connection between my Windows 11-configured laptop and the ESP32 board. To do so, I've uploaded the following code onto my board via the PlatformIO plugin on VScode:

#include <Arduino.h>
#include "BluetoothSerial.h"

#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif

BluetoothSerial SerialBT;

void setup() {
  Serial.begin(115200);
  SerialBT.begin("ESP32test"); //Bluetooth device name
  Serial.println("The device started, now you can pair it with bluetooth!");
  pinMode(2,OUTPUT);
}

void loop() {
  if (Serial.available()) {
    SerialBT.write(Serial.read());
    digitalWrite(2,HIGH);
  }
  if (SerialBT.available()) {
    Serial.write(SerialBT.read());
  }
  delay(20);
}

The Serial Monitor responds how it is intended to, i.e when I press the "EN" button on the ESP32, I receive an output "The device started, now you can pair it with bluetooth!".

Now, when I pair this with my Windows 11 laptop, for a brief moment (about 3 seconds), before it automatically drops and displays "Not connected".

How do I fix this bug?

Have you asked Microsoft? We don't have source code of Windows 11.

I experience same problem here. It can connect well with android, but not win 11.

I too have the same problem. Does ANYBODY know if the problem lies with Windows (likely I know) or with the Arduino (ESP32) hardware or the Arduino bluetooth libraries? Works solidly with Android, but I have yet to test with Linux and with other Windows machines.

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