I have issues with the orginal arduino WiFi shield. I use it as a TCP/IP server, to send data periodically over an open connection (streaming).
I experienced bursts of the send data each 2 seconds, and each write() that finally starts a burst is blocked for a really long time (I think it was around 500 ms, but not sure any more.)
I found a bug report under https://github.com/arduino/wifishield/issues/24 and applied the given workaround (sending data to the shield in between). Still the data comes in bursts, always 5 data lines in one burst, and each 5th write() blocks for 150 ms (detailed calculation below). This is still inacceptable in my opinion (and for my use case).
Here is some output of the attached sources:
1366397893,140 sek value=1023.0 1366397893,140 sek value=1023.0 1366397893,140 sek value=1023.0 1366397893,389 sek value=1023.0 1366397893,390 sek value=1023.0 1366397893,390 sek value=1023.0 1366397893,391 sek value=1023.0 1366397893,391 sek value=1023.0 1366397893,642 sek value=1023.0 1366397893,642 sek value=1023.0 1366397893,643 sek value=1023.0 1366397893,643 sek value=1023.0 1366397893,643 sek value=1023.0 1366397893,894 sek value=1023.0 1366397893,895 sek value=1023.0 1366397893,895 sek value=1023.0 1366397893,896 sek value=1023.0 1366397893,896 sek value=1023.0 1366397893,897 sek value=1023.0 1366397894,148 sek value=1023.0 1366397894,148 sek value=1023.0 1366397894,148 sek value=1023.0 1366397894,149 sek value=1023.0 1366397894,149 sek value=1023.0 1366397894,402 sek value=1023.0 1366397894,402 sek value=1023.0 1366397894,402 sek value=1023.0 1366397894,403 sek value=1023.0 1366397894,403 sek value=1023.0 1366397894,403 sek value=1023.0 1366397894,657 sek value=1023.0 1366397894,657 sek value=1023.0 1366397894,658 sek value=1023.0 1366397894,658 sek value=1023.0 1366397894,658 sek value=1023.0 1366397894,907 sek value=1023.0 1366397894,908 sek value=1023.0 1366397894,908 sek value=1023.0 1366397894,908 sek value=1023.0 1366397894,909 sek value=1023.0 1366397895,160 sek value=1023.0
Each 250 ms there are 5 values comming in in one burst. This does not change, when I accompany each data line with an extra line (see in the arduino code), so it cannot be a simple buffer-filled trigger.
Another thing we see in this data: The arduino code was supposed to send a data line each 20 ms (see "delay(20)" in the code). This would make 50 values per second. But there are only 5 values/burst * 4 bursts = 20 values per second. So, the loop passes the delay(20) only 20 times per second, that make400 ms /sec. So the missing 600 ms /sec are spended in the 4 "client.write()". This gives a blocking of 150 ms on each send() that leads to a send-burst.
This is much to much to be in any way "normal". The WiFi shield has its own processor, so the write() should take just a few microseconds.
I put the code in the next post, due to post size limits.