Skip to content

Pico W connects to Wifi only every second boot #1031

@jokinghands

Description

@jokinghands

Im trying to connect over C++ / Arduino IDE
If i take the Example code it would connect only every second boot. No matter if just flashed or Hardreset:

 WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  Serial.println("");

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

If I write it that way it would always conntect skipping the first try.

WiFi.begin(ssid, password);
  if (WiFi.waitForConnectResult() != WL_CONNECTED) {
    Serial.printf("STA: Failed!\n");
    WiFi.disconnect(false);
    delay(1000);
    WiFi.begin(ssid, password);
  }

it works with a while loop aswell. But he doesnt need more the a second attempt.

Anyone any Ideas? I guess its something about the router, i never experienced this with any ESP.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions