Skip to content

ESP32 BLE Client Cannot Find Services

DodaTech Updated 2026-06-26 1 min read

In this tutorial, you'll learn about ESP32 BLE Client Cannot Find Services. We cover key concepts, practical examples, and best practices.

The Problem

ESP32 BLE client connects to a device but cannot discover services or characteristics.

Quick Fix

Wrong

BLEClient* pClient = BLEDevice::createClient();
pClient->connect(peerAddress);
BLERemoteService* pService = pClient->getService("180D");
GATT ERROR: Service 180D not found
Returns NULL pointer, crash on dereference
BLEClient* pClient = BLEDevice::createClient();
pClient->setClientCallbacks(new MyClientCallback());
pClient->connect(peerAddress);
if (pClient->isConnected()) {
  BLERemoteService* pService = pClient->getService(NimBLEUUID("180D"));
  if (pService != nullptr) {
    BLERemoteCharacteristic* pChar = pService->getCharacteristic("2A37");
    Serial.println("Service and characteristic found");
  }
}
Service and characteristic found

Prevention

Always check isConnected() before service discovery. Set client callbacks for connection events. Verify the UUID format (16-bit vs 128-bit). Add a connection timeout. Handle NULL returns from getService() gracefully.

DodaTech engineers apply these same patterns when building Doda Browser's networking stack, DodaZIP's firmware packaging pipeline, and Durga Antivirus Pro's sensor communication layer.

FAQ

### Why does getService return NULL?

The remote device may not support the requested UUID, or the device disconnected during discovery. Always check the return value before using it.

How do I scan for BLE devices as a client?

Use BLEDevice::getScan() to create a scan, set callbacks for onResult, and start scanning with active scan mode.

Can ESP32 connect to multiple BLE devices?

Yes, ESP32 supports up to 9 BLE clients simultaneously. Create separate BLEClient instances for each connection.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro