Skip to content

zehnm/idf-improv-wifi-ble

Repository files navigation

ESP32 Improv WiFi BLE

This project demonstrates the use of Improv WiFi via Bluetooth Low Energy communication on an ESP32 board.

Motivation

The main motivation for this project was to learn BLE communication and to evaluate Improv WiFi BLE for a project I'm working on. After using PlatformIO with the Arduino framework in the past for private and commercial projects, it was also time to finally embrace the IDF SDK.

Since I couldn't find any IDF implementations, I started this project and hope it will be useful to others. Please note, this is not an IDF component you can simply include in a project to get improv-wifi BLE support! It's mainly a playground to explore NimBLE and other features of the IDF SDK.

Status

Work in progress :-)

  • BLE advertisement works and looks identical to the ESP Web Tools firmware.
  • Connection to the device with https://www.improv-wifi.com/ works:
    • Authorization request (push the button) is shown if authorization is enabled.
    • WiFi provisioning dialog is shown if authorization is disabled.
  • Capabilities, current state, and error state can be read.
  • Identify command works (except with Chrome on Mac, see below).
  • WiFi credentials are received (except with Chrome on Mac, see below).
  • WiFi connection with received credentials.
  • Redirect link is sent back after successful connection

Open issues and missing features:

  • WiFi credentials are not persisted. They are only held in RAM and are not written to NVS.
  • Not all LED drivers are fully tested yet and LED patterns could be improved.

Development

Developed with Espressif IDF 5 and NimBLE.

Tested with:

  • ESP32 boards:
    • ✅ C6
    • ⁉️ ESP32-S:
      • IRAM size issue: use size-optimized build. TODO increase size.
      • Random stack overflow in task Tmr Svc panic: increasing CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH to 3000 seems to solve it.
  • Development environment:
    • Espressif IDF 5.1.2
    • Visual Studio Code with ESP-IDF extension
  • Browser based WiFi provisioning with https://www.improv-wifi.com/
    • ✅ Chrome 121 on an Android 9 tablet
    • ✅ Chrome 121 on Linux
    • ⛔️ Chrome 121 on macOS 13.6 M1: write call never reaches the peripheral: improv-wifi/sdk-ble-js#213

Configuration

Use the ESP-IDF SDK configuration editor (menuconfig) to configure features and options of improv-wifi:

  • Optional authorization through a GPIO push button.
  • Optional LED identification feature. Uses IDF LED Indicator component to support various LED drivers.
  • BLE device information advertisement data

About

ESP32 improv-wifi BLE example with IDF and NimBLE

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published