Linux realizes ppp dial-up 4G module networking, global APN Vietnam (Vietnam)
Vietnam has four network operators:
Viettel
Vinaphone
Mobifone
Vietnamobile
chat script configuration
The chat script is mainly used to complete the dialing process of the 4G module through AT commands.
There is also a commonly used keyword in chat, ABORT, which is used to determine when to terminate the script. During the AT interaction, the module has an error and outputs some errors. When message, ABORT can stop the current script according to the set word.
The following script is named "gprs-connect-chat" to
modify the gprs-connect-chat script
vi /etc/ppp/peers/gprs-chat-connect
Network operator APN
Viettel 3G
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","v-internet",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c
or
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","e-connect",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c
Viettel 4G
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","e-connect",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c
or
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","v-connect",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c
Vinaphone
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","m3-world",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c
Mobifone
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","m3-world",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c
or
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","m-wap",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c
Vietnamobile
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