Tuesday, June 24, 2008

Connecting to Internet using Huawei C5320 - Part 2

Added two lines to the option.c file to enable support for C5320. Also built a patch file:
*** /usr/src/linux-source-2.6.24/drivers/usb/serial/option.c 2008-06-18 19:35:04.000000000 +0530
--- option.c 2008-06-24 10:56:41.000000000 +0530
*** 109,114 ****
--- 109,115 ----
#define HUAWEI_PRODUCT_E600 0x1001
#define HUAWEI_PRODUCT_E220 0x1003
#define HUAWEI_PRODUCT_E220BIS 0x1004
+ #define HUAWEI_PRODUCT_C300 0x3197

#define DELL_VENDOR_ID 0x413C
*** 158,163 ****
--- 159,165 ----
{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1100) }, /* Novatel Merlin XS620/S640 */
Now just need to create a hal rules for the device.

Connecting to Internet using Huawei C5320 - Part 1

Well some things do not last long. I had to give my Huawei C2900i to the service center as something was wrong with the headphones socket. I decided to get the Huawei C5320 (white, I could not get the black) and give the C2900i to someone else. While the C5320 is more than twice the price of the C2900i and comes with a microSD slot, a 1.3mp camera and a basic mp3/mp4 player, I actually preferred the C2900i. This is because firstly I do not need a 1.3mp camera, and I actually prefer using my Fuji Finepix S5200 for any photography. Secondly I do not need an mp3 player since I already have one. And thirdly I do not need an mp4 player since I have a laptop. The C5320 misses one feature from the low-end C2900i; it does not allow voice recording of conversations. But I needed a phone which I could backup my sms' and phone numbers, and yes customize ringtones (though this is optional). Anyway, I plugged it onto my laptop hoping that like my C2900i it would be automatically recognised on Linux. A lsusb -v lists the device as Huawei Technologies C300 USB modem with device id : 0x12d1:0x3197.

By installing the device on Windows, I had discovered that it adhers to the USB CDC-ACM. So tried getting it the cdc-acm module on linux to load. But my attempts to get it to work were futile. The phone supports three modes of operation, an USB disk mode for accessing the microSD card, a Phone Sync mode to sync data between the mobile and system, including phonebook and sms's, and a third mode the data sync mode which enables the data modem. Strangely the cdc-acm driver would get loaded in Phone Sync mode, but display that it is not a modem.

The kernel modules typically loaded for the C2900i are option.ko and usbserial.ko. The option module is required since the usbserial.ko does not work well with GSM modems. So I decided to try my luck with these modules.
A "sudo modprobe usbserial vendor=0x12d1 product=0x3197" worked. I finally got a /dev/ttyUSB0 device. Connecting to the internet worked, but was a bit slow.

Connecting to internet on Ubuntu/Linux using Huawei 2900i

After having got a Tata Indicom connection, I decided to go in for the Huawei 2900i mobile as it was the cheapest mobile I could find with a modem. I could not find the data cable anywhere, so ended up ordering it online. The modem was detected as a Huawei E220 modem in Feisty. However once I upgraded to Hardy, ended up with problems as sometimes the device would be recognised as a USB storage device. This is because it is sort of a 3-in-1 device, a usb modem, a usb storage device and a CDFS (virtual CDROM).

Adding the following rules to hal, /usr/share/hal/fdi/preprobe/10osvendor/20-broken-usb-sticks.fdi did fix the problem.

<!-- Ignore the Huawei E220 USBHSDPA modem -->

<match key="@storage.originating_device:usb.vendor_id" int="0x12d1"> <match key="@storage.originating_device:usb.product_id"int="0x1003"> <merge key="info.ignore" type="bool">true</merge> </match> </match>

Once the modem is detected, then just setup a ppp connection using any ppp dialer, either Gnome PPP, KPPP or wvdial, with the following settings:
Username: internet
Password: internet
Phone Number: #777

Changing mobile service providers

I recently changed mobile my mobile service provider from Vodafone to Tata Indicom. The primary reason was lower STD calls (now virtually free Tata2Tata) . Earlier I used to run huge bills on my Vodafone Postpaid (enough to buy a mobile each month). Thanks Tata ;).