W5500 TCP Server Port Hangup
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: W5500 TCP Server Port Hangup
by Philipp K ·
The first (and only thing) that comes to my mind is writing over the borders of the socket memory. To you reset/overflow the pointers when exceeding the assigned memory areas?
RE: RE: W5500 TCP Server Port Hangup
by Eugeny ·
… corrupting the chip configuration (e.g. SIP, mask, MAC address …)
RE: W5500 TCP Server Port Hangup
by Mtuan ·
I manually verified all registers after W5500’s port being frozen, and I found that a SHAR0 had been changed. The rest of the registers are all the same.
Is there an app manual that tell you what to do at each Sn_SR?
I think I missed the action for each status or react wrongly, so would you please verify my code:
switch (Wiznet_Connection_Status)
{
case 0x00: // SOCK_CLOSED
WiznetClearInterruptStatus(Int_AllBit);// clear all int bit
WiznetSocketOpen();
WiznetSocketListen();
break;
case 0x13: // SOCK_INT
WiznetClearInterruptStatus(Int_AllBit);// clear all int bit
WiznetSocketListen();
break;
case 0x14: // Keep socket open
WiznetSocketSendKeep();
break;
case 0x17: // SOCK_ESTABLISHED
WiznetSocketSend(); // Command Wiznet to send
if (SocketInterruptStatus.SendComplete==1)
WiznetClearInterruptStatus(Int_SendComplete); // Clear SEND_OK interrupt bit
WiznetSocketSendKeep();
break;
case 0x1C: // SOCK_CLOSE_WAIT
WiznetClearInterruptStatus(Int_AllBit); // clear all int bit
WiznetSocketDisConnectCloseReOpenListen(); // Command socket to close and reopen
break;
case 0x22: // SOCK_UDP
break;
case 0x42: // SOCK_MACRAW
break;
/////////////// Temporary status
case 0x15
break;
case 0x16: // SOCK_SYNRECV
break;
case 0x18: // SOCK_FIN_WAIT
break;
case 0x1A: // SOCK_CLOSING
break;
case 0x1B: // SOCK_TIME_WAIT
break;
case 0x1D: // SOCK_LAST_ACK
break;
default:
WiznetClearInterruptStatus(Int_AllBit);// clear all int bit
break;
}
Thank you very much.
RE: W5500 TCP Server Port Hangup
by acpie360 ·
I am using the WIZNET ioLibrary, which has all the socket API source code. I can see that APIs like connect(), disconnect(), send() all check the Sn_IR register for socket timeout. Are you doing the same thing in your code?
RE: RE: W5500 TCP Server Port Hangup
by Mtuan ·
No, I wrote my own libs.
RE: W5500 TCP Server Port Hangup
by Mtuan ·
I used Wireshark to capture my TCP frame. When client sent a request, my server responded with a RST, ACK.
Anyone has any idea why my server stayed in this mode?
Server status and interrupt as: S0_SR=0x14, and S0_IR=0, and server still replied to a ping request from the pc.
RE: RE: W5500 TCP Server Port Hangup
by Eugeny ·
Do you use different source port numbers at client side? Not sure why client continues with retransmissions as it was clearly told RST. There’s something wrong with the packets. Attach Wireshark log instead of the picture.
RE: W5500 TCP Server Port Hangup
by Mtuan ·
Eugeny, Philipp_K, and acpie360
Thanks for taking time to understand my issues and helped me.
The client is a third party software, and they used a different port for sure. My server used port 502 which dedicates for BACnet TCP/IP. Currently, I hard coded to send only one packet out, and I still have trouble with the W5500 on both RX/TX sides. I got about 48000 packets correct, and about 2000 incorrect packets. I know for sure that my Spi bus is very stable because it shares with an EEPROM, and there is no error on the EEPROM at all.
The W5500 is giving me lot of headache for the last couple weeks.
Many people mentions W5500io libs. I may start to look into them next week. Do you know if W5500io libs include source code for TCP server? Any pre-built libraries that you recommend?
I started this project from scratch by reading the specification version 1.0.6 and now is 1.0.8, but it does not clarify many TCP server apps.
Again, thank y’all very much.
RE: W5500 TCP Server Port Hangup
by Philipp K ·
i once had an issue that was not entirely dissimilar to yours. In my case, it was that I did not overflow the pointers correctly. I think, you idea to use the ioLibraries might eventually help you.
Yes they do, IIRC.
RE: W5500 TCP Server Port Hangup
by Mxyxixptlick ·
You may want to consider giving this W5500 library a try. I’m using it with great success. Even if it doesn’t completely meet your needs, you may gleen useful information from it.