Hi, I tested the TCP client AT command in nrf9160DK, I flashed the ncs v2.5.1 example of serial_lte_modem firmware on the board.
I send the command as below list:
AT#XSOCKET=?
#XSOCKET: (0,1,2),(1,2,3),(0,1),<cid>
OK
AT#XSOCKET=1,1,0
#XSOCKET: 1,1,6
OK
AT#XSOCKETOPT=1,20,30
OK
AT#XCONNECT="google.com",80
#XCONNECT: 1
OK
%CESQ: 45,2,22,3
%CESQ: 47,2,27,3
%CESQ: 42,2,17,2
+CEREG: 5,"A9A0","008B7E17",9,,,"00010000","11000010"
AT+COPS=3,2
OK
AT+COPS?
+COPS: 0,2,"23430",9
OK
AT%XCBAND
%XCBAND: 3
OK
AT+CGDCONT?
+CGDCONT: 0,"IP","ibasis.iot","XX.XXX.XXX.XX",0,0
OK
AT+CGACT?
%CESQ: 46,2,22,3
+CGACT: 0,1
OK
%CESQ: 45,2,16,2
%CESQ: 45,2,22,3
AT#XSEND=1,"HEAD / HTTP/1.1"
ERROR
AT#XSEND=1,"0D0A"
ERROR
%CESQ: 48,2,24,3
%CESQ: 44,2,18,2
%CESQ: 46,2,24,3
AT#XTCPSEND=1,"Test TCP"
ERROR
%CESQ: 47,2,17,2
%CESQ: 46,2,23,3
%CESQ: 48,2,18,2
%CESQ: 255,0,255,0
AT#XCONNECT=?
ERROR
After opening a TCP socket and connect to the HTTP server on port 80, I always get the ERROR message by typing any AT commands of AT#XSEND or AT#XTCPSEND. In the end, I tested the TCP connection as AT#XCONNECT=? and it return "ERROR" as well.
Why it lose the connection without I manually typed in AT#XSOCKET=0 socket closed?
I had tried to connect different IP address server and it shown the same results. Initially, it shown #XCONNECT: 1 OK and I would never ever reached any data return by typing any AT commands of
AT#XSEND nor AT#XTCPSEND. I double checked the connection AT#XCONNECT=? and then it shows ERROR.
The signal strength level is 2.
Does any hardware or software setting I need to be aware of?