Freez Problem?

Hello (i’m french, sorry for my english)

I am developping my own board for domotic control via ethernet, based on a atmega2560 (arduino compatible) and your wiz820io module. It is very interresting because it is very small, and easy to use. I am very happy about the wiz820io, but it doesn’t works very well…

when my program starts, approximately once on two, the wiz820io doesn’t connect to my LAN network (my programme is based on the webserver arduino example, so i use the “begin(mac, ip)” function). I have update W5100.h and W5100.cpp for the W5200 chip.

when i am lucky and the wiz820io is connect, the program works fine, but after 60s, or sometime more (no constant), my program still run (i have one led which blink to visualise activity), but wiz820io donesn’t works : no ping, no response in google chrome, nothing ! i have too reset my board…

do i need to connect the real 10 pin digital (pin which represent the SS on a ethernet shield) of the atmega 2560 (PORTB 4), or can i just connect the SS’s wiz820io pin to GND ? (it is actualy like that, and seem to work ?) The real hardware SS atmega 2560 pin is PORTB 0, but the arduino library works with another pin : PORTB 4

Is it very important if the SS pin is not connected to a SS pin, because it seem too works sometime with GND

i don’t see the is the difference than that…

Thanks for your answer

Hi mccyrille

I do not work for Wiznet and also not an arduino user :slight_smile: but I am also facing similar issues as yours. On you first issue, it seems like you are not holding the nRESET long enough. Try holding the nRESET low for 100ms, then hold it high for about 500ms before doing any read/write to W5200. It does not seem to hard reset the part properly if I use the same timings as wiznet has mentioned in datasheet, shame. Applying hard reset for longer duration seem to have fixed my problem and I am able to connect all the time reliably.

On your second issue of no response to ping, I am also facing similar one and looking for some help. see my issue here. Wiz820io stops responsing to PING after few hour of running

thanks

Hi,
It seems to look the phenomenon as same as nver said.
Let me know your data code on W5200 chip, purchase date and dealer.
Data code is 4 digits number on the bottom of the w5200 chip.

Thanks.

This post seems to be helpful.

Informations on the chip W5200 :

W5200
HP2564
1133

I have purchase the Wiz820io at Lextronic (France), the 9th january 2014

As “nver” saids, a long hard reset and a 500ms waiting time is really better for the first connection (not a IP 0.0.0.0), not as datasheet said… It is really better, thanks !

I have connected the nSS to the pin of my Atmega2650 (before, nSS pin was directly on GND). Not really better, not really worst, i have always a random freez in the time (sometime some minute, sometime some hours…).

I juste send a Get request of 100 char maxi every min…

