2

I just bought a WiFi shield and I cannot connect to my wireless network (WPA2).

  • I used the sketch from the Arduino site for connecting to WPA network and put my SSID and password on but it doesn't connect (I know the credentials are correct as I used my phone to connect with these WiFi credentials).
  • When I read the serial monitor it just keeps trying to connect. The WiFi-shield board error light is red
  • I checked my network settings and my block level is at is lowest (NAT only).

Why can't I connect?

1

In the loop:

// attempt to connect to Wifi network:
  while ( status != WL_CONNECTED) { 
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network:    
    status = WiFi.begin(ssid, pass);

    // wait 10 seconds for connection:
    delay(10000);
  }

Can you add Serial.print(status); before the delay so you can see if any of these arise:

  • WL_IDLE_STATUS = 0
  • WL_NO_SSID_AVAIL
  • WL_CONNECT_FAILED
  • WL_CONNECTION_LOST
  • WL_DISCONNECTED

They are defined in wl_definitions.h

0

I was facing the same issue using the Feather M0 board from Adafruit. After updating the Arduino IDE as well as the IDE's libraries and firmware, I was able to connect to WiFi.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.