Using ArduinoBLE -

I have a BLE project that compiles and works using the original nkolban libraries, but as it’s been incorporated into Arduino core it seemed to be sensible to use that.
So, removing the old headers and adding the Arduino.h

#include <ArduinoBLE.h>

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

Following the published example I can see I get errors as shown…

image

I have installed the ArduinoBLE library.
I am using ESP32 with the Arduino framework - can I validly use the current ArduinoBLE or must I continue with nkolban ESP32 BLE Arduino library?
Is there a working PIO example of a BLE sensor anywhere using ArduinoBLE.h , or suggestions as to why I see those errors.

In which library is BLEDevice::address() an existing API?

When I look into Arduino-ESP32’s BLE library it says

there’s a getAddress() but no address().

I see also see no .address() function in the NKolban version version of the library

(and none of them have the .connected() function or the bool conversion operator)

I’m just following this… and online examples

Well as ArduinoBLE - Arduino Reference says

This library supports all the Arduino boards that have the hardware enabled for BLE and Bluetooth 4.0 and above; these include Nano 33 BLE, Arduino NANO 33 IoT, Uno WiFi Rev 2, MKR WiFi 1010.

They are refering to the library version made by Arduino here. That has these functions

The ArduinoBLE library version built into the Arduino-ESP32 version does not have these functions, as shown above.

You need to program against the functions that are actually existant in the library you’re using. Look into the examples folder of that library.

1 Like