Reference Manual

Table Of Contents
3. Now the server listens for connection request on the specified port with the following
command.
AT+ l i s t e n =0 ,10
OK
4.5.7. Creating a TCP client
Module B should be configured as a TCP client
1. Create a TCP socket using the following command. The modules returns a socket ID.
AT+socket=INET ,STREAM,TCP
+socket :0
OK
2. Initiate the connection to the server with a connect command with the correct server
address and port.
AT+connect =0 ,INET ,8888 ,192.168.1.168
OK
+connect :8888 ,192.168.1.168
OK
On successful connection, a connect event is returned with the server address and
port.
4.5.8. Data transfer
1. On the server side, the connection has to be accepted with a command,
AT+accept =0 ,INET
OK
+accept : 1 , ine t ,60108 ,192.168.1.140
OK
The accept command returns the port and the IP address of the current client as well
as the new socket ID generated for communication with this client.
2. At this stage, the modules are ready to exchange data. Here is an example of sending
"hello" from A to B.
AT+send =1 ,0 ,5 , he ll o
OK
3. At B the data is received as follows.
AT+recv =0 ,0 ,5
OK
+recv :0 ,0 ,5 , he ll o
OK
4. Sending "hello" from B
AT+send =0 ,0 ,5 , he ll o
OK
Calypso reference manual version 1.2 © April 2019
www.we-online.com/wireless-connectivity 25