Skip to content

Commit

Permalink
"tricks" to make wifi work on de esp32 s3
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertvanheusden committed Apr 30, 2024
1 parent 8e081ac commit 9e57f3e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ESP32/main.ino
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ void set_hostname()

void configure_network(console *const c)
{
WiFi.disconnect();

WiFi.persistent(true);
WiFi.setAutoReconnect(true);

WiFi.useStaticBuffers(true);
WiFi.mode(WIFI_STA);

c->put_string_lf("Scanning for wireless networks...");
Expand Down Expand Up @@ -159,7 +161,7 @@ void wait_network(console *const c)

int i = 0;

while (WiFi.waitForConnectResult() != WL_CONNECTED && i < timeout) {
while (WiFi.status() != WL_CONNECTED && i < timeout) {
c->put_string(".");

delay(1000 / 3);
Expand All @@ -184,7 +186,7 @@ void start_network(console *const c)
set_hostname();

WiFi.mode(WIFI_STA);

WiFi.useStaticBuffers(true);
WiFi.begin();

wait_network(c);
Expand Down

0 comments on commit 9e57f3e

Please sign in to comment.