W5100 tcp socket closes after some minutes
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: W5100 tcp socket closes after some minutes
by Eugeny ·
I do not see CONNECT command on the list. Do you try to connect to the server?
Most probably socket is closed because server says to close it, sending FIN packet.
Use wireshark to trace packets on the network - the best is to have it installed and run on the server (hopefully Linux or Windows).
RE: W5100 tcp socket closes after some minutes
by elasticman ·
Sorry, I just missed to paste the Connect-command, but it is there!
I’ve tried both, client and server mode, but even in server mode the connection is closed after some time, although I never send the FIN/Close socket command explicitly.
RE: W5100 tcp socket closes after some minutes
by Eugeny ·
It would be very helpful if you can make a wireshark log to see what happens on the network - who sends the closing packet, and what happens before it.
When connection is established, there’re still packets being send from one node to another to keep it alive. It may happen that these packets are got lost, and one of the hosts thinks that connection is broken and closes its end sending FIN to another device.
RE: W5100 tcp socket closes after some minutes
by elasticman ·
Here is a Wireshark log (please notice, there was a ping command running all the time until it dropped!) - you’ll see that there is no close command from any of the devices. The connection simply breaks at a random time.
I wrote a debug register dump method to output all the registers AFTER the connection broke - all the essential registers (GAR, SUBR, SIPR, PORT, DIPR) are 0 (zero!) at the time the connection breaks - or better, the connection breaks because of that. The reset pin is connected to 3V3 through a resistor / capacitor. It seems like the W5100 suddenly loses its settings, even the ping isn’t working any further (how should it as the W5100 lost its network settings)…
ws_export_ping.zip (47.5 KB)
RE: W5100 tcp socket closes after some minutes
by Eugeny ·
Good! You took very good troubleshooting steps. IMHO common registers’ contents loss is not normal and the cause can be:
Thus your action plan would be:
RE: W5100 tcp socket closes after some minutes
by elasticman ·
Thank you very much for your quick answer. I’ve updated the main loop to do nothing. But the problem still occurs after some minutes. I’ve just pinged the device and it suddenly breaks. The debugger was inside the main loop, so no hardfault happened. Power is stable.
RE: W5100 tcp socket closes after some minutes
by Eugeny ·
Change your W5100’s MAC address to 18:15:15:15:AA:AA and try again.
RE: W5100 tcp socket closes after some minutes
by elasticman ·
Thanks for the hint, I’m running a test with another MAC address at the moment.
I also wired a quick, but total similar, setup using an Arduino Uno and the official arduino-ethernet library to exclude a software bug in my driver.
I’ll edit my post as anything occurs.
Edit: Changing the Mac-Address on my STM-board didn’t help me out. The fault is so hard to isolate, that I just can’t provide a real solution - worse, I can’t even find out what’s wrong…
My arduino is running since half an hour without crashing, but it broke once, so I am not sure wether that it’s working…
RE: W5100 tcp socket closes after some minutes
by elasticman ·
So, finally my arduino broke as well, so that I come to the conclusion that my WIZ812MJ board is rubbish.
RE: W5100 tcp socket closes after some minutes
by Eugeny ·
You mean that both boards exhibit the same behavior and both are suspected to be malfunctioning?
Let’s revise everything again:
Is above correct?
Edit:
0. you have exponential signal on the reset line after power up, and perform software reset writing 0x80 to common registers’ MR.