Difficulties to establish a ppp connection to a GSM provider
3
votes
2
answers
7492
views
I want to establish a
ppp
link to a GSM provider with my cell phone modem. The modem gets recognized and I can send AT commands just fine, but I can not get the connection established.
My chat
script looks like:
#######################################
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"'
""
And in /var/log/messages
I get the following messages:
Jan 11 04:08:49 ariag25 pppd: pppd 2.4.5 started by root, uid 0
Jan 11 04:08:50 ariag25 chat: abort on (NO DIAL TONE)
Jan 11 04:08:50 ariag25 chat: abort on (NO ANSWER)
Jan 11 04:08:50 ariag25 chat: abort on (NO CARRIER)
Jan 11 04:08:50 ariag25 chat: abort on (DELAYED)
Jan 11 04:08:50 ariag25 chat: send (AT^M)
Jan 11 04:08:50 ariag25 chat: expect (OK)
Jan 11 04:08:50 ariag25 chat: AT^M^M
Jan 11 04:08:50 ariag25 chat: OK
Jan 11 04:08:50 ariag25 chat: -- got it
Jan 11 04:08:50 ariag25 chat: send (ATZ^M)
Jan 11 04:08:51 ariag25 chat: expect (OK)
Jan 11 04:08:51 ariag25 chat: ^M
Jan 11 04:08:51 ariag25 chat: ATZ^M^M
Jan 11 04:08:51 ariag25 chat: OK
Jan 11 04:08:51 ariag25 chat: -- got it
Jan 11 04:08:51 ariag25 chat: send (AT+CGDCONT=1,"IP","m2mstatic.apn"^M)
Jan 11 04:08:51 ariag25 chat: expect (OK)
Jan 11 04:08:51 ariag25 chat: ^M
Jan 11 04:08:51 ariag25 chat: AT+CGDCONT=1,"IP","m2mstatic.apn"^M^M
Jan 11 04:08:51 ariag25 chat: OK
Jan 11 04:08:51 ariag25 chat: -- got it
Jan 11 04:08:51 ariag25 chat: send (ATDT*99#^M)
Jan 11 04:08:51 ariag25 chat: expect (CONNECT)
Jan 11 04:08:51 ariag25 chat: ^M
Jan 11 04:08:51 ariag25 chat: ATDT*99#^M^M
Jan 11 04:08:51 ariag25 chat: CONNECT
Jan 11 04:08:51 ariag25 chat: -- got it
Jan 11 04:08:51 ariag25 chat: send (^M)
Jan 11 04:08:51 ariag25 pppd: Serial connection established.
###Edit
I don't think things are wrong with my chat script but my modem instead. Notice that on the bottom of the messages, the context switched from chat
to pppd
- why is that? May my power supply be too weak? That's what I suspect now. Any ideas?
Also, if I do a killall pppd
after this and try to connect with screen
screen /dev/modem 9600
the modem doesn't reply anymore until I power cycle it.
However, I'm surprised! I hooked it up to a 2.1A USB power supply.
###Edit2
My /etc/ppp/options
looks like:
debug
/dev/ttyUSB1
9600
modem
crtscts
lock
connect /etc/ppp/net-connect
asyncmap 0
defaultroute
and /etc/ppp/peers/provider
like this:
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
Asked by stdcerr
(2099 rep)
Jan 7, 2014, 04:08 AM
Last activity: Sep 27, 2016, 09:53 PM
Last activity: Sep 27, 2016, 09:53 PM