[OTA] Capability to disable Firmware Update on ESP32 WEB (#1621)
* disabling Firmware Update on ESP32 --------- Co-authored-by: Bert Wynants <bwynants+drupal-git@gmail.com>
This commit is contained in:
1 parent
ad4e4b55c7
commit
9bb322daf8
3 files changed
+10
-3
No files matched your search
@@ -117,6 +117,7 @@ build_flags =
|
|||||||
'-DDEEP_SLEEP_IN_US=120000000' ; Deep sleep for a period of time to conserve battery
|
'-DDEEP_SLEEP_IN_US=120000000' ; Deep sleep for a period of time to conserve battery
|
||||||
'-DESP32_EXT0_WAKE_PIN=GPIO_NUM_14' ;Should a water leak be detected immediatly wake the ESP32 and report the problem
|
'-DESP32_EXT0_WAKE_PIN=GPIO_NUM_14' ;Should a water leak be detected immediatly wake the ESP32 and report the problem
|
||||||
'-DESP32_EXT0_WAKE_PIN_STATE=0' ;Should a water leak be detected immediatly wake the ESP32 and report the problem, sensor state to look for wakeup
|
'-DESP32_EXT0_WAKE_PIN_STATE=0' ;Should a water leak be detected immediatly wake the ESP32 and report the problem, sensor state to look for wakeup
|
||||||
|
'-UMQTT_HTTPS_FW_UPDATE' ;disable HTTPS firmware updating
|
||||||
[env:esp32dev-rf]
|
[env:esp32dev-rf]
|
||||||
platform = ${com.esp32_platform}
|
platform = ${com.esp32_platform}
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
|
|||||||
+4
-1
@@ -1056,6 +1056,7 @@ void handleIN() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if defined(ESP32) && defined(MQTT_HTTPS_FW_UPDATE)
|
||||||
/**
|
/**
|
||||||
* @brief /UP - Firmware Upgrade Page
|
* @brief /UP - Firmware Upgrade Page
|
||||||
*
|
*
|
||||||
@@ -1121,6 +1122,7 @@ void handleUP() {
|
|||||||
response += String(buffer);
|
response += String(buffer);
|
||||||
server.send(200, "text/html", response);
|
server.send(200, "text/html", response);
|
||||||
}
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
void sendRestartPage() {
|
void sendRestartPage() {
|
||||||
char jsonChar[100];
|
char jsonChar[100];
|
||||||
@@ -1257,8 +1259,9 @@ void WebUISetup() {
|
|||||||
|
|
||||||
server.on("/in", handleIN); // Information
|
server.on("/in", handleIN); // Information
|
||||||
server.on("/cs", handleCS); // Console
|
server.on("/cs", handleCS); // Console
|
||||||
|
# if defined(ESP32) && defined(MQTT_HTTPS_FW_UPDATE)
|
||||||
server.on("/up", handleUP); // Firmware Upgrade
|
server.on("/up", handleUP); // Firmware Upgrade
|
||||||
|
# endif
|
||||||
server.on("/cn", handleCN); // Configuration
|
server.on("/cn", handleCN); // Configuration
|
||||||
server.on("/wi", handleWI); // Configure Wifi
|
server.on("/wi", handleWI); // Configure Wifi
|
||||||
server.on("/mq", handleMQ); // Configure MQTT
|
server.on("/mq", handleMQ); // Configure MQTT
|
||||||
|
|||||||
@@ -34,8 +34,11 @@
|
|||||||
#define body_footer_config_menu "<div id=but3d style=\"display: block;\"></div><p><form id=but3 style=\"display: block;\" action='cn' method='get'><button>Configuration</button></form></p>"
|
#define body_footer_config_menu "<div id=but3d style=\"display: block;\"></div><p><form id=but3 style=\"display: block;\" action='cn' method='get'><button>Configuration</button></form></p>"
|
||||||
#define body_header "<body><div style='text-align:left;display:inline-block;min-width:360px;'><div style='text-align:center;'><noscript> To use, please enable JavaScript <br></noscript><h3>%s</h3><h2>%s</h2></div>"
|
#define body_header "<body><div style='text-align:left;display:inline-block;min-width:360px;'><div style='text-align:center;'><noscript> To use, please enable JavaScript <br></noscript><h3>%s</h3><h2>%s</h2></div>"
|
||||||
|
|
||||||
#define button_upgrade "<p><form id=but5 style='display: block;' action='up' method='get'><button>Firmware Upgrade</button></form></p>"
|
#if defined(ESP32) && defined(MQTT_HTTPS_FW_UPDATE)
|
||||||
|
# define button_upgrade "<p><form id=but5 style='display: block;' action='up' method='get'><button>Firmware Upgrade</button></form></p>"
|
||||||
|
#else
|
||||||
|
# define button_upgrade ""
|
||||||
|
#endif
|
||||||
// Configuration Menu
|
// Configuration Menu
|
||||||
|
|
||||||
#define configure_1 "<p><form action='wi' method='get'><button>Configure WiFi</button></form></p>"
|
#define configure_1 "<p><form action='wi' method='get'><button>Configure WiFi</button></form></p>"
|
||||||
|
|||||||
Reference in new issue
Block a user