Open clau-bucur opened 11 months ago
I would also highly appreciate a simple BLE example for ESP32 or Arduino to get started quickly. Something like this serial demo but for BLE would be perfect: https://jnthas.github.io/improv-wifi-demo/.
Improv Wi-Fi seems a like a perfect fit for a project I'm working on, but the entry barrier is a bit high (outside of ESPHome). Maybe it's super simple for BLE experts, but I haven't done any BLE stuff yet :-)
I got my hands dirty and started learning BLE and developing an improv-wifi example for ESP32 with IDF 5.1 and NimBLE. Once the fundamentials are working I'll release it (Apache-2.0) so others don't have to go through the same pain.
Current state:
Advertisement works and looks identical to the ESP Web Tools firmware.
Note to the https://www.improv-wifi.com/ble/ authors: please improve the Bluetooth LE Advertisement
section with the correct terms, especially:
If the device cannot fit all of its advertising data in 31 bytes, it should cycle between advertising data.
As a BLE noob this led me on a quest what "cycle" means :-) Couldn't find anything in the BLE specs. Cycle each advertisement with different data, but how? Then thought maybe it's the BLE 5 extended advertisement... only to find out that web-bluetooth doesn't support it.
It's all clear now, but that was quite confusing. I suggest to replace "cycle" with setting the improv UUID & service data in the advertisement data, and all the rest like local name etc. in the advertisement response.
Still missing: whole WiFi sta handling logic, RPC result and state timeouts
Work in progress example project for ESP32 with IDF 5.1.2 and NimBLE: https://github.com/zehnm/idf-improv-wifi-ble
Trying to use Improv with BLE adoption, but can't find any examples other than the ESPHome implementation (which is a bit too complex for my limited understanding).
Do you have some simple example of a BLE implementation?