Hi,
I’ve opened the Examples->ESP BLE Arduino ->BLE_notify sketch and tried to upload it to my ESP32 module.
The sketch seems to have an error at line 55: BLEDevice::init(“ESP32”). The error message is as such: “‘init’ is not a member of ‘BLEDevice’
How can it rectify the error so that I can continue on the learnig?
Thanks
Hi.
What version of the ESP32 boards do you have installed? In the Arduino IDE, go to Tools > Board > Boards Manager, search for ESP32 and tell me which version of the ESP32 boards you have installed.
Regards,
Sara
Hi Sara,
Thanks for your response. I’ve the ESP32 DEVKIT V1 30 pins and also 32 pin versions both had the same error issues. After browsing on the internet to look for answer, I chanced upon one who reported similar issue and the solution provider mentioned that the problem like this could be due to Arduino “library discovery system” is using the incorrect # include directive due to multiple libraries.
I check my installation and realize that I had two copies of the ESP32 BLE Arduino both in the hidden “AppData\local\Arduino15\…….\BLE\examples\BLE_notify” directory and in another in the Sketchbook location. This was probably caused by me doing another library installation although it was indicated that the BLE library is now part of the Arduino installation package.
I’ve deleted the sketchbook location copy and the issue no longer exist. I was able to continue with the exercise.
It was painful trying to find the answer to the cause and solution to resolve it. Perhaps some advice could be noted in the training package to pay attention to this type issue during installation of the Arduino package.
Thanks
Please treat this issue as closed
Hi.
I’m glad you were able to found the issue and I’m sorry for the confusion.
In all our tutorials, you only need to install the libraries we mention. All other libraries used in the code that we don’t mention are already included by default.
Regards,
Sara
I’m having the same problem. I deleted and then reloaded the library. both the library and sketch are by Neil Kolban. I have the same ESP32 Dev Module that is recommended for the course. and getting the same error
In file included from /Users/judsonbelmont/Documents/Arduino/libraries/ESP32_BLE_Arduino/src/BLEAdvertising.h:15,
from /Users/judsonbelmont/Documents/Arduino/libraries/ESP32_BLE_Arduino/src/BLEServer.h:19,
from /private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:23:
/Users/judsonbelmont/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);
^~~~~~~~~~~~~~
In file included from /Users/judsonbelmont/Documents/Arduino/libraries/ESP32_BLE_Arduino/src/BLECharacteristic.h:17,
from /Users/judsonbelmont/Documents/Arduino/libraries/ESP32_BLE_Arduino/src/BLEServer.h:20,
from /private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:23:
/Users/judsonbelmont/Documents/Arduino/libraries/ESP32_BLE_Arduino/src/BLEDescriptor.h:25:7: error: redefinition of ‘class BLEDescriptor’
class BLEDescriptor {
^~~~~~~~~~~~~
In file included from /Users/judsonbelmont/Documents/Arduino/libraries/ArduinoBLE/src/BLECharacteristic.h:25,
from /Users/judsonbelmont/Documents/Arduino/libraries/ArduinoBLE/src/BLEService.h:23,
from /Users/judsonbelmont/Documents/Arduino/libraries/ArduinoBLE/src/BLEDevice.h:25,
from /private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:22:
/Users/judsonbelmont/Documents/Arduino/libraries/ArduinoBLE/src/BLEDescriptor.h:28:7: note: previous definition of ‘class BLEDescriptor’
class BLEDescriptor {
^~~~~~~~~~~~~
In file included from /Users/judsonbelmont/Documents/Arduino/libraries/ESP32_BLE_Arduino/src/BLEServer.h:20,
from /private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:23:
/Users/judsonbelmont/Documents/Arduino/libraries/ESP32_BLE_Arduino/src/BLECharacteristic.h:53:7: error: redefinition of ‘class BLECharacteristic’
class BLECharacteristic {
^~~~~~~~~~~~~~~~~
In file included from /Users/judsonbelmont/Documents/Arduino/libraries/ArduinoBLE/src/BLEService.h:23,
from /Users/judsonbelmont/Documents/Arduino/libraries/ArduinoBLE/src/BLEDevice.h:25,
from /private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:22:
/Users/judsonbelmont/Documents/Arduino/libraries/ArduinoBLE/src/BLECharacteristic.h:45:7: note: previous definition of ‘class BLECharacteristic’
class BLECharacteristic {
^~~~~~~~~~~~~~~~~
In file included from /Users/judsonbelmont/Documents/Arduino/libraries/ESP32_BLE_Arduino/src/BLEServer.h:21,
from /private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:23:
/Users/judsonbelmont/Documents/Arduino/libraries/ESP32_BLE_Arduino/src/BLEService.h:49:7: error: redefinition of ‘class BLEService’
class BLEService {
^~~~~~~~~~
In file included from /Users/judsonbelmont/Documents/Arduino/libraries/ArduinoBLE/src/BLEDevice.h:25,
from /private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:22:
/Users/judsonbelmont/Documents/Arduino/libraries/ArduinoBLE/src/BLEService.h:28:7: note: previous definition of ‘class BLEService’
class BLEService {
^~~~~~~~~~
/private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino: In function ‘void setup()’:
/private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:56:14: error: ‘init’ is not a member of ‘BLEDevice’
BLEDevice::init(“ESP32”);
^~~~
/private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:59:24: error: ‘createServer’ is not a member of ‘BLEDevice’
pServer = BLEDevice::createServer();
^~~~~~~~~~~~
/private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:66:31: error: ‘class BLEService’ has no member named ‘createCharacteristic’; did you mean ‘addCharacteristic’?
pCharacteristic = pService->createCharacteristic(
^~~~~~~~~~~~~~~~~~~~
addCharacteristic
/private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:68:42: error: ‘PROPERTY_READ’ is not a member of ‘BLECharacteristic’
BLECharacteristic::PROPERTY_READ |
^~~~~~~~~~~~~
/private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:69:42: error: ‘PROPERTY_WRITE’ is not a member of ‘BLECharacteristic’
BLECharacteristic::PROPERTY_WRITE |
^~~~~~~~~~~~~~
/private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:70:42: error: ‘PROPERTY_NOTIFY’ is not a member of ‘BLECharacteristic’
BLECharacteristic::PROPERTY_NOTIFY |
^~~~~~~~~~~~~~~
/private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:71:42: error: ‘PROPERTY_INDICATE’ is not a member of ‘BLECharacteristic’
BLECharacteristic::PROPERTY_INDICATE
^~~~~~~~~~~~~~~~~
/private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:76:47: error: no matching function for call to ‘BLECharacteristic::addDescriptor(BLE2902*)’
pCharacteristic->addDescriptor(new BLE2902());
^
In file included from /Users/judsonbelmont/Documents/Arduino/libraries/ArduinoBLE/src/BLEService.h:23,
from /Users/judsonbelmont/Documents/Arduino/libraries/ArduinoBLE/src/BLEDevice.h:25,
from /private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:22:
/Users/judsonbelmont/Documents/Arduino/libraries/ArduinoBLE/src/BLECharacteristic.h:91:8: note: candidate: ‘void BLECharacteristic::addDescriptor(BLEDescriptor&)’
void addDescriptor(BLEDescriptor& descriptor);
^~~~~~~~~~~~~
/Users/judsonbelmont/Documents/Arduino/libraries/ArduinoBLE/src/BLECharacteristic.h:91:8: note: no known conversion for argument 1 from ‘BLE2902*’ to ‘BLEDescriptor&’
/private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:79:13: error: ‘class BLEService’ has no member named ‘start’
pService->start();
^~~~~
/private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:82:45: error: ‘getAdvertising’ is not a member of ‘BLEDevice’
BLEAdvertising *pAdvertising = BLEDevice::getAdvertising();
^~~~~~~~~~~~~~
/private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:86:14: error: ‘startAdvertising’ is not a member of ‘BLEDevice’
BLEDevice::startAdvertising();
^~~~~~~~~~~~~~~~
/private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino: In function ‘void loop()’:
/private/var/folders/t0/g2705rvn0915yxrngsl44y_40000gn/T/.arduinoIDE-unsaved2023621-21139-tei6pa.fu3zr/BLE_notify/BLE_notify.ino:94:26: error: ‘class BLECharacteristic’ has no member named ‘notify’
pCharacteristic->notify();
^~~~~~
Multiple libraries were found for “BLEDevice.h”
Used: /Users/judsonbelmont/Documents/Arduino/libraries/ArduinoBLE
Not used: /Users/judsonbelmont/Documents/Arduino/libraries/ESP32_BLE_Arduino
Not used: /Users/judsonbelmont/Library/Arduino15/packages/esp32/hardware/esp32/2.0.9/libraries/BLE
Multiple libraries were found for “BLEServer.h”
Used: /Users/judsonbelmont/Documents/Arduino/libraries/ESP32_BLE_Arduino
Not used: /Users/judsonbelmont/Library/Arduino15/packages/esp32/hardware/esp32/2.0.9/libraries/BLE
exit status 1
Compilation error: ‘init’ is not a member of ‘BLEDevice’
I deleted the copies of the sketch I had moved to my sketchbook which made no difference. Can you direct me? thank you.
Hi.
What is the version of the ESP32 that you have installed and what is the example that you’re running?
To check the ESP32 version, go to Tools > Board > Boards Manager, search for ESP32 and check the version you have installed.
Regards,
Sara
Sarah, many thanks. I deleted “/Users/judsonbelmont/Documents/Arduino/libraries/ESP32_BLE_Arduino”
and all is happy now. I don’t understand why the IDE would choose that file while I was “including” the correct library before loading. Interesting in that the folder and file were in the sketchbook and not in the libraries where I was looking.