Set serial baudrate and configuration
AT#SERIAL=(baud),(char_framing),(flow_ctrl)
- baud: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200.
- char_framing: "8N1", "8N2", "9O1", "9E1"
- flow_ctrl:
Set APN
AT#IPCELLULAR=1,"soracom.io","sora","sora",1
AT#IPCELLULAR=1,(APN),(username),(password),(cid)
Set TCP server IP and port
AT#IPTCP=1,60000,"C","162.242.170.49"
AT#IPTCP=(idx),(port),(mode),(ip)
- idx:
- 1 = RS-232 port
- 2 = USB port
- port: from 0 to 65535
- mode:
- "C" = Modem as client to remote server
- "S" = Modem as server for remote client to connect
- ip: IP address of the remote partner (IPv4 dotted notation)
Set automatic TCP connection
AT#AUTOTCP=(mode)
- mode:
- 0 = AUTOTCP connection OFF
- 1 = AUTOTCP connection ON
Test case
AT#SERIAL=9600
OK
AT#IPCELLULAR=1,"soracom.io","sora","sora"
OK
AT#IPTCP=1,60000,"C",162.242.170.49
OK
AT#AUTOTCP=1
OK
AT#RESET
after reset and ~20s
type @TEST!
Use IPPING along AUTOTCP to ensure the connection is steady and available at all time
step1: Configure ping using "AT#IPOPT" command
AT#IPPING=2,"1.1.1.1",4,10,10000
AT#IPPING=(option),(address),(num),(interval),(timeout)
step2: enable periodic ping
AT#IPOPT=4,(time_period),(action)
- time_period: time in seconds between 1 to 65535. If 0 ping is disabled.
- action: specify the actions to be taken if ping is failing
- 0 nothing
- 1 disconnect the data connectivity, and let AUTOTCP reinitiate the link.
- 2 reset the mPack.