Hello all,
I'm having some trouble getting my new Ethernet Shield to make repeated connections to a php script hosted on my server.
I'm just starting out using the ethernet shield, and found some code at another post that looked like a decent starting point.
(My code will attached in the next post, as the forums won't let me include URLs in my first post)
the result from the serial window:
connecting...
connected
HTTP/1.1 200 OK
Date: Wed, 26 Nov 2008 15:50:47 GMT
Server: Apache/2.2.3 (Debian) PHP/5.2.0-8+etch11
X-Powered-By: PHP/5.2.0-8+etch11
Content-Length: 27
Content-Type: text/html; charset=UTF-8
/nd101 /c1001 1 2 3 4 /et
disconnecting.
connecting...
connected
HTTP/1.1 200 OK
Date: Wed, 26 Nov 2008 15:51:06 GMT
Server: Apache/2.2.3 (Debian) PHP/5.2.0-8+etch11
X-Powered-By: PHP/5.2.0-8+etch11
Content-Length: 27
Content-Type: text/html; charset=UTF-8
/nd101 /c1001 1 2 3 4 /et
At this point, it just hangs -- indefinitely.
It always connects twice, gets the proper result, and then hangs.
Also, there is a delay of approximately 20 seconds between the printing of the first request ending and the printing of "disconnecting".
Also, if I press the reset button on the shield immeadately after the the first request is returned there is no hanging, and I can continue dozens of times with no troubles.
So, where to start looking for the trouble ?
Incidentally, the included web_client example will hang on "connecting.." if I press the reset button to restart the arduino. If I disconnect it from the power instead of pressing the reset button, no problems.
Ultimately, I'm looking to send a request to my script every few seconds and parse the response. So, if there is a better way to start working at this, I'm all ears.
Many thanks for any advice!