Friday, May 21, 2010

Viettel 3G USB Modem with Fedora

I got myself a Viettel 3G USB stick yesterday for the need of roaming access while I'm off the city. I tried it first with my colleague's Windows machine. The stick worked well with Windows but in ridiculous way. It shown up in a dedicated, silly designed window frame with the ISP heavily branded. That's still acceptable, anyway.

I booted up my laptop which has only Fedora 12 to see how the stick behaves in GNU/Linux. Plugging in the USB in with a really hopeless mind since I know clearly that Linux is not what they are willing to support. And that was clearly documented in the tiny user manual I got when purchasing the stick.

I was right. It did not work. To be honest, it actually worked as a storage device since I found a fake CD-ROM shown up with the name of D-COM.

And that was the interesting clue for me to solve the problem. I googled for the whole day, asked in the forum to have it finally solved in the sweetest way!

To save others' time, here follows a complete guide for Fedora users:

Background

Modems provided Viettel are produced by Huawei and the one I got is the Huawei E1750. Huawei and many other manufactures use a method (which they actually call 'technology') in which the device will behave as a fake CD-ROM when just plugged in. This is to allow the manufacture to ship the installation CD contents right within the device instead of having a real CD-ROM attached.

An autorun application for Windows is included in the fake CD-ROM to start the driver installation process.

After the installation is done the driver is up and to begin the use of the stick as a real modem, a special data sequence is sent by the driver to the device in order to ask it to switch the USB interface into the modem mode. From that on, the USB can be used as a 3G GSM modem. The USB will kept itself switched as long as the power to it is not cut.

This is really clever! A CD-ROM and GSM Modem within just a single USB stick.

Problem with GNU/Linux

The clever part of the device is also the problematic part of it in GNU/Linux. While Huawei GSM modem support is added into the kernel, the activation of the GSM modem mode is however not straightforward.

When the device is plugged in, the OS recognizes it as a storage device only. What we have to find out is how to switch the device into the GMS mode.

Fortunately, a dedicated project was created for just this purpose. The usb_modeswitch program! The latest version of this program is included in the Fedora 12 official repository.

Switching the mode with usb_modeswitch

usb_modeswitch is a helper application that integrates into udev to watch for USB devices. When a device is plugged in, usb_modeswitch lookups the just-plugged-in device vendor and product ID in its internal registry and carries out an appropriate operation in order to switch the device into the GMS modem mode. This perfectly fits our need for the Huawei device. The following steps help you install the switching:

Step 1: Installing usb_modeswitch

usb_modeswitch can be installed easily with yum:

#yum -y install usb_modeswitch

Step 2: Removing wrong udev entries

An important thing that you have to do is to resolve a conflicts in using the device. To do this, find the file at /lib/udev/-modem-modeswitch.rules and comment out the line that mentions the Huawei device (Huawei devices have the vendor:product id of 12d1:1446)

May thanks to Josh for guiding me in this section.

Step 3: Reboot

There may be other ways but this is the most simple one to get udev reloaded.

Configuring the connection

After rebooting and plugging in your device you can now configured the connection using NetworkManager. And this is what I found it is so sweet, the Linux way of configuring network connection. You have a single, united and well designed graphical user interface for all network connections of all types, all kind of devices.

Adding a new connection

Right-click the NetworkManager panel icon, select 'Edit Connections...', select the 'Mobile Broadband' and click 'Add'

The Huawei device should be listed in the device list, select it and click 'Forward'.

Since Vietnam may not be listed in this version of NetworkManager, just select 'My country is not listed' and then 'Forward'

Enter Viettel in the Provider box. This is not a configuration parameter, you can choose another name. However, this will be used in the default connection name so I suggest that you have the ISP name here.

Enter 'e-connect' as the Access Point Name. This is an important configuration parameter. I found it when inspecting the Windows application shipped with the modem. No information for this parameter is officially provided by the ISP.

Click 'Forward'.

Just click 'Apply' in this confirmation screen.

Modify the connection name if you want and click 'Apply'. The configuration is done you can now start using the connection.

Using the connection

Clicking the NetworkManager panel icon you will find that connection is now listed and ready for use:

Select the connection and wait for the modem to get connected, you can now start using the 3G connection!










16 comments:

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
嘉王偉 said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Truong Anh Tuan said...

Bài này lâu quá rồi nhỉ :)
Cắm Viettel D-COM 3G (và hầu hết các USB 3G khác) vào là nhận ngay từ Fedora 15 rồi.

Unknown said...

hoặc có thể tìm kiếm trên google dang ky internet fpt quan go vap tai hcm

Unknown said...


khi bạn muốn đăng ký lắp đặt cáp quang internet viettel vui lòng liên hệ:
Phòng Kinh Doanh Dịch Vụ Viễn Thông Viettel – Chi Nhánh Viettel TP Hồ Chí Minh
Địa chỉ: Số 286 Cộng Hòa – Phường 13 – Quận Tân Bình – TP.HCM
Điện thoại: 0988.677.995 (Mr. Hoàng)
Email: dangkyviettel24h@gmail.com
1. dang ky mang internet viettel
2. lap dat cap quang viettel tphcm
3. lắp đặt ADSL viettel tại tpchm

Unknown said...

Mọi nhu cầu về dịch vụ lắp đặt adsl viettel tại tphcm và toàn quốc xin liên hệ:
Phòng Kinh Doanh Dịch Vụ Viễn Thông Viettel – Chi Nhánh Viettel TP Hồ Chí Minh
Địa chỉ: Số 286 Cộng Hòa – Phường 13 – Quận Tân Bình – TP.HCM
Điện thoại: 0988.677.995 (Mr. Hoàng)
Email: dangkyviettel24h@gmail.com

website : http://www.dangkyviettel24h.com/