Pages: [1]   Go Down
Author Topic: Ethernet Shield with Mega 2560 data feed drop out problems  (Read 333 times)
0 Members and 1 Guest are viewing this topic.
Mildura, Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I am using a Mega 2560 with an Ethernet shield to monitor temperature and humidity from a DHT11 sensor.  I have set up an account on Cosm and everything works well for 5 to 10 minutes and then the connection seems to drop out.  If I press the reset button on the Ethernet shield the feed starts again for another 5 to 10 minutes before dropping out again.  Is this a common problem and if so how can I fix it to recieve data continuously and reliably?

Thanks in advance.
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 140
Posts: 5873
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If your code does not have all the error checking functions, it is a very common problem. You need to insure the w5100 socket rx buffer is empty and the server has closed its end (or timed out) before closing the connection. This code has all that:
http://playground.arduino.cc/Code/WebClient
The timeout code is very important. Without it, your connection will eventually lock up the Arduino if the server or connection fails. That happens a lot more often than you think.
Logged

Mildura, Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 45
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks SurferTim I will check it out.
Logged

Pages: [1]   Go Up
Jump to: