Skip to content

Commit bdb40f0

Browse files
committed
Workaround the WiFi scan not working on Serial with latest ESP32 core
1 parent e903dce commit bdb40f0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

esp3d/src/core/espcmd/ESP410.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ bool Commands::ESP410(const char* cmd_params, level_authenticate_type auth_type,
4747
bool plain = hastag(cmd_params,"plain");
4848
int n = 0;
4949
uint8_t total = 0;
50+
n = WiFi.scanNetworks ();
5051
if (plain) {
5152
output->printLN ("Start Scan");
5253
}
53-
n = WiFi.scanNetworks ();
5454
if (!plain) {
5555
output->print ("{\"AP_LIST\":[");
5656
}
@@ -104,7 +104,9 @@ bool Commands::ESP410(const char* cmd_params, level_authenticate_type auth_type,
104104
if (!plain) {
105105
output->printLN ("]}");
106106
} else {
107-
output->printLN ("");
107+
if(total>0) {
108+
output->printLN ("");
109+
}
108110
output->printLN ("End Scan");
109111
}
110112
WiFi.mode((WiFiMode_t)currentmode);

0 commit comments

Comments
 (0)