WiFly Setup Problem

I’ve hesitated posting this as it seems like a simple problem to figure out but two of us haven’t been able to so here it is…

I’ve purchased 3 RN-XV units and 3 RN-131C Units. With every unit I have the same issue. I connect power and ground, and then enable ad-hoc via a jumper and I can telnet in via ad-hoc mode without issue. But no matter what I try, after saving my changes and rebooting, none of the units will connect to any of my Wifi routers. I setup a dedicated router just for testing the simplest config, a one word ssid and a 8 character password. I’ve tried WPA1 and WPA2. I also had another one of our engineers try it himself and after several hours he also wound up in the same place no matter what he tried. We’ve tried 802.11a and 802.11b compatible modes on 3 routers (An Airport Express, and 2 different Airport Extremes)

I also tried using an Arduino Rev 3 board and the WiFlyHQ Sketches but I always get “can’t enter command mode” even though I have tried repeatedly and verified that TX, RX, Power and Ground are connected. I tried reversing TX and RX too.

The last config I tried was this

SSID=quick

Chan=0

ExtAnt=0

Join=1

Auth=MIXED

Mask=0x1fff

Rate=12, 24 Mb

Linkmon=0

Passphrase=11111111

TxPower=0

Once again, in ad-hoc mode it works fine, but the minute I try to reboot it with the above settings it never connects to the network. I’m assuming I’m missing something obvious but I can’t figure out what it is?

in ad hoc do a get e and copy paste.

Here it is

WiFly Ver 2.31, 01-01-2012 on RN-171

Beacon=100

Probe=5

Reboot=0

OPEN=OPEN

CLOSE=CLOS

REMOTE=HELLO

FlushSize=64

MatchChar=0

FlushTimer=10

IdleTimer=0

CmdChar=$

IF=UP

DHCP=ON

IP=169.254.1.1:2000

NM=255.255.0.0

GW=0.0.0.0

HOST=0.0.0.0:2000

PROTO=TCP,

MTU=1524

FLAGS=0x7

TCPMODE=0x0

BACKUP=0.0.0.0

DNS=161.72.0.0

Name=server1

Backup=backup2

FTP=208.109.78.34:21

File=wifly-EZX.img

User=roving

Pass=Pass123

Dir=public

Timeout=80

FTP_mode=0x0

SSID=quick

Chan=0

ExtAnt=0

Join=1

Auth=MIXED

Mask=0x1fff

Rate=12, 24 Mb

Linkmon=0

Passphrase=11111111

TxPower=0

SleepTmr=0

WakeTmr=0

Trigger=0x1

Autoconn=0

IoFunc=0x0

IoMask=0x21f0

IoValu=0x0

DebugReg=0x0

PrintLvl=0x1

TimeEna=0

TIMEADR=129.6.15.28:123

Zone=7

Baudrate=9600

Flow=0x0

Mode=0x0

Cmd_GPIO=0

JoinTmr=1000

Replace=0x24

DeviceId=WiFly-EZX

Password=

Format=0x0

Signal=0

Average=5

BCAST=255.255.255.255:55555

Interval=0x7

Sensor=0x0

SensePwr=0x0

What is the subnet mask on the router set to?

255.255.255.0

note I’ve tried giving the WiFly a static IP in the right range and also a DHCP address.

You have the wifly at 255.255.0.0, have you tried setting it to the same netmask as your router 255.255.255.0?

Ugh! It’s working. After trying over and over again, I decided to go back to square one. I got a new router that we hadn’t used before. I reset all the boards. I rebooted all the equipment. I rewired everything. And tried again. And it worked. Then I moved it to the existing routers it wasn’t working on and amazingly, it still works.

I will point out a few things. For some reason even though we have WPA2 routers and all of our desktops log in via WPA2, the WiFly only worked when setting it to WPA1. Also, setting the ip address per several online tutorials wasn’t working. I then realized we also needed to turn DHCP off. Obvious, yes, but blindly reading the online tutorial it wasn’t mentioned, so I didn’t think about it at first.

I had the same issue with WPA2-PSK, I could not connect, using the basic Tutorial, however could with WPA1.

I have been looking for Arduino Code to set the Auth level to 4, however have not found a good example.

I have managed to connect it manually using the SPIuArtTerminal, by setting the commands set wlan auth 4, set wlan said for chance, and set wlan passphrase password, and that worked fine

Here is my code, which works great, but not for WPA-2

#include "WiFly.h"
//#include "Credentials.h"  // Not used since I am using this one file

void setup() {
  Serial.begin(9600);  // Set 
  Serial.println("WiFly Shield Trying to Connect, Routine");
  WiFly.begin();
  if (!WiFly.join("forchance", "password")) {     // auth i would assume would go here, however have no idea how to set it, and found no examples
    Serial.println("Association failed.");
    while (1) {
      // Hang on failure.
      Serial.println("HANG ON FAILURE");
    }
  }
  Serial.println("Associated!");
    Serial.print("IP: ");,, prints IP
  Serial.println(WiFly.ip());//displays the IP address if connected
}
void loop() {
  while(SpiSerial.available() > 0) {
    Serial.print(SpiSerial.read(), BYTE);
  }
  if(Serial.available()) { // Outgoing data
    SpiSerial.print(Serial.read(), BYTE);
  }
}