However, i have an other problem which i have solve with search on the net : if i send my get request in my browser, and i do F5 lot of time, the Wiz820io freez to. The problem as been solve (reply #12) : forum.arduino.cc/index.php?topic=139147.0

Juste add “if (_len ==0) return 0;” in int16 write function in the W5100.cpp file. it is really better, but i always have the problem of freez randomly…

Hi,
Is it worked again without any system reset after freezing?

If yes, the freezing is caused by no acceptable channel any more or host burden of such proocessing as memory copy, proctocol process, and etc. Normally, it is used as many channel as possible in server application like as webserver, and optimized codes.

If no, It maybe have some problem as firmware or others. In this case, test more and more for analyzing the reason.

I have always the problem…

It works somes hours, but after, the acces page don’t responding, but it always ping…

I look socket statut, an sometime i have a socket statu = 0, but always open (port and IP is always set), and it donesn’t reset

i have seen 0x16 for socket statu. The most of time, i see 0x17 and 0x14…

example :

Socket#0:0x17 80 D:192.168.0.45(55817) FreeTX:2047 - TxReadPointer:25273 - TxWritePointer:25296- FreeRx:0 - RxReadPointer:417 - RxWritePointer:417
Socket#1:0x17 80 D:192.168.0.31(55563) FreeTX:2048 - TxReadPointer:11579 - TxWritePointer:11579- FreeRx:0 - RxReadPointer:0 - RxWritePointer:0
Socket#2:0x17 80 D:192.168.0.31(55598) FreeTX:2048 - TxReadPointer:57586 - TxWritePointer:57586- FreeRx:0 - RxReadPointer:0 - RxWritePointer:0
Socket#3:0x14 80 D:192.168.0.45(55815) FreeTX:2048 - TxReadPointer:0 - TxWritePointer:0- FreeRx:0 - RxReadPointer:0 - RxWritePointer:0
Socket#4:0x0 80 D:192.168.0.45(55729) FreeTX:2048 - TxReadPointer:41772 - TxWritePointer:41772- FreeRx:0 - RxReadPointer:299 - RxWritePointer:299
Socket#5:0x16 80 D:37.161.113.233(32023) FreeTX:2048 - TxReadPointer:1764 - TxWritePointer:0- FreeRx:0 - RxReadPointer:0 - RxWritePointer:0
Socket#6:0x0 0 D:0.0.0.0(0) FreeTX:2048 - TxReadPointer:0 - TxWritePointer:0- FreeRx:0 - RxReadPointer:0 - RxWritePointer:0
Socket#7:0x0 0 D:0.0.0.0(0) FreeTX:2048 - TxReadPointer:0 - TxWritePointer:0- FreeRx:0 - RxReadPointer:0 - RxWritePointer:0

as you can see, socket #4 is “0x0”, but not cleard, and the socket #5 has “0x16” statu…

do you think all is ok ?

maybe more i wait, more socket fill and rest fill with statu 0x0, but cant be use ? What append when all socket are use ?

Hi,

Is the below log dumped on freezing ?

it seems to be likely to normal.
Socket status 0x14, 0x16, 0x17 and 0x00 represents ‘LISTEN’, ‘CONNECTED(ESTABLISHED)’, ‘SYN RECV’, and ‘CLOSED’ respectively.
These status can be shown commonly in TCP protocl processing. (For more detail, refer to Sn_SR in W5200 datasheet.)
Also, the related socket registers such as pointers, destination IP, and etc isn’t reset when the socket is reset.
The registers are reset or remained with the previous value when socket is opened.
Notice that pointer regsiters should be reset when socket is opend.

Anyway, I just wonder that …
– Is ‘37.161.113.233’ valid, that is, the ip address is used in your network environments.
----> If it is not valid, Test more why it is read.

As you said, The socket is closed and then it can’t be re-opened. right?

Thank you.
<c.f> The detination register are only valid when socket status is established. Other status, it is dummy value or the previous value.

[quote=“midnightcow”]Hi,

Is the below log dumped on freezing ?

I do not manage to have a log on freezing…

it seems to be likely to normal.
Socket status 0x14, 0x16, 0x17 and 0x00 represents ‘LISTEN’, ‘CONNECTED(ESTABLISHED)’, ‘SYN RECV’, and ‘CLOSED’ respectively.
These status can be shown commonly in TCP protocl processing. (For more detail, refer to Sn_SR in W5200 datasheet.)
Also, the related socket registers such as pointers, destination IP, and etc isn’t reset when the socket is reset.
The registers are reset or remained with the previous value when socket is opened.
Notice that pointer regsiters should be reset when socket is opend.

OK

Anyway, I just wonder that …
– Is ‘37.161.113.233’ valid, that is, the ip address is used in your network environments.
----> If it is not valid, Test more why it is read.

Yes it’s normal. I use the Wiz820io for a homemade domotic device, and it’s my smarphone which is connected, or maybe the google script which manage my device, i don’t know, but it’s an externa IP, that’s normal. The most of time, the wiz820io receive external command. local ip is very rare, juste for me, for testing freezing w5200. Maybe the wiz820io freez more with external IP ?

As you said, The socket is closed and then it can’t be re-opened. right?

Yes, it seem to be that too ; when it have to re-open a socket, sometime the wiz820io us a completely free socket, than a closed, but not cleard socket… coincidence ?

Thank you.
<c.f> The detination register are only valid when socket status is established. Other status, it is dummy value or the previous value.[/quote]

I want to add that when i try to connect to the wiz820io from external IP in a browser and when it’s freezing, i have a quick answer “server don’t respond” (2s max). When the wiz820io is really not connect (turn off, or arduino don’t ready to answer), the browser loading for 10 - 15s, and print “server not found”. There is a différence…

if i don’t find what is the real problem, i will have to reset every 15min… it’s sad and not really pro for a domotic system…

I’m not alone with this problem : forum.arduino.cc/index.php?topic … icseen#new

Hi,
I’m so sorry about my unhelpless posts.

Most of all, Find where the code is hanged up.
For this, Add debugging information as serial,led toggle, and etc to infinited loop.
Did you test another modules?
And If it is critical and serious , then I recommened that you will directly request help to Europe Branch of WIZnet.

If W5200 have no acceptable socket for a client, normally, W5300 send a RST packet, therefore it didn’t take time 10 ~ 15 seconds. If you solve the problem, it will be cleared also.

Thank you.

I have only one wiz820io ; it’s 20$, and I would like to be sure of this one before order another one…

I think the problem comes from the WIZ820io… I use your librairy arduino. If you are sure of librairy, and sometime the wiz820io communicate / works, it couldn’t be my fault… no ? I only use server object / client objet, like webserver sketch arduino example…

I haven’t to enter in bottom librairy / object normaly, i only need to use the global class…