Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improv BLE example #19

Open
clau-bucur opened this issue Nov 21, 2023 · 3 comments
Open

Improv BLE example #19

clau-bucur opened this issue Nov 21, 2023 · 3 comments

Comments

@clau-bucur
Copy link

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?

@zehnm
Copy link

zehnm commented Jan 12, 2024

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 :-)

@zehnm
Copy link

zehnm commented Jan 26, 2024

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.

  • Connection to the device with https://www.improv-wifi.com/ works and WiFi provisioning dialog is shown.
  • Capablilites, current state, and error state can be read
  • Identify command works
  • WiFi credentials are received

Still missing: whole WiFi sta handling logic, RPC result and state timeouts

@zehnm
Copy link

zehnm commented Jan 28, 2024

Work in progress example project for ESP32 with IDF 5.1.2 and NimBLE: https://github.com/zehnm/idf-improv-wifi-ble

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants