Page 1 of 1

ESP-WROOM-32D and ESP-WROOM-32E not find advertisements that older ESP32-WROOM-32 does

Posted: Mon Jun 21, 2021 10:18 pm
by schmid.johnny
When scanning for BLE devices the new ESP32-WROOM board does not find one of the BLE devices that an older ESP32 finds. Both boards run the exact same code and get different results. How do I go about tracking down why the radio in the new ESP32s is failing to return the advertisements?

Device Info

ESP32-WROOM-32
This is ESP32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 1, 4MB external flash

ESP-WROOM-32D
This is ESP32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 1, 4MB external flash

ESP-WROOM-32E
This is ESP32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 3, 4MB external flash

Output from ESP32-WROOM-32 via advertisedDevice.toString().c_str() in Scanner Advertisement Callback
Found Advertisements
Name: 709-BT , Address: 00:a0:50:0e:69:15, manufacturer data: 31010e69150220323530323430333200, serviceUUID: 0000180a-0000-1000-8000-00805f9b34fb, serviceUUID: 00000000-0000-1000-8000-00805f9b34f1

My Phone and BLE Scanner have no problems detecting the device.

Example Advertisement Packets

0000 d6 be 89 8e 00 25 15 69 0e 50 a0 00 02 01 06 09
0010 09 37 30 39 2d 42 54 20 20 11 ff 31 01 0e 69 15
0020 03 4f 50 4e 30 33 33 31 30 30 00 9b be d7

0000 d6 be 89 8e 00 25 15 69 0e 50 a0 00 02 01 06 09
0010 09 37 30 39 2d 42 54 20 20 11 ff 31 01 0e 69 15
0020 0d 31 33 36 31 32 38 32 35 36 00 96 59 cd

Scan Initialization

void ScanForBT709TankMonitor_BTDevices (void * parameter) {
ESP_LOGI(_module, "ScanForBT709TankMonitor_BTDevices on %d", xPortGetCoreID());

const String btnName = "btnSensor";
String key = "";

BLEDevice::init("BaseCamp");
BT709TankMonitorBLEAdv adv = BT709TankMonitorBLEAdv(Serial);
BLEScan* pBLEScan = BLEDevice::getScan();
_pBLEScan = pBLEScan;
pBLEScan->setAdvertisedDeviceCallbacks(&adv, false, true);
pBLEScan->setActiveScan(true);
BLEScanResults foundDevices = pBLEScan->start(1, false);

ESP_LOGI(_module, "ScanForBT709TankMonitor_Scan Complete %d on %d", adv.Count, xPortGetCoreID());

if(adv.Count > 0)
{
for(int ii=0; ii < adv.Count; ii++) {
key = btnName + String(ii + 1) + ".txt=";

String address = _bt709Adv->Devices[ii].toString().c_str();

_nextConn.Send(key, address);
}

_nextConn.Send("isDirty_9.val=", 1);

}

ESP_LOGI(_module, "ScanForBT709TankMonitor_DisposeOfBLE", xPortGetCoreID());

if(pBLEScan != nullptr && _pBLEScan == nullptr) {
pBLEScan->stop();
pBLEScan->clearResults();
pBLEScan = nullptr;
_pBLEScan = nullptr;
BLEDevice::deinit();
}

ESP_LOGI(_module, "ScanForBT709TankMonitor_DisposeOfBLE_Complete", NULL);

delay(500);

if(_bleScanTask != NULL) {
ESP_LOGI(_module, "ScanForBT709TankMonitor_Deinitalizing deleting task", NULL);
TaskHandle_t xTask = _bleScanTask;
_bleScanTask = NULL;
vTaskDelete(xTask);
}
}