title: Stable HTTP server w/ Arduino WiFi Shield?
body: <p>I'm building my first Arduino project. You can see the basics of what I've done, here: <a href="http://lostechies.com/derickbailey/2013/04/10/a-first-look-at-my-arduino-bbq-thermometer/" rel="nofollow">http://lostechies.com/derickbailey/2013/04/10/a-first-look-at-my-arduino-bbq-thermometer/</a> - it's a network enabled BBQ thermometer, to tell me when my meat is done cooking on the grill.</p>
  
  <p>I've got this set up with a basic HTTP server to produce a JSON document when an HTTP request is made. All of the HTTP handing code that I'm using comes from the samples that are built in to the Arduino IDE software.</p>
  
  <p>The Ethernet Shield version of this code seems to work great. It seems to run for as long as I let the thing stay plugged in / turned on. But when I switch over to my Arduino WiFi shield, and upload the WiFi version of my code - which is also based on the samples in the WiFi libraries demos - it stops responding to requests after about 10 minutes or so.</p>
  
  <p>I'm using an Arduino Undo R3, with the latest Arduino WiFi shield. I've got Arduino IDE v1.0 on my Mac. Everything compiles fine, and seems to run fine for a while. </p>
  
  <p>The HTTP server code very quickly starts having problems. If I put up a simple web page with jQuery.ajax calls to hit the http server every 3 seconds, approximately 1 in 3 requests will fail, almost immediately. Once it moves beyond 10+ minutes, the HTTP server code on the Arduino just stops responding entirely.</p>
  
  <p>It's as if I have a resource leak on HTTP clients, and they aren't being cleaned up... but this is a total guess.</p>
  
  <p>For the gist of what I'm doing, see the code found here: <a href="https://github.com/arduino/wifishield/tree/master/libraries/WiFi/examples/WifiWebServer" rel="nofollow">https://github.com/arduino/wifishield/tree/master/libraries/WiFi/examples/WifiWebServer</a></p>
  
  <p>I've literally just copy &amp; pasted this code, turned it on, and then it starts erroring out. I don't even have to modify the code anymore than setting the right SSID and password, and setting a CORS: * header in the HTTP response. Once I upload it to my Arduino, it starts bombing requests frequently, and a few minutes later, it stops responding entirely.</p>
  
  <p>Has anyone seen this problem before, with the WiFi shield? Does anyone have better HTTP request handling code for the Arduino WiFi shield?</p>
  
  <p>I can provide more information, my actual code, or whatever else is needed, as well.</p>