W5500 TCP Client CONNECT problem
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 Client CONNECT problem
by Zarck ·
More precisions:
I am using ezTerm or Hercules as TCP Server, listening the Port 31000.
I was thinking for a moment that it could be the Windows firewall which was blocking the port access but the OPEN_COMMAND works well.
I just cannot connect to the PC and I don’t see why, I always go to Time Out.
I also tried adding the subnet mask register but nothing changed.
RE: W5500 TCP Client CONNECT problem
by suhwan ·
Dear Zarck,
Would you send the packet capture ?
Your code doesn’t seem to have any problem.
Thanks,
RE: W5500 TCP Client CONNECT problem
by Zarck ·
Thank you for your answer.
Here are the captures. Note that it stays infinitely in the last while loop because it is never equal to 0x17.
These captures are done with a terminal open as Server and listening on the Port 31000 configured in the code above.
I did 3 captures to clearly see the packets.
RE: W5500 TCP Client CONNECT problem
by suhwan ·
Thank you for your the spi packet…
But, we want to Ethernet packet capture.
By using 'WireShark", you can capture the Ethernet packet.
Please, attach Ethernet packet capture.
Thanks,
RE: W5500 TCP Client CONNECT problem
by Zarck ·
Ok Sorry.
Here is a screenshot of wireshark. I think there is definitely a problem there.
I just added one code line which define the Source Port at 31001 in order to clearly see it on wireshark.
RE: W5500 TCP Client CONNECT problem
by suhwan ·
Dear Zarck,
As you know, PC program do not send SYN-ACK corresponding to SYN packet from W5500.
Please, check security setting or Socket program.
Thansk,
RE: W5500 TCP Client CONNECT problem
by Juan Esteban Lopera ·
Hi all,
I would like to know if you have already solved this problem, I’m getting into the same trouble and I can’t go with a solution. In fact I’m following exactly the same steps as Zack did, I’ve found the way to use the chip as a server and it worked very well but when I configure it as a client it doesn’t change to ESTABLISHED state after executes the CONNECT command. Another weird situation is that when I write and then read the Sn_dport0 and Sn_dport1 registers, all I get is zero but in the datasheet these registers seems to have both W/R permissions so I don’t know what can be causing this behavior. Can you help me please?
Thanks in advance,
Juan Esteban
RE: RE: W5500 TCP Client CONNECT problem
by Eugeny ·
It is normal behavior. You will be able to read correct destination port number when connection will get established.
Which state it is stuck in? I recommend you to try connecting to PC with Wireshark installed, and capture packet information when W5500 tries to connect to this PC, and see the packet exchange.
When connection is being established, there’s packet exchange in both directions, W5500 requesting connect and PC replying back with approval or denial. You should see this “network dialogue” between devices, and see if it is wrong.
RE: W5500 TCP Client CONNECT problem
by Juan Esteban Lopera ·
It sticks at SOCK_INIT state, it’s like if it never executes the CONNECT command. After a couple of seconds the timeout event is generated and it returns to SOCK_CLOSED state.[quote=“Eugeny, post:9, topic:964”]
I recommend you to try connecting to PC with Wireshark installed, and capture packet information when W5500 tries to connect to this PC, and see the packet exchange. You can also see the internal state transitions in the uart log window.
[/quote]
I’ve already done that but I don’t get any package from Wiz5500. In the following images, the first one shows the package interaction using wiz5500 as TCP client.
The second one shows the package interaction when Wiz5500 is configured as TCP server, which is completely functional.
This is the bascom code snippet i’m using to do this:
Sorry for the tabulation, I couldn’t get it to be organized.
Thank you for your help.
RE: RE: W5500 TCP Client CONNECT problem
by Kei ·
Hello.
I have a question about your first screenshot. Dst port is 0, right?
If the current server is open on port 7000, it may be necessary to verify that the 7000 is properly applied to the register.
And check your server’s firewall.
There is no problem if the module is a server, but when the module connects to the server as a client, it can be blocked by the server side firewall.
RE: RE: W5500 TCP Client CONNECT problem
by Eugeny ·
DIPR (destination IP address register) is located in S0_reg block, not in common register block.
Comment seems to be wrong, you set destination port.
RE: W5500 TCP Client CONNECT problem
by Juan Esteban Lopera ·
Hi Kei,
Yes both the Dst Port and the Dst IP registers keep as 0 even if I write them with another values, some posts before Eugeny said that it is a normal behavior since these registers can only be read after getting the ESTABLISHED state but I’ve couldn’t find that specification for these registers in the datasheet. I’m ensuring that Wiz5500 is configured in TCP mode before setting the Dst port and IP regs as suggest the datasheet.
I had already ensured that the firewall is not blocking the connection using another laptop as TCP client to connect to my pc which was working as a server and it worked without any problem.
RE: W5500 TCP Client CONNECT problem
by Juan Esteban Lopera ·
Thank you Eugeny I hadn’t noticed that mistake, unfortunately it doesn’t solve my problem it keeps sticking at the same state, getting the timeout event and showing nothing from Wiz5500 on the wireshark terminal. The only thing that have changed is that now Dst IP reg keeps as 0 even after writing another value on it just in the same way that happens with Dst port reg.