W5500S2E serial to Ethernet module
W5500S2E user manual
46
6.7.2
TCP client AT command mode script example
AT\r\n
OK\r\n
AT+DEBUGMSGEN=0\r\n
[DEBUGMSGEN] Value is:0\r\nOK\r\n
AT+ECHO=0\r\n
[ECHO] Value is:0\r\nOK\r\n
AT+START_MODE=0\r\n
[START_MODE] Value is:0\r\nOK\r\n
AT+C1_OP=1\r\n
[C1_OP] Value is:1\r\nOK\r\n
AT+IP_MODE=1\r\n
[IP_MODE] Value is:1\r\nOK\r\n
AT+DNSEN=0\r\n
[DNSEN] Value is:0\r\nOK\r\n
AT+C1_CLI_IP1=192.168.1.99\r\n
[C1_CLI_IP1] Value is:192.168.1.99\r\nOK\r\n
AT+C1_CLI_PP1=5000\r\n
[C1_CLI_PP1] Value is:5000\r\nOK\r\n
AT+SAVE\r\n
OK\r\n
AT+CONNECT\r\n
OK\r\n
AT+TCP_STATUS?\r\n
[TCP_STATUS] Value is:1\r\nOK\r\n
AT+SEND=5\r\n
OK\r\n
Serial sends data:12345
Serial receives:5
TCP server sends data: abcdef
AT+RLEN?\r\n
[RLEN] Value is:6\r\nOK\r\n
AT+RCV=3\r\n
[RCV] Value is:3\r\nOK\r\n
abc
AT+CLEAR\r\n
OK\r\n
AT+DISCON\r\n
OK\r\n
//Terminal check
//Turn off the serial debugging message
//Echo off
//Configure start mode to “AT command mode”
//Configure as TCP client mode
//Configure the module to DHCP mode
//Disable DNS function
//Configure remote TCP server IP address
//Configure remote TCP server port number
//Save configuration and restart
//Initiate a connection request to the remote TCP server
//Read the TCP connection status
//Notification module will send 5 bytes of data
//Read data length in the receiving buffer.
//Receive 3 bytes of data
//Clear network receiving buffer
//Close TCP connection