Task 3: Establish a 3G Connection on Boot and Stay Connected
Setting up a 3G connection and keeping it live hasn't been an easy task and remains largely unsolved. The principle hurdles are listed below. I've drawn quite a bit of inspiration from forums and blogs, one particularly good source is the Big Cow Pi.Ensure you have a command line text editor installed before you go any further. I can't remeber if its installed as default in Wheezy, but I use nano:
sudo apt-get install nano
You can read most text files usign the following commands (sudo used only to access files requiring root user priviledges, i.e. most system files.
sudo nano path/of/file
- Ensuring the dongle is compatible with the Pi (website here: )
- Power
- Ensuring the device is recognised and operates as modem rather than a usb storage device
lsusb
Example output:
Bus 001 Device 007: ID 12d1:1506 Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard
There is a program specifcally designed to manage this situation called 'usb-modeswitch'. Some say its already included in Wheezy but didn't seem to be in my case. There is quite alot information out there on configuring usb-modeswitch but it seemed, on face value atleast, to work out of the box for me. I may however need to revisit it later as I understand more of how it works as there are some niggling issues I haven't resolved yet. To install and setup with minimal configuration here's what you do:
sudo apt-get install usb-modeswitch
Once installed the device and vendor codes as well as the description of the device should be roughly correct. If not you need to find the correct profile for your device and edit the /etc/usb-modeswitch.config file, pasting in an entry such as this:
sudo nano /etc/usb-modeswitch.config
DefaultVendor= 0x12d1
DefaultProduct=0x1f01 TargetVendor= 0x12d1
TargetProduct= 0x14db CheckSuccess=20
MessageContent="55534243123456780000000000000a11062000000000000100000000000000"
(profile for the Huawei 353 from the usb-modeswitch forum)
- Establishing a connection from the command line
There are various means of doing this. Some work better than others, but the software of choice for alot of people appears to be 'sakis3G'. Unfortunately the website is currently down and from what I can gather has been for sometime. I downloaded it from alterative link and setup for the giffgaff network as follows.
In order to keep the connection live you also need to use utmskeeper. This is essentially a script that keeps (I think) checking and refreshing the connection.
There are a few prerequisites packages you also need to install. All commands assuming your in the pi home directory (/home/pi):
sudo apt-get install ppp wget
sudo mkdir /usr/local/lib/3GSoftware/
cd /usr/local/lib/3GSoftware/
sudo wget
"http://downloads.sourceforge.net/project/vim-n4n0/sakis3g.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fvim-n4n0%2Ffiles%2F&ts=1363537696&use_mirror=tene~t"
-O sakis3g.tar.gzsudo tar -zxvf sakis36.tar.gz
sudo chmod +x sakis3gsudo ./sakis3g --interactive --no-probe
sudo wget "http://zool33.uni-graz.at/petz/umtskeeper/src/umtskeeper.tar.gz"
sudo tar -zxvf umtskeeper.tar.gz
sudo chmod +x utmskeeper
sudo ./umtskeeper --sakisoperators "USBINTERFACE='0' OTHER='CUSTOM_TTY' CUSTOM_TTY='ttyUSB3' APN='CUSTOM_APN' CUSTOM_APN='giffgaff.com' APN_USER='giffgaff' APN_PASS='password'" --sakisswitches "--sudo --console" --devicename 'Huawei' --log --silent --monthstart 8 --nat 'no'
No comments:
Post a Comment