mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 20:09:14 +03:00
Добавляем возможность установить SSID и пароль WiFi через get
http://192.168.4.1/set?routerssid=&routerpass=
This commit is contained in:
@@ -38,6 +38,22 @@ void standWebServerInit() {
|
|||||||
// HTTP.send(200, "text/plain", "ok");
|
// HTTP.send(200, "text/plain", "ok");
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
HTTP.on("/set", HTTP_GET, []() {
|
||||||
|
if (HTTP.hasArg(F("routerssid")) && WiFi.getMode() == WIFI_AP) {
|
||||||
|
jsonWriteStr(settingsFlashJson, F("routerssid"), HTTP.arg(F("routerssid")));
|
||||||
|
syncSettingsFlashJson();
|
||||||
|
HTTP.send(200, "text/plain", "ok");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (HTTP.hasArg(F("routerpass")) && WiFi.getMode() == WIFI_AP) {
|
||||||
|
jsonWriteStr(settingsFlashJson, F("routerpass"), HTTP.arg(F("routerpass")));
|
||||||
|
syncSettingsFlashJson();
|
||||||
|
HTTP.send(200, "text/plain", "ok");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
// Добавляем функцию Update для перезаписи прошивки по WiFi при 1М(256K FileFS) и выше
|
// Добавляем функцию Update для перезаписи прошивки по WiFi при 1М(256K FileFS) и выше
|
||||||
// httpUpdater.setup(&HTTP);
|
// httpUpdater.setup(&HTTP);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user