Wifly RN131G module keeps crashing

I originally posted this on the product page but thought I’d get a bigger audience here :-

"I have one of these but it keeps crashing even when simply sitting there doing nothing. This is an example output form the terminal when it crashes :-

Unrecoverable failure (7) Misaligned address at PC=0002fcd0

The system will be reset

WiFly Ver 2.15, 10-15-2009

MAC Addr=00:06:66:00:3b:b3

Auto-Assoc roving1 chan=1 mode=NONE FAILED

READY

ERR WATCHDOG

Auto-Assoc roving1 chan=1 mode=NONE FAILED

Auto-Assoc roving1 chan=1 mode=NONE FAILED

It always seems to be the same address. Anyone else had this? Note Firmware is 2.15 The REALLY annoying thing is that it seems to do a full factory reset so after a crash has to be set up again from scratch!"

It’s now crashed 4 times in less than an hour!

Martin.

Martin.

Well after some VERY impressive customer service from Mike at Roving networks (he replied to emails within hours even though it’s a weekend and he’s on holiday) I’m now using 2.23 firmware and so far so good although I still need to test it on some other access points next week. Note to anyone who does a firmware update “ftp u” make sure you follow it with a “factory RESET” command otherwise some configuration values will be corrupt.

Martin.

MFX:
Well after some VERY impressive customer service from Mike at Roving networks (he replied to emails within hours even though it’s a weekend and he’s on holiday) I’m now using 2.23 firmware and so far so good although I still need to test it on some other access points next week. Note to anyone who does a firmware update “ftp u” make sure you follow it with a “factory RESET” command otherwise some configuration values will be corrupt.

Martin.

Hi Martin,

Im having the same issues that you had. Ive just emailed RN now to see what they have to say.

im on version 2.27… did you just upgrade the firmware or was there some setting that was needed.

cheers,

David

I have the same issue also.

Anyone have any other clues?

<2.30> scan

<2.30>

SCAN:Found 1

Num SSID Ch RSSI Sec MAC Address Suites

1 911 06 -74 Open 00:0f:66:09:04:eb 104

join 911

Auto-Assoc 911 chan=6 mode=OPEN SCAN OK

Joining 911 now…

<2.30> Associated!

DHCP: Start

DHCP in 5058ms, lease=86400s

IF=UP

DHCP=ON

IP=192.168.1.16:2000

NM=255.255.255.0

GW=192.168.1.1

Listen on 2000

Unrecoverable failure (7) Misaligned address at PC=00039a84

The system will be reset

I figured it out.

The network had multicast running. Once I isolated the WiFly modules from the chatter it works fine.

This is also happening to me on my home network, after upgrading to version 2.30 of the firmware

and doing factory RESET, as advised. If multicast is the issue, how does one stop it, or isolate the

modules from it?

The servers that I’m not aware of using, but that are running on my router are:

IPSec 0.0.0.0 UDP 500/500

PPTP 0.0.0.0 TCP 1723/1723

NetMeeting 0.0.0.0 TCP 1720/1720

Should I stop any of those? Any suggestions would be welcome!

Thanks, Jim

Teraterm session log:

Joining KR1 now…

READY

Associated!

DHCP: Start

DHCP in 11ms, lease=86400s

IF=UP

DHCP=ON

IP=192.168.0.101:2000

NM=255.255.255.0

GW=192.168.0.1

Listen on 2000

CMD

set ip proto 2

AOK

<2.30> Unrecoverable failure (7) Misaligned address at PC=00039fec The system will be reset

WiFly Ver 2.30, 10-26-2011 on 131C11

MAC Addr=00:06:66:14:a5:17

Auto-Assoc KR1 chan=11 mode=OPEN SCAN OK

Joining KR1 now…

READY

ERR WATCHDOGAssociated!

DHCP: Start

DHCP in 11ms, lease=86400s

IF=UP

DHCP=ON

IP=192.168.0.101:2000

NM=255.255.255.0

GW=192.168.0.1

Listen on 2000

It occurred to me that most users of this module probably rely on the Arduino WiFly shield and software, which (as far as I can tell) shields the user from any error messages generated by the module. If the module randomly resets, but recovers and reconnects, users might never notice the problem, except possibly for missed data, etc.

I’ve been emailing with the folks at Roving Networks, and they don’t yet know how to fix the problem.

I’ve also been battling the WiFly to stay connected for about a month now.

This thread spurred me to dig a little deeper into the WiFly library and find out why I would get random hangs of the WiFly module. All I am using it for is to read sensor data and submit an HTTP POST to a remote server, so I’m not using any server functionality whatsoever. The multicast comment made me think that the library may be trying to fire up the HTTP server inside the WiFly module as well, and when receiving a multicast packet, to fall over dead.

Sure enough, I dug into the library, and what I found was the WiFlyDevice.cpp (under the setConfiguration() method) is trying to set a server port to listen on (“set ip localport ”). It was also setting autojoin to 0, and some other things I specifically did not want it to do. Here’s what I did to solve that, and so far so good with not losing connections (though no guarantee this will work for you):

