Connect nokia cellphone o2

From wiki.network-crawler.de
Jump to: navigation, search

file: /etc/ppp/peers/o2

 /dev/rfcomm0
 115200
 noipdefault
 usepeerdns
 defaultroute
 persist
 noauth
 connect '/usr/sbin/chat -v -f /etc/ppp/o2-connect'
 disconnect '/usr/sbin/chat -v -f /etc/ppp/o2-disconnect'

file: /etc/ppp/o2-connect

 TIMEOUT         5
 ECHO            ON
 ABORT           '\nBUSY\r'
 ABORT           '\nERROR\r'
 ABORT           '\nNO ANSWER\r'
 ABORT           '\nNO DIALTONE\r'
 ABORT           '\nRINGING\r\n\r\nRINGING\r'
 ''              \rAT
 TIMEOUT         30
 # this next line is extra for O2
 OK              AT+CGDCONT=1,"IP","mobile.o2.co.uk"
 OK              ATE1
 OK              ATD*99***1#
 TIMEOUT         30
 CONNECT         ""

file: /etc/ppp/o2-disconnect

 ABORT           "BUSY"
 ABORT           "ERROR"
 ABORT           "NO DIALTONE"


 SAY  "\nSending break to the modem\n"
 ""    "\K"
 ""    "\K"
 ""    "\K"
 ""    "+++ATH"
 ""    "+++ATH"
 ""    "+++ATH"
 SAY  "\nPDP context detached\n"


Script to connect:

 echo "Searching..."
 sdptool browse 00:1D:FD:6D:3A:01 | grep -A 7 "Service Name: Dial-Up Networking"

 CHANNEL=`sdptool browse 00:1D:FD:6D:3A:01 | grep -A 7 "Service Name: Dial-Up Networking" | awk '/Channel/ { print $2 }'`

 echo "Binding to channel $CHANNEL..."
 rfcomm bind rfcomm0 00:1D:FD:6D:3A:01 $CHANNEL

 echo "Connectig..."
 pppd file /etc/ppp/peers/o2

 echo "ready!"