From 5aca3a62d849d70a56465d4c48a40f8526b623ea Mon Sep 17 00:00:00 2001 From: travis-farmer Date: Sun, 19 Nov 2023 03:09:53 -0500 Subject: [PATCH] solved WiFiNINA reset/restart bug --- Wifi_NINA.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Wifi_NINA.cpp b/Wifi_NINA.cpp index 4672d85..1cd71a8 100644 --- a/Wifi_NINA.cpp +++ b/Wifi_NINA.cpp @@ -122,6 +122,8 @@ bool WifiNINA::setup(const char *SSid, DIAG(F("Forcing one more Wifi restart")); // esp_wifi_start(); // esp_wifi_connect(); + WiFi.end(); + WiFi.begin(SSid, password); tries=40; while (WiFi.status() != WL_CONNECTED && tries) { Serial.print('.'); @@ -219,7 +221,7 @@ void WifiNINA::checkForNewClient() { for (byte clientId=0; clientIdconnected()) { clients[clientId]->stop(); - DIAG(F("Remove client %d"), clientId); + //DIAG(F("Remove client %d"), clientId); CommandDistributor::forget(clientId); clients[clientId]=nullptr; } @@ -264,7 +266,7 @@ void WifiNINA::checkForClientOutput() { if (!c) { // client is gone, throw away msg for (int i=0;iread(); - DIAG(F("gone, drop message.")); //TJF: only for diag + //DIAG(F("gone, drop message.")); //TJF: only for diag return; } // emit data to the client object