ariel
May 3rd, 2008, 12:57 PM
Mini-Howto: using your HTC Touch (CDMA - EVDO, P3050) cellular phone or PDA as a wireless modem via USB
This guide has been written for Ubuntu 8.04 but should work in all variants and other distros as well (you may need to install the wvdial package though, which ubuntu installs by default). The main source of information for this post is this guide for ASUS eee / xandros (http://forum.eeeuser.com/viewtopic.php?pid=53155).
> Before connecting the USB cable, turn on the mobile phone and set it in "Wireless Modem" mode (don't forget to hit "Start"); you can do this from the "Cube" > "Comm Manager" or by navigating the phone menus: Start > Programs > then scrolling down to the "WModem" app icon and launching it, and then clicking "Start" from the menu.
> Now, connect the device with the USB cable
> Wait for a few seconds and then run:
sudo lsusb -v and look for the "Generic Serial" device; note down the Vendor and ProdID info.
T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=0bb4 ProdID=0b03 Rev= 0.00
S: Manufacturer=Generic Manufacturer (PROTOTYPE--Remember to change idVendor)
S: Product=Generic Serial
C:* #Ifs= 2 Cfg#= 1 Atr=c0 MxPwr= 0mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=02(comm.) Sub=ff Prot=ff Driver=(none)
E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=32ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=02(comm.) Sub=ff Prot=ff Driver=(none)
E: Ad=84(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=05(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
> In my case, the key information is: Vendor=0bb4 ProdID=0b03
> Now let's load the module that will make the device appear as a serial port to the kernel
sudo /sbin/modprobe ipaq vendor=0x0bb4 product=0x0b03 If you now check dmesg, you will see a line that looks like: [ 3161.461769] usb 4-1: PocketPC PDA converter now attached to ttyUSB0 Which means you are OK up to this point.
Note: to have this done automatically on boot, edit /etc/rc.local and add in it (don't forget to replace the Vendor and Product IDs with your own):
/sbin/modprobe ipaq vendor=0x0bb4 product=0x0b03
sudo gedit /etc/rc.localWhich should then look like:
joe@doe:~$ cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/sbin/modprobe ipaq vendor=0x0bb4 product=0x0b03
exit 0> Edit the ppp configuration file:
sudo gedit /etc/ppp/options In this file, comment out the lines starting with 'lcp-echo-interval 30' and 'lcp-echo-failure 4' to prevent ppp from disconnecting; you do this by adding a "#" character in the beginning of the line.
> Edit the dialer configuration:
sudo gedit /etc/wvdial.conf Replace the contents with the following, noting first:
- Phone: this line contains the access phone number, and varies from provider to provider. In Canada, NZ, and some US operators use #777
- Username and Password: you need to get this from your provider; however, some operators do not use this information (mine, for example), they control access at the radio access layer;
which means that you can use something any string as username and password, such as test / test.
- Modem: this line has to match the the /dev/xxxxx device that you see showing up in dmesg after you plugged in your phone in wireless modem mode
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
Phone = #777
Modem = /dev/ttyUSB0
Username = test
Password = test
Baud = 460800
Idle Seconds = 0
Carrier Check = no
Stupid Mode = on
FlowControl = NOFLOW
Compuserve = 0
Auto DNS = 1> To start using your wireless modem, open a terminal and launch wvdial, you should see something like the below (you must leave the terminal window open for the connection to stay up):
joe@doelaptop:~$ wvdial
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT#777
--> Waiting for carrier.
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sat May 3 12:14:58 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: 11142
--> Using interface ppp0> Finally, if you are using networkmanager, you may have a default IP route pointing to your wlan or your wired ethernet (sometimes, if you were using wlan and then turn the wifi switch off, networkmanager does not remove the installed default route). If this is your case, you will notice that you can not ping google.ca (because your linux can't reach the DNS servers). The fix is very easy; open a terminal and type:
sudo ip route add default dev ppp0> That's it! now you should be able to browse the internet, connect your VPN, etc. My connection is quite good BTW, speetest.net shows me:
Download: 1503 Kbps
Upload: 103 Kbps
Latency: 305 ms
This guide has been written for Ubuntu 8.04 but should work in all variants and other distros as well (you may need to install the wvdial package though, which ubuntu installs by default). The main source of information for this post is this guide for ASUS eee / xandros (http://forum.eeeuser.com/viewtopic.php?pid=53155).
> Before connecting the USB cable, turn on the mobile phone and set it in "Wireless Modem" mode (don't forget to hit "Start"); you can do this from the "Cube" > "Comm Manager" or by navigating the phone menus: Start > Programs > then scrolling down to the "WModem" app icon and launching it, and then clicking "Start" from the menu.
> Now, connect the device with the USB cable
> Wait for a few seconds and then run:
sudo lsusb -v and look for the "Generic Serial" device; note down the Vendor and ProdID info.
T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=0bb4 ProdID=0b03 Rev= 0.00
S: Manufacturer=Generic Manufacturer (PROTOTYPE--Remember to change idVendor)
S: Product=Generic Serial
C:* #Ifs= 2 Cfg#= 1 Atr=c0 MxPwr= 0mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=02(comm.) Sub=ff Prot=ff Driver=(none)
E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=83(I) Atr=03(Int.) MxPS= 64 Ivl=32ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=02(comm.) Sub=ff Prot=ff Driver=(none)
E: Ad=84(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=05(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
> In my case, the key information is: Vendor=0bb4 ProdID=0b03
> Now let's load the module that will make the device appear as a serial port to the kernel
sudo /sbin/modprobe ipaq vendor=0x0bb4 product=0x0b03 If you now check dmesg, you will see a line that looks like: [ 3161.461769] usb 4-1: PocketPC PDA converter now attached to ttyUSB0 Which means you are OK up to this point.
Note: to have this done automatically on boot, edit /etc/rc.local and add in it (don't forget to replace the Vendor and Product IDs with your own):
/sbin/modprobe ipaq vendor=0x0bb4 product=0x0b03
sudo gedit /etc/rc.localWhich should then look like:
joe@doe:~$ cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/sbin/modprobe ipaq vendor=0x0bb4 product=0x0b03
exit 0> Edit the ppp configuration file:
sudo gedit /etc/ppp/options In this file, comment out the lines starting with 'lcp-echo-interval 30' and 'lcp-echo-failure 4' to prevent ppp from disconnecting; you do this by adding a "#" character in the beginning of the line.
> Edit the dialer configuration:
sudo gedit /etc/wvdial.conf Replace the contents with the following, noting first:
- Phone: this line contains the access phone number, and varies from provider to provider. In Canada, NZ, and some US operators use #777
- Username and Password: you need to get this from your provider; however, some operators do not use this information (mine, for example), they control access at the radio access layer;
which means that you can use something any string as username and password, such as test / test.
- Modem: this line has to match the the /dev/xxxxx device that you see showing up in dmesg after you plugged in your phone in wireless modem mode
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = USB Modem
Phone = #777
Modem = /dev/ttyUSB0
Username = test
Password = test
Baud = 460800
Idle Seconds = 0
Carrier Check = no
Stupid Mode = on
FlowControl = NOFLOW
Compuserve = 0
Auto DNS = 1> To start using your wireless modem, open a terminal and launch wvdial, you should see something like the below (you must leave the terminal window open for the connection to stay up):
joe@doelaptop:~$ wvdial
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT#777
--> Waiting for carrier.
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sat May 3 12:14:58 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: 11142
--> Using interface ppp0> Finally, if you are using networkmanager, you may have a default IP route pointing to your wlan or your wired ethernet (sometimes, if you were using wlan and then turn the wifi switch off, networkmanager does not remove the installed default route). If this is your case, you will notice that you can not ping google.ca (because your linux can't reach the DNS servers). The fix is very easy; open a terminal and type:
sudo ip route add default dev ppp0> That's it! now you should be able to browse the internet, connect your VPN, etc. My connection is quite good BTW, speetest.net shows me:
Download: 1503 Kbps
Upload: 103 Kbps
Latency: 305 ms