I am trying to follow this article in order to create a BLE iBeacon out of my ESP32 board, but it keeps throwing a lot of errors about undefined types, even though I installed the correct library and the library has those types.
I compiled for the "DOIT ESP32 DEVKIT V1" and only got one error:
In function 'void setup()':
error: unused variable 'pServer'
BLEServer *pServer = BLEDevice::createServer(); // <-- no longer required to instantiate BLEServer, less flash and ram usage
^~~~~~~
After commenting out that line it compiled without error.
Maybe some library is not compatible with the S2 version of the processor? I tried to compile for "Adafruit Feather ESP32-S2" and got a bunch of errors with undefined variables, starting with:
libraries/BLE/src/BLEBeacon.h:33:2:
error: 'BLEUUID' does not name a type
BLEUUID getProximityUUID();
^~~~~~~
In file included from C:\Users\andre\Documents\Arduino\libraries\ESP32_BLE_Arduino\src/BLEAdvertising.h:15,
from C:\Users\andre\Documents\Arduino\libraries\ESP32_BLE_Arduino\src/BLEServer.h:19,
from C:\Users\andre\Documents\Arduino\libraries\ESP32_BLE_Arduino\src/BLEDevice.h:18,
from D:\BLE_iBeacon\BLE_iBeacon.ino:2:
C:\Users\andre\Documents\Arduino\libraries\ESP32_BLE_Arduino\src/FreeRTOS.h:61:28: error: 'ringbuf_type_t' has not been declared
Ringbuffer(size_t length, ringbuf_type_t type = RINGBUF_TYPE_NOSPLIT);
^~~~~~~~~~~~~~
Multiple libraries were found for "BLEDevice.h"
Used: C:\Users\andre\Documents\Arduino\libraries\ESP32_BLE_Arduino
Not used: C:\Users\andre\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.5\libraries\BLE
exit status 1
Error compiling for board ESP32 Dev Module.
What's even more strange is that it seems that if I monitor it in room-assistant, the id changes a bit
Summary
12/15/2022, 10:53:09 PM - error - BluetoothService: Failed to start advertising instance via BLE: Command Disallowed
12/15/2022, 10:53:19 PM - error - BluetoothService: Failed to start advertising instance via BLE: Command Disallowed
12/15/2022, 10:53:22 PM - info - BluetoothLowEnergyService: Discovered nearby BLE peripheral ESP32 as iBeacon with ID 644f76f76a5242bce911fd902c9bb987-0-2 and RSSI -65
12/15/2022, 10:53:30 PM - error - BluetoothService: Failed to start advertising instance via BLE: Command Disallowed
12/15/2022, 10:53:33 PM - info - BluetoothLowEnergyService: Discovered nearby BLE peripheral ESP32 as iBeacon with ID 644f76f76a5242bce911fd902c9bb987-0-3 and RSSI -68
12/15/2022, 10:53:40 PM - error - BluetoothService: Failed to start advertising instance via BLE: Command Disallowed
12/15/2022, 10:53:44 PM - info - BluetoothLowEnergyService: Discovered nearby BLE peripheral ESP32 as iBeacon with ID 644f76f76a5242bce911fd902c9bb987-0-4 and RSSI -70
12/15/2022, 10:53:51 PM - error - BluetoothService: Failed to start advertising instance via BLE: Command Disallowed
12/15/2022, 10:53:55 PM - info - BluetoothLowEnergyService: Discovered nearby BLE peripheral ESP32 as iBeacon with ID 644f76f76a5242bce911fd902c9bb987-0-5 and RSSI -69
12/15/2022, 10:54:01 PM - error - BluetoothService: Failed to start advertising instance via BLE: Command Disallowed
12/15/2022, 10:54:05 PM - info - BluetoothLowEnergyService: Discovered nearby BLE peripheral ESP32 as iBeacon with ID 644f76f76a5242bce911fd902c9bb987-0-6 and RSSI -67
12/15/2022, 10:54:12 PM - error - BluetoothService: Failed to start advertising instance via BLE: Command Disallowed
12/15/2022, 10:54:16 PM - info - BluetoothLowEnergyService: Discovered nearby BLE peripheral ESP32 as iBeacon with ID 644f76f76a5242bce911fd902c9bb987-0-7 and RSSI -67
12/15/2022, 10:54:22 PM - error - BluetoothService: Failed to start advertising instance via BLE: Command Disallowed
12/15/2022, 10:54:27 PM - info - BluetoothLowEnergyService: Discovered nearby BLE peripheral ESP32 as iBeacon with ID 644f76f76a5242bce911fd902c9bb987-0-8 and RSSI -70
No clue why, but at least it partially works. Thank you for the help.