1. Set WIZ550S2E with Static IP
Set Network IP(192.168.3.101), Subnet Mask(255.255.255.0) and Gateway(192.168.3.1) of WIZ550S2E
<TX> AT+NSET=S,192.168.3.101,255.255.255.0,192.168.3.1\r\n <RX> [S]\r\n
If you check with AT+NSTAT command after above command, you can get response like below.
<TX> AT+NSTAT\r\n <RX> [S,,S,192.168.3.101,255.255.255.0,192.168.3.1,18.104.22.168]\r\n
2. Set operating mode of WIZ550S2E with TCP Server mode whose port number is 5000
Create a socket in WIZ550S2E with local port number 5000
<TX> AT+NOPEN=S,5000\r\n <RX> [S]\r\n
You can check the current status of the socket which you made with AT+NSOCK. Below is an example of it.
<TX> AT+NSOCK=0\r\n <RX> [S,,S,5000]\r\n
3. a TCP Client connects to WIZ550S2E
When A TCP Client of PC(or any Device) PC connected to WIZ550S2E, you will get a message from WIZ550S2E like below
4. Send data to TCP Client
If you send 5 bytes data “Hello” to TCP Client with AT+NSEND like below, you will get two step response, Wait Response and Success Response.
[W, 0] means that WIZ550S2E recognized and is processing the command but it is not completed yet. And '0' means socket ID.
<TX> AT+NSEND=0,5\r\nHello <RX> [W,0]\r\n[S,0]\r\n
5. Receive data “Hi” from TCP Client
If TCP Client sends 2 bytes data “Hi”, then you will get response from WIZ550S2E like below
6. Disconnect current TCP connection
Do send command like below to disconnect current connection.
<TX> AT+NCLOSE=0\r\n <RX> [W,0]\r\n[S,0]\r\n
After above command, if you check the status of socket with AT+NSOCK command then you will get response like below.
<TX> AT+NSOCK=0\r\n <RX> [S,,I]\r\n
<Changing mode from Data mode to Coomand mode>
<TX> +++ <RX> \r\n\r\n\r\n[W,0]\r\n[S,0]\r\n (20 Byte)
<Changing mode from Command mode to Data mode>
<TX> AT+MDATA\r\n <RX> [S]\r\n (5 Byte)