From 76b2f0a0e1534cd89f4ffbeca7fcf9026cb60e6d Mon Sep 17 00:00:00 2001 From: Florian <1technophile@users.noreply.github.com> Date: Sat, 15 Jan 2022 18:28:11 -0600 Subject: [PATCH] fix wifi manager portal missing parameters on esp8266 (#1132) * fix wifi manager portal missing parameters on esp8266 on esp8266 with ZgatewayBT Reducing the scope of the parameters on wifi manager for esp8266 to enable to enter properly the configuration --- main/main.ino | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main/main.ino b/main/main.ino index d4873ce..9c22bde 100644 --- a/main/main.ino +++ b/main/main.ino @@ -1140,7 +1140,9 @@ void setup_wifimanager(bool reset_settings) { WiFiManagerParameter custom_mqtt_pass("pass", "mqtt pass", mqtt_pass, parameters_size * 2); WiFiManagerParameter custom_mqtt_topic("topic", "mqtt base topic", mqtt_topic, mqtt_topic_max_size); WiFiManagerParameter custom_mqtt_secure("secure", "mqtt secure", "1", 1, mqtt_secure ? "type=\"checkbox\" checked" : "type=\"checkbox\""); +# ifdef ESP32 // not enough memory on ESP8266 WiFiManagerParameter custom_mqtt_cert("cert", "mqtt broker cert", mqtt_cert.c_str(), 2048); +# endif WiFiManagerParameter custom_gateway_name("name", "gateway name", gateway_name, parameters_size * 2); # endif //WiFiManager @@ -1169,7 +1171,9 @@ void setup_wifimanager(bool reset_settings) { wifiManager.addParameter(&custom_mqtt_user); wifiManager.addParameter(&custom_mqtt_pass); wifiManager.addParameter(&custom_mqtt_secure); +# ifdef ESP32 // not enough memory on ESP8266 wifiManager.addParameter(&custom_mqtt_cert); +# endif wifiManager.addParameter(&custom_gateway_name); wifiManager.addParameter(&custom_mqtt_topic); # endif @@ -1227,6 +1231,7 @@ void setup_wifimanager(bool reset_settings) { strcpy(gateway_name, custom_gateway_name.getValue()); mqtt_secure = *custom_mqtt_secure.getValue(); +# ifdef ESP32 // not enough memory on ESP8266 int cert_len = strlen(custom_mqtt_cert.getValue()); if (cert_len) { char* cert_in = (char*)custom_mqtt_cert.getValue(); @@ -1244,6 +1249,7 @@ void setup_wifimanager(bool reset_settings) { mqtt_cert = cert_begin; } +# endif # endif //save the custom parameters to FS saveMqttConfig();