The following steps describe how to connect a Zain Kenya mobile phone to ubuntu. I’m using Ubuntu 8.04 LTS and the mobile is a Nokia 6300. These instructions will work for most Nokias though…I’ve also been able to connect a Sharkpod modem using a Safaricom line but with a little more tweaking…
Step 1: Plug in the mobile phone and choose Nokia mode so that the phone acts like a modem. You can confirm this by typing lsusb…the output is as displayed below if the phone has been detected…if not, you might need to install the necessary kernel modules for usb device access using modprobe and then try again…
$ lsusb
Bus 005 Device 003: ID 05ac:1261 Apple Computer, Inc.
Bus 005 Device 002: ID 05ca:1870 Ricoh Co., Ltd
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 002: ID 0421:04f9 Nokia Mobile Phones Nokia 6300 (PC-Suite mode)
Bus 001 Device 001: ID 0000:0000
Step 2: wvdialconf is used to build the configuration file for wvdial. (run it as root or use sudo)…running it as normal user will result in permission errors as the file being edited belongs to root…
$ sudo wvdialconf
Editing `/etc/wvdial.conf'.
Scanning your serial ports for a modem.
Modem Port Scan<*1>: S0 S1 S2 S3
WvModem<*1>: Cannot get information for serial port.
ttyACM0<*1>: ATQ0 V1 E1 -- OK
ttyACM0<*1>: ATQ0 V1 E1 Z -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyACM0<*1>: Modem Identifier: ATI -- Nokia
ttyACM0<*1>: Speed 4800: AT -- OK
ttyACM0<*1>: Speed 9600: AT -- OK
ttyACM0<*1>: Speed 19200: AT -- OK
ttyACM0<*1>: Speed 38400: AT -- OK
ttyACM0<*1>: Speed 57600: AT -- OK
ttyACM0<*1>: Speed 115200: AT -- OK
ttyACM0<*1>: Speed 230400: AT -- OK
ttyACM0<*1>: Speed 460800: AT -- OK
ttyACM0<*1>: Max speed is 460800; that should be safe.
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
Found an USB modem on /dev/ttyACM0.
Modem configuration written to /etc/wvdial.conf.
ttyACM0<Info>: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
Step 3: wvdialconf is a non-interactive utility (that means that you still need to edit /etc/wvdial.conf to specify the phone number, login name, and password of your internet account in order for wvdial to work). You can use your favourite editor e.g. vim, nano, gedit etc. Since Zain uses a blank username and password field, you have to fill in the fields with the words “blank” (without the quotation marks) and also add another field called ‘StupidMode’ and set it to 1. Without StupidMode, the connection will not go through as wvdial cannot take a blank username and password in normal mode.
You can just create a separate segment for zain so as to make a zain profile for wvdial…and the resulting config file will be…
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
ISDN = 0
New PPPD = yes
Modem = /dev/ttyACM0
Baud = 460800
; Phone = <Target Phone Number>
; Password = <Your Password>
; Username = <Your Login Name>
[Dialer zain]
Modem = /dev/ttyACM0
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Stupid Mode = 1
Modem Type = USB Modem
Phone = *99#
New PPPD = yes
ISDN = 0
Username = blank
Password = blank
Baud = 460800
Then save and exit.
Step4: Run wvdial now on the zain profile
$ wvdial zain
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
~[7f]}#@!}!} } }2}#}$@#}!}$}%\}"}&} }*} } g}%~
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Thu Nov 20 22:44:07 2008
--> Warning: Could not modify /etc/ppp/pap-secrets: Permission denied
--> --> PAP (Password Authentication Protocol) may be flaky.
--> Warning: Could not modify /etc/ppp/chap-secrets: Permission denied
--> --> CHAP (Challenge Handshake) may be flaky.
--> Pid of pppd: 12482
--> Using interface ppp0
--> pppd: h�[06][08]8�[06][08]
--> pppd: h�[06][08]8�[06][08]
--> pppd: h�[06][08]8�[06][08]
--> pppd: h�[06][08]8�[06][08]
--> local IP address 172.20.32.90
--> pppd: h�[06][08]8�[06][08]
--> remote IP address 10.6.6.6
--> pppd: h�[06][08]8�[06][08]
--> primary DNS address 41.220.238.4
--> pppd: h�[06][08]8�[06][08]
--> secondary DNS address 196.201.231.167
--> pppd: h�[06][08]8�[06][08]
The numbers indicated are the DNS Servers issued to the connection thus now you can begin surfing using the phone as a modem with a zain line.
Step 5: To disconnect from the connection just Ctrl+C , wvdial will detect the termination signal and close the connection
<Ctrl+C>
Caught signal 2: Attempting to exit gracefully...
--> Terminating on signal 15
--> pppd: h�[06][08]8�[06][08]
--> Connect time 0.1 minutes.
--> pppd: h�[06][08]8�[06][08]
--> pppd: h�[06][08]8�[06][08]
--> pppd: h�[06][08]8�[06][08]
--> Disconnecting at Thu Nov 20 22:44:15 2008
Step 6: For those who want to avoid the hustle of the command line install gnome-ppp…it is a GUI that allows you to directly set all the options from an attractive interface as opposed to the terminate…either way…they both work!
$ sudo apt-get install gnome-ppp
For safaricom, the wvdial settings are as shown below…
[Dialer safaricom]
Modem = /dev/ttyACM0
Init1 = ATZ
Init2 = ATQ0 V1 E1 &C1 &D2 +FCLASS=0
Stupid Mode = 1
Modem Type = USB Modem
Phone = *99#
New PPPD = yes
ISDN = 0
Username = saf
Password = data
Baud = 460800
If any of you needs help configuring a Sharkpod modem with wvdial, let me know…
November 26, 2008 at 3:21 pm
Thanks for that post. Educate us more on this please. I am a lite Ubuntu user (still on 7.04, but my 8.04 and 8.10 DVDs are lying somewhere). Any chance you could post on how to upgrade to 8.04 (or 8.10)?
BTW: Is anyone working on Kenux? A Kenyan-flavoured Linux distro (I hope I got the lingo right)
Cheers!
November 27, 2008 at 7:53 pm
Your welcome…i’ll might write up something about upgrading Linux in due time but not to keep you waiting i’ll give you the general idea…i have 8.04 myself and i had upgraded it to the new intrepid out of curiosity and well..what can i say, just to know how to do it…this is what i learnt…(i went back to 8.04 though).
There are two ways to upgrade Ubuntu…
1) From the internet…
You can do this by going to System>Software Sources and under one of the tabs there’s a drop down list containing Long Term Release, Normal Release and No release … select Normal Release since Intrepid and the like (NOT hardy heron) are not Long Term Support…then go to update manager and reload or you can press then type ‘update-manage -d’ (without the quotes)…it will inform you that there’s new release out and select to upgrade if you have a fast internet connection…which is rare in Kenya. But i did it at Mobil Westlands using the free Butterly Mobil wireless reaching speeds of upto 1Mbps – 512kbps on average though…(Also thought this is worth mentioning…type ‘update-manager –help’ in the terminal to display the various options that exist with the command e.g. ‘update-manager -c’ tries to check if a new distribution release is available there’s also ‘update-manager -p’…)
2) Alternative CD…
Before you ask…just know that you CAN’T upgrade Ubuntu from the live CD directly i.e if you have 8.04 LTS LiveCD, you can’t use it to upgrade 7.04 or 7.10 to 8.04…you need a special upgrading CD call the alternative CD for the specific version you want to upgrade to…you can download it from the internet…
We need that fibre optic cable quick! Have i answered your question?
Oh, by the way…i’ve been thinking about Kenux (kenyan linux) too! I’d love to be one of the guys on that team contributing ideas and planning but i haven’t heard anyone do it yet :-(
December 4, 2008 at 2:32 pm
thanks for your post.
December 11, 2008 at 4:52 pm
i was also able to connect sing the safaricom mobile office thingy.
here is my wvconf. which i use for both zain and safaricom on my nokia e61i, and safaricom on my girlfriends edge modem (whenever she is not in).
by the way, has anyone realized one can access both ke.celtel.com and safaricom acccess points from a safaricom line? i realized this when my phone started scanning access points and connected with zain internet this morning when the safaricom was down.
___________________________________________
[Dialer zain]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Stupid Mode = 1
Modem Type = USB Modem
ISDN = 0
Phone = *99#
New PPPD = yes
Modem = /dev/ttyACM0
Username = saf
Password = data
Baud = 460800
[Dialer mobileoffice]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Stupid Mode = 1
Modem Type = USB Modem
ISDN = 0
Phone = *99#
New PPPD = yes
Modem = /dev/ttyUSB0
Username = saf
Password = data
Baud = 460800
[Dialer safaricom]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Stupid Mode = 1
Modem Type = USB Modem
ISDN = 0
Phone = *99#
New PPPD = yes
Modem = /dev/ttyACM0
Username = blank
Password = blank
Baud = 460800
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
; Phone =
ISDN = 0
; Password =
New PPPD = yes
; Username =
Modem = /dev/ttyUSB0
Baud = 9600
~
December 11, 2008 at 4:57 pm
By the way, i need an 8.1 DVD, the one with everything esp for my LAMPP purposes….
arebacollins at gmail dot com
720 5167 58
kind regards,
December 12, 2008 at 11:35 am
Yeah i noticed that too…about the ke.celtel thing…it did strike me as really odd!
Oh yeah, Collins i don’t have an official 8.10 DVD with software but i have my personal package DVD that’s got LAMP plus all those packages i’ve ever downloaded…i made it using a program called APTonCD so that i can have my own DVD repository…that’s what i have…helps me by keeping me from re-downloading the same packages everytime i re-install…
March 31, 2009 at 7:05 pm
I just bought a zain line and modem and its working well on my computer. I have a small lan as well of which i assigned the ip addresses 192.168.x.x. My problem is, although it seems i have the lan, i cant connect to the internet via the clients :( Someone please tell me what to do.
March 31, 2009 at 7:06 pm
one other thing: what does server ip address an client ip address on the edge modem properties mean?
April 1, 2009 at 12:31 pm
I don’t have the details but I think that it requires extra configuration for the computer to share its internet connection, probably why the clients are not working….I am assuming that you have a computer on the Zain modem that you want to provide internet to the rest, yes?….the Zain modem is configured to obtain IPs automatically (AutoPPP), chances are that the IP it obtains after establishing a connection are different from the 192.168.x.x that your network has so…technically they aren’t on the same network…thus as I had said before some extra configuration needs to be done…
Check out this link…(I’m assuming you are using Ubuntu or Linux for that matter)…
Sharing Internet Connection In Ubuntu
But I could be wrong and this sounds like an awefully difficult approach to a simple solution, anyone with ideas?