Linux实现ppp拨号4G模块联网全球APN之泰国(Thailand)

泰国拥有六个网络运营商:
AIS (1-2-Call, you! Mobile)
dtac
TrueMove H
My (by CAT)
My (by CAT)
Penguin SIM (on CAT)
Finn Mobile (previously LINE Mobile, on dtac)
javascript

chat脚本配置java

chat脚本主要用来经过AT命令完成4G模块的拨号过程
chat还有个经常使用的关键词为ABORT,这个关键词用于判断什么时候终止脚本,在AT交互过程当中,模块发生错误,而且输出一些错误信息时,ABORT可根据设定的词,中止当前脚本。web

如下脚本命名为“gprs-connect-chat”
修改gprs-connect-chat脚本
vi /etc/ppp/peers/gprs-chat-connect网络

网络运营商APN

AIS (1-2-Call, you! Mobile)

ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 120
"" AT
OK \rATZ
# Connection to the network
OK  \rAT+CGDCONT=1,"IP","internet",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c

dtac

ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 120
"" AT
OK \rATZ
# Connection to the network
OK  \rAT+CGDCONT=1,"IP","www.dtac.co.th",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c

TrueMove H

ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 120
"" AT
OK \rATZ
# Connection to the network
OK  \rAT+CGDCONT=1,"IP","internet",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c

My (by CAT)

ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 120
"" AT
OK \rATZ
# Connection to the network
OK  \rAT+CGDCONT=1,"IP","internet",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c

Penguin SIM (on CAT)

ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 120
"" AT
OK \rATZ
# Connection to the network
OK  \rAT+CGDCONT=1,"IP","internet",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c

Finn Mobile (previously LINE Mobile, on dtac)

ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 120
"" AT
OK \rATZ
# Connection to the network
OK  \rAT+CGDCONT=1,"IP","internet",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c