BLE_server example compiler error

when I load the > ESP32 BLE Arduino / BLE_server example sketch I get the following compiler error:

Through much trial and error I have learned that the problem is due to the ArduinoBLE.h library - which is NOT included - in the BLE_server sketch. More specifically, it is the version number of the ArduinoBLE.h library that is the problem.

If I use version ArduinoBLE 1.3.1 and not the latest version, the error vanishes.

I am using the latest ESP32 library as seen next:

Can someone shed some light on this?

Thanks!

It was not my intent to post this thread here. I tried to delete it and move it to General but could not.

If someone could move it to General that would be great.

Thanks!

Move the Post

Either you can move the post. Deletion is not possible. To move a post, you need to select the new category up here.

The Post

Also, of course you wrote where you got the code from, but it would always be easier to post it directly here.

To avoid conflicts when using an ESP32 , I have found it best to change the library properties file of the Arduino BLE library so that it is not used with the ESP32.

In the ArduinoBLE library properties file I have saved this change.

//architectures=samd,megaavr,mbed,apollo3,mbed_nano,mbed_portenta,mbed_nicla,esp32,mbed_giga
architectures=samd,megaavr,mbed,apollo3,mbed_nano,mbed_portenta,mbed_nicla,mbed_giga
includes=ArduinoBLE.h

In my experience, inspite of the claimed compatibility, I think it best to use the esp library with the esp32 and the Arduino library with the other platforms.

Thanks for your help. I tried your suggestions but could not get it to work. I have asked the moderator for help.

Thanks again.

Thank you so much for your post. I will definitely do as you suggested.

What I fail to understand is why the ArduinoBLE.h is called/triggered when it is not an included library in the BLE_server example sketch?

BLE_server_xmple_libs

I looked at all the code in each of those libraries and ArduinoBLE.h is not 'included' anywhere that I saw.

Out of curiosity I 'included' the ESP32 lib to this same sketch and got the following lib:

dummy_lib?

Is this the 'esp library' you were referring to?

Thank you again for your help

#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>

There is a file named BLEDevice.h which is part of the ArduinoBLE library as well as the ESP32 BLE Arduino library. It is getting used by the compiler.

Is this the 'esp library' you were referring to?

I'm not certain what you mean. In the esp 32 core for Arduino there is a included library called BLE.

C:\Users\YourName\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.7\libraries\BLE

I'm not clear if you are trying to compile code for an ESP32 or a Nano33 IoT?

I apologize for the confusion.

I included the ESP32 library as follows:

and the following library appeared in my sketch:

dummy_lib? copy

So I'm not certain what functionality that 'dummy.h' library contains.

I am using is an ESP32 microcontroller. Posting to the NANO33 forum was a mistake as noted earlier.

This odyssey began by trying to figure out how to wake a ESP32 board from deep sleep with BLE - which I now believe is not possible - thus my opening the ESP32 BLE Arduino / BLE_server example sketch because a server sketch example does not exist in the Examples / ESP32 folder.

Thanks once again for your help.

Topic moved as requested

You appear to be running the BLE_server.ino example from the examples path in the ide when EPS32 is board selected

File>Examples>ESP32 BLE Arduino>BLE_server

I do not know why you are trying #include ESP32, but this is why you see dummy.h
https://github.com/espressif/arduino-esp32/blob/master/libraries/ESP32/src/dummy.h

There are individual libraries in ESP32 which should be included by name.

This odyssey began by trying to figure out how to wake a ESP32 board from deep sleep with BLE - which I now believe is not possible

Mr. Google should be able to tell you.

Thank you!!

I am now a bit wiser about all of this. Thanks again for your help.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.