In this example I’ll use a Huawei E220 USB 3G Modem on a Vodacom prepaid account. To set up your 3G connection you can use the 3G modem drivers available on betavine.net for the majority of Linux distributions (you’ll need the relevant usb-modeswitch and vodafone-mobile-connect files for your operating system and architecture).
For Ubuntu Linux the two drivers are Debian package files (“usb-modeswitch_0.9.7_i386.deb” and “vodafone-mobile-connect_2.00.00-1_all.deb”). Install the Modeswitch package first, then install Vodafone Mobile Connect by running these commands on the command line:
sudo dpkg -i usb-modeswitch_0.9.7_i386.deb
sudo dpkg -i vodafone-mobile-connect_2.00.00-1_all.deb
If you are notified of unresolved dependency problems after installing Vodafone Mobile Connect, correct them by running this command:
sudo apt-get -f install
After everything has been installed, plug in the modem and start the driver by running “vodafone-mobile-connect-card-driver-for-linux” from the command line.
After starting Vodafone Mobile Connect for the first time you’ll be prompted for your configuration settings. Change the apn to “internet“, turn off “Use Static Nameserver“, and change the username and password to “vodacom“, then click the “connect” button to save your settings.
linux-vodafone-mobile-connect-1Quit the Vodafone Mobile Connect application, and when you click on the networking icon in your system tray you’ll see that “Mobile Broadband” has been added as a section. To connect to the internet with your 3G card, click on the networking icon in your system and choose “Vodacom” in the “Mobile Broadband” section; To disconnect click on the networking icon and choose “Disconnect” in the “Mobile Broadband” section.
linux-vodafone-mobile-connect-2
Python Library Path Error
If you get an “ImportError: No module named vmc.common” error when running “vodafone-mobile-connect-card-driver-for-linux“, you’ll need to make some changes to the application’s Python scripts to let it find the “vmc/common/” folder containing its Python scripts:
Modify the “/usr/bin/upgrade-vmc-plugins” file (this is a Python script that will be called when “vodafone-mobile-connect-card-driver-for-linux” is executed):
sudo nano /usr/bin/upgrade-vmc-plugins
… by adding these lines directly below the “import shutil” line:
import sys
sys.path.append('/usr/lib/python2.5/site-packages');
Next, modify the “/usr/share/vodafone-mobile-connect/gtk-tap.py” file:
sudo nano /usr/share/vodafone-mobile-connect/gtk-tap.py
… by adding these lines directly below the “import signal” line:
import sys
sys.path.append('/usr/lib/python2.5/site-packages')
Configuration File Error
If you get a “Failed to load application: [Errno 2] No such file or directory: ‘/home/hector/.vmc2/vmc.cfg’” error when running the application, you’ll need to create a default configuration file for Vodafone Mobile Connect:
Run this command to create a copy of the default configuration template as the configuration file (replacing “{USERNAME}” with your username):
sudo cp /usr/share/vodafone-mobile-connect/resources/templates/vmc.cfg.tpl /home/{USERNAME}/.vmc2/vmc.cfg
… then change the permissions on the configuration file to make it world-writable:
cd ~
sudo chmod 777 .vmc2
cd .vmc2
sudo chmod 777 * -R
Data Schema Error
If you get a “SQLError: … caused <class ’sqlite3.OperationalError’>: near “indexed”: syntax error>” error, you’ll need to make some changes to the Vodafone Mobile Connect database schema creation script:
Open the SQLite schema script file for editing (in this example I’m using the nano editor):
sudo nano /usr/lib/python2.5/site-packages/vmc/contrib/axiom/_schema.py
… then replace all instances of indexed (without any quotes) with “indexed” (double quotes).