WiFly bee not connecting, with failed SendCommands


I’ve just unpacked my first WiFly bee, and have it strapped in a Bees shield. I’ve been following the steps outlined here Cairo Hacker Space: A beginner’s guide to connecting and operating the WiFly to Arduino Serially but with the trick that our network is WEP 128 secured. After not succeeding I added some debugging as follows:

boolean initSettings() {
  Serial << "set wlan auth 1, " ;
  if(!WiFly.SendCommand("set wlan auth 1","AOK")) Serial << "FAIL. " ;
  Serial << endl << "set wlan key, " ;
  if(!WiFly.SendCommand("set wlan key <...key snipped...>","AOK")) Serial << "FAIL. " ;
  Serial << endl << "set wlan channel 0, " ;
  if(!WiFly.SendCommand("set wlan channel 0","AOK")) Serial << "FAIL. " ;
  Serial << endl << "set wlan join 1, " ;
  if(!WiFly.SendCommand("set wlan join 1","AOK")) Serial << "FAIL. " ;
  Serial << endl << "set dhcp 0, " ;
  if(!WiFly.SendCommand("set dhcp 0","AOK")) Serial << "FAIL. " ;
  Serial << endl << "set IP address, ";
  if(!WiFly.SendCommand("set ip address","AOK")) Serial << "FAIL. ";
  Serial << endl << "set netmask, ";
  if(!WiFly.SendCommand("set netmask","AOK")) Serial << "FAIL. ";
  Serial << endl << "save, " ;
  if(!WiFly.SendCommand("save","AOK")) Serial << "FAIL. " ;
  Serial << endl << "reboot." ;
  if(!WiFly.SendCommand("reboot","AOK")) Serial << "FAIL. " ;


The output indicates some of these SendCommands aren’t returning true:

RAM :659
MAC: 00:06:66:71:c8:5e
set wlan auth 1, 
set wlan key, 
set wlan channel 0, 
set wlan join 1, 
set dhcp 0, FAIL. 
set IP address, 
set netmask, FAIL. 
save, FAIL. 

Is this normal, or what could be causing the issue?

I’ve yet to be able to log onto the network, but this would indicate I’m not getting past basic setup. Any ideas?

Also, to get this running I’ve installed IDE 0022. Is there a library to support serial WiFly comms that’s IDE 1.0 compatible ?


A bit of progress on this. Firstly the SendCommand calls aren't really failing. Despite the example code provided, those three WiFly commands do not return "AOK" so they will return a false value to your sketch, even when they execute correctly. So that bit's a red herring entirely.

Using TeraTerm Pro and talking to the WiFly bee directly I managed to get an adhoc WiFi connection with a netbook, but still having no joy getting connected to the 802.11g access points in infrastructure mode. I'll be upgrading the network to 11N this week so removing that as a possible cause of the issue.

I see some posts on the Sparkfun forum about poor "grounding" causing problems. I don't know enough to understand that quite yet. Hoping the issue will be resolved with a current network security.

Will continue to post progress.

So it transpires now the network is upgraded to 11N, using WPA2 the Wifly associates correctly in infrastructure mode. Happy days ! 8)