mirror of
https://github.com/revspace/operame
synced 2024-10-31 21:47:30 +00:00
More detailed on-screen portal instructions
This commit is contained in:
parent
e9c6cd49ec
commit
7b989eda31
49
operame.ino
49
operame.ino
@ -237,22 +237,55 @@ void setup() {
|
||||
display_big("WiFi mislukt!", TFT_RED);
|
||||
delay(2000);
|
||||
};
|
||||
static int portal_phase = 0;
|
||||
WiFiSettings.onPortalView = [] {
|
||||
if (portal_phase < 2) portal_phase = 2;
|
||||
};
|
||||
WiFiSettings.onConfigSaved = [] {
|
||||
portal_phase = 3;
|
||||
};
|
||||
WiFiSettings.onPortalWaitLoop = [] {
|
||||
if (WiFi.softAPgetStationNum()) {
|
||||
display_lines({
|
||||
"Volg instructies op",
|
||||
"smartphone.",
|
||||
"(login-notificatie)"
|
||||
}, TFT_WHITE, TFT_BLUE);
|
||||
} else {
|
||||
if (WiFi.softAPgetStationNum() == 0) portal_phase = 0;
|
||||
else if (! portal_phase) portal_phase = 1;
|
||||
|
||||
switch (portal_phase) {
|
||||
case 0: {
|
||||
display_lines({
|
||||
"Voor configuratie,",
|
||||
"verbind met WiFi",
|
||||
"\"" + WiFiSettings.hostname + "\"",
|
||||
"met een smartphone."
|
||||
}, TFT_WHITE, TFT_BLUE);
|
||||
if (millis() > 10*60*1000) ESP.restart();
|
||||
break ;
|
||||
}
|
||||
case 1: {
|
||||
display_lines({
|
||||
"Volg instructies op",
|
||||
"uw smartphone.",
|
||||
"(inlog-notificatie)"
|
||||
}, TFT_WHITE, TFT_BLUE);
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
display_lines({
|
||||
"Wijzig instellingen",
|
||||
"en klik op \"Save\".",
|
||||
"(rechtsonder)"
|
||||
}, TFT_WHITE, TFT_BLUE);
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
display_lines({
|
||||
"Wijzig instellingen",
|
||||
"en klik op \"Save\".",
|
||||
"Of \"Restart device\"",
|
||||
"als u klaar bent."
|
||||
}, TFT_WHITE, TFT_BLUE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (portal_phase == 0 && millis() > 10*60*1000) ESP.restart();
|
||||
|
||||
if (ota_enabled) ArduinoOTA.handle();
|
||||
if (!digitalRead(portalbutton)) {
|
||||
delay(50);
|
||||
|
@ -22,11 +22,14 @@ targets = upload
|
||||
monitor_speed = 115200
|
||||
#upload_speed = 460800
|
||||
lib_deps =
|
||||
ESP-WiFiSettings @^3.5
|
||||
# ESP-WiFiSettings @^3.6
|
||||
https://github.com/Juerd/ESP-WiFiSettings/
|
||||
MH-Z19
|
||||
TFT_eSPI
|
||||
MQTT
|
||||
|
||||
build_flags =
|
||||
# -DCORE_DEBUG_LEVEL=5
|
||||
-DUSER_SETUP_LOADED=1
|
||||
-DST7789_DRIVER=1
|
||||
-DCGRAM_OFFSET=1
|
||||
|
Loading…
Reference in New Issue
Block a user