Loading...
Pages: [1]   Go Down
Author Topic: Official Wifi Shield Disconnect and Reconnect Problems  (Read 692 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi there!

I am having problems with my Wifi Shields.

Setup:
All my Shields are plugged into Arduino Duo Rev.3, of course, one for each Wifi Shield. Nothing fancy here.
I do not power the Uno via USB, but with a 12V power supply.  However, I tried both and it doesnt affect its behaviour or these problems.

Software:
The software running Server Side (on the Arduino) is just like the Chat Server example. It doesnt echo back the data, but makes a simple computation and then, sends back the data to my computer.
At client side, there is a software which connects to the server and sends random values, 1 per second.

Problems:
I have to deal with two problems:
1. Reconnect Issues - Whenever I had to stop my software on the computer (happened a lot while debugging), the socket doesnt terminate correctly ( the server probably doesnt get any RST ). After that, I can not reconnect to the Arduino. After resetting the Arduino, connecting works normally.

2. Disconnecting - After some time (like 3 hours) the Arduino just seems to disconnect from the network. I dont know why, but pinging the device still works. I cant reconnect, though. Here, I have to reset the whole Arduino again in order to reconnect.

3. Random data - When connecting to the Arduino (with netcat or telnet) I get random data, first. If I dont send any data back, the connetion terminates and I have to reset the Arduino in order to reconnect again. Why is that? Of course, the server flushes the client buffer when I connect, but actually, I shouldnt get this random data.

All these problems occur not only once - They occur all the time. I am using 5 Uno - WifiShield setups so this is definitely not some hardware-specific failure.

I hope anyone can help me fixing these problems or, at least, provide some workaround. The server doesnt have to run 24/7 but 12 hours a day straight should be possible.
Thanks in advance!

kind regards,
kamo


Link to Chatserver Example:
http://arduino.cc/en/Tutorial/WiFiChatServer
« Last Edit: December 14, 2012, 11:01:45 am by kamo » Logged

California
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a very similar problem.  I am using the Webduino webserver library with the official wifi shield and official WiFi library. The arduino board is Mega 2560 rev 3.  Everything works great and is rock solid as long as the router connection is maintained.  If the LAN router goes down, the arduino/wifi shield reconnects the radio and reappears on the LAN when the LAN router is brought up.  But when it comes back my sketch is hung up.

The arduino/wifi shield connot be reached from a client unless I do a hardware reset or power cycle the shield.  I have two systems, and they both behave the same way.

I reflashed the firmware to the 1/19/2013 revision, and installed the 1/19/2013 library.  These actions did not fix the problem.  I think the previous poster is correct that something is not being reset that should be reset when the wifi shield loses connection.

I do not have the previous posters disconnecting problems (#2 and #3).  I had those problems when I was using the example web servers from the arduino web site.  Once I switched to the Webduino library those problems went away.  I think the simple web server sketches on the arduino web site cannot handle connections coming from multiple clients in rapid succession.  I was able to crash those servers easily by using two or three computers issuing client connections repeatedly.  The Webduino library web server is robust enough to survive that.

When the arduino/wifi shield cannot survive a power failure of the LAN router without requiring a manual reset, it is not useful as a remote data server/controller.  I am hoping enough people see the problem that a fix can be developed.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I reflashed the firmware to the 1/19/2013 revision, and installed the 1/19/2013 library.  These actions did not fix the problem.  I think the previous poster is correct that something is not being reset that should be reset when the wifi shield loses connection.

That didnt work for me, either.

I do not have the previous posters disconnecting problems (#2 and #3).  I had those problems when I was using the example web servers from the arduino web site.  Once I switched to the Webduino library those problems went away.  I think the simple web server sketches on the arduino web site cannot handle connections coming from multiple clients in rapid succession.  I was able to crash those servers easily by using two or three computers issuing client connections repeatedly.  The Webduino library web server is robust enough to survive that.

Now, that is interesting. Did you have those problems only with multiple clients? Or was it exactly the same as in #2 ?
I will definitely try out the webduino library. My biggest problem here is reliability and I did not have any concurrent connections, just one. Thanks.

kind regards,
kamo
Logged

California
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Both.  Multiple clients and a single computer.

Using the simple arduino servers I was able to quickly and repeatably crash the arduino server using multiple computers on my LAN trying to become the client at the same time.  I could also sometimes crash it by hitting it with refresh or GET from a single computer in rapid succession.  If I hit it while the HTML page was reloading it would frequently fail.

Also, it would usually go down at least once a day by itself.  That was because my Firefox browsers would issue page hits to the arduino occasionally on their own.  I think Firefox does that to create the tiled page of previous web sites visited.

So then I switched to the webduino library.  The webduino library has a more robust handling and timeout procedure that has been able to survive any traffic I have thrown at it.  I am using the Webduino wifi library that was forked from the ethernet version:

https://github.com/acarlton/Webduino/tree/wifi

At the moment I using webduino to run a 110v house light using an X10 firecracker controller.  My webpage is on the internet and I am controlling the light reliably from 100 miles away.  It works with iPad Safari, IE explorer, and Firefox.  iPad is a somewhat slower, but mine is the old iPad2.

I still have trouble getting my arduino wifi shield to reconnect to my ATT Uverse 2Wire gateway after a power failure.  If my arduino webserver powers up prior to the LAN being available, the radio in the shield connects, the wifi status is correct, but my webduino server does not process connections.  I have to power down reset the arduino to reconnect.  As long as the power on both stays up I do not have any problems with the arduino webduino server hanging up.

If you try webduino wifi , please post your results.

Regards also,
fpga6
Logged

California
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

An update.

I have two of these arduino/webduino/official wifi shield systems running.

Each ran successfully for about 6 1/2 days and then each stopped responding.  The void loop is running fine, but the webserver is not responding to clients.

Since I am not at the location of these systems, I put one on a mechanical lamp timer so it powers down for one hour at midnight and reboots.  That way the system is unlikely to be down for more than one day.  I can live with that temporarily.

For the long term I am still searching for a new fix.  I am now running the newly patched Webduino server at https://github.com/cat101/Webduino/tree/patch-2.

I had to change three lines to convert WebServer.h to WiFi from Ethernet.  I will update this thread if I see improved reliability.
Logged

Pages: [1]   Go Up
Print
 
Jump to: