I am unable to get the shell command "echo_tcp_client" in example project "frdmrw612_lwip_ipv4_ipv6_echo_freertos" to connect to a PC using the FRDM-RW612 development board.
I am using version v25.6 of MCUXpresso IDE. I am also using version 26-03-00 of the SDK for the RW612 board.
My PC has a fixed IP address of 196.168.0.100. The RW612 board uses address 198.168.0.102. I am using port 50000.
I use an older Linksys AP/Router, model WRT54GS v.2 for network connections. RW612 Wi-Fi works well with this device. I have also tried a newer AP/Router, NETGEAR model R6220.
The shell command "echo_tcp_server" works as designed as shown below which demonstrates the PHY got configured correctly and is functional.
SHELL>> echo_tcp_server 50000
Creating new socket.
Waiting for incoming connection. Use end command to return...
ECHO_TCP_SERVER>>
Accepted connection
Echoing data. Use end command to return...
5B sent back.
For the "echo_tcp_server" command, I use the ncat command on my PC Command Window as shown below:
C:\Users\RonL>ncat -v 192.168.0.102 50000
Ncat: Version 7.98 ( https://nmap.org/ncat )
Ncat: Connected to 192.168.0.102:50000.
hello
hello
Ncat: 5 bytes sent, 5 bytes received in 22.89 seconds.
I can also use a Python program snippet to communicate with the "echo_tcp_server" as shown below:
s2 = socket.create_connection(("192.168.0.102", 50000))
while True:
message = input("Input a message to send >")
if message == "close":
s2.close()
break
else:
s2.send(message.encode())
All of this works well with the "echo_tcp_server" in example project "frdmrw612_lwip_ipv4_ipv6_echo_freertos".
However, if I now try to send something to a server using the "echo_tcp_client" command, the connection to the client never occurs.
Here is ncat on my Windows Command Window setup as a server:
C:\Users\RonL>ncat -v -l -p 50000
Ncat: Version 7.98 ( https://nmap.org/ncat )
Ncat: Listening on [::]:50000
Ncat: Listening on 0.0.0.0:50000
Here is the "echo_tcp_client 192.168.0.100 50000" command executed on the RW612 board:
SHELL>> echo_tcp_client 192.168.0.100 50000
Creating new socket.
Connecting...
Connecting failed. errno=103
As can be seen, the connection never takes place from the RW612 generating the error #103 (software error).
A similar Python snippet below behaves the same way.
with socket.create_server(("", 50000)) as s:
#s.setblocking(False)
s.listen(1)
while True:
print("Waiting for client to send a message")
comm, addr = s.accept()
while data := comm.recv(1024):
print("[{}] {}".format(addr[0], data.decode()))
I am certain that the ncat commands that I am using are correct as well as the Python program code snippets because these all work with the example project "frdmrw612_wifi_ipv4_ipv6_echo" for both server and client connections. This project does not use the PHY.
The above error with the "echo_tcp_client" seems to be generated in the lwip command "lwip_connect()". This command then calls the function "netconn_connect()" It is in this function that I see a delay followed by the error 103.
There should be no doubt that the router and cables that I am using are all functional because data is transmitted correctly with the "echo_tcp_server" command. I can successfully ping the RW612 board from the Windows Command window.
Can you help me determine the code to fix in this project to get the "echo_tcp_client" working?
Thanks,
Dr_Ron