這次寒假回南部,因為老家並沒有裝設網路,所以就在台北租了一台3.5G無線網卡,怕訊號不好,所以使用中華電信的系統,本來以為會租給我ubuntu下最容易使用的E220,結果卻是Bandluxe C120。
當然啦,windows XP下面不會有問題,結果我在ubuntu 9.10下面卻是一直失敗。
上網看了一下,發現有人說 ubuntu 9.04可以順利執行
http://abcubuntu.blogspot.com/2008/12/ubuntu-810bandluxe-c120.html
於是我就重新安裝了9.04,結果還是發現問題一堆,曾經有一次成功,但是發現,網路圖示的選項中,行動寬頻的選項,通常只閃爍一下子就會消失,所以很容易失敗。
後來找到一個英文網頁http://swiss.ubuntuforums.org/showthread.php?p=8069704
照著做到執行script之後,網路圖示選項就正常了(9.04和9.10都成功了),我把修改後包含必須的檔案打包起來bandluxe-c120.tar,下次只要下載解壓縮,並用root權限執行bandluxe-c120.sh。
然後進入終端機,執行
sudo gedit /etc/NetworkManager/nm-system-settings.conf
將 managed=false 改成 managed=true 之後存檔離開。
重新登入或重新開機即可。
PS:每更新一次核心都要做一次,因為會更改/lib/modules/核心編號/modules.alias 這個檔案。
內容節錄如下:
I am using Ubuntu 8.10 with the latest updates in a Sony Vaio VGN-SR150A.
I managed to configure and use the HDSPA USB 3G modem from Bandrich,
the Bandluxe C120, adapting a configuration script made by the maker
of this USB card for the Eee PC. You can download all the files from
this link
http://www.bandrich.com/Data-Card_C100_down_3.html
and click download.
You get a file named
EeePC patch.zip
Uncompress it and you get two pdf files and another compressed file
bandluxe-eeepc.tar.bz2
Uncompress this file too. You should get a directory named bandluxe-eeepc.
Inside you have a script eeepc3g.sh.
Do not run this script just yet!
Unless you are using a Eee PC with the version of the
gnu-linux operating system that is shipped from Asus!
This script reads
============FILE eeepc3g.sh====================================
#!/bin/sh
MODDIR=/lib/modules/`uname -r`
echo "Backup file modules.alias"
cp -v ${MODDIR}/modules.alias ./modules-eeepc.alias
echo "Patching file modules.alias"
sed -f vidpid.sed ./modules-eeepc.alias > ${MODDIR}/modules.alias
echo "Unload the kernel module"
/sbin/rmmod option
echo "Backup file option.ko"
cp -v ${MODDIR}/kernel/drivers/usb/serial/option.ko ./option-eeepc.ko
echo "Add support of Bandluxe Data Card"
cp -v option-bandluxe.ko ${MODDIR}/kernel/drivers/usb/serial/option.ko
echo "Rules for auto switch from CDROM to Modem"
cp -vf 10-bandluxe.rules /etc/udev/rules.d/10-bandluxe.rules
mkdir -p /usr/share/hal/fdi/preprobe/20thirdparty/
cp -vf bandluxe.fdi /usr/share/hal/fdi/preprobe/20thirdparty/bandluxe.fdi
============END of FILE eeepc3g.sh====================================
You should comment everything which is kernel-specific, as follows,
and save it in a new file named say "Bandluxe-c120.sh" IN THE SAME
DIRECTORY bandluxe-eeepc.
==================FILE Bandluxe-c120.sh=============================
#!/bin/sh
MODDIR=/lib/modules/`uname -r`
echo "Backup file modules.alias"
cp -v ${MODDIR}/modules.alias ./modules-eeepc.alias
echo "Patching file modules.alias"
sed -f vidpid.sed ./modules-eeepc.alias > ${MODDIR}/modules.alias
#echo "Unload the kernel module"
#/sbin/rmmod option
#echo "Backup file option.ko"
#cp -v ${MODDIR}/kernel/drivers/usb/serial/option.ko ./option-eeepc.ko
#echo "Add support of Bandluxe Data Card"
#cp -v option-bandluxe.ko ${MODDIR}/kernel/drivers/usb/serial/option.ko
echo "Rules for auto switch from CDROM to Modem"
cp -vf 10-bandluxe.rules /etc/udev/rules.d/10-bandluxe.rules
mkdir -p /usr/share/hal/fdi/preprobe/20thirdparty/
cp -vf bandluxe.fdi /usr/share/hal/fdi/preprobe/20thirdparty/bandluxe.fdi
==============End of File Bandluxe-c120.sh=============================
If you just edited the file with gedit, then it will remain an executable
file and you can just run it with
cd "path to bandluxe-eeepc"
sudo ./Bandluxe-c120.sh
The script now just adds some rules for the system udev to recognize the
Bandluxe C120 USB device, let it open the modem devices /dev/ttyUSBx
where x depends on the installed hardware of your machine,
but when the Bandluxe tries to identify itself as a CDROM the udev system
sends a kind of sleep signal and ignores this device. It keeps the other
ttyUSBx devices open however, and this enables one to then connect to the
modem through either gnome-ppp or kppp or even NetworkManager in
Ubuntu 9.04.
I cannot put this 3G USB modem to work through NetworkManager in my Ubuntu 8.10, I can only use it through gnome-ppp (you need probably
to install gnome-ppp with synaptic first) as follows.
Create a Laucher on your desktop clicking the right mouse buttom on
the background of the desktop and select "Create Launcher". In the
window that opens choose Application, give it a name to appear in your
desktop, click on the icon on the upper left of the window to choose some
icon for the desktop, and on the command entry form write
gksudo gnome-ppp
since we have to open the gnome frontend to ppp with root privileges.
Click ok and you shoudl have a new icon on your desktop. Double-click it,
enter your password and then gnome-ppp window opens.
Write the unsername and passwork of your 3G connection, then the
phone number to dial (should be something like *99#, depending on
the GSM operator) and then click on SETUP.
Here you should write \dev\ttyUSBx where x=0,1,2,… on the DEVICE entry field, depending on your hardware — you should use lsusb or dmesg to find out which is the right number for you (more on this below). Then
TYPE choose Analog Modem
Speed: choose the highest 460800
then click on "Init Strings" and enter the following
Inti2 = AT+CGDCONT=1,"IP","www address of your provider"
Init3 = at+cgatt=1
Init4 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
On the Networking tab choose Dynamic IP address and you may choose also
Automatic DNS. I prefer to use Open DNS, so I click Manual DNS and enter
DNS1 = 208.67.222.222
DNS2 = 208.67.220.220
On the options tab I selected:
Abort connecting if no dialtone
Check carrier line
Check default route
Ignore terminal strings (stupid mode)
and
Idle time is set to 0 (disabled).
You can close the window and get back to the gnome-ppp window.
Now, plug-in the C120 USB and wait some 15 seconds. Then click
Connect on the small gnome-ppp window. You should be online in no time.
The setup of the gnome-ppp is kept between sessions so you should
make this setup only once.
Finally, to find out which /dev/ttyUSBx to write in the device form above,
I did this: pluged the USB modem C120, waited half a minute, open a terminal and entered "dmesg". The last few lines are
[128169.940927] usb 4-1: new full speed USB device using uhci_hcd and address 4
[128170.108853] usb 4-1: configuration #1 chosen from 1 choice
[128170.112856] scsi11 : SCSI emulation for USB Mass Storage devices
[128170.113735] usb-storage: device found at 4
[128170.113740] usb-storage: waiting for device to settle before scanning
[128170.122409] option 4-1:1.1: GSM modem (1-port) converter detected
[128170.122565] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB0
[128170.133087] option 4-1:1.2: GSM modem (1-port) converter detected
[128170.133177] usb 4-1: GSM modem (1-port) converter now attached to ttyUSB1
The last lines show that I got two new devices
/dev/ttyUSB0
/dev/ttyUSB1
I use /dev/ttyUSB1 on the devices form field of the gnome-ppp setup.
It works well and fast!
Hope this helps you folks here!