Ethernet fails connecting after a while

The EtherTen combines an Uno-equivalent Arduino-compatible board and Wiznet-based Ethernet support, along with a microSD card slot and Power-over-Ethernet support. [Product page]
cjdelphi
Posts: 36
Joined: Mon Mar 19, 2012 10:11 am

Re: Ethernet fails connecting after a while

Post by cjdelphi » Sun Apr 01, 2012 2:55 am

but...

Sometimes (even after no use) after 24 hours it just stops responding, and it has nothing to do with the close_wait or fin or any other ack.

So, is the longterm issue a sign of badly written firmware on the wiznet chip?

cjdelphi
Posts: 36
Joined: Mon Mar 19, 2012 10:11 am

Re: Ethernet fails connecting after a while

Post by cjdelphi » Sun Apr 01, 2012 2:56 am

http://110.175.97.110:1234

there's my Ether10 unit, you'll find after 2 days (just reset it now, i wont touch it until it dies and make a post here) it stops again... and i'm sure it's the Wiznet chip at fault.

cjdelphi
Posts: 36
Joined: Mon Mar 19, 2012 10:11 am

Re: Ethernet fails connecting after a while

Post by cjdelphi » Mon Apr 02, 2012 8:50 am

it stopped, trying again lol, this time i think it was my fault... 4/2/2012 6:18pm.. South Australia

Sleurhutje
Posts: 28
Joined: Thu Mar 01, 2012 9:18 am

Re: Ethernet fails connecting after a while

Post by Sleurhutje » Mon Apr 02, 2012 3:27 pm

Sleurhutje wrote:@mr-russ: You're my hero. :ugeek:

Added the SnSR::CLOSE_WAIT to the EthernetClient.cpp (in Arduino 1.0 Ethernet Library line 44) and the EtherTen is running fine for a continuous 72 hours. Normally it would crash within 24 hours. Even in a high latency network no connection failures. Sometime the wait state takes up 60 seconds but all keeps going on without crashing.
Too bad, too soon... :cry: After 6 days with some minor hick-ups things started to fail. My EtherTen opens a URL every 121 seconds and closes the connection afterwards. When the connection fails, one or more subsequent efforts to open the remote URL fail. Then all works fine. Until the real crash. The ethernet chip doesn't respond anymore, other processes are still working fine.

Most remarkable is that when the Wiznet crashes, LED D13 is lit (red LED next to the blue power LED). Nowhere in my script is D13 used... :shock: Any ideas? :idea:

Sleurhutje
Posts: 28
Joined: Thu Mar 01, 2012 9:18 am

Re: Ethernet fails connecting after a while

Post by Sleurhutje » Mon Apr 02, 2012 7:02 pm

Could it be the problem is caused by a wrong type of ethernet connector, just like happened to the first batch of the Raspberry Pi? It had something to do with the internal transformer of the connector.


