I'm starting a project : read an ADC value on ESP32 (peripheral) and send it over BLE to android (central). I'm a bit confused looking for proper libraries . I found at least 3 solutions/libraries
@1: #include <Adafruit_BluefruitLE_SPI.h>
@2: #include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>
@3: #include <ArduinoBLE.h>
It looks like the @3'rd one is most modern and officially published by Arduino IDE (see the link https://github.com/nkolban/ESP32_BLE_Arduino/tree/adc2aee2f0d01eb6b30dd5ad3589f2cc89934beb ), hence @2 has more examples then others.
Using @2 I can use .notify command to start publishing the value. Using @3 there is no documentation for this command, it looks like I should only use .writeValue and the .poll is taking care of publishing the value.
Also @3 is using setEventHandler , while @1 and @2 don't have this described.
Is it right to use @3 because it is officially published by Arduino IDE and has full documentation within Ardiuno IDE ?
It seems that only @2 is designed for ESP32 module. It's quite popular, for ESP32 it won't be a bad choice.
As a kickstart for @2, take a look at this project: BLEProof on gihtub - contains BLE Central & Peripheral for Android and ESP32, simple demo of BLE read, write and notify.
When starting a project, please choose the hardware wisely:
ESP32 with library @2 is a convenient way to prototype your project, but it's not an energy-efficient solution when you use only Bluetooth Low Energy. Also note that I don't have any experience with libraries @1 and @3.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With