no wifi disconnect until reboot on ssid cleared

This commit is contained in:
MichaelDvP
2023-10-24 21:54:57 +02:00
parent 5e7e1c30ca
commit ad51870d2c
8 changed files with 39 additions and 17 deletions

View File

@@ -1100,6 +1100,10 @@ void Boiler::process_UBAMonitorFast(std::shared_ptr<const Telegram> telegram) {
*/
void Boiler::process_UBATotalUptime(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, UBAuptime_, 0, 3); // force to 3 bytes
// if broadcasted there is no need to fetch
if (telegram->dest == 0) {
toggle_fetch(0x14, false);
}
}
/*

View File

@@ -385,7 +385,7 @@ void System::wifi_tweak() {
}
// check for valid ESP32 pins. This is very dependent on which ESP32 board is being used.
// Typically you can't use 1, 6-11, 12, 14, 15, 20, 24, 28-31 and 40+
// Typically you can't use 1, 6-11, 20, 24, 28-31 and 40+
// we allow 0 as it has a special function on the NodeMCU apparently
// See https://diyprojects.io/esp32-how-to-use-gpio-digital-io-arduino-code/#.YFpVEq9KhjG
// and https://nodemcu.readthedocs.io/en/dev-esp32/modules/gpio/
@@ -475,15 +475,16 @@ void System::button_init(bool refresh) {
reload_settings();
}
if (is_valid_gpio(pbutton_gpio_)) {
if (!myPButton_.init(pbutton_gpio_, HIGH)) {
LOG_DEBUG("Multi-functional button not detected");
} else {
LOG_DEBUG("Multi-functional button enabled");
}
} else {
if (!is_valid_gpio(pbutton_gpio_)) {
LOG_WARNING("Invalid button GPIO. Check config.");
myPButton_.init(255, HIGH); // disable
return;
}
if (!myPButton_.init(pbutton_gpio_, HIGH)) {
LOG_WARNING("Multi-functional button not detected");
return;
}
LOG_DEBUG("Multi-functional button enabled");
myPButton_.onClick(BUTTON_Debounce, button_OnClick);
myPButton_.onDblClick(BUTTON_DblClickDelay, button_OnDblClick);
@@ -1064,7 +1065,7 @@ bool System::check_upgrade(bool factory_settings) {
// see if we're missing a version, will be < 3.5.0b13 from Dec 23 2022
missing_version = (settingsVersion.empty() || (settingsVersion.length() < 5));
if (missing_version) {
LOG_DEBUG("No version information found (%s)", settingsVersion.c_str());
LOG_WARNING("No version information found (%s)", settingsVersion.c_str());
settingsVersion = "3.6.2"; // this was the last stable version
}
}
@@ -1441,7 +1442,7 @@ bool System::load_board_profile(std::vector<int8_t> & data, const std::string &
} else if (board_profile == "E32") {
data = {2, 4, 5, 17, 33, PHY_type::PHY_TYPE_LAN8720, 16, 1, 0}; // BBQKees Gateway E32
} else if (board_profile == "E32V2") {
data = {2, 14, 4, 5, 0, PHY_type::PHY_TYPE_LAN8720, 15, 0, 1}; // BBQKees Gateway E32 V2
data = {2, 14, 4, 5, 12, PHY_type::PHY_TYPE_LAN8720, 15, 0, 1}; // BBQKees Gateway E32 V2
} else if (board_profile == "MH-ET") {
data = {2, 18, 23, 5, 0, PHY_type::PHY_TYPE_NONE, 0, 0, 0}; // MH-ET Live D1 Mini
} else if (board_profile == "NODEMCU") {

View File

@@ -36,8 +36,7 @@ void WebStatusService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) {
switch (event) {
case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
EMSESP::logger().warning("WiFi disconnected. Reason code=%s", disconnectReason(info.wifi_sta_disconnected.reason)); // IDF 4.0
// WiFi.disconnect(true); // this is done in NetworkSettingsService
EMSESP::logger().warning("WiFi disconnected. Reason: %s (%d)", disconnectReason(info.wifi_sta_disconnected.reason), info.wifi_sta_disconnected.reason); // IDF 4.0
EMSESP::system_.has_ipv6(false);
break;
@@ -282,6 +281,16 @@ const char * WebStatusService::disconnectReason(uint8_t code) {
return "assoc fail";
case WIFI_REASON_HANDSHAKE_TIMEOUT: // = 204,
return "handshake timeout";
case WIFI_REASON_CONNECTION_FAIL: // 205,
return "connection fail";
case WIFI_REASON_AP_TSF_RESET: // 206,
return "AP tsf reset";
case WIFI_REASON_ROAMING: // 207,
return "roaming";
case WIFI_REASON_ASSOC_COMEBACK_TIME_TOO_LONG: // 208,
return "assoc comeback time too long";
case WIFI_REASON_SA_QUERY_TIMEOUT: // 209,
return "sa query timeout";
default:
return "unknown";
}