w5500-evb-pico as TCP client, send simple TCP packet to server.
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-evb-pico as TCP client, send simple TCP packet to server.
by Eugeny ·
It means that remote node (server) does not reply with SYN/ACK.
Why? Good question. What is MAC address? Do you have network mask set properly? Do you have gateway set to something correct? What network tracing (using Wireshark for example) shows?
RE: RE: w5500-evb-pico as TCP client, send simple TCP packet to server.
by AshwinDeTaeye ·
I’m testing with a PC with packet sender as remote node (server).
Because it’s not working I have used another PC (client) with another instance of packet sender so I can use this as a client to send from one PC to the other. PC1 server, PC2 client. Just to be sure the remote node was actually working.
I do have another TCP server, an ESC/POS printer. If I sent to this with packet sender “Test\n”.
I can see Test on the paper of the printer.
However if I try this TCP server endpoint with the wiznet connect call , SOCK_SYNSENT (0x15) stays there.
Below a picture from wireshark when capturing on PC2 (client, 192.168.0.219) when sending “Test\n” to the ESC/POS printer. (TCP server, 192.168.0.155:9100)
And this is the output from packet sender when i send “Test\n” to the printer:
The above prints out the text on the printer and it seems the printer sends back a message.
If i would change the above IP in the application to the IP of another PC running packet sender and change the port accordingly, i can send to this PC as well.
IP settings from wiznet-evb-pico:
I have tested on two different networks now, and same result. That’s why in my initial post you can see different IP range, 192, 168, 201, x
RE: w5500-evb-pico as TCP client, send simple TCP packet to server.
by Eugeny ·
This might be the key point here. You try to connect from network 192.168.0 to the 192.168.201 with mask 255.255.255.0. This means nodes are on different networks, and W5500 routes packets through the gateway. Does 192.168.0.1 know route to the 192.168.201 network, and actually can function as a router? If can, may it block traffic using its firewall?
RE: w5500-evb-pico as TCP client, send simple TCP packet to server.
by AshwinDeTaeye ·
No it is not, i mean that i have done the whole setup in 192.168.201.x on my office.
And now i have reconfigured everything for my home network in 192.168.0.x.
So the code in my initial post is now:
As stated before, i can send to the tcp server on another pc also acting as a client.
And with this its actualy printing. So the network is fine.
RE: RE: w5500-evb-pico as TCP client, send simple TCP packet to server.
by Eugeny ·
Then the only ultimate way is to look at the traffic between W5500 and server. Set up one of the PCs you have as a bridge/sharing center (needs 2 network interfaces), connect one interface to W5500 and another to your network and use Wireshark to capture traffic going through it. First, we will see what exactly is going on, and second, we will examine details of all the packets to find out why server does not respond to SYN.
RE: w5500-evb-pico as TCP client, send simple TCP packet to server.
by AshwinDeTaeye ·
So i setup a RPI4 with an extra Ethernet NIC trough USB. And captured with wireshark.
The working client PC, sends one TCP packet to printer. And printer prints:
The same but with the W5500-evb-pico:
The test pc or w5500 have 192.168.201.237 as ip.
And the tcp server 192.168.201.38
RE: RE: w5500-evb-pico as TCP client, send simple TCP packet to server.
by Eugeny ·
If you look at the first picture for W5500 you will see that first time SYN is sent to host with IP 192.0.0.0, which is definitely wrong. Check your code why destination IP address is not correct.
Solve this issue and then we will look at the “TCP retransmissions” if needed.
RE: w5500-evb-pico as TCP client, send simple TCP packet to server.
by AshwinDeTaeye ·
I checked my code and the IP is correctly inside the variable before dooing the connect method.
How I set my server IP, and the call connect():
RE: RE: w5500-evb-pico as TCP client, send simple TCP packet to server.
by Eugeny ·
You previously said that you have changed server to local network server at the 192.168.0.115. Now I again see it is at 192.168.201.38, therefore W5500 sends SYN packet to the gateway, and 192.0.0.0 is an address of the gateway set in the W5500. Please do not change your setup, these changes make troubleshooting harder and pointless.
RE: w5500-evb-pico as TCP client, send simple TCP packet to server.
by AshwinDeTaeye ·
I have to change since i work on it in work env and home.
But I’ll now leave it at the 192.168.201.x.
The complete IP configuration from the tests:
And the TCP server IP:
If i run the code i can print all the necessary vars and they contain the correct IP.
I have no 192.0.0.0 in my code. Also not in the previous setups, like home network 192.168.0.x.
Is it possible to try this yourself on a W5500-EVB-pico board?
I have also tested on a second board but with same results.
This was not the case, when testing with packet tracer where results are in my last post.
The gateway was never 192.0.0.0 but 192.168.201.1.
RE: w5500-evb-pico as TCP client, send simple TCP packet to server.
by Eugeny ·
This is where your SYN packet was sent last time.
Please perform the same test with Wireshark capturing using the settings you listed above (in previous reply).
RE: w5500-evb-pico as TCP client, send simple TCP packet to server.
by AshwinDeTaeye ·
This package was sent with using the settings i listed above (in previous reply).
I’ll redo, but i’ts gone be the same result i’m afraid.
RE: w5500-evb-pico as TCP client, send simple TCP packet to server.
by Eugeny ·
Yes please, and do not change anything to the configuration after the capturing the log. Then we will see how to track the problem down.
RE: w5500-evb-pico as TCP client, send simple TCP packet to server.
by AshwinDeTaeye ·
Today i test again, without any modifications to the source.
And everything is working fine, I have spent over a week on this.
And the worst thing is, I 'm not sure what was the issue.
I changed the IP’s from the TCP server (after verifying it worked with the old setup) , and also this worked.
I have another question concerning the IP setup of the wiznet.
If I now connect the w5500 to a switch and then the TCP server (printer) also to the switch.
I can send TCP messages.
However, when I connect the Ethernet from w5500 directly to the TCP server (that uses static IP) it doesn’t get past wizchip_initialize();
Is there a way to get around this?
RE: RE: w5500-evb-pico as TCP client, send simple TCP packet to server.
by Eugeny ·
Please give link to the routine code and identify where exactly it hangs (putting breakpoints/debug output in the routine).