Go Down

Topic: Reconnecting to Ethernet (Read 3992 times) previous topic - next topic

SurferTim

The 10 second timeout example above shows how to close a connection from the client end. Note there is no break after the timeout client.stop(). Allow the "while(client.connected()) { while(client.available())" loops to exit normally. That insures the connection is closed.

StefanoDiMera

Hi gang,

I (believe that I) successfully integrated SurferTim's code which adds a 10 second timeout. That is to say, when watching the output in the serial monitor scroll by, it reports back that it closes the initial connection to my server after requesting my php script out there.

However, all subsequent requests for that file after the first one continue to be unsuccessful, just as described before. I guess that suggests that something else was preventing all GET requests for the script after the first one from being successful.

Here's a screenshot of the serial monitor output showing the sequence of events.



If you guys recommend that this deserves a separate thread because the root cause is not the same doubledaffy's , I'm happy to open a new one.

Thanks again for your help.

StefanoDiMera

(thinking out loud...)

I wonder if there is a "verbose mode" where I can get it to belch up the error that prevents it from connecting?

SurferTim

#18
May 27, 2012, 11:04 pm Last Edit: May 27, 2012, 11:08 pm by SurferTim Reason: 1
Did you try the code from this link? It gets Google home page every 10 seconds.
http://arduino.cc/forum/index.php/topic,99629.msg754629.html#msg754629

Change the network settings to yours, and the server variable to your server ip. Load your home page first. See how that does. Then try the php page.

edit: corrected spelling.

Is your web server using virtual hosting? If so, the "Host:" parameter must be correct. If it is "www.example.com", then "example.com" may not work.

Go Up