From 4138d0b2f5936357a9140a1fac0317c423e6779c Mon Sep 17 00:00:00 2001 From: Ray Jones Date: Sun, 27 Oct 2019 15:24:54 +1100 Subject: [PATCH] Blocked debug messages whilst getting other strings. STA only retries if a SSID is defined --- src/Afterburner.cpp | 8 +++++++- src/WiFi/BTCWifi.cpp | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Afterburner.cpp b/src/Afterburner.cpp index a86b4a8..e7653b3 100644 --- a/src/Afterburner.cpp +++ b/src/Afterburner.cpp @@ -564,7 +564,7 @@ void loop() if(NVstore.getUserSettings().menuMode == 2) bReportRecyleEvents = false; - + if( CommState.is(CommStates::OEMCtrlRx) || CommState.is(CommStates::HeaterRx1) || CommState.is(CommStates::HeaterRx2) ) { @@ -1320,6 +1320,7 @@ void checkDebugCommands() return; } else if(nGetString) { + DebugPort.enable(true); if(rxVal < ' ') { if(rxVal == 0x1b) { // ESCAPE nGetString = 0; @@ -1349,6 +1350,7 @@ void checkDebugCommands() else { nGetString = 3; DebugPort.print("\r\nPlease enter new password - "); + DebugPort.enable(false); // block other debug msgs whilst we get the password } return; case 3: @@ -1356,6 +1358,7 @@ void checkDebugCommands() if(PCline.Len <= 31) { nGetString = 4; DebugPort.print("\r\nPlease confirm new password - "); + DebugPort.enable(false); // block other debug msgs whilst we get the password } else { DebugPort.println("\r\nNew password is longer than 31 characters - ABORTING"); @@ -1384,6 +1387,7 @@ void checkDebugCommands() else DebugPort.print('*'); PCline.append(rxVal); + DebugPort.enable(false); // block other debug msgs whilst we get strings return; } } @@ -1455,6 +1459,7 @@ void checkDebugCommands() else if(rxVal == 'n') { DebugPort.print("Please enter new SSID name for Access Point - "); nGetString = 1; + DebugPort.enable(false); // block other debug msgs whilst we get strings PCline.clear(); } else if(rxVal == 'm') { @@ -1467,6 +1472,7 @@ void checkDebugCommands() else if(rxVal == 'p') { DebugPort.print("Please enter current AP password - "); nGetString = 2; + DebugPort.enable(false); // block other debug msgs whilst we get strings PCline.clear(); } else if(rxVal == 's') { diff --git a/src/WiFi/BTCWifi.cpp b/src/WiFi/BTCWifi.cpp index 9969c01..920de4c 100644 --- a/src/WiFi/BTCWifi.cpp +++ b/src/WiFi/BTCWifi.cpp @@ -163,7 +163,8 @@ void doWiFiManager() WiFi.mode(WIFI_AP_STA); wifi_config_t conf; esp_wifi_get_config(WIFI_IF_STA, &conf); - WiFi.begin((char*)conf.sta.ssid, (char*)conf.sta.password); + if(strlen((char*)conf.sta.ssid)) + WiFi.begin((char*)conf.sta.ssid, (char*)conf.sta.password); } } else {