WIZnet Developer Forum

W5500 reads strange socket status (0x01) after a while

Hello everyone.

I’m using W5500 within an Arduino like Hardware configuration and I observe the following:

My device is set up as a Server which is set up in a one-to-one network (1 client, 1 Server)

  1. The server opens a socket and listens for clients
  2. The client connects to this socket
  3. The client sends fixed amount of bytes (9)
  4. The server replies to this with fixed length (63)
  5. The clients waits for 200ms
  6. Steps 3 to 5 are repeated.

No timeouts configured at all.

Everything works fine for some hours. Than the communication breaks down.
For debugging purposes I print out W5500 socket status if changed.
It prints me the following state changes:
0x00 -> 0x13
0x13 -> 0x14
0x14 -> 0x17
after some hours sending data back and forth it prints
0x17 -> 0x01

At this point, I’m not able to get any more data exchanged.
Since it is working for several hours I don’t know what is going wrong.

Due to other restrictions I’m not able to close and reopen the socket after every data transfer.
If you need any additional data I will provide it, please just ask.

At this time I have 4 devices running and all are showing the same behaviour.

Can anyone please help me.
Thanks

0x01 — SOCK_ARP — It is shown when ARP Request is sent in order to acquire hardware address of remote peer when it sends connection request in TCP mode or sends data in UDP mode. If ARP Reply is received, it changes to the status, SOCK_SYNSENT, SOCK_UDP or SOCK_ICMP, for the next operation.

This seems not to be valid state of socket when connection is already established. My immediate guess is that something causes W5500 sending ARP request, and never receiving reply (being stuck in state 0x01). I did not try this, and think it is not valid operation, but may it happens that IP address (of gateway, of remote device) is being corrupt during operation?

What you can do - as soon as device goes into 0x01 state, perform full dump of the common registers and socket registers and check if all settings are correct.

Next step would be running Wireshark, but I assume it may be a lot of data capturing packets for several hours, but that’s good that there’s nothing else on the network, only these two devices. Then you note time when issue happens with W5500, and look into Wireshark log what happens around this event time.

Thank you for response.
It seems a bit unusual, since W5500 is configured as server and only listens for connection. It is not sending a connection request.
Only one Socket of W5500 is used for this and the remote device is a well proven SPS. The cable is directly connected, no HUB/Switch whatsoever.

I have to look tomorrow, because I think I already have a wireshark capture of it, but ignored it in a way. It was only saying RST requests from one, SYN requests from the other device. (I don’t remember which device startet it :-))

Right now I stripped out any logic from my device and will run a test overnight just with hardcoded bytestream to take out any timing/interrupt issues out of the equation.
One time it took 17.239 seconds to get the error (approx. 4h48min).
In SPS I have two counter, one starting at startup, one starting on first connectionError.
That would give me a good chance for wireshark … again

I’ll let you know if I get any news.

1 Like

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.