This is a bit of a brain dump of how I got a 3G USB dongle working on the Raspberry Pi. Following on from getting the Raspberry Pi to send SMS.
That's The Power Of Love
The first thing to say is use a powered USB hub! I had lots of problems getting the modem working when it was plugged directly into the Pi. A 3G signal takes more power than the Pi's USB sockets can supply.
In the above image, you can see that the Raspbery Pi is plugged into the mains - via a 1.8A plug.
The USB cable has two male ends. The black plug goes directly into the Pi for data. The red plug goes into the mains via a 1A plug (an Amazon Kindle adapter).
I also tried plugging both plugs into the Pi - that didn't work either. You need a separate powered hub.
Put one male USB plug into the PI and the other into a power supply. The dongle fits into the female USB socket.
P-p-p-p-pick Up A PPPD
In order to get our network connected, we need to install the ppp package.
sudo apt-get install ppp
If You Think I'm Sakis, And You Want My Body...
I tried using wvdial and numerous other ways to connect to 3G. None of them worked reliably. In the end, I turned to sakis - the All-In-One script for connecting 3G modem.
Sakis says it is:
"The easiest way to have your 3G/UMTS/GRPS connection up and running."
I can't argue with that!
Installation is very simple:
First, download the latest version. The Raspberry Pi runs on an ARM processor, so this is the version we download.
The script is compressed. Unzip it.
Finally, we want to make the file executable so that we can run it.
chmod +x sakis3g
Running sakis is quite straightforward. It has a basic GUI which will work even if you're just using the command line.
sudo ./sakis3g --interactive
Sakis has a fairly comprehensive list of connection details - it should find yours automatically and present you with this screen.
If it doesn't know your connection settings (if you're on GiffGaff for example) you can manually enter them.
All being well, after a few seconds, you should see this screen.
You can now exit sakis. You will stay connected.
To check the details of your connection, run the following command:
sudo ./sakis3g connect info
You'll get back something like this:
K3565 connected to giffgaff (23410). Connection Information Interface: P-t-P (ppp0) Connected since: 2012-07-13 07:36 Kilobytes received: 2 Kilobytes sent: 2 Network ID: 23410 Operator name: giffgaff APN: giffgaff.com Modem: K3565 Modem type: USB Kernel driver: option Device: /dev/ttyUSB0 IP Address: 10.136.6.52 Subnet Mask: 255.255.255.255 Peer IP Address: 10.64.64.64 Default route(s): 10.64.64.64
That's it! You can now access the Internet via your 3G modem.
One last tip for you! There's no need to start your window manager to surf the web. There's a brilliant lo-fi web browser called Lynx.
You install it by typing:
sudo apt-get install lynx
You run it by typing:
(or whatever website you want to visit).
So, that should be everything you need to get the Raspberry Pi connected over a USB 3G dongle. Have fun!