From bdb40f0ab860db0f50a71a59d66ee060f3ee3dd7 Mon Sep 17 00:00:00 2001 From: Luc <8822552+luc-github@users.noreply.github.com> Date: Sat, 23 Oct 2021 09:31:18 +0800 Subject: [PATCH] Workaround the WiFi scan not working on Serial with latest ESP32 core --- esp3d/src/core/espcmd/ESP410.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esp3d/src/core/espcmd/ESP410.cpp b/esp3d/src/core/espcmd/ESP410.cpp index 9b05e2c4..ef703f72 100644 --- a/esp3d/src/core/espcmd/ESP410.cpp +++ b/esp3d/src/core/espcmd/ESP410.cpp @@ -47,10 +47,10 @@ bool Commands::ESP410(const char* cmd_params, level_authenticate_type auth_type, bool plain = hastag(cmd_params,"plain"); int n = 0; uint8_t total = 0; + n = WiFi.scanNetworks (); if (plain) { output->printLN ("Start Scan"); } - n = WiFi.scanNetworks (); if (!plain) { output->print ("{\"AP_LIST\":["); } @@ -104,7 +104,9 @@ bool Commands::ESP410(const char* cmd_params, level_authenticate_type auth_type, if (!plain) { output->printLN ("]}"); } else { - output->printLN (""); + if(total>0) { + output->printLN (""); + } output->printLN ("End Scan"); } WiFi.mode((WiFiMode_t)currentmode);