Edit WiFlyDevice::setConfiguration() so that everything is commented out except for the following:

enterCommandMode();

sendCommand(“set comm remote 0”);

Then I use the SPIUartTerminal program in the WiFly examples and run the following:

$$$

reset FACTORY (start from a clean slate. Lots of corruption happened on my card from the shaky library)

set wlan channel 0 (for scanning of all channels)

set wlan ssid (use $ for spaces)

set wlan phrase (Your password)

set wlan hide 1 (to hide the AP password in the command line mode here)

set wlan linkmon 5 (to retry connecting to AP in case of random drop)

set wlan rate 2 (For better range but at a slower speed)

set wlan auth 3 (For mixed WPA1 & WPA2-PSK)

set wlan join 1 (Try to join access point saved above automatically)

set ip flags 0x6 (defaults to 0x7. 0x6 will cause an established TCP conn. to be closed if access to the AP is lost for some reason. This prevents hangs)

set ip protocol 3 (Only act as TCP client right now, not a client/server as default. Server hangs on multicast is the hypothesis as of now)

set comm idle 2 (If inactivity on a socket after 2 seconds, close the connection. Again, try to keep sockets closed when possible)

save (save configuration)

scan (scan for ssid set above)

join # (based on scan command above, join this #)

This should show your WiFly card connected to your access point. Next step is to update to the latest firmware. Just send this:

ftp u

And you should be updated to (as of my writing this) 2.31 firmware.

Now, recompile your program and the modifications to the WiFly library made above, and your card should stay connected. Mine is working great now, but if for some reason it crashes again, I’ll report back so we can keep at it.

As an aside, looking more deeply at the WiFly library, I appreciate that SparkFun created it for us, but it’s not the most solid piece of code I’ve seen, and it assumes a ton (like wanting to run both a client and server). For my project–and I’m sure many of your projects–I will need a lot of solid flexibility with this piece of hardware and I don’t want to have to hand-type the configuration above into the Uart of the WiFly module each time, so I’m considering writing another library for it that will handle this for me. If so, I’ll post it to GitHub and here for others to use and contribute to.

Cheers-

Eric

PS: This doc was indispensable to me. Highly recommended for getting commands directly into the WiFly via the SpiUartTerminal program: http://www.sparkfun.com/datasheets/Wire … SX-um2.pdf

The same problem here. We use it for sensor monitoring purposes and at night when there is no much traffic it works nicely, but

when the laptops, phones start to probe networks. The Wifly module keeps crushing.

Can anyone recommend a robust Wifi module? We are desperate for a good solid one.

The WiFly is a great idea but sadly, not ready for commercial distribution. The folks at Roving Networks can’t seem to fix the problems. There doesn’t seem to be anything comparable, short of a regular network connection with tried and true operating systems running on small computers (netbooks?).

I’ve been designing Wi-Fi based products for over 15 years. In the early days I used Compact Flash Wi-Fi cards as there were no embedded Wi-Fi modules on the market. I’ve used the WiFly (RN-171) in a couple of commercial products with good success, although I’ve had to work closely with Roving Networks to resolve some serious issues. The module does have some limitations that precludes its use in specific applications – don’t even consider this module for use in a web server. As JRemington pointed out, if you are using the Arduino shield some of the problems you are seeing may be related to the driver.

An alternative Wi-Fi module that I’ve also used in a few projects is the Gainspan GS1011M http://www.gainspan.com/gs1011mxx. This module doesn’t have the limitations that the WiFly module does and seems to be more reliable. If there was enough demand, I’d consider designing an Arduino shield using that module and writing a commercial grade driver.

You concern me when saying ‘do not use as a web server’.

I was going to save a small webpage (with Java) on some EEPROM, and then serve it up to clients when they connect. The webserver will populate data about the device where appropriate.

What issues did you face?

The Roving Networks module support only one (1) TCP connection at a time, and if another connection request arrives while it servicing the last request the new one will fail.

All browsers make multiple requests when opening a web page - to speed up the display of the page. The browser makes a separate connection for each files referenced on your page, such as images, CSS or JavaScript - and using the RN-171 they won’t load on a normally coded web page. The only way around this is to include the CSS and JavaScript in your web page. To handle images you’ll have to run JavaScript after your page loads to load each image one by one. Since everything is loaded sequentially the page load is quite slow. Also, it you are planning on using AJAX, you have to carefully manage those requests and make sure they are all synchronous to each other.

I’ve built a couple of projects using the RN-171 where I had to serve web pages for configuring the device, but I wouldn’t use it to serve “real” web pages. While it is doable, it’s difficult to implement and doesn’t provide a nice user experience.

I’m not here to promote my own products, but if you are going to do any serious web serving , you may want to consider this product: http://www.UConTroll.com

set ip protocol 3 (Only act as TCP client right now, not a client/server as default. Server hangs on multicast is the hypothesis as of now)]

Given

1=UDP

2=TCP server + client

4=only packets from stored host IP

8=TCP client only

shouldn’t it be set ‘ip p 8’ ? Doesn’t set ‘ip p 3’ mean UDP + TCPserver/client?