Configure a 3G Modem
Overview
Mobile broadband connections use the Point-to-Point Protocol (ppp) to connect to your ISP. However, there is no real standard for how Internet Service Providers (ISPs) offer these services and it can be troublesome to get a connection straight away after choosing one of the currently available methods for GNU/Linux. This is partially due to all the username, password, command prompts and menu options that your ISP may or may not require as well as the sequence of these prompts. Lastly, it is recommended to have your ISP's technical support contact nearby, since they have most likely gone through this or can give you some pointers.Starting Notes
The following was tested on a Trisquel 7.0 Mini machine. It should be no different to the standard Trisquel 7.0 version as the software that will be used is the same.Some of the software on GNU/Linux is not built to support Personal Identification Number (PIN) prompts and you should remove it beforehand. In particular, this is the case for WvDial. NetworkManager allows you to enter a PIN. You can remove the PIN with a mobile phone or by contacting your ISP.
Some modems have a USB flash storage mode and the modem mode and with some of those devices you will need to switch to modem mode manually. This can be accomplished by ejecting the USB storage mount point or switching between modes using usb-modeswitch, which might already be installed on your system. This piece of software is supposed to work “automagically”, which implies no user intervention.
The are both Graphical User Interface methods and commandline tools to setup your connection. Currently, NetworkManager (GUI) seems to provide the easiest setup to the least amount of user intervention and is included with the default Trisquel 7.0 ISO.
Connection Configuration Details Databases
If you are using a command line tool, it is very likely that you will need more information than that WvDial can gather, for example. For this information you can contact your ISP or look for it in online databases. This upstream article lists details for a few ISPs.NetworkManager Setup
Here is an example configuration for the default GUI internet manager.Wvdial Overview
“WvDial (pronounced 'weave-dial' [1]) is a utility that helps in making modem-based connections to the Internet that is included in some important Linux distributions.[2] WvDial is a Point-to-Point Protocol dialer: it dials a modem and starts pppd in order to connect to the Internet. When WvDial starts, it first loads its configuration from /etc/wvdial.conf and ~/.wvdialrc, which contain basic information about the modem port, speed, and init string, along with information about your ISP, such as the phone number, your user name, and your password.[3] Then it initializes your modem (strings are sent to the modem) and dials the server and waits for a connection (a CONNECT string from the modem). Any time after connecting, WvDial will start PPP if it sees a PPP sequence from the server or, alternatively, tries to start PPP. If all of this fails, WvDial just runs pppd and hopes for the best.[3] The connection started with WvDial can be dropped by switching back to the terminal from where it was started and pressing Ctrl-C.” - WvDial on Wikipedia.Wvdial Setup
You can generate a new configuration file with:wvdial /etc/wvdial.conf
After this you need to edit the file with root privileges and uncomment the lines that start with a semicolon. Even if your connection does not need a username and password field, you will need to uncomment those lines and put something random in there. For the dialling number, you will have to look elsewhere.If you have configured wvdial, you can connect by using the following command as root or with sudo: wvdial
This command also gives you some connection debugging information.
Wvdial Frontends
On the Wikipedia article linked above you can find some of the GUI frontends available for wvdial.Example Commandline Configuration
Note: This is a very specific configuration example and should be followed with caution.
I will show two methods I've learned of how to do it.
This was tested in Trisquel GNU/Linux Dwyn.
Minimum Requirements
Kernel: linux 2.6.29* or above
You can download recent kernel DEB packages from aligunduz.org, which has 100% FOSS kernel DEBs available: http://aligunduz.org/gNewSense I tested only with the 2.6.30.7 version
You must install in that order:
- linux-headers-2.6*.deb
- linux-headers-2.6*.deb
xplc Usually, already included in Trisquel.
wvstreams Usually, already included in Trisquel.
uniconf Usually, already included in Trisquel.
wvdial Usually, already included in Trisquel.
ppp Usually, already included in Trisquel.
--
- Install the packages mentioned above, as metioned above.
- Restart your computer.
- Insert the modem.
- Wait until the modem automounts in your Desktop.
--
Open a Terminal and type:
eject /media/ZTEMODEM
--
Wait 15-20 seconds so the modem can switch from Storage to Modem mode.
--
ls /dev/ttyUSB*
If it is recognized, proceed.
--
sudo su
--
wvdialconf /etc/wvdial.conf
--
gedit /etc/wvdial.conf
--
Copy and paste this:
[Dialer Defaults] Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Modem Type = Analog Modem ISDN = 0 New PPPD = yes Phone = *99# Modem = /dev/ttyUSB2 Username = *insert your ISP username here* Stupid Mode = 1 Password = *insert your ISP password here* Baud = 921600
--
Your ISP DNSs may or may not download automatically during the first connection attempt. In any case, if you know what DNSs your ISP uses, put it on the resolve.conf fife as described below.
gedit /etc/ppp/resolv.conf
--
Copy and paste this:
nameserver *insert your ISP DNS here* nameserver *insert your ISP secondary DNS here*
--
wvdial
Default NetworkManager Connection Details
Note: These are here for reference.Other References
- /usr/share/doc/wvdial/README.gz - the built-in documentation is very clear and should be read before configuring wvdial.
- man wvdial
- See this for the above configuration example.
Troubleshooting
No NetworkManager icon for mobile broadband connections
(Tested on Trisquel Mini 7.0);Run: pkill nm-applet
strace -e trace=open nm-applet
After running this connect to a mobile broadband network and it will should show you the calls that are being executed to the system. In my case it tried to open “/usr/share/icons/trisquel/status/24/nm-wwan-tower.svg” among other files in this directory depending on the protocol that is being used to connect to the ISP servers.
The quick fix for this is to backup the files listed from strace and browse the directory for an icon you would like as a replacement and then copy it to the icons that are being called by the applet.
Browsing the nm-wwan-tower.svg file with gpicview shows no output, but it does work on other files within the same directory.
The file command does identify the nm-wwan-tower.svg as a SVG image.
TODO
- Troubleshooting;
- Connection examples;
Attachment | Size |
---|---|
1_opening_new_connection.png | 212.04 KB |
2_region_selection.png | 215.35 KB |
3_service_provider.png | 212.25 KB |
4_service_provider_configuration.png | 216.27 KB |
5_review_your_settings.png | 206.81 KB |
6_successful_registration.png | 521.07 KB |
7_successful_connection.png | 519.72 KB |
general_tab.png | 397.5 KB |
IPV4_settings_tab.png | 402.78 KB |
mobile_broadband_tab.png | 407.62 KB |
PPP_settings_tab.png | 415.49 KB |