How to troubleshoot WiFi shield issues?

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 ruled out the following issues as causes of the problem:

  • Bad reception. WiFi.scanNetworks() and WiFi.SSID() show the network as being available. The signal strength returned by WiFi.RSSI() is better than in my home network (so is the number of bars shown by my laptop).
  • Wrong SSID/password. I've checked and re-checked multiple times. Then I copy-pasted the credentials from my laptop's working configuration. Still no luck.
  • Something being wrong with the network. The network is being used without issue by other people every day.
  • The problem being a fluke. I tried multiple times on different days. Same result.

Since I've last tried, I upgraded both firmwares on the shield to the newest versions (from wifishield/firmware/binary at master · arduino/wifishield · GitHub).

I'll have another chance to try the shield in this network some time later this week. My question now is, in case upgrading the firmware won't solve the problem, how can I troubleshoot this?

Beyond the return value returned by WiFi.begin(), I'm not aware of any additional information being available that could help me track down this problem. Is it possible to somehow get a detailed error message or some other info that might help pinpoint this problem? Any advice is greatly appreciated.


To answer my own question, the WiFi shield has a debug interface, as documented here:

Did you manage to fix your problem yet ?

Maybe the DHCP server on your router has trouble assigning an IP address to your device ? In that case you could try assigning an IP address manually on the network.

If that still doesn't work, you could try the debug interface with a serial terminal program like HyperTerm or PuTTY and read the status messages off the WiFi shield

Hi ankitdaf,

thank you for your reply!

Unfortunately, I haven't been able to find the problem yet. After debugging the shield using the FTDI interface, I posted a follow-up here: WiFi shield won't connect to a network - possible DNS issue? - Networking, Protocols, and Devices - Arduino Forum

I don't think it's a DHCP problem. Here's an excerpt from the log I posted in the follow-up post:

I-[wl_cm_conn_cb] Start DHCP...
requesting dhcp ... OK
I-[wl_cm_conn_cb] Start DNS...
CM: disconnected

See the follow-up post for the full log.