Skip to content

Cannot connect to GATT server using Windows 11 #1091

Open

Description

@ayan4m1

I am running Windows 11 25H2. I am using the latest stable Chrome and also the OS's inbuilt Bluetooth functionality to test connecting to my ESP32 BLE server. My code:

#include <Arduino.h>
#include <FastLED.h>
#include <NimBLEDevice.h>

#define LED_COUNT 1
#define LED_PIN 48

#define IP_ADDR_SERVICE_UUID "0c3df205-d093-46ab-b360-74e67fee325f"
#define WIFI_SETUP_SERVICE_UUID "cab5bfc5-18a5-4924-bcf8-02269e00301c"
#define IP_ADDR_CHARACTERISTIC_UUID "5181caeb-8309-48e5-942f-5e678fccf4db"
#define SSID_CHARACTERISTIC_UUID "88f26ae8-04f1-49ab-9341-1208f7b0fff8"
#define PSK_CHARACTERISTIC_UUID "ad42f5f5-6560-4773-9604-925d0727c671"

NimBLEServer* bleServer;
CRGB leds[LED_COUNT];

void setup() {
  FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, LED_COUNT);
  FastLED.setBrightness(100);

  leds[0] = CRGB::Yellow;

  FastLED.show();

  NimBLEDevice::init("CT Tester");

  bleServer = NimBLEDevice::createServer();
  auto ipAddressService = bleServer->createService(IP_ADDR_SERVICE_UUID);
  auto wifiSetupService = bleServer->createService(WIFI_SETUP_SERVICE_UUID);
  auto ipCharacteristic = ipAddressService->createCharacteristic(
      IP_ADDR_CHARACTERISTIC_UUID,
      NIMBLE_PROPERTY::READ | NIMBLE_PROPERTY::WRITE | NIMBLE_PROPERTY::NOTIFY);
  auto ssidCharacteristic =
      wifiSetupService->createCharacteristic(SSID_CHARACTERISTIC_UUID);
  auto pskCharacteristic =
      wifiSetupService->createCharacteristic(PSK_CHARACTERISTIC_UUID);

  ipAddressService->start();
  wifiSetupService->start();

  ipCharacteristic->setValue("1.2.3.4");

  auto advertising = NimBLEDevice::getAdvertising();

  advertising->addServiceUUID(IP_ADDR_SERVICE_UUID);
  advertising->addServiceUUID(WIFI_SETUP_SERVICE_UUID);
  advertising->enableScanResponse(true);
  advertising->setConnectableMode(BLE_GAP_CONN_MODE_UND);
  advertising->setName("CT Tester");
  advertising->start();

  bleServer->start();

  leds[0] = CRGB::Green;

  FastLED.show();
}

void loop() {}

The LED goes green on startup, and the device is adveritising. However, any connection attempt times out with a failure (error code 0 in Chrome). I have tried with and without the setConnectableMode call.

Activity

  1. h2zero commented on Feb 16, 2026

    @h2zero
    Owner

    If im not mistaken I don't think windows will connect to a device that doesn't have bonding enabled.

  2. axa88 commented on Feb 17, 2026

    @axa88

    If im not mistaken I don't think windows will connect to a device that doesn't have bonding enabled.

    I'm absolutely sure a BLE client using the windows SDK can allow a connection without having a bond.
    Im unsure how "Chrome" in this case, affects the use of the underlying windows sdk but, targeting:

    <TargetFramework>net10.0-windows10.0.26100.0</TargetFramework>

    and most likely earlier versions, will allow it as per spec, fwiw I do it all the time.

    Probably already done it, but i'd advise trying with another client like nRF Connect, and confirm your peripheral is working as expected.

  3. afpineda commented on Feb 25, 2026

    @afpineda
    Contributor

    This seems to be an specific issue with Windows 11 2025H2 (not other versions).
    This is how I fixed it:

    Go to Settings > System > Recovery > Fix problems using Windows Update > Reinstall now.

  4. afpineda commented on Feb 25, 2026

    @afpineda
    Contributor

    If im not mistaken I don't think windows will connect to a device that doesn't have bonding enabled.

    Not exactly and not only Windows.
    Just HID devices.
    You can connect HID devices without pairing, but bonding is required for the operating system to reroute HID reports to all applications.

  5. ayan4m1 commented on Feb 26, 2026

    @ayan4m1
    Author

    This seems to be an specific issue with Windows 11 2025H2 (not other versions). This is how I fixed it:

    Go to Settings > System > Recovery > Fix problems using Windows Update > Reinstall now.

    Sorry, I'm not reinstalling my entire copy of Windows to fix this. That's very disappointing. Thanks.

  6. afpineda commented on Feb 26, 2026

    @afpineda
    Contributor

    Sorry, I'm not reinstalling my entire copy of Windows to fix this. That's very disappointing. Thanks.

    That's not a reinstall, but another patch. It takes less than an hour and is not destructive.

  7. axa88 commented on Feb 28, 2026

    @axa88

    If I'm not mistaken I don't think windows will connect to a device that doesn't have bonding enabled.

    I should clarify. while I'm confident connection is possible without bonding, this is of course only relevant if both devices agree to not to ask/require a bond upon connection or data exchange. Confirm your client doesn't attempt to pair and hang as you're not handling the request.
    To do this , you could simply set with a NimBLEServerCallbacks and verify the device isn't requesting authenticated pair and you're not handling it.

    Edit: just ran some test with this library, indeed a bond is not needed to connect.

  8. h2zero commented on Mar 18, 2026

    @h2zero
    Owner

    @ayan4m1 I tested your code and was able to connect to a windows 11 desktop, is this still an issue?

  9. ayan4m1 commented on Mar 18, 2026

    @ayan4m1
    Author

    It is still not working for me, but I've given up on doing this in Arduino and moved to ESP-IDF.

  10. h2zero commented on Mar 18, 2026

    @h2zero
    Owner

    Fair enough are you using https://github.com/h2zero/esp-nimble-cpp in IDF?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions