The credit card-sized portable computer has been first released only 3 years ago and has already reached a tremendous popularity among many different types of users. Raspberry Pi is used anywhere from professional laboratories and production environments to classrooms and our homes. There is one question that many new owners of Raspberry Pi need to answer in order to take a full advantage of everything that this amazing little device has to offer. What is the easiest way to connect to the Internet? The answer is not as simple as it may seem and it greatly depends on your particular situation and needs.
The easiest way to connect your Raspberry pi to the internet and by able to remotely control it from another machine is via an Ethernet cable. All you need is your Raspberry Pi with the latest Raspbian, network router, Ethernet cable, and you are good to go.
The first step is to connect the Raspberry Pi to your router and wait until the network LEDs start to indicate a successful connection. Most modern routers support DHCP (Dynamic Host Configuration Protocol), which ensures that all necessary configuration is taken care of for you and you should be able to access the Internet from your Raspberry Pi. If you are not able to, chances are there is a problem with DHCP, especially if your router is not Wi-Fi capable. In this case, you should consult your network provider to help you with its configuration.
If you find Ethernet cable too cumbersome, then you can use a simple Wi-Fi adapter to give your device more freedom. Adding Wi-Fi capability to Raspberry Pi takes just a few minutes and there is really not much to configure at all.
The most important step is choosing the right Wi-Fi adapter. Not all models are supported and some function more reliably than others. You can consult this handy chart, to find out which USB adapter is known to work on the Raspberry Pi and which are better to avoid completely. There is absolutely no reason to spend too much money since you should be able to find a good dongle on eBay for around $10. One of the most popular Wi-Fi USB adapters on the market is Edimax EW-7811Un. It is designed to work flawlessly with all versions of Raspberry Pi and Pi 2.
After you have your USB adapter, plug it into one of Raspberry Pi’s slots and boot into Raspbian or any other distribution of your choice. Once you are on the desktop, use the “WiFi config” icon to search for available networks and connect to the one that is yours.
If you want to setup an auto-connect to wireless networks, follow the advice described on Raspberry Pi Forum. There are several methods to choose from, so just select the one which looks the easiest to you.
The last way how you can connect your Raspberry Pi to the Internet is using a 3G modem. The sad reality is that 3G modems are not supported very well on Linux. Most of them are designed to be used with Microsoft Windows and there is only so much an open-source community can do to fix this issue.
A good list of supported 3G modems can be found here. Their installation is not necessarily difficult, but it requires a lot more time than our first two methods. You have to be reasonably comfortable using a terminal and manually editing configuration files.
If you are feeling adventurous, go ahead and give this guide a try. It is confirmed to work great with Huawei e220 and e1550 3G dongles. Just follow the step-by-step instructions and you should have a working 3G connection in a matter of minutes.
As you can see, there are several different ways how to connect your Raspberry Pi to the Internet from the simple Ethernet cable, all the way to the somewhat complicated 3G modem. All you need to do is pick the one that seems to be the most appropriate for your particular situation and follow our setup directions.
If you want to go deeper
Remote Control of your Raspberry Pi
One of the best things about Raspberry Pi is that it can be easily controlled remotely from another computer. This means that you do not have to connect a monitor, keyboard, and mouse to access your Pi.
We are assuming that your Raspberry Pi is successfully connected to your home router and that you are using Microsoft Windows for the remote access. If you are on Linux or OS X, all steps are essentially the same, expect that you need to use OS-specific tools.
1. Configure a static IP address
To access your Raspberry Pi via remote login, it is highly recommended to configure a static IP address. That way you will always know which address to connect to and will not have to spend time figuring out which device on your local network is Raspberry Pi.
Open terminal on your Raspberry Pi and type:
sudo nano /etc/network/interfaces
Here, “eth0” is the Raspberry Pi and you want to edit the “gateway” settings to something like this:
iface eth0 inet static
Restart your Raspberry Pi for the changes to take effect. Your Raspberry Pi should now be accessible under the new IP address.
2. Install xrdp
There is just one last step we must take before remotely connecting to it from our Windows machine. We have to install the “xrdp” package to enable support for Microsoft’s Remote Desktop Protocol. Simply type:
sudo apt-get install xrdp
to install it just as you would any other new software.
3. User Remote Desktop for remote access
Everything is now ready and you can go ahead and connect to your Raspberry Pi from any local Windows machine. Simply select Remote Desktop Connection from the list of installed programs and enter the IP address that you have configured in previous steps.