- C++ 99.3%
- CMake 0.7%
|
|
||
|---|---|---|
| docs | add support to esp8266 | |
| examples | add support to esp8266 | |
| src | Merge branch 'jnthas:main' into main | |
| .gitignore | add support to esp8266 | |
| CMakeLists.txt |
Create Improv-WiFi-Library component for ESP-IDF.
|
|
| library.json | added flag to explicitly enable BLE support, removed nimble-arduino dependency | |
| library.properties | added flag to explicitly enable BLE support, removed nimble-arduino dependency | |
| LICENSE | Update LICENSE | |
| README.md | added flag to explicitly enable BLE support, removed nimble-arduino dependency | |
Improv WiFi Library
Improv is a free and open standard with ready-made SDKs that offer a great user experience to configure Wi-Fi on devices. More details here.
This library provides an easier way to handle the Improv serial protocol in your firmware, allowing you to configure the WiFi via web browser as in the following example.
Simplest use example:
#include <ImprovWiFiLibrary.h>
ImprovWiFi improvSerial(&Serial);
void setup() {
improvSerial.setDeviceInfo(ImprovTypes::ChipFamily::CF_ESP32, "My-Device-9a4c2b", "2.1.5", "My Device");
}
void loop() {
improvSerial.handleSerial();
}
Bluetooth Support (Optional)
You can also use Improv over Bluetooth (uses about 25kb memory). BLE support is optional and must be explicitly enabled.
Enabling BLE Support
To enable BLE functionality, you need to:
-
Add the build flag to your
platformio.ini:build_flags = -DIMPROV_WIFI_BLE_ENABLED -
Add the NimBLE-Arduino dependency to your
platformio.ini:lib_deps = h2zero/NimBLE-Arduino@^2.3.7
Note: BLE is not supported on ESP32-S2 and ESP32-C2 as these chips lack Bluetooth hardware. Only enable BLE for chips that support it (ESP32, ESP32-C3, ESP32-S3).
Example with BLE enabled:
#include <ImprovWiFiBLE.h>
ImprovWiFiBLE improvBLE;
void setup() {
improvBLE.setDeviceInfo(ImprovTypes::ChipFamily::CF_ESP32, "My-Device-9a4c2b", "2.1.5", "My Device");
}
void loop() {
}
Using both Serial and BLE:
#include <ImprovWiFiLibrary.h>#ifdef IMPROV_WIFI_BLE_ENABLED
#include <ImprovWiFiBLE.h>#endif
ImprovWiFi improvSerial(&Serial);
#ifdef IMPROV_WIFI_BLE_ENABLED
ImprovWiFiBLE improvBLE;
#endif
void setup() {
improvSerial.setDeviceInfo(ImprovTypes::ChipFamily::CF_ESP32, "My-Device-9a4c2b", "2.1.5", "My Device");
#ifdef IMPROV_WIFI_BLE_ENABLED
improvBLE.setDeviceInfo(ImprovTypes::ChipFamily::CF_ESP32, "My-Device-9a4c2b", "2.1.5", "My Device");
#endif
}
void loop() {
improvSerial.handleSerial();
}
Documentation
The full library documentation can be seen in docs/ folder.
License
This open source code is licensed under the MIT license (see LICENSE for details).