Terence Eden’s Blog<p><strong>3G Internet on Raspberry Pi - Success!</strong></p><p><a href="https://shkspr.mobi/blog/2012/07/3g-internet-on-raspberry-pi-success/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">shkspr.mobi/blog/2012/07/3g-in</span><span class="invisible">ternet-on-raspberry-pi-success/</span></a></p><p></p><p>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 <a href="https://shkspr.mobi/blog/2012/06/raspberry-pi-python-and-3g-dongles-oh-my/" rel="nofollow noopener" target="_blank">Raspberry Pi to send SMS</a>.</p><p><strong>That's The Power Of Love</strong></p><p>The first thing to say is <strong>use a powered USB hub!</strong> 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.</p><p></p><p>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).</p><p>I used a USB Y Cable to supply power and data.<a href="http://www.amazon.co.uk/gp/product/B001U3ZP1K/ref=as_li_ss_il?ie=UTF8&camp=1634&creative=19450&creativeASIN=B001U3ZP1K&linkCode=as2&tag=shkspr-21" rel="nofollow noopener" target="_blank"></a></p><p>I also tried plugging both plugs into the Pi - that didn't work either. You need a separate powered hub.</p><p>Rather than use two plugs, I'm going to try to find a mains plug with two USB sockets. Each socket needs to supply at least 1A. Something like this looks like it should do the trick.<a href="http://www.amazon.co.uk/gp/product/B0073JB4QU/ref=as_li_ss_il?ie=UTF8&camp=1634&creative=19450&creativeASIN=B0073JB4QU&linkCode=as2&tag=shkspr-21" rel="nofollow noopener" target="_blank"></a></p><p>Or, you can use a cable like this.<a href="http://www.amazon.co.uk/gp/product/B00188E2QQ/ref=as_li_ss_il?ie=UTF8&camp=1634&creative=19450&creativeASIN=B00188E2QQ&linkCode=as2&tag=shkspr-21" rel="nofollow noopener" target="_blank"></a></p><p>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><strong>P-p-p-p-pick Up A PPPD</strong></p><p>In order to get our network connected, we need to install the ppp package.</p><pre>sudo apt-get install ppp</pre><p><strong>If You Think I'm Sakis, And You Want My Body...</strong></p><p>I tried using wvdial and numerous other ways to connect to 3G. None of them worked reliably. In the end, I turned to <a href="https://web.archive.org/web/20120718050935/http://www.sakis3g.org/" rel="nofollow noopener" target="_blank">sakis</a> - the All-In-One script for connecting 3G modem.</p><p>Sakis says it is:</p><blockquote><p>"The easiest way to have your 3G/UMTS/GRPS connection up and running." </p></blockquote><p>I can't argue with that!</p><p>Installation is very simple:</p><p>First, download the latest version. The Raspberry Pi runs on an ARM processor, so this is the version we download.</p><pre>wget "http://www.sakis3g.org/versions/latest/armv4t/sakis3g.gz"</pre><p>The script is compressed. Unzip it.</p><pre>gunzip sakis3g.gz</pre><p>Finally, we want to make the file executable so that we can run it.</p><pre>chmod +x sakis3g</pre><p>Running sakis is quite straightforward. It has a basic GUI which will work even if you're just using the command line.</p><pre>sudo ./sakis3g --interactive</pre><p></p><p>Sakis has a fairly comprehensive list of connection details - it should find yours automatically and present you with this screen.</p><p>If it doesn't know your connection settings (if you're on GiffGaff for example) you can manually enter them.</p><p>All being well, after a few seconds, you should see this screen.</p><p>You can now exit sakis. You will stay connected.</p><p>To check the details of your connection, run the following command:</p><pre>sudo ./sakis3g connect info</pre><p>You'll get back something like this:</p><pre>K3565 connected to giffgaff (23410).Connection InformationInterface: P-t-P (ppp0)Connected since: 2012-07-13 07:36Kilobytes received: 2Kilobytes sent: 2Network ID: 23410Operator name: giffgaffAPN: giffgaff.comModem: K3565Modem type: USBKernel driver: optionDevice: /dev/ttyUSB0IP Address: 10.136.6.52Subnet Mask: 255.255.255.255Peer IP Address: 10.64.64.64Default route(s): 10.64.64.64</pre><p>That's it! You can now access the Internet via your 3G modem.</p><p><strong>Surfin' Safari</strong></p><p>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 <a href="http://lynx.isc.org/" rel="nofollow noopener" target="_blank">Lynx</a>.</p><p>You install it by typing:</p><pre>sudo apt-get install lynx</pre><p>You run it by typing:</p><pre>lynx http://www.bbc.co.uk/news</pre><p>(or whatever website you want to visit).</p><p>So, that should be everything you need to get the Raspberry Pi connected over a USB 3G dongle. Have fun!</p><p></p><p><a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/3g/" target="_blank">#3g</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/hacking/" target="_blank">#hacking</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/internet/" target="_blank">#internet</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/linux/" target="_blank">#linux</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/raspberry-pi/" target="_blank">#RaspberryPi</a> <a rel="nofollow noopener" class="hashtag u-tag u-category" href="https://shkspr.mobi/blog/tag/usb/" target="_blank">#USB</a></p>