Hi Folks,
I recently picked up an Arduino Wifi Shield and have bumped in to a few major setbacks with what I believe is the library and firmware. I won't post code, because you can use the "WifiChatServer" example sketch that ships with it to demonstrate the problems. Forgive me if I've missed something obvious here and please point out my error.
I know this is a new project and the code has only recently been made public. I'd like to rally some folks to see if we can wrap up a few bugs add some functionality and perhaps get some momentum going (or be informed that there already is some).
Basically I've experienced the following issues (one of which there is a bug report for). You can test this by uploading the example chat server sketch to your board+wifishield and running it.
SETUP:
- Mac OS X 10.8.2
- Arduino Uno Rev 2
- Arduino WifiShield
- Latest code as of Oct 21, 2012 from
https://github.com/arduino/wifishield- I re-flashed the shield with the binaries in the github repo to make sure it's latest (Consequently it broke WiFiDrv::getFwVersion(), which now returns an empty string whereas it used to return 1.0.0 when it was stock - Yes, I realize that the github repo contains 1.0.0 as well)
ISSUES:
1)
Server hangs up and turns in to a zombie: Make a socket connection to the chatserver. Don't send data. After ~12 seconds, the wifiserver will disconnect with a TCP RESET packet. You will no longer be able to initiate a connection (via nc,socat,telnet) to the server until you reset the Arduino. From a tcp/ip perspective, packets are still sent and ack'd from the server. It's just that the server is somehow dead. If you put in some debug code and call server.status(), after that event, it always returns 0. You can not run a server.begin() on it again as it has no effect.
If the you/client initiates the disconnect (ctrl-c, ctrl-d, etc) at any point. Things are fine. You can reconnect and be on your merry way. Just don't let the server disconnect you, or it'll go zombie.
Furthermore, this isn't an issue of the client not sending data. If you comment out all the server.write() calls so that the server NEVER returns data. It will always hang up after ~10-12 seconds, no matter how much client data is received (and logged to serial). This issue is specifically with the shield firmware or library timing out for some reason if the server never sends a byte of data.
WORKAROUND: You can write some heartbeat code to always send (server.write()) a NULL byte every 5 seconds to the client when connected and this issue no longer occurs. You can remain connected without worrying about the server going zombie.
References:
http://code.google.com/p/arduino/issues/detail?id=1024&q=wifi2)
Only one connection at a time: It looks like you should be able to handle up to 4 sockets, but the server never seems to return the additional connections in a server.available() call. Perhaps I misunderstand how to code this, but again, use the chatServer example and you'll see that only one connection at a time works. The additional connections over the initial one will send and receive tcp/ip packets, but the client connection never gets passed to the "application layer".
3)
Wifi Disconnects, server goes zombie: If the Wifi signal is lost you can detect this and have it reconnect. However, after that event, on a wifi.disconnect() then wifi.begin(), you can server.begin(), but server.status() always returns a 0. I can post modified chat server code for this on request, but this issue seems to be related to issue (1) above.
FUNCTIONALITY REQUEST:
1)
UDP server: Lack of code at the moment.
WHAT I NEED:
1)
Set up environment to compile firmware: Eclipse or otherwise. I've done quite a bit of reading and tracing of the code back to the firmware. I'd like for us to come together and see if we can get to the bottom of some of these issues. I've managed to compile avr32-toolchain for os x with the help of
https://github.com/jsnyder/avr32-toolchain with some slight modifications and I've got eclipse installed with the avr-plugin, CDT and avr32 studio, but I still can't import the wifiHD firmware project as I'm getting a "No file system is defined for scheme: framework" message on import. Any help on this would be appreciated.
2)
Expert advice: If anything I've written sounds crazy or I'm doing something wrong or misunderstanding, please point that out. If there is anyone who has some pointers to make my life easier in trying to track this bug down, please provide them.
3)
Development help: Anyone out there who's willing to donate some time. We'd all appreciate it.
Thanks so much! Hope to hear from you.