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
Here’s a screenshot of the configuration tool: