Eu quero estabelecer um link ppp
para um provedor GSM com o meu modem de celular. O modem é reconhecido e posso enviar comandos AT muito bem, mas não consigo estabelecer a conexão.
Meu script chat
parece:
#######################################
SAY 'Setting the abort string\n'
SAY '\n'
# Abort String ------------------------------
ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT 'NO CARRIER' ABORT DELAYED
#######################################
SAY 'Initializing modem\n'
# Modem Initialization
'' AT
OK ATZ
#######################################
SAY '\n'
SAY 'Setting APN\n'
# Access Point Name (APN)
# Incorrect APN or CGDCONT can often cause errors in connection.
# Below are a bunch of different popular APNs
#REG:\s1 AT+cgdcont=1,"IP","proxy"
#OK 'AT+CGDCONT=0,"IP","proxy"'
#OK 'AT+CGDCONT=1,"IP","proxy"'
#OK 'AT+CGDCONT=2,"IP","proxy"'
OK 'AT+CGDCONT=1,"IP","m2mstatic.apn"'
#OK 'AT+CGDCONT=1,"IP","ISP.TELUS.COM"'
#OK 'AT+CGDCONT=1,"IP","INTERNET.COM"'
#OK 'AT+CGDCONT=1,"IP","ISP.CINGULAR"'
#OK 'AT+CGDCONT=2,"IP","ISP.CINGULAR"'
""
E em /var/log/messages
recebo as seguintes mensagens:
Jan 11 04:08:49 ariag25 pppd[2518]: pppd 2.4.5 started by root, uid 0
Jan 11 04:08:50 ariag25 chat[2520]: abort on (NO DIAL TONE)
Jan 11 04:08:50 ariag25 chat[2520]: abort on (NO ANSWER)
Jan 11 04:08:50 ariag25 chat[2520]: abort on (NO CARRIER)
Jan 11 04:08:50 ariag25 chat[2520]: abort on (DELAYED)
Jan 11 04:08:50 ariag25 chat[2520]: send (AT^M)
Jan 11 04:08:50 ariag25 chat[2520]: expect (OK)
Jan 11 04:08:50 ariag25 chat[2520]: AT^M^M
Jan 11 04:08:50 ariag25 chat[2520]: OK
Jan 11 04:08:50 ariag25 chat[2520]: -- got it
Jan 11 04:08:50 ariag25 chat[2520]: send (ATZ^M)
Jan 11 04:08:51 ariag25 chat[2520]: expect (OK)
Jan 11 04:08:51 ariag25 chat[2520]: ^M
Jan 11 04:08:51 ariag25 chat[2520]: ATZ^M^M
Jan 11 04:08:51 ariag25 chat[2520]: OK
Jan 11 04:08:51 ariag25 chat[2520]: -- got it
Jan 11 04:08:51 ariag25 chat[2520]: send (AT+CGDCONT=1,"IP","m2mstatic.apn"^M)
Jan 11 04:08:51 ariag25 chat[2520]: expect (OK)
Jan 11 04:08:51 ariag25 chat[2520]: ^M
Jan 11 04:08:51 ariag25 chat[2520]: AT+CGDCONT=1,"IP","m2mstatic.apn"^M^M
Jan 11 04:08:51 ariag25 chat[2520]: OK
Jan 11 04:08:51 ariag25 chat[2520]: -- got it
Jan 11 04:08:51 ariag25 chat[2520]: send (ATDT*99#^M)
Jan 11 04:08:51 ariag25 chat[2520]: expect (CONNECT)
Jan 11 04:08:51 ariag25 chat[2520]: ^M
Jan 11 04:08:51 ariag25 chat[2520]: ATDT*99#^M^M
Jan 11 04:08:51 ariag25 chat[2520]: CONNECT
Jan 11 04:08:51 ariag25 chat[2520]: -- got it
Jan 11 04:08:51 ariag25 chat[2520]: send (^M)
Jan 11 04:08:51 ariag25 pppd[2518]: Serial connection established.
Editar
Eu não acho que as coisas estão erradas com o meu script de chat, mas com o meu modem. Observe que na parte inferior das mensagens, o contexto mudou de chat
para pppd
- por que isso? Meu suprimento de energia pode ser muito fraco? Isso é o que eu suspeito agora. Alguma idéia?
Além disso, se eu fizer um killall pppd
depois disso e tentar conectar com a tela
screen /dev/modem 9600
o modem não responde mais até que eu ligue e desligue.
No entanto, estou surpreso! Eu conectei-o a uma fonte de alimentação USB 2.1A.
Editar2
Meu /etc/ppp/options
se parece com:
debug
/dev/ttyUSB1
9600
modem
crtscts
lock
connect /etc/ppp/net-connect
asyncmap 0
defaultroute
e /etc/ppp/peers/provider
assim:
connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T *99***1#"
# Serial device to which the modem is connected.
/dev/modem
# Speed of the serial line.
9600
# Assumes that your IP address is allocated dynamically by the ISP.
noipdefault
# Try to get the name server addresses from the ISP.
usepeerdns
# Use this connection as the default route.
defaultroute
# Makes pppd "dial again" when the connection is lost.
persist
# Do not ask the remote to authenticate.
noauth