mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
docs: annotate basic portal flow
This commit is contained in:
@@ -21,11 +21,16 @@ WiFiManager wifi;
|
|||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
|
||||||
|
// Leave the temporary setup portal available for three minutes.
|
||||||
wifi.setConfigPortalTimeout(180);
|
wifi.setConfigPortalTimeout(180);
|
||||||
|
|
||||||
|
// Reconnect to saved Wi-Fi, or open the setup portal when none works.
|
||||||
wifi.autoConnect("Device Setup", "change-me");
|
wifi.autoConnect("Device Setup", "change-me");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
// Service portal requests and connection state without blocking firmware work.
|
||||||
wifi.process();
|
wifi.process();
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -38,9 +43,7 @@ WiFiManager remains a standalone provisioning library. If a device also needs
|
|||||||
persistent configuration, MQTT, Home Assistant discovery, OTA, mDNS, and an
|
persistent configuration, MQTT, Home Assistant discovery, OTA, mDNS, and an
|
||||||
optional local web UI, see
|
optional local web UI, see
|
||||||
[DeviceFramework](https://github.com/alexhopeoconnor/DeviceFramework), which
|
[DeviceFramework](https://github.com/alexhopeoconnor/DeviceFramework), which
|
||||||
integrates this portal as part of that larger device lifecycle. A
|
integrates this portal as part of that larger device lifecycle.
|
||||||
DeviceFramework sketch includes DeviceFramework and calls its `setup()` and
|
|
||||||
`loop()` APIs; do not create a second `WiFiManager` instance alongside it.
|
|
||||||
|
|
||||||
## Make it yours
|
## Make it yours
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user