-edit-
D13 is used for the SPI Clock (if I'm correct) so it looks like there is a problem with clocking the SPI interface which probably causes the ethernet to fail due invalid data. :?

In my sketch I removed all interrupt driven routines and replaced them by reading each pin in the main loop and toggle a boolean when things change. And changed the last 3 digits of the MAC address to valid ASCII characters because some DHCP servers can't handle invalid DNS hostnames (WIZnet??? where ??? are the last 3 bytes of the MAC address). Still no improvements.

The sketch pushes the data to a SQL server on the internet using a URL with variables. The PHP script injects data into the database. Each update is sent every 121 seconds. In the log below you can see in the last column when the connection fails. At 21:07:52 the connection was recovered from the previous failure. The count is a forced close of the internet connection and counted as a failed connection. But the entries on the lines below did not result in a forced closing of the connection because the status of the connection indicated the active connection was succesfully closed. However, no data was send because there is a gap in the log times. There were no problems on the internet and network connections.

It's still a mystery to me. I've received my ENC28J60 modules today and will hook them up and change the sketch to see if the same thing happens with the ENC28J60 chip. Okay, it's a different library but worth a try.

Code: Select all

Date/Time                          TEMP    RH%     MQ7   PIR  FAIL
------------------------------------------------------------------
Mon, 02 Apr 2012 21:17:57 +0200    28.4    34.6    162    2    0 
Mon, 02 Apr 2012 21:15:56 +0200    28.4    34.5    155    0    0 
Mon, 02 Apr 2012 21:13:55 +0200    28.4    34.7    150    0    0 
Mon, 02 Apr 2012 21:11:54 +0200    28.3    34.6    159    3    0 
Mon, 02 Apr 2012 21:09:53 +0200    28.3    34.7    160    0    0 
Mon, 02 Apr 2012 21:07:52 +0200    28.3    34.7    159    2    1 <-- Correct
Mon, 02 Apr 2012 21:03:50 +0200    28.2    35.2    160    0    0 
Mon, 02 Apr 2012 21:01:49 +0200    28.2    35.1    159    0    0 
Mon, 02 Apr 2012 20:59:48 +0200    28.2    34.9    161    0    0 
Mon, 02 Apr 2012 20:57:47 +0200    28.1    34.7    163    6    0 
Mon, 02 Apr 2012 20:55:46 +0200    28.2    34.3    168    2    0 
Mon, 02 Apr 2012 20:53:45 +0200    28.3    33.9    170    0    0 
Mon, 02 Apr 2012 20:51:44 +0200    28.4    33.7    167    1    0 
Mon, 02 Apr 2012 20:49:43 +0200    28.5    33.3    168    2    0 <-- 7x Wrong
Mon, 02 Apr 2012 20:33:19 +0200    27.8    34.7    172    0    0 
Mon, 02 Apr 2012 20:31:18 +0200    27.7    35.0    166    4    0 <-- 1x Wrong 
Mon, 02 Apr 2012 20:27:16 +0200    27.8    34.3    169    0    0 
Mon, 02 Apr 2012 20:25:15 +0200    27.8    34.5    177    2    0 
Mon, 02 Apr 2012 20:23:14 +0200    27.7    34.5    171    0    0 <-- 2x Wrong
Mon, 02 Apr 2012 20:17:11 +0200    27.5    34.5    171    0    0 
Mon, 02 Apr 2012 20:15:10 +0200    27.5    34.5    170    0    0 

cjdelphi
Posts: 36
Joined: Mon Mar 19, 2012 10:11 am

Re: Ethernet fails connecting after a while

Post by cjdelphi » Wed Apr 04, 2012 2:01 am

Could it be heat doing this?... I'm starting to think it's plausible, I simply placed an IC heatsink (TO22?, 3 pin IC type) on top of the wiznet chip carefully not shorting anything, and it's been running for 2 days solid now without a crash...

going to see how long it lasts....


Anyone else confirm this heat issue? - eg if it's giving you problems stick some kind of heatsink on and see if they continue...

cjdelphi
Posts: 36
Joined: Mon Mar 19, 2012 10:11 am

Re: Ethernet fails connecting after a while

Post by cjdelphi » Wed Apr 04, 2012 5:02 am

I've added an Uptime counter now so I can at least check on it and get a rough idea of when it crashed (not happened yet though)



http://110.175.97.110:1234

-------------------

Hello from my Arduino!
Main Power: Main 240 volts OK
Bedroom Lighting: OFF!
Local IP: http://192.168.1.253:1234/WAN IP: http://110.175.97.110:1234
Hello Visitor Number: 68
New Pressure: 1015.01Millibars
Old Pressure: 1014.92Millibars
Temprature: 27.80c
Altitude 69.13 meters above sea level

0h:45m:44s


- Written By Craig C. (2012)

---------------------

It's now a bedroom weather station lol....

Sleurhutje
Posts: 28
Joined: Thu Mar 01, 2012 9:18 am

Re: Ethernet fails connecting after a while

Post by Sleurhutje » Wed Apr 04, 2012 10:11 am

cjdelphi wrote:Could it be heat doing this?... I'm starting to think it's plausible, I simply placed an IC heatsink (TO22?, 3 pin IC type) on top of the wiznet chip carefully not shorting anything, and it's been running for 2 days solid now without a crash...

going to see how long it lasts....


Anyone else confirm this heat issue? - eg if it's giving you problems stick some kind of heatsink on and see if they continue...
The WIZnet chip gets hot but does not exceed 50 degrees Celsius in my configuration. That's acceptable. If overheating was an issue, the problems would be back quickly after resetting the Arduino. But that is not happening, it starts working for another X hours without problems.

I also tried other power supplies, adding extra capacitors to get rid of any ripple voltages and perhaps glitches, soldered all connections eliminating contact problems on the headers etc. but nothing did the trick so far. :cry:

cjdelphi
Posts: 36
Joined: Mon Mar 19, 2012 10:11 am

Re: Ethernet fails connecting after a while

Post by cjdelphi » Wed Apr 04, 2012 10:45 am

you say that...


Hello from my <u><b><i>Arduino!</u></b></i><br>
Main Power: Main 240 volts OK<BR>
Bedroom Lighting: <B><I>
OFF!
</B></I><BR>
Local IP: http://192.168.1.253:1234/WAN IP: http://110.175.97.110:1234 <br>
Hello Visitor Number: <b>107
<br></b>New Pressure: <b>1016.94</b>Millibars<br>Old Pressure: <b>1017.00</b>Millibars<br>Temprature: <b>26.30</b>c<br>Altitude
53.00 meters above sea level<br>
<br>
0h:0m:56s<br> <BR><BR> - Written By Craig C. (2012)1234/WAN IP: http://110.175.97.110:1234 <br>
Hello Visitor Number: <b>83
<br></b>New Pressure: <b>1HTTP/1.1 200 OK
Content-Type: text/html

Hello from my <u><b><i>Arduino!</u></b></i><br>
Main Power: Main 240 volts OK<BR>
HTTP/1.1 200 OK
Content-Type: text/html

Hello from my <u><b><i>Arduino!</u></b></i><br>
Main Power: Main 240 volts OK<BR>
Bedroom Lighting: <B><I>
OFF!
</B></I><BR>
Local IP: http://192.168.1.253:1234/WAN IP: http://110.175.97.110:HTTP/1.1 200 OK
Content-Type: text/html

Hello from my HTTP/1.1 200 OK
Content-Type: text/html


if i hit F5 (refresh) from the browser a few hundred times, it eventually ends up spewing out line after line until it dies...., i've stuck an ice cube (inside a bag) on top and guess what, it no longer crashes, take it off and do it, it crashes.., i'm almost certain it's heat related now..

maybe after it crashes it quickly cools down ... and allows it to be reset and work for a few more hours?

cjdelphi
Posts: 36
Joined: Mon Mar 19, 2012 10:11 am

Re: Ethernet fails connecting after a while

Post by cjdelphi » Wed Apr 04, 2012 10:49 am

ok i take it all back... i managed to get it to crash with an ice cube performing as a melt-able heatsink :( :oops:

Post Reply