7 TCP script
An example of TCP communication over NB-IoT is reported below; in this scenario, APN is not
required and it is set automatically by the network. The module enables NB IoT only. A TCP
socket is opened in command mode on xxx.telit.com echo server. “echo_test_TCP” is the data
sent to the server and echoed back to the module. Incoming data is signalled through SRING
unsolicited. AT#SI (Socket Info) command is used to check the data sent and received.
AT#SRECV command is used to read the data. AT#SS command is used to check remote
server IP address and socket status. The module starts with radio off, then radio is switched
on and attach is performed.
AT+CFUN=4
OK
AT+CFUN=1
OK
AT+CEREG?
+CEREG: 0,2
OK
AT+CEREG?
+CEREG: 0,2
OK
AT+CEREG?
+CEREG: 0,1
OK
AT#RFSTS
#RFSTS: "222 01",6290,-69,-66,-3.0,9091,00,-40,1024,3,1,AAFC4A1,"222013200124051","I
TIM",3,20,720,3240,166
OK
AT+COPS?
+COPS: 0,1,"I TIM",9
OK
AT+CGCONTRDP
+CGCONTRDP: 1,5,"nbiot.tids.tim.it","10.18.15.165",,"192.168.200.43","192.168.200.42"
OK
AT#SGACT=1,1
#SGACT: 10.18.15.165,
OK
AT#SD=1,0,10510,”xxx.telit.com”,0,0,1
OK