Skip to content

Cannot connect to GATT server using Windows 11 #1091

@ayan4m1

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.

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