I have finally been able to get the USB modem feature with the Windows Mobile 5, Verizon Treo working under Linux.
Following is a detailed how to on getting it set up and running. In this case, I was doing it with an IBM ThinkPad T42 running Kubuntu 8.04.
This how to should help you figure out how to get other mobile devices to work as well.
- The first thing that you need to do is make sure that you have the latest version of Windows Mobile 5 on your Treo 700w/700wx. I won’t go through the details of that process as the docs on the Palm site cover it. This gives you the new Modem app on the phone that we’ll use once you get your linux box all setup.
- Install:
- synce-dccm (and all deps)
- synce-serial:
- When installing chose the following serial interface:
- /dev/ttyUSB0
- Use the default IP address for ppp to windows device:
- 192.168.131.102
- Use the default remote IP address for ppp for windows device:
- 192.168.131.201
- Edit /etc/init.d/mountdevsubfs.sh:
- uncommented the following lines:
# Magic to make /proc/bus/usb work
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount –rbind /dev/bus/usb /proc/bus/usb
- install latest version of wvdial
- Edit /etc/ppp/options:
- Comment out the following:
# lcp-echo-interval 30
# lcp-echo-failure 4
- Turn off other network interfaces (this didn’t seem neccessary once it was set up but was helpful for testing)
- Determine which driver/module you need to load (much of this information was gleaned from a howto on determining the correct module from scratch http://www.linuxtopia.org/online_books/linux_kernel/kernel_configuration/ch08s02.html):
- Make sure that you have the kernel source for your current kernal installed
- To figure out what version of the kernel you are runing type the following:
- cat /proc/version
- Figure out the specific vendor/product id for your device:
- Plug in device and run a lsusb command.
- You will get something similar to the following
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 002: ID 045e:0301 Microsoft Corp.
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
- Devices with an ID of 0000:0000 can be safely ignored as they are the USB host controllers for the usb bus. If you have a number of other USB devices attached you’ll need to detach each to isolate and figure out which one is your handheld. In the aforementioned example, I only have one USB device attached and entry is obvious. After the Bus and Device entries there is an ID entry that contains a string of numbers and letters separated by a colon. That is your vendor and product ID for your device respectively. You will need these when loading your module and will need that information to figure out which module you will need to load.
- Now that you know the vendor and product ID you will need to search through the linux driver files to find the driver that controls your device. To do so go to /usr/src/linux-source-YOUR.VERSION/drivers/
- In our case, our vendor ID is 045e so run the following command to find out which files contain that string:
find ./ -type f -exec fgrep -l 045E {} \;
- In my case, my driver source file had the "e" in upper case, and that took a bit of searching around to figure out. You may have to play around with the case of your search string to find the right source file.
- find output the following:
./usb/serial/ipaq.c
./usb/misc/emi62_fw_s.h
./usb/misc/emi62_fw_m.h
./video/matrox/matroxfb_maven.c
./atm/pca200e.data
- Since I know my device is a usb serial devide I started with the ipaq.c file.
- Open the file and do a search for your vendor ID. This brought me to the first of many entries with the MicroSoft vendor id:
{ USB_DEVICE(0x045E, 0x00CE) }, /* Microsoft USB Sync */
{ USB_DEVICE(0x045E, 0x0400) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0401) }, /* Windows Powered Pocket PC 2002 */
{ USB_DEVICE(0x045E, 0x0402) }, /* Windows Powered Pocket PC 2002 */
- What you would do then, is search for your product ID, in our case 0301 from our lsusb output. However, in this specific case, there doesn’t seem to be an entry for that model, but evidently the ipaq module contains support for another device that is similar enough that it works. So, technically, you would search for a line that contained the following (I have fabricated this for purposes of this tutorial):
{ USB_DEVICE(0x045E, 0x0301) },
- Drivers tell the kernel the devices that they support so that the kernel can bind the proper driver to the device. This is done with the struct usb_device_id variable that contains our device’s entry. The entries are a list of vendor/product IDs that are supported by the driver. So, if your vendor/product id is in the list, your device is supported by this driver, and you can conclude that you need to load the ipaq module.
- If that driver was not compiled in your distro of linux you will need to do a few extra steps. Basically:
- Find the USB vendor/product ID using lsusb.
- Search the kernel source tree for the vendor/product ID of the device. Both ids should be in a struct usb_device_id definition.
- Search the kernel Makefiles for the CONFIG_ rule that builds the driver: find -type f -name Makefile | xargs grep ipaq
- Search in the kernel config system for that configuration value and go to that location in the menu that it specifies to enable that driver to be built.
- Now that you know which module you need to load, load it in using modprobe specifying vendor/product:
modprobe ipaq vendor=0x045e product=0x0301
- Add the following to /etc/rc.local so that the module will be loaded on boot.
/sbin/modprobe ipaq vendor=0x045e product=0x0079
touch /var/lock/subsys/local
- Turn on the usb modem program on the phone.
- Plug in phone and check messages to make sure that the right driver is used when creating the device file for your handheld.
Jun 10 15:57:47 transient kernel: [ 7022.957111] usb 2-2: new full speed USB device using uhci_hcd and address 3
Jun 10 15:57:47 transient kernel: [ 7023.142403] usb 2-2: configuration #1 chosen from 1 choice
Jun 10 15:57:47 transient kernel: [ 7023.146207] ipaq 2-2:1.0: PocketPC PDA converter detected
Jun 10 15:57:47 transient kernel: [ 7023.149911] usb 2-2: PocketPC PDA converter now attached to ttyUSB0
- Assuming that you got the aforementioned (or something similar specific to your device) you are ready to configure the modem.
- run wvdialconf. If it runs properly you should get a confirmation message and a new file will be created in /etc/wvdial.conf.
- Now, try running wvdial and see what happens.
- In my case it connected but then lost the signal.
- I made the following tweeks to my wvdial.conf file. Simply add:
Stupid Mode = yes
- run wvdial and if successful you should get something like this:
–> 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
–> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
–> Modem initialized.
–> Sending: ATDT#777
–> Waiting for carrier.
ATDT#777
CONNECT
–> Carrier detected. Starting PPP immediately.
–> Starting pppd at Tue Jun 10 16:05:33 2008
–> Pid of pppd: 30644
–> Using interface ppp0
–> pppd: ��[06][08]P�[06][08]��[06][08]
–> pppd: ��[06][08]P�[06][08]��[06][08]
–> pppd: ��[06][08]P�[06][08]��[06][08]
–> pppd: ��[06][08]P�[06][08]��[06][08]
–> pppd: ��[06][08]P�[06][08]��[06][08]
–> remote IP address 66.174.12.5
–> pppd: ��[06][08]P�[06][08]��[06][08]
–> primary DNS address 66.174.95.44
–> pppd: ��[06][08]P�[06][08]��[06][08]
–> secondary DNS address 69.78.96.14
–> pppd: ��[06][08]P�[06][08]��[06][08]
- Check ifconfig for a proper ppp0 entry and you are all set.
- To disconnect simply type Ctrl-C in that terminal in which you launched wvdial and it will disconnect your modem.