From bccdc624763b51ea17a23d9d4e20b54873e8c69f Mon Sep 17 00:00:00 2001 From: Miroslav Pivovarsky Date: Thu, 19 Jun 2025 09:53:26 +0200 Subject: [PATCH] web: Wi-Fi Enterprise settings on the Wi-Fi page (preparation) - library versions in the sketch header --- ESP32_PrusaConnectCam/ESP32_PrusaConnectCam.ino | 12 ++++++------ ESP32_PrusaConnectCam/WebPage.h | 13 +++++++++++++ webpage/page_wifi.html | 5 +++++ webpage/scripts.js | 8 ++++++++ 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/ESP32_PrusaConnectCam/ESP32_PrusaConnectCam.ino b/ESP32_PrusaConnectCam/ESP32_PrusaConnectCam.ino index ad1810c..e056461 100644 --- a/ESP32_PrusaConnectCam/ESP32_PrusaConnectCam.ino +++ b/ESP32_PrusaConnectCam/ESP32_PrusaConnectCam.ino @@ -4,16 +4,16 @@ It's neccesary install support for ESP32 board to the arduino IDE. In the board manager we need add next link https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json Then we can install "ESP32 by Espressif Systems" board in the board manager. - ESP32 lib version: 3.0.2 (ESP-IDF v5.1.4) by Espressif Systems + ESP32 lib version: 3.1.3 (ESP-IDF v5.3) by Espressif Systems This project uses other libraries. It is necessary to install them in the arduino IDE. - Library - License - Version - Link - - ESPAsyncWebServer - LGPL 3.0 - 3.4.5 - https://github.com/mathieucarbou/ESPAsyncWebServer - - AsyncTCP - LGPL 3.0 - 3.3.1 - https://github.com/mathieucarbou/AsyncTCP - - ArduinoJson - MIT - 7.3.0 - https://github.com/bblanchon/ArduinoJson + - ESPAsyncWebServer - LGPL 3.0 - 3.7.2 - https://github.com/mathieucarbou/ESPAsyncWebServer moved to https://github.com/ESP32Async/ESPAsyncWebServer + - AsyncTCP - LGPL 3.0 - 3.3.7 - https://github.com/mathieucarbou/AsyncTCP moved to https://github.com/ESP32Async/AsyncTCP + - ArduinoJson - MIT - 7.3.1 - https://github.com/bblanchon/ArduinoJson - ArduinoUniqueID - MIT - 1.3.0 - https://github.com/ricaun/ArduinoUniqueID - - arduino-esp32 - LGPL 2.1 - 3.1.0 - https://github.com/espressif/arduino-esp32 - - DHTnew - MIT - 0.5.2 - https://github.com/RobTillaart/DHTNew + - arduino-esp32 - LGPL 2.1 - 3.1.3 - https://github.com/espressif/arduino-esp32 + - DHTnew - MIT - 0.5.3 - https://github.com/RobTillaart/DHTNew Arduino IDE configuration for the MCU are stored in the module_XXX.h file. diff --git a/ESP32_PrusaConnectCam/WebPage.h b/ESP32_PrusaConnectCam/WebPage.h index d04058e..2a24987 100644 --- a/ESP32_PrusaConnectCam/WebPage.h +++ b/ESP32_PrusaConnectCam/WebPage.h @@ -202,6 +202,11 @@ const char page_wifi_html[] PROGMEM = R"rawliteral( Default gateway DNS server + + Enable WPA2-Enterprise + Username + Password + @@ -1165,6 +1170,14 @@ function setWifiNet(val_ip, val_mask, val_gw, val_dns) { get_data("wifi"); } +function setWPA2EAP(val_user, val_pass) { + var xmlHttp = new XMLHttpRequest(); + xmlHttp.open("GET", "wifi_wpa2_eap?user=" + encodeURIComponent(val_user) + "&pass=" + encodeURIComponent(val_pass), false); + xmlHttp.send(null); + alert(xmlHttp.responseText); + get_data("wifi"); +} + function scanWifi() { var xmlHttp = new XMLHttpRequest(); xmlHttp.open("GET", "wifi_scan?", false); diff --git a/webpage/page_wifi.html b/webpage/page_wifi.html index bd89795..5d896db 100644 --- a/webpage/page_wifi.html +++ b/webpage/page_wifi.html @@ -65,6 +65,11 @@ Default gateway DNS server + + Enable WPA2-Enterprise + Username + Password + diff --git a/webpage/scripts.js b/webpage/scripts.js index 6112fb4..3f344f2 100644 --- a/webpage/scripts.js +++ b/webpage/scripts.js @@ -255,6 +255,14 @@ function setWifiNet(val_ip, val_mask, val_gw, val_dns) { get_data("wifi"); } +function setWPA2EAP(val_user, val_pass) { + var xmlHttp = new XMLHttpRequest(); + xmlHttp.open("GET", "wifi_wpa2_eap?user=" + encodeURIComponent(val_user) + "&pass=" + encodeURIComponent(val_pass), false); + xmlHttp.send(null); + alert(xmlHttp.responseText); + get_data("wifi"); +} + function scanWifi() { var xmlHttp = new XMLHttpRequest(); xmlHttp.open("GET", "wifi_scan?", false);