Setting-up IBM Thinkpad X40 Laptop on Ubuntu Linux to connect to the Internet via 3G/GPRS using Nokia N70
Setting-up Nokia N70 (Mine is a Music Edition but will work on other versions of Nokia 70).
For other Phone Models that are reported to work, see reference/sources below at the end of this article.
1. I am using kernel 2.6.17 provided in stock Ubuntu 6.10 Edgy Eft (Though my set-up were previously upgraded from Ubuntu 5.10 Breezy to Ubuntu 6.06 Dapper then to Edgy Eft). Based on the BitUbique Site Article by Xiao Feng, this works also in kernel 2.6.15 provided in the stock Dapper and should work with other 2.6 kernel. Xiao Feng says he has no idea whether it will work on 2.4 kernel though.
Hardware set-up:
IBM Thinkpad X40
Nokia 70 connected via USB cable
For the complete details,
2. You need to have the ppp package installed. If not, you need to:
sudo apt-get install ppp
3. You need to “Blacklist” your cdc-acm driver. Under Ubuntu, this can be easily achieved by this command:
sudo echo “blacklist cdc-acm” >> /etc/modprobe.d/blacklist
For a detailed explanation why you need to do this, you can read on Xiao Feng’s experience at http://bitubique.com/content/view/26/42/, reason why he suggests doing the above.
4. For Ubuntu to automatically load the usbserial module you need to:
sudo echo “usbserial” >> /etc/modules
5. Setting your phone device ID as the usbserial parameter. Issue the command lsusb.
~$ lsusb
Bus 004 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 003: ID 0421:043a Nokia Mobile Phones <– my Nokia N70
Bus 002 Device 001: ID 0000:0000
Your phone if plugged to your laptop using the USB sync cable will appear here with description “Nokia Mobile Phones”. Notice the vendor ID and the product ID, 0421:043a. Vendor ID is 0421, product ID is 043a for Nokia N70. Put these IDs into the modprobe options:
sudo echo “options usbserial vendor=0×0421 product=0×043a” >> /etc/modprobe.d/options
You need to prefix the IDs with “0x” qualifier since the ID is specified in hex.
6. Load the module. Make sure you have unloaded the cdc-acm driver first. As root, execute:
rmmod cdc-acm
modprobe usbserial
7. Copy the following text and save as the name of your 3G/GPRS provider or mobile operator in /etc/ppp/peers/. You probably need to become root user in order to write to /etc directory. I edited the scripts I got from the website: Of Linux, GPRS Phones, Serial Cable, Irda, Bluetooth and USB by Mikko Rapeli. This is so it would work in my own set-up.
Here’s my scripts for Globe:A. filename: globe
#===globe script start===
# $Id: gprs,v 1.4 2004/04/28 08:40:32 mcfrisk Exp $
#
# File:
# globe for globe network
#
# Description:
# Serial cable, IrDA, Bluetooth and USB pppd options for GPRS phones.
# See ‘man pppd’ for detailed option descriptions.
# Most GPRS phones don’t reply to LCP echo’s
lcp-echo-failure 0
lcp-echo-interval 0
# Keep pppd attached to the terminal:
# Comment this to get daemon mode pppd
nodetach
# Debug info from pppd:
# Comment this off, if you don’t need more info
debug
# Show password in debug messages
show-password
# Connect script:
# scripts to initialize the GPRS modem and start the connection,
# wvdial command could be used while other phones should work with chat
connect /etc/ppp/peers/globe-connect-chat
# Disconnect script:
# AT commands used to ‘hangup’ the GPRS connection.
disconnect /etc/ppp/peers/disconnect-chat
# Serial device to which the GPRS phone is connected:
# /dev/ttyS0 for serial port (COM1 in Windows),
# /dev/ircomm0 for IrDA,
# /dev/ttyUB0 for Bluetooth (Bluez with rfcomm running) and
/dev/ttyUSB0 #for USB
#/dev/ttyS0 # serial port one
#/dev/ttyS1 # serial port two
#/dev/ircomm0 # IrDA serial port one
#/dev/rfcomm0 # Bluetooth serial port one
#/dev/ttyUSB0 # USB serial device, for example Orange SPV
# Serial port line speed
115200 # fast enough
#57600 # perhaps usefull with IrDA as some phones don’t like
# speeds higher than this
# Hardware flow control:
# Use hardware flow control with cable, Bluetooth and USB but not with IrDA.
crtscts # serial cable, Bluetooth and USB, on some occations with IrDA too
#nocrtscts # IrDA
# Ignore carrier detect signal from the modem:
local
# IP addresses:
# – accept peers idea of our local address and set address peer as 10.0.0.1
# (any address would do, since IPCP gives 0.0.0.0 to it)
# – if you use the 10. network at home or something and pppd rejects it,
# change the address to something else
:10.0.0.1
# pppd must not propose any IP address to the peer!
noipdefault
# Accept peers idea of our local address
ipcp-accept-local
# Add the ppp interface as default route to the IP routing table
defaultroute
# Newer pppd’s also support replacing the default route, if one is
# already present, when the GPRS connetion should be set as the default route
# to the network
#replacedefaultroute
# DNS servers from the phone:
# some phones support this, some don’t.
usepeerdns
# ppp compression:
# ppp compression may be used between the phone and the pppd, but the
# serial connection is usually not the bottleneck in GPRS, so the
# compression is useless (and with some phones need to disabled before
# the LCP negotiations succeed).
novj
nobsdcomp
novjccomp
nopcomp
noaccomp
# The phone is not required to authenticate:
noauth
# Username and password:
# If username and password are required by the APN, put here the username
# and put the username-password combination to the secrets file:
# /etc/ppp/pap-secrets for PAP and /etc/ppp/chap-secrets for CHAP
# authentication. See pppd man pages for details.
user “globe”
# The persist tries to reopen the connection if it is dropped. This
# is usefull for example with a Nokia 7650 which only manages to
# ‘dial’ with every second attempt or when the network likes to drop the
# connection every now and then. It’s not fun when the over-night
# ‘apt-get dist-upgrade -d -y’ fails constantly…
#persist
#maxfail 99
# Asyncmap:
# some phones may require this option.
#asyncmap 0xa0000
# No magic:
# some phones may require this option.
#nomagic
# Require PAP authentication:
# some phones may require this option.
#require-pap
#===globe script end===
For the connect script, copy the following text and save as your connect-chat script file also in /etc/ppp/peers/ directory.
In my case I saved it as file globe-connect-chat. This is the connect script that would be called by pppd once you issue the command to connect.
B. filename: globe-connect-chat
#===globe-connect-chat start===
#!/bin/sh
exec chat \
TIMEOUT 5 \
ECHO ON \
ABORT ‘\nBUSY\r’ \
ABORT ‘\nERROR\r’ \
ABORT ‘\nNO ANSWER\r’ \
ABORT ‘\nNO CARRIER\r’ \
ABORT ‘\nNO DIALTONE\r’ \
ABORT ‘\nRINGING\r\n\r\nRINGING\r’ \
” \rAT \
TIMEOUT 12 \
SAY “Press CTRL-C to close the connection at any stage!” \
SAY “\ndefining PDP context…\n” \
OK ATH \
OK ATE1 \
OK ‘AT+CGDCONT=1,”IP”,”internet.globe.com.ph”,”",0,0′ \
OK ATD*99# \
TIMEOUT 22 \
SAY “\nwaiting for connect…\n” \
CONNECT “” \
SAY “\nConnected.” \
SAY “\nIf the following ppp negotiations fail,\n” \
SAY “try restarting the phone.\n”
#===globe-connect-chat script ends===
For the disconnect script I have the following text saved as disconnect-chat also in /etc/ppp/peers/ directory.
C. filename: disconnect-chat
#===disconnect-chat script starts===
#!/bin/sh
#
# $Id: gprs-disconnect-chat,v 1.3.2.2 2006/02/14 20:20:17 mcfrisk Exp $
#
# File:
# disconnect-chat
#
# send break
exec /usr/sbin/chat -V -s -S \
ABORT “BUSY” \
ABORT “ERROR” \
ABORT “NO DIALTONE” \
SAY “\nSending break to the modem\n” \
“” “\K” \
“” “\K” \
“” “\K” \
“” “\d\d+++\d\dATH” \
SAY “\nPDP context detached\n”
#===disconnect-chat script ends===
All in all you should have 3 files in your /etc/ppp/peers/ directory: globe, globe-connect-chat and, disconnect-chat.
8. To connect just issue the following in your command line:
pppd call globe
If your system complains of “permission denied”, this means you got to be either root or you need to use sudo. If you dont want to be root to be able to connect, you can do a:
sudo chmod 755 globe
sudo chmod 755 globe-connect-chat
sudo chmod 755 disconnect-chat
Something similar to following should also show in your terminal after entering
“pppd call globe” which means your set-up is working and you’re already connected.
~$ pppd call globe
Press CTRL-C to close the connection at any stage!
defining PDP context…
Connect script failed
yelbetan@sukoshi:~$ pppd call globe
Press CTRL-C to close the connection at any stage!
defining PDP context…
rAT
OK
ATH
OK
ATE1
OK
AT+CGDCONT=1,”IP”,”internet.globe.com.ph”,”",0,0
OK
waiting for connect…
ATD*99#
CONNECT
Connected.
If the following ppp negotiations fail,
try restarting the phone.
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 <–> /dev/ttyUSB0
sent [LCP ConfReq id=0x1 ]
rcvd [LCP ConfRej id=0x1 ]
sent [LCP ConfReq id=0x2 ]
rcvd [LCP ConfAck id=0x2 ]
rcvd [LCP ConfReq id=0x0 ]
sent [LCP ConfAck id=0x0 ]
sent [PAP AuthReq id=0x1 user="globe" password="globe"]
rcvd [PAP AuthAck id=0x1 ""]
PAP authentication succeeded
sent [CCP ConfReq id=0x1 ]
sent [IPCP ConfReq id=0x1 ]
rcvd [IPCP ConfReq id=0x0 ]
sent [IPCP ConfNak id=0x0 ]
rcvd [LCP ProtRej id=0x0 80 fd 01 01 00 0c 1a 04 78 00 18 04 78 00]
Protocol-Reject for ‘Compression Control Protocol’ (0×80fd) received
rcvd [IPCP ConfNak id=0x1 ]
sent [IPCP ConfReq id=0x2 ]
rcvd [IPCP ConfReq id=0x1 ]
sent [IPCP ConfAck id=0x1 ]
rcvd [IPCP ConfAck id=0x2 ]
not replacing existing default route via 202.92.148.249
Cannot determine ethernet address for proxy ARP
local IP address 10.60.129.228
remote IP address 10.0.0.1
primary DNS address 192.40.100.30
secondary DNS address 203.177.255.10
Script /etc/ppp/ip-up started (pid 13758)
Script /etc/ppp/ip-up finished (pid 13758), status = 0×0
To terminate the connection just do a CRTL-C
To check whether you’re already connected type the following command:
ifconfig ppp0
You should see something like this in your terminal:
# ifconfig ppp0
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.176.226.135 P-t-P:10.6.6.6 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:38 errors:0 dropped:0 overruns:0 frame:0
TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:7700 (7.5 KiB) TX bytes:3148 (3.0 KiB)
For those using smart you just need to edit the files:
a) globe
b) globe-connect-chat
(This is if you will be using both networks alternatively).
a) For the file globe, edit the following portions and then saved as smart:
# Connect script:
# scripts to initialize the GPRS modem and start the connection,
# wvdial command could be used while other phones should work with chat
connect /etc/ppp/peers/globe-connect-chat
change the string globe-connect-chat to smart-connect-chat
# Username and password:
# If username and password are required by the APN, put here the username
# and put the username-password combination to the secrets file:
# /etc/ppp/pap-secrets for PAP and /etc/ppp/chap-secrets for CHAP
# authentication. See pppd man pages for details.
user “globe”
change user “globe” to “anything”
b) For the file globe-connect-chat, edit the following portions and then save it as smart-connect-chat.
Change the following line:
OK ‘AT+CGDCONT=1,”IP”,”internet.globe.com.ph”,”",0,0′ \
to
OK ‘AT+CGDCONT=1,”IP”,”internet”,”",0,0′ \
To activate connection just issue the command:
pppd call smart
—————————————————————————————————————————–
Related article /resource:
GPRS Easy Connect for linux and freebsd.
This is graphical apps for gprs connection. I tried this but I still can’t make it work. Will update this article once I got to make it work.
Sources:
Of Linux, GPRS Phones, Serial Cable, Irda, Bluetooth and USB by Mikko Rapeli
Getting Nokia 6630 / Nokia 6680 / Nokia N70 to work as 3G / EDGE / GPRS modem in Linux by Xiao Feng
Nick’s Adventure with Series 60 Phones and Linux
These references/sources contain useful related Linux and Mobile Phone tips/info/how to’s, including lists of compatible phones. Include also instructions on connecting using bluetooth and InfraRed.
Tags: Free and Open Source Software, GPRS/3G, Laptops, Linux, Mobile Phones, Symbian OS, Ubuntu