Skip to content

ESP32 BLE Advertisement Data Wrong

DodaTech Updated 2026-06-26 1 min read

In this tutorial, you'll learn about ESP32 BLE Advertisement Data Wrong. We cover key concepts, practical examples, and best practices.

The Problem

ESP32 BLE advertisement data is malformed, truncated, or does not include the intended service UUID.

Quick Fix

Wrong

BLEAdvertising* pAdv = BLEDevice::getAdvertising();
pAdv->start();
// No service UUID set, no device name in advertisement
Device appears as "Unknown" with no services listed in scanner.
BLEAdvertising* pAdv = BLEDevice::getAdvertising();
pAdv->addServiceUUID("4fafc201-1fb5-459e-8fcc-c5c9c331914b");
pAdv->setScanResponse(true);
pAdv->setMinPreferred(0x06);
pAdv->setMaxPreferred(0x12);
pAdv->setAdvertisementType(ADV_TYPE_IND);
pAdv->start();
Device found: "ESP32-BLE" with service 4fafc201-1fb5-459e-8fcc-c5c9c331914b

Prevention

Always add service UUIDs to the advertisement. Set advertisement type to ADV_TYPE_IND for general discoverability. Use manufacturer-specific data for custom payloads. Keep advertisement data under 31 bytes (BLE limit). Enable scan response for additional data.

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

### How much data can BLE advertise?

Standard BLE advertisement packets are limited to 31 bytes. Additional data up to 31 bytes can be sent in the scan response.

What is the difference between ADV_IND and ADV_NONCONN_IND?

ADV_IND (general discoverable) accepts connections. ADV_NONCONN_IND (non-connectable) only broadcasts data without accepting connections, used for beacons.

How do I set custom advertisement data?

Use BLEAdvertisementData class: setAdvertisementData() with a BLEAdvertisementData object containing custom manufacturer data or service data.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro