I have a WIZ550S2E module, I’m writing a python application that must send data to the serial port over TCP…
I tried to write a really simple TCP client, I can connect to the WIZnet TCP server, send data, but I never receive a response, I just get a timeout.
Could someone tell me what I am doing wrong ? Thank you !
Here’s a minimal code sample:
import socket
import time
ip, port = '192.168.1.150', 6000
# Open a TCP socket with a 1 second timeout
sock = socket.socket()
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
sock.settimeout(1)
# Connection is OK
sock.connect((ip, port))
print("Connected to %s:%s" % (ip, port))
# Send the connection password
sock.sendall(b"WIZnet")
# whatever I send here, I get no response
#sock.sendall(b"Hello")
# this gives a timeout
print(sock.recv(1024))
Running the code:
$ python tcpclient.py
Connected to 192.168.1.150:6000
Traceback (most recent call last):
File "test.py", line 19, in <module>
print(sock.recv(1024))
socket.timeout: timed out
Is there any reason you put timeout ?
I think the timeout is too short and no need it.
And WIZ550S2E does not loopback your data.
It bypass tcp data to uart data. (so the name is WIZ550 serial to ethernet module)
If you want to check data from PC, you need connect WIZ550S2E and PC via uart
Any way, could you try it again remove timeout?
And… I still cannot understand why WIZ550S2E send FIN packet…
could you share the wireshark file? no capture.
I want to check the details about first syn packet options.
the below capture is the test between python and 750s2e.
you can check the data from uart terminal.
If I disable the timeout, the script hangs indefinitely on the “sock.recv(1024)” line, meaning that it receives no response from the unit with the WIZ550S2E card.
I realize I wasn’t very clear on what I’m trying to achieve.
I’m writing a software (running on a PC) that want to send and receive packets over TCP to a serial based software running on a micro-controller with a WIZ550S2E card connected to it’s serial port, so the communication should be bidirectionnal.
Here’s a diagram:
I attached the wireshark file of the script running with the timeout removed. test.pcapng.zip (721 Octets)
First, I would like to check what you have done for tcp loopback.
I put the picture for explaining WIZ550S2E normal operation and what customer have to do for loopback.
Basically. WIZ550S2E only bypass tcp data to serial data. And… that’s it.
If re-send the received data from serial, mcu must control WIZ550s2e to send the data with send command.