- 
                Notifications
    You must be signed in to change notification settings 
- Fork 507
Labels
waiting for feedbackRequires response from original posterRequires response from original poster
Description
Hi, I am trying to implement proper WiFi reconnect handling, but it seems the second time I am calling WiFi.begin it blocks forever. This is my logic called from loop:
  if (!WiFi.isConnected())
  {
    Serial.println("connection lost");
    if (WiFi.begin(ssid, pass) != WL_CONNECTED) // seems to block forever
    {
      Serial.println("wifi reconnect failed");
    }
    else
    {
      Serial.println("wifi reconnect success");
    }
  }
I am triggering the disconnect by powering off and on my router. The last message I get over Serial is "connection lost" which makes me believe that WiFi.being blocks.
What I tried so far:
- Using the async version WiFi.beginNoBlockbut it also never returns.
- Adding various delays here and there.
- Calling WiFi.disconnectandWiFi.endbefore the reconnect.
- An RP2350
These are my versions:
[env:rpipicow]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#a4b555a5f29961fd76e278b3c5ba56f0067207d0
framework = arduino
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m
board = rpipicow
Thanks for any help on the issue!
Metadata
Metadata
Assignees
Labels
waiting for feedbackRequires response from original posterRequires response from original poster