WiFi shield won't connect to a network - possible DNS issue?

Hi everyone,

I'm having problems with the WiFi shield (which I'm running on top of a Mega 2560). Everything runs flawlessly in my home network, but the shield fails to connect to the office network: The red error LED lights up and the call to WiFi.begin() does not return WL_CONNECTED.

I've tried to connect to the network using the WiFi shields FTDI debug interface. Here's an excerpt from the log:

$ Arduino Wifi Startup... [Sat Jan 19 09:44:18 2013]
status
wl_api version v2.7.0
hw addr: 78-c4-0e-01-99-ae
link status: down
ip interface is down
dhcp : enabled
==> DNS1: 208.67.222.222
==> DNS2: 0.0.0.0
IF   status: DOWN
CONN status: DOWN
$ debug init 2
$ debug cm 2
$ debug spi 2
$ debug tcp 2
$ debug util 2
$ debug warn 2
$ debug abc 2
$ debug on
Debug ON
$ scan
c0-25-06-d7-c1-0a "Cowo21" RSSI -59 dBm  (CCMP encryption)
$ CM: scan completed
I-[wl_cm_scan_cb] Scan Completed!
wpass Cowo21 <censored>
$ connect Cowo21
$ CM: scan completed
I-[wl_cm_scan_cb] Scan Completed!
CM: connect failed, scanning
CM: scan completed
I-[wl_cm_scan_cb] Scan Completed!
CM: connected to Cowo21
I-[wl_cm_conn_cb] Connection cb...
link up, connected to "Cowo21"
I-[wl_cm_conn_cb] Start DHCP...
requesting dhcp ... OK
I-[wl_cm_conn_cb] Start DNS...
CM: disconnected
CM: connection lost, scanning
I-[wl_cm_disconn_cb] Disconnection cb...
link down, release dhcp
I-[set_result_cmd] set_result_cmd 4
CM: scan completed
I-[wl_cm_scan_cb] Scan Completed!

After that, the last part of the error message just keeps repeating:

CM: connected to Cowo21
I-[wl_cm_conn_cb] Connection cb...
link up, connected to "Cowo21"
I-[wl_cm_conn_cb] Start DHCP...
requesting dhcp ... OK
I-[wl_cm_conn_cb] Start DNS...
CM: disconnected
CM: connection lost, scanning
I-[wl_cm_disconn_cb] Disconnection cb...
link down, release dhcp
I-[set_result_cmd] set_result_cmd 4
CM: scan completed
I-[wl_cm_scan_cb] Scan Completed!

It seems like the connection to the network and even DHCP succeed, but it fails before DNS can be established. I've tried to use another DNS server (with WiFi.setDNS()), but no luck.

I'm using the latest version of the WiFi shield firmware.

I'm not sure what to make of this. Any idea how I can proceed?

Hi Hanno

link status: down
ip interface is down

Going by the above, I think the connection is not even being made, as the status of both is "down". Could you try to set the IP address and gateway parameters manually as well and see if that works ? I have faced similar problems with the shield a while ago.
Talking to the network administrator and getting the connection parameters set manually worked for me.

ankitdaf:

link status: down

ip interface is down




Going by the above, I think the connection is not even being made, as the status of both is "down".

But that's the status from before any connection attempt has been made. Later it says:

CM: connected to Cowo21
I-[wl_cm_conn_cb] Connection cb...
link up, connected to "Cowo21"

ankitdaf:
Could you try to set the IP address and gateway parameters manually as well and see if that works ? I have faced similar problems with the shield a while ago.
Talking to the network administrator and getting the connection parameters set manually worked for me.

I have tried, but I'm getting the same result.

Ask your IT if that is a WPA or WPA2 Enterprise network. Your wifi card won't connect unless it is WPA2-PSK (Personal).

hannobraun:
I'm not sure what to make of this. Any idea how I can proceed?

When joining a WiFi network, DNS is not established as such. WiFi is a ~Layer2 protocol. DNS is a Layer 7 client/server protocol. During the WiFi join, the only relevance DNS has is the startup of the DNS client and setting of the DNS Server address.

You should definitely check the encryption protocol settings with whomever looks after the Access Point. The debug indicates the Access Point is advertising WPA2/AES (ccmp) but some Access Points offer mixed modes (WPA2/TKIP and WPA/AES, with/without fallback) which can confuse some WiFi interfaces. Also check they don't have some form of MAC filtering or RADIUS set up.

You could also try comparing the debug output from a successful join to your failure.

At first glance and it is only a hunch. It looks like it might be some sort of timeout issue, causing the join to be aborted before it is complete.

The usual suspects are;

  • Signal to Noise Ratio (SNR).
    The signal strength looks like you are in range, but is it consistent and are there any sources of 2.4Ghz interference. WiFi interfaces generally do not report the RF noise floor, because they only understand WiFi. So you might have four bars but if the noise floor is three bars, the effective SNR is only one bar. Same goes for interference, four bars means nothing when a non-WiFi device is swamping the band with the equivalent of five bars.

  • Busy WiFi segment.
    The access point can only hear one transmitter at a time. So many transmitters cause many collisions and many retransmissions. So the whole segment slows down.

BTW, WEP/WPA/WPA2 can all use PSK. PSK stands for Pre-Shared key. It just means a key which has been set and shared manually, rather than being issued by the Access Point at join time using RADIUS or whatever.

Thanks a lot for all the useful advice!

SurferTim:
Ask your IT if that is a WPA or WPA2 Enterprise network. Your wifi card won't connect unless it is WPA2-PSK (Personal).

There is only one key that is used by all participants in the network. Wouldn't a WPA Enterprise imply that there's a username/password per user?

MattS-UK:
You should definitely check the encryption protocol settings with whomever looks after the Access Point. The debug indicates the Access Point is advertising WPA2/AES (ccmp) but some Access Points offer mixed modes (WPA2/TKIP and WPA/AES, with/without fallback) which can confuse some WiFi interfaces. Also check they don't have some form of MAC filtering or RADIUS set up.

This network is in a semi-public space, so new people come in and join the network all the time, without any problems and using the same SSID/password. This couldn't work with any MAC filtering going on.
Wouldn't RADIUS imply a username being used?

MattS-UK:
You could also try comparing the debug output from a successful join to your failure.

Unfortunately I didn't do that when I had the chance, and I don't have access either to the hardware or the working network right now.

MattS-UK:
The usual suspects are;

  • Signal to Noise Ratio (SNR).
    The signal strength looks like you are in range, but is it consistent and are there any sources of 2.4Ghz interference. WiFi interfaces generally do not report the RF noise floor, because they only understand WiFi. So you might have four bars but if the noise floor is three bars, the effective SNR is only one bar. Same goes for interference, four bars means nothing when a non-WiFi device is swamping the band with the equivalent of five bars.

  • Busy WiFi segment.
    The access point can only hear one transmitter at a time. So many transmitters cause many collisions and many retransmissions. So the whole segment slows down.

BTW, WEP/WPA/WPA2 can all use PSK. PSK stands for Pre-Shared key. It just means a key which has been set and shared manually, rather than being issued by the Access Point at join time using RADIUS or whatever.

Hmm, wouldn't any of those mean that other devices in the network would have problems, too?
As I said, the network is being used by a lot of people without problems. With my laptop, I actually had more troubles (like occasional disconnects) in the network where the WiFi shield worked.

Thanks,
Hanno

Hmm, wouldn't any of those mean that other devices in the network would have problems, too?

Not if the wireless is WPA. Most devices handle WPA-PSK fine. The wifi shield doesn't. Only WPA2-PSK. I ran into this with one of my network customers. His wireless network was set to WPA and the device he wanted to connect with did not support WPA, only WEP and WPA2. And it was a popular brand/model. ??

Hi,

sorry for being quite for a while.
As I've said earlier, I don't have the hardware currently. I've passed the advice from here on to the guy who has it right now, but haven't heard back in a while. I'll post here, if we find the cause of the problem.

Thanks,
Hanno