3G Configuration – Ubuntu Lucid UPDATE 1

来源:互联网 发布:贵阳 软件著作权资助 编辑:程序博客网 时间:2024/06/03 18:21

This is an update to this page. Read that before continuing.

Some people have a catch-22 problem with 3G Modem and Ubuntu. If 3G is only way to connect to internet, but it does not work, and you need usb-modeswitch to get it to work, then.. it is kind of a vicious circle. You can install packages offline. Here are some instructions for Ubuntu offline package installation. I recommend you to try Keryx, which is graphical offline installer for Ubuntu.

After 3 months of constant daily use the I can conclude that 3G modems Huawei E220, Huawei E160, Huawei E1820 and ZTE MF 668 work just fine in Ubuntu 10.04. Only thing you have to remember is that usually these modems (especially E1820 and MF668) need several seconds to “settle” properly. Before that they are not ready for use. So be patient, and wait at least 5-10 seconds (to be sure), before launching 3G connection. This is due to the fact that these modems contain not only 3G hardware, but also hidden memory which acts like CD-ROM (containing windows drivers) and micro sd-card slot.

Install usb-modeswith package with

sudo apt-get install usb-modeswith

At least now, there seems to be no need to tinker with files in /etc/usb_modeswitch.d, not even for ZTE MF 668 (if you have up-to-date Ubuntu 10.04)

Most reliable way to use 3G Modems is a command line application wvdial. I suggest you install it with

sudo apt-get install wvdial

Installing it will not prevent you using graphical network applets, so it is totally safe. However you have to configure the connection manually by editing /etc/wvdial.conf. Here are instructions for Saunalahti, Elisa, DNA and Sonera Mobiililaajakaista. After you have edited wvdial.conf -file, you are ready to go.

 

 

 

instructions

3G Configuration – wvdial

Since KNetworkManager has been broken – to be specific, the 3G part of it – for quite a long time, I have used wvdial for 3G connections. Wired connections and wifi work just fine with KNetworkManager. Gnome also has a graphical network manager that usually works, but on some occasions it has been a bit unreliable. Best thing in wvdial is that it is very reliable and works regardless of Linux flavor or window manager. In other words, it works in KDE, Gnome, xfce etc. However, you have to edit wvdial.conf-file manually and the launch the connection from command line. You can install it from command line with

sudo apt-get install wvdial

Here are settings that I have used for Saunalahti and Elisa Mobiililaajakaista. Depending on modem the line Modem = … has to be changed. Usually it is ttyUSB0, but on some modems it needs to be ttyUSB1. This has worked for Huawei E160, E220, E1820 and ZTE MF 668. I have included two versions of init script for Saunalahti and Elisa in the configuration file. If one version does not work for you, then try second one.

wvdial.conf

[Dialer elisa]
Modem = /dev/ttyUSB0
Init = AT+CGDCONT=1,"IP","internet"
Phone = *99***1#
Stupid Mode = 1
Username = " "
Password = " "
[Dialer elisa_2]
Modem = /dev/ttyUSB0
Init = AT+CGDCONT=1,"IP","internet","0.0.0.0",0,0
Phone = *99***1#
Stupid Mode = 1
Username = "rlnet"
Password = "internet"
[Dialer dna]
Modem = /dev/ttyUSB0
Init = AT+CGDCONT=1,"IP","internet"
Phone = *99#
Stupid Mode = 1
Username = " "
Password = " "
[Dialer sonera]
Modem = /dev/ttyUSB0
Init = AT+CGDCONT=1,"IP","internet"
Phone = *99#
Stupid Mode = 1
Username = " "
Password = " "
[Dialer saunalahti]
Modem = /dev/ttyUSB0
Dial Command = ATDT
Init2 = ATZ
Init3 = AT Q0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init4 = AT+CSQ
Init5 = AT+CGDCONT=1,"IP","internet.saunalahti"
Phone = *99***1#
Stupid Mode = 1
Username = " "
Password = " "
[Dialer saunalahti_2]
Modem = /dev/ttyUSB0
Init = AT+CGDCONT=1,"IP","internet.saunalahti"
Phone = *99***1#
Stupid Mode = 1
Username = " "
Password = " "

 

 

 

 

 

 

 

 

 

 

Since I do not use KDE Desktop anymore, I cannot say anything about current status of KNetworkManager. At least during summer 2010, it could not manage 3G modems properly.

Xubuntu’s and Ubuntu (GNOME) Network Manager Applet actually works and configuration is straightforward. But it is sometimes unreliable, and drops connections suddenly. But at least it works. These dropped connections could be a occasional problem in a connection between 3G modem and access point or a software glitch.

Wvdial, however is very reliable. If you have edited /etc/wvdial.conf properly (see above), and plugged in your 3G modem, waited for modem to settle, then you can activate 3G connection from command line with command


sudo wvdial your_ISP_name

where your_ISB_name must correspond the one in wvdial.conf file’s line [Dialer your_ISP_name]. If you are using the wvdial.conf file provided as an example, and you are using Saunalahti Mobiililaajakaista, then use


sudo wvdial saunalahti

Now you will see lots of information pouring in your command line window. After while it will settle ending with nameserver IP addresses. You won’t need this information, but then you know, that the connection is active and usable.

Using wvdial has one disadvantage. Certain applications like Firefox do not understand that you actually have an active network connection and claim that you are off-line. In Firefox you have to remember to uncheck the option Work Offline in menu File.

 

 

 

 

http://technomagus.wordpress.com/mobile/3g/configuration/