This tutorial will explain, step by step, how to configure your Ubuntu 9.04 (should work with 8.10) to use your phones GPRS connection as gateway. This tutorial explains
only how to use your phone connected with USB cable.
Make sure you have access to GPRS and your phone is capable of connecting to internet and browsing. If you are A1200 user there's a patch to enable EDGE so you can gain some extra speed.
Ok, lets start...
1. First we need to find IP address of service providers GPRS server.
1.1 Put your phone in
USB Lan mode and connect it to your computer. Since motorola does not have DNS installed you will need to set IP address manually. In most cases phone was connected with 192.168.1.2 so I have set mine to 192.168.1.1
Before setting your IP address I suggest checking the existing one. Open your terminal and type:
Among other things you should have
usb0 listed
Code:
usb0 Link encap:Ethernet HWaddr 3e:0f:c4:8e:29:4b
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::3c0f:c4ff:fe8e:294b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1494 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:57 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:32 (32.0 B) TX bytes:8135 (8.1 KB)
As you can see in my case address is already set. If you dont have IP address set for
usb0 you can set it by typing:
Code:
ifconfig usb0 down
ifconfig usb0 192.168.1.1 netmask 255.255.255.0 up
First line will bring interface down (if it's not already) and the second one, well, will set IP address and try to bring it up.
1.2 Once your phone is in
USB Lan mode and successfuly connected to your computer go to (on your phone)
Main Menu -> Setup -> Data network and activate your GPRS connection.
1.3 Connect to your phone by typing:
After that you should be prompted for username
Code:
Trying 192.168.1.2...
Connected to 192.168.1.2.
Escape character is '^]'.
MontaVista(R) Linux(R) Consumer Electronics Edition 3.1
Linux/armv5tel 2.4.20_mvlcee31-mainstone_pxa27x
(none) login:
Type in
root and system should let you in without asking for password. You will get message saying "/root" can not be found. Don't worry it's ok, system was never meant to be used by root. Whole thing should look like this
Code:
(none) login: root
MontaVista(R) Linux(R) Consumer Electronics Edition 3.1
No directory /root!
Logging in with home = "/".
#
1.4 Now when we are logged in issue
ifconfig (on your phone) again. Notice there is no
-a flag this time. This flag tells ifconfig to display all interfaces regardless of their state (up/down). This time we want
ifconfig to show only active interfaces.
After hitting enter you should be presented with all the interfaces on your phone. In results you will find interface named
gprsv0 Code:
gprsv0 Link encap:Point-to-Point Protocol
inet addr:172.17.253.196 P-t-P:10.112.112.112 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:50
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Notice the IP address
172.17.253.196. That is THE address we are looking for. Write it down somewhere or copy/paste it.
1.5 Logout from your phone using
exit command. (not necessary but we are just being polite

)
1.6 Disconnect from GPRS network on your phone. This is important because if you don't dialer will later report that line is busy.
2. We are going to tell
pppd to use IP address we found earlier.
2.1 Open
/etc/ppp/options file by executing
Code:
gksu gedit /etc/ppp/options
from your terminal or run command dialog. In case you dont have/use gEdit you can change that part to your favourite editor. Please note that
gksu command is same as
sudo for terminal. Meaning if you want to edit file using console based editor (vi, nano, vim) you need to use
sudo for other Gnome based applications use
gksu.
2.2 Once file is opened scroll to its end and add following lines
Code:
novj
:172.17.253.196
Instead IP address I wrote, use one you found earlier.
2.3 Save file and close editor
3. Now we are going to create
wvdial.conf file for wvdial in order to initialise our phone.
3.1 Before modifying anything you need to set your phone back to
Modem mode. You can do this by going (on your phone) to
Main Menu -> Setup -> USB mode 3.2 Create
wvdial.conf file by executing
Code:
sudo touch /etc/wvdial.conf
3.3 Open file for editing
Code:
gksu gedit /etc/wvdial.conf
3.4 Paste the folowing lines
Code:
[Dialer Defaults]
Init1 = ATZ
Init2 = AT&FE0V1&C1S0=0
Init3 = AT+cgdcont=1,"IP","apn_name","",0,0
Modem Type = USB Modem
ISDN = 0
Phone = *99***2#
New PPPD = yes
Modem = /dev/ttyACM0
Username = apn_user
Password = apn_pass
Baud = 460800
Idle Seconds = 3000
Auto DNS = 1
Stupid Mode = 1
Dial Command = ATD
Ask Password = 0
FlowControl = NOFLOW
Before saving change
apn_name and
apn_user to settings from your GPRS connection. Since
Ask Password = 0 you dont have to change
apn_pass. In case you don't know how to find these settings go to
Main Menu -> Setup -> Data network and edit your GPRS connection. There you will find apn_name and apn_user.
3.5 Save the file and close your editor.
Ok, this should be it as far as configuration goes. Now it's time to test your connection. Again, make sure you are disconnected from your GPRS connection on your phone.
Now, to connect type
This is the line you will need to type everytime you want to connect using your phone. Sadly I was unable to make it work through network manager but hey, better something than nothing. Anyway result should be something like this
Code:
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
--> Sending: ATQ0
ATQ0
OK
--> Re-Sending: ATZ
ATZ
OK
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: AT&FE0V1&C1S0=0
AT&FE0V1&C1S0=0
OK
--> Sending: AT+cgdcont=1,"IP","internet","",0,0
OK
--> Modem initialized.
--> Idle Seconds = 3000, disabling automatic reconnect.
--> Sending: ATD*99***2#
--> Waiting for carrier.
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Wed May 6 20:53:46 2009
--> Pid of pppd: 11794
--> Using interface ppp0
--> pppd: [10]�!
--> pppd: [10]�!
--> pppd: [10]�!
--> pppd: [10]�!
--> pppd: [10]�!
--> local IP address 172.17.32.205
--> pppd: [10]�!
--> remote IP address 172.17.253.196
--> pppd: [10]�!
--> primary DNS address 217.65.192.1
--> pppd: [10]�!
--> secondary DNS address 217.65.192.52
--> pppd: [10]�!
Once you see
local IP address xxx.xxx.xxx.xxx it means you are connected. If you get dialer error 16, don't worry try few more times. For me it took few times for everything to work correctly. Network might be slow and at first it might look like it's not working (at least that's my expirience) but after few seconds everything started working like it should.
IMPORTANT: Closing terminal window or pressing CTRL+C in that window (where you typed
sudo wvdial) will disconect you...
Hope this helped someone!
Edit: Recently I've found out that not all firmwares support or have telnet server started. I'll try to find a different way of finding IP...