# Bluetooth not working with Windows 10 and not working with Android

**URL:** <https://forum.arduino.cc/t/bluetooth-not-working-with-windows-10-and-not-working-with-android/920136>\
**Category:** General Guidance\
**Created:** [October 30, 2021, 4:28pm UTC](https://forum.arduino.cc/t/bluetooth-not-working-with-windows-10-and-not-working-with-android/920136 "2021-10-30T16:28:34Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![spikespiegel](https://avatars.discourse-cdn.com/v4/letter/s/8dc957/32.png) [@spikespiegel](https://forum.arduino.cc/u/spikespiegel)\
**Post date:** [October 30, 2021, 4:28pm UTC](https://forum.arduino.cc/t/bluetooth-not-working-with-windows-10-and-not-working-with-android/920136/1 "2021-10-30T16:28:35Z")

</div>

I'm trying to use ESP32 to send receive/send data (RFCOMM) through bluetooth to Windows 10, I've already tried with both classic and BLE bluetooth, but despite what I do, Windows 10 won't recognize ESP32 as a Bluetooth device.

This is what I see when I go to the bluetooth and other devices settings in Windows 10:  
[![](https://europe1.discourse-cdn.com/arduino/original/4X/d/a/0/da0f91855b0fe51be3239c287dfe7606dc6c3dd2.jpeg)](https://ibb.co/jg6Vs4d)

If I try to add a bluetooth device, it won't detect anything, even if I press the reset button in ESP32. All I can see from ESP32 is that "Silicon Labs CP201x USB to UART Bridge (COM 7)" COM 7 port is working. I also noticed that COM1 port isn't working, it just displays in Arduino IDE, but it won't connect.

I can see that port COM 7 is working because I'm able to upload the code to the ESP32, but then when I test the bluetooth from the Serial Monitor, the Android device won't pair at all, this is all I get from the Serial Monitor:

> ets Jun 8 2016 00:22:57
> 
> rst:0x1 (POWERON\_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:9720  
> ho 0 tail 12 room 4  
> load:0x40080400,len:6352  
> entry 0x400806b8  
> Waiting a client connection to notify...

I've also installed the drivers CH34x\_Install\_Windows\_v3\_4 and CP210x\_Universal\_Windows\_Driver, also tried CH341SER, CP210x\_Windows\_Drivers\_with\_Serial\_Enumeration and CP210x\_Windows\_Drivers, still the same results.

All I need to do is to connect a bluetooth controller to Windows 10 through ESP32, that's all. That shouldn't be that hard, right?

This is the board I'm using:  
[![](https://europe1.discourse-cdn.com/arduino/original/4X/2/2/8/22843ce42f654f4807bb0b1a291c898c39c69094.jpeg)](https://ibb.co/cLHKyNQ)

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [October 31, 2021, 9:05am UTC](https://forum.arduino.cc/t/bluetooth-not-working-with-windows-10-and-not-working-with-android/920136/2 "2021-10-31T09:05:56Z")

</div>

Please post the sketch that you are using

---

<div class="post-metadata">

**Author:** ![spikespiegel](https://avatars.discourse-cdn.com/v4/letter/s/8dc957/32.png) [@spikespiegel](https://forum.arduino.cc/u/spikespiegel)\
**Post date:** [October 31, 2021, 9:55pm UTC](https://forum.arduino.cc/t/bluetooth-not-working-with-windows-10-and-not-working-with-android/920136/3 "2021-10-31T21:55:03Z")

</div>

Right away sir. I've tested 3 types so far.

Classic bluetooth (Bluetooth to serial):

```cpp
//This example code is in the Public Domain (or CC0 licensed, at your option.)
//By Evandro Copercini - 2018
//
//This example creates a bridge between Serial and Classical Bluetooth (SPP)
//and also demonstrate that SerialBT have the same functionalities of a normal Serial

#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!");
}

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

```

Classic Bluetooth, from techcoil blog:

```cpp
#include "BluetoothSerial.h"
   
BluetoothSerial SerialBT;
    
void setup()
{
  SerialBT.begin("ESP32test");
  delay(1000);
}
    
void loop()
{
  String inputFromOtherSide;
  if (SerialBT.available()) {
    inputFromOtherSide = SerialBT.readString();
    SerialBT.println("You had entered: ");
    SerialBT.println(inputFromOtherSide);
  }
}

```

This one will refuse connection right away, from android, using BLE UART:

```cpp
/*
    Video: https://www.youtube.com/watch?v=oCMOYS71NIU
    Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleNotify.cpp
    Ported to Arduino ESP32 by Evandro Copercini

   Create a BLE server that, once we receive a connection, will send periodic notifications.
   The service advertises itself as: 6E400001-B5A3-F393-E0A9-E50E24DCCA9E
   Has a characteristic of: 6E400002-B5A3-F393-E0A9-E50E24DCCA9E - used for receiving data with "WRITE" 
   Has a characteristic of: 6E400003-B5A3-F393-E0A9-E50E24DCCA9E - used to send data with "NOTIFY"

   The design of creating the BLE server is:
   1. Create a BLE Server
   2. Create a BLE Service
   3. Create a BLE Characteristic on the Service
   4. Create a BLE Descriptor on the characteristic
   5. Start the service.
   6. Start advertising.

   In this example rxValue is the data received (only accessible inside that function).
   And txValue is the data to be sent, in this example just a byte incremented every second. 
*/
#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>

BLEServer *pServer = NULL;
BLECharacteristic * pTxCharacteristic;
bool deviceConnected = false;
bool oldDeviceConnected = false;
uint8_t txValue = 0;

// See the following for generating UUIDs:
// https://www.uuidgenerator.net/

#define SERVICE_UUID "6E400001-B5A3-F393-E0A9-E50E24DCCA9E" // UART service UUID
#define CHARACTERISTIC_UUID_RX "6E400002-B5A3-F393-E0A9-E50E24DCCA9E"
#define CHARACTERISTIC_UUID_TX "6E400003-B5A3-F393-E0A9-E50E24DCCA9E"

class MyServerCallbacks: public BLEServerCallbacks {
    void onConnect(BLEServer* pServer) {
      deviceConnected = true;
    };

    void onDisconnect(BLEServer* pServer) {
      deviceConnected = false;
    }
};

class MyCallbacks: public BLECharacteristicCallbacks {
    void onWrite(BLECharacteristic *pCharacteristic) {
      std::string rxValue = pCharacteristic->getValue();

      if (rxValue.length() > 0) {
        Serial.println(" *********");
        Serial.print("Received Value: ");
        for (int i = 0; i < rxValue.length(); i++)
          Serial.print(rxValue[i]);

        Serial.println();
        Serial.println(" *********");
      }
    }
};

void setup() {
  Serial.begin(115200);

  // Create the BLE Device
  BLEDevice::init("UART Service");

  // Create the BLE Server
  pServer = BLEDevice::createServer();
  pServer->setCallbacks(new MyServerCallbacks());

  // Create the BLE Service
  BLEService *pService = pServer->createService(SERVICE_UUID);

  // Create a BLE Characteristic
  pTxCharacteristic = pService->createCharacteristic(
										CHARACTERISTIC_UUID_TX,
										BLECharacteristic::PROPERTY_NOTIFY
									);
                      
  pTxCharacteristic->addDescriptor(new BLE2902());

  BLECharacteristic * pRxCharacteristic = pService->createCharacteristic(
											 CHARACTERISTIC_UUID_RX,
											BLECharacteristic::PROPERTY_WRITE
										);

  pRxCharacteristic->setCallbacks(new MyCallbacks());

  // Start the service
  pService->start();

  // Start advertising
  pServer->getAdvertising()->start();
  Serial.println("Waiting a client connection to notify...");
}

void loop() {

    if (deviceConnected) {
        pTxCharacteristic->setValue(&txValue, 1);
        pTxCharacteristic->notify();
        txValue++;
		delay(10); // bluetooth stack will go into congestion, if too many packets are sent
	}

    // disconnecting
    if (!deviceConnected && oldDeviceConnected) {
        delay(500); // give the bluetooth stack the chance to get things ready
        pServer->startAdvertising(); // restart advertising
        Serial.println("start advertising");
        oldDeviceConnected = deviceConnected;
    }
    // connecting
    if (deviceConnected && !oldDeviceConnected) {
		// do stuff here on connecting
        oldDeviceConnected = deviceConnected;
    }
}

```

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [October 31, 2021, 10:09pm UTC](https://forum.arduino.cc/t/bluetooth-not-working-with-windows-10-and-not-working-with-android/920136/4 "2021-10-31T22:09:10Z")

</div>

> [@spikespiegel](#):
>
> Right away sir.

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'  
  
Use **code tags** (the \</\> icon above the compose window)&nbsp;to make it easier to read and copy for examination

> [@How to get the best out of this forum](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966):
>
> See also [FAQ - Arduino Forum](https://forum.arduino.cc/faq) for general rules on forum behaviour and etiquette. Hello, Welcome to the Arduino Forum. This guide explains how to get the best out of this forum. Please read and follow the instructions below. Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is fru…

---

<div class="post-metadata">

**Author:** ![spikespiegel](https://avatars.discourse-cdn.com/v4/letter/s/8dc957/32.png) [@spikespiegel](https://forum.arduino.cc/u/spikespiegel)\
**Post date:** [October 31, 2021, 10:14pm UTC](https://forum.arduino.cc/t/bluetooth-not-working-with-windows-10-and-not-working-with-android/920136/5 "2021-10-31T22:14:36Z")

</div>

Sorry, I'm having trouble formatting code here.

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [October 31, 2021, 10:16pm UTC](https://forum.arduino.cc/t/bluetooth-not-working-with-windows-10-and-not-working-with-android/920136/6 "2021-10-31T22:16:55Z")

</div>

The easiest way is to right click in the IDE, select Copy for Forum and paste it here in a post. The code tags will be added by the IDE

---

<div class="post-metadata">

**Author:** ![Brazilino](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/brazilino/32/1198404_2.png) [@Brazilino](https://forum.arduino.cc/u/Brazilino)\
**Post date:** [November 1, 2021, 4:03pm UTC](https://forum.arduino.cc/t/bluetooth-not-working-with-windows-10-and-not-working-with-android/920136/7 "2021-11-01T16:03:49Z")

</div>

My guess is that you need to start bluetooth (classic) server by adding this line to your setup code:

SerialBT.begin("nameofyourchoice");

"nameofyourchoice" will appear as a possible connection choice in your Windows.

---

<div class="post-metadata">

**Author:** ![anon29785379](https://avatars.discourse-cdn.com/v4/letter/a/ee59a6/32.png) [@anon29785379](https://forum.arduino.cc/u/anon29785379)\
**Post date:** [March 30, 2022, 7:33am UTC](https://forum.arduino.cc/t/bluetooth-not-working-with-windows-10-and-not-working-with-android/920136/8 "2022-03-30T07:33:28Z")

</div>

Hello! post #3 has mentioned Classic bluetooth (Bluetooth to serial example) `SerialBT.begin("ESP32test"); //Bluetooth device name`.

I have the same problem as the spikespiegel's post. Windows 10 don't find SPP bluetooth of the ESP32....😥

Before, I used Bluetooth LE Explorer software to check Bluetooth characteristics, service names, etc **(laptop can find BLE by Bluetooth LE Explorer)**.

@spikespiegel Have you solved the problem yet?

---

<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 26, 2022, 7:34am UTC](https://forum.arduino.cc/t/bluetooth-not-working-with-windows-10-and-not-working-with-android/920136/9 "2022-09-26T07:34:10Z")

</div>

Closed on September 26, 2022, 7:34am UTC

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