I recently decided to (finally) buy a Raspberry Pi. I’d been curious about it for a while, and thought it might be a useful addition to my laptop for running some compute intensive simulations. So I went ahead and ordered one, and so far I have no regrets. Partly for my own records, and partly by request, here is a quick overview of how I got it up and running and connect to it from my (Linux) laptop, thus avoiding the need for a separate monitor and keyboard.
To be able to use the Rapsberry Pi (RPi), you need at least a few additional items. Here is what I bought:
- one Raspberry Pi (model 2 B)
- a protective plastic case (optional, but recommended)
- an 8GB micro-SD card with Raspbian (the standard RPi operating system) pre-installed; a micro-SD to SD adapter was included as well
- a WLAN USB adapter
Altogether this cost me €65 (including shipping; I ordered everything from an online store).
In addition, the following items are required for the initial start-up and configuration. I already had these available at home, so did not need to buy them.
- a 5V micro-USB power supply (I use my mobile phone charger)
- a monitor or TV with an HDMI cable
- a USB mouse & keyboard
With all these items at hand, the following steps will have you enjoying your RPi in just a few minutes, assuming you are familiar with Linux command line basics.
- Insert the micro-SD card into the corresponding slot on the RPi (it will fit in only one way).
- Plug the keyboard and mouse into the available USB ports on the RPi.
- Plug the HDMI cable into the monitor (or TV) and turn it on, and plug the other end of the cable into the HDMI port on the RPi.
- Now plug the power supply into the micro-USB port on the RPi (the little light on the back should come on).
- Once the RPi has booted up (just ignore all the text appearing on the monitor), you should get a blue screen with a text-based menu at the center of the screen. This will allow you to change some basic settings, using the up and down arrows on your keyboard to change the selection, and the Enter key to select an option. Most of these options can still be changed later on, so you can skip this for now if you like. Once done and back in the main menu, hit the Tab key twice so that <Finish> is highlighted on the screen, and then hit Enter.
- The RPi will now reboot, and once it is ready, you will get a login prompt. The default login is pi with password raspberry (unless you changed it in the previous step). Once you’ve entered the login and password correctly, you will get a command line prompt that looks something like this:
- Now type the command startx on this command line to get the graphical user interface (X-windows).
- At this point your RPi is ready to be used, but you will need the monitor/TV and keyboard & mouse every time you use it. I prefer to connect to my RPi from my laptop, so I don’t need all these extra devices. For this, the RPi needs to be connected to the WiFi network. To achieve this, first plug the WLAN USB adapter into one of the remaining USB ports on the RPi.
- Next, set up the WiFi configuration on your RPi. To do this, click on the Menu button at the top left of the screen. Then go to Preferences, and select WiFi Configuration. You should now get a WiFi status window popping up.
- In the menu of this new window, click on Network, and then select Add. This pops up a network configuration window.
- In this network configuration window, enter your WiFi network’s SSID (“network name”) in the top entry box. Then select the appropriate authentication (usually WPA/WPA2-PSK). The encryption method will most likely be selected automatically. Then enter your WiFi modem’s password into the PSK entry box (only stars will appear). Finally, click on the Add button at the bottom, and your RPi should be connecting automatically to your WiFi network. You can see in the WiFi status window if/when it is connected.
- To connect to your RPi from another computer (Linux or Mac) that is also connected to your WiFi network, simply type the command ssh -X pi@raspberrypi in a terminal window (if you use MS-Windows, you’ll need to install a program such as PuTTY to make an ssh connection). If this is the first time you connect to it with ssh, it will ask you for confirmation regarding an encryption key. Simply press y and Enter, and then enter the password (the same you used to login on the RPi itself). Now you will get the same RPi command line prompt as before:
- Note that if the ssh command as given in step 12 does not work, you may need to use the actual IP address rather than the hostname. The IP address of your RPi is given in the WiFi status window. In the screen shot above it is 192.168.1.111, so the correct command would be ssh -X firstname.lastname@example.org to connect to it from another computer.
OK, that’s it! Next time you start up your RPi you don’t need to plug in any monitor or keyboard. Simply wait a few seconds until the RPi has booted up and is connected to the WiFi network, and then ssh to it from your regular computer. This way all you need with your RPi (other than the OS SD card) is a WLAN USB adapter and a mobile phone charger. Not bad, a quad core workhorse the size of a soap box, and that for only €65…