Skip to content

Simple library for BLE station using ESP32 in Arduino IDE

License

Notifications You must be signed in to change notification settings

NikitaS2001/StationESP32Ble

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32BleAdvertise

Simple library of a BLE advertise using ESP32 in Arduino.

Usage

Simple example:

void setup() {
    ble.begin("ESP32-BLE");  //sets the device name
}

void loop() {
    String str = String(random(0, 1000));
    ble.advertise(str);   // advertises a random number on Manufacturer Data field
    delay(1000);
}

Service data:

    String str = String(random(0, 1000));
    ble.serviceAdvertise(str);   // advertises a random number on Service Data field

Downloading and Installing

Click on the green button "Clone or download" and download as a zip file. In Arduino Studio, click in Sketch > Include Library > Add .ZIP Library and select the file you've just downloaded.

Debugging and visualizing data

Check out this Android app, works very well for debugging this application: https://play.google.com/store/apps/details?id=uk.co.alt236.btlescan&hl=en You will see the advertise data at "Manufacturer Specific Data" or in "Service Data", depending on how you published your data.

Tips

Be aware of the limitations of the BLE broadcast in terms of the message size. Your advertise data should not be bigger than 20 bytes and the name of the device should not be bigger than 20 bytes.

TODOs

  • Being able to change the UUID

About

Simple library for BLE station using ESP32 in Arduino IDE

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%