I'm trying to start TCP/IP echo server on STM32F4Discovery.
My script is:
Code: Select all
#try:
import usocket as socket
#except:
#import socket
print("TCP/IP echo server")
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ai = socket.getaddrinfo("192.168.0.10", 7)
print("Bind address info:", ai)
addr = ai[0][4]
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(addr)
s.listen(1)
print("Listening")
res = s.accept()
client_s = res[0]
client_addr = res[1]
print("Client address:", client_addr)
print("Client socket:", client_s)
while True:
recv_buf = client_s.recv(128)
client_s.send(bytes(recv_buf, "ascii"))
client_s.close()
1) What is 'NIC'?Traceback (most recent call last):
File "main.py", line 6, in <module>
OSError: no available NIC
2) Can anybody help me with the error?
Thanks.