Skip to content

ESP32 Classic Bluetooth Not Discoverable

DodaTech Updated 2026-06-26 1 min read

In this tutorial, you'll learn about ESP32 Classic Bluetooth Not Discoverable. We cover key concepts, practical examples, and best practices.

The Problem

ESP32 Bluetooth Classic does not appear in device scans or fails to pair with phones.

Quick Fix

Wrong

#include "esp_bt_main.h"
void setup() {
  esp_bluedroid_init();
}
Device not visible to phone scans. Bluetooth initializes but no name appears.
#include "esp_bt.h"
#include "esp_bt_main.h"
#include "esp_bt_device.h"
void setup() {
  esp_bt_controller_mem_release(ESP_BT_MODE_BTDM);
  esp_bt_controller_config_t cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
  esp_bt_controller_init(&cfg);
  esp_bt_controller_enable(ESP_BT_MODE_CLASSIC_BT);
  esp_bluedroid_init();
  esp_bluedroid_enable();
  esp_bt_dev_set_device_name("ESP32-Classic");
  esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_GENERAL_DISCOVERABLE);
  Serial.println("Bluetooth Classic ready");
}
Bluetooth Classic ready
(Phone scans show "ESP32-Classic" in Bluetooth devices)

Prevention

Release BLE memory first with esp_bt_controller_mem_release(). Initialize BT controller with ESP_BT_MODE_CLASSIC_BT. Set device name before making discoverable. Use both CONNECTABLE and DISCOVERABLE scan modes. Register callback handlers for pairing events.

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

### Can ESP32 run BLE and Classic Bluetooth simultaneously?

Yes, use ESP_BT_MODE_BTDM mode. Both stacks consume about 1.4 MB of memory. You may need to adjust the partition table for larger flash.

What is the range of ESP32 Classic Bluetooth?

Classic Bluetooth range is about 10 meters indoors. External antenna can extend to 30 meters but expect higher power consumption.

How do I handle incoming connections?

Register a callback with esp_bt_gap_register_callback() for ESP_BT_GAP_AUTH_CMPL_EVT and ESP_BT_GAP_PIN_REQ_EVT events to complete pairing.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro