mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
Update to 16.8.1
This commit is contained in:
@@ -19,6 +19,12 @@ NetworkSettingsService::NetworkSettingsService(AsyncWebServer * server, FS * fs,
|
|||||||
WiFi.mode(WIFI_MODE_MAX);
|
WiFi.mode(WIFI_MODE_MAX);
|
||||||
WiFi.mode(WIFI_MODE_NULL);
|
WiFi.mode(WIFI_MODE_NULL);
|
||||||
|
|
||||||
|
#if defined(EMSESP_WIFI_TWEAK)
|
||||||
|
// https: //www.esp32.com/viewtopic.php?t=12055
|
||||||
|
esp_wifi_set_bandwidth(ESP_IF_WIFI_STA, WIFI_BW_HT20);
|
||||||
|
esp_wifi_set_bandwidth(ESP_IF_WIFI_AP, WIFI_BW_HT20);
|
||||||
|
#endif
|
||||||
|
|
||||||
WiFi.onEvent(std::bind(&NetworkSettingsService::WiFiEvent, this, _1));
|
WiFi.onEvent(std::bind(&NetworkSettingsService::WiFiEvent, this, _1));
|
||||||
|
|
||||||
addUpdateHandler([&](const String & originId) { reconfigureWiFiConnection(); }, false);
|
addUpdateHandler([&](const String & originId) { reconfigureWiFiConnection(); }, false);
|
||||||
|
|||||||
@@ -6,7 +6,12 @@
|
|||||||
#include <HttpEndpoint.h>
|
#include <HttpEndpoint.h>
|
||||||
#include <JsonUtils.h>
|
#include <JsonUtils.h>
|
||||||
|
|
||||||
|
#ifndef EMSESP_STANDALONE
|
||||||
|
#if defined(EMSESP_WIFI_TWEAK)
|
||||||
|
#include <esp_wifi.h>
|
||||||
|
#endif
|
||||||
#include <ETH.h>
|
#include <ETH.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NETWORK_SETTINGS_FILE "/config/networkSettings.json"
|
#define NETWORK_SETTINGS_FILE "/config/networkSettings.json"
|
||||||
#define NETWORK_SETTINGS_SERVICE_PATH "/rest/networkSettings"
|
#define NETWORK_SETTINGS_SERVICE_PATH "/rest/networkSettings"
|
||||||
@@ -27,10 +32,10 @@
|
|||||||
class NetworkSettings {
|
class NetworkSettings {
|
||||||
public:
|
public:
|
||||||
// core wifi configuration
|
// core wifi configuration
|
||||||
String ssid;
|
String ssid;
|
||||||
String password;
|
String password;
|
||||||
String hostname;
|
String hostname;
|
||||||
bool staticIPConfig;
|
bool staticIPConfig;
|
||||||
|
|
||||||
// optional configuration for static IP address
|
// optional configuration for static IP address
|
||||||
IPAddress localIP;
|
IPAddress localIP;
|
||||||
@@ -55,10 +60,10 @@ class NetworkSettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static StateUpdateResult update(JsonObject & root, NetworkSettings & settings) {
|
static StateUpdateResult update(JsonObject & root, NetworkSettings & settings) {
|
||||||
settings.ssid = root["ssid"] | FACTORY_WIFI_SSID;
|
settings.ssid = root["ssid"] | FACTORY_WIFI_SSID;
|
||||||
settings.password = root["password"] | FACTORY_WIFI_PASSWORD;
|
settings.password = root["password"] | FACTORY_WIFI_PASSWORD;
|
||||||
settings.hostname = root["hostname"] | FACTORY_WIFI_HOSTNAME;
|
settings.hostname = root["hostname"] | FACTORY_WIFI_HOSTNAME;
|
||||||
settings.staticIPConfig = root["static_ip_config"] | false;
|
settings.staticIPConfig = root["static_ip_config"] | false;
|
||||||
|
|
||||||
// extended settings
|
// extended settings
|
||||||
JsonUtils::readIP(root, "local_ip", settings.localIP);
|
JsonUtils::readIP(root, "local_ip", settings.localIP);
|
||||||
|
|||||||
Reference in New Issue
Block a user