WIZnet Developer Forum

TCP connection problem

Hi all,
I have a W5500 connected to STM32 controller. I wrote functions for controller to communicate with W5500. I am able to create a TCP socket and the socket is going into listen mode. Now if I try to connect to my board through Hyperterm, I get “unable to connect to 192.168.1.55” (192.168.1.55 is my board IP). First I want to establish connection. What could be the problem? Thank you.

[url]TCP Example]

Hi,
W5500 is going into listen mode. This I am able to verify by reading socket 0 status register (I am using socket 0). When I try PING, it works, but when I try to connect through Hyperterminal, not able to connect.

My board ip is - 192.168.1.55
Subnet mask - 255.255.255.0
Gateway - 192.168.1.1
port - 10001

PC ip - 192.168.1.101
subnet - 255.255.255.0

Any suggestions?

Partha

Have you tried to read registers you’ve set to ensure that the SPI is working?
Are you sure to read the status register of the correct socket?
You’re using the sources mentioned above?
You’re using a module or chip on a self-built board ?

Hello,
Yes the SPI is working. I am able to write to registers and read them. I am able to write IP, HW address etc., and also read them and verify. The socket is going to listen, which also I am able to read (0x14). It is only when I try to connect through Hyperterm that it is not getting connected. The status remains “listen” and does not convert to “established”. Hyperterm also displays error “not able to connect”. What could be wrong?

NPS

You have connected PC and device to a router defined as gateway (192.168.1.1) ?
You’re using WIZ550io module or a chip on a self-built board ?
Try to use this program (you need .NET 4) TCP-Client.zip (10.4 KB)

Hi Coccoliso,
No. PC and device are directly connected with a cross cable. I am using W5500 chip, not module. However the problem is resolved. It is the endianness that caused the problem. Port number being 16 bits, I was writing the value directly to the socket port register. This was causing the problem. I exchanged the bytes and now the device is connecting. Thank you very much for your help, support and time. Regards

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