Hi,
Hardware Setup:
- Arduino Uno R3
- Arduino WIFI R3 Shield
Network Setup:
- Asus AP
- D-link AP
I've configured the Asus AP with WPA2 Personal encryption and the D-Link AP with WEP Open encryption with different SSIDs.
Programming the Uno to connect using WPA2 works fine. The problem comes in with the WEP connection - it doesn't want to connect.
I've also switched the encryption types around and WPA2 works but WEP still fails.
Asus = WPA2 - Works
Asus = WEP - ERROR
D-link = WPA2 - Works
D-link = WEP - ERROR
PC connects to both without issue.
So what is wrong ?
Code:
#include <WiFi.h>
char ssid[] = "dlink"; // your network SSID (name)
char key[] = "78898DBD024093C60F19C54DA1"; // your network key
int keyIndex = 0; // your network key Index number
int status = WL_IDLE_STATUS; // the Wifi radio's status
void setup() {
// initialize serial:
Serial.begin(9600);
// attempt to connect to an open network:
Serial.print("Attempting to connect to WEP network: ");
Serial.println(ssid);
status = WiFi.begin(ssid, keyIndex, key);
// if you're not connected, stop here:
if ( status != WL_CONNECTED) {
Serial.println("Couldn't get a wifi connection");
while(true);
}
// if you are connected :
else {
Serial.print("You're connected to the network");
printCurrentNet();
printWifiData();
}
}