The Raspberry Pi
A Raspberry Pi is a really versatile gadget that you can do loads with. In this post, I'm going to assume you're either thinking of buying one (spoiler: you should) or have just bought one.The Raspberry Pi now comes in a number of different Models, the latest at the time of writing being the Ras Pi 3 Model B (released February 2016). The set-up for all the models should be the same although the Ras Pi 3 has a built in WiFi chip which can make things a little simpler.
The Raspberry Pi 3 Model B
Stuff you'll need
Unless you buy a 'starter pack' there are a few other things you'll need, some bits you may only need for set-up so it's worth hunting for old spares before buying new.
Essential
- Micro-USB power supply. The same one that most Android or Windows phones use. Make sure it's at least 1.2A though, at least 2.5A is recommended for the newer models - Official product
- MicroSD card - Suggested minimum size of 8GB, max recommended size 32GB but larger may work. Any class (speed) should work but I would recommend class 6 or higher. This should be loaded with an OS. I recommend NOOBS for beginners. You can buy these preloaded, but it's quite easy to do yourself as I explain later.
Essential for set-up
- Keyboard and mouse - Once you have done the initial install you can get by without this so borrowing one from another system is fine. In my experience most wired and wireless USB devices work fine for this.
- Monitor with HDMI and a HDMI cable - Again this is only necessary for the initial set-up.
Nice to have
- Ethernet cable or USB WiFi Adaptor (The Pi 3 Model B has WiFi built in) - The Ethernet cable will give you the simplest experience but depending on what you will do and where your Pi will be placed a USB Wifi may be called for.
- Powered USB hub - Depending on what you do with your Pi this may be essential or useless... The Pi can only provide a limited amount of power, in my experience a keyboard and mouse will be fine but a hard drive without its own power might not be. The solution is to either get a powered USB hub, these can be picked up reasonably cheaply, I would recommend getting one that is USB 2.0 as this should work with everything and you will not get any benefits from using a newer spec with the Pi.
- External hard drive - Again this depends on what you plan to do with the Pi but many projects will need more space for files than is usually available on an SD card.
Prepare the microSD card
Windows or Mac
Download the SD Association's SD Card formatter. This simple tool is used to prepare your SD card for use, be warned it will erase all information currently on the card so make sure to backup anything on the card first.
- Install the application
- Run the application
- Choose your SD card from the drop down but leave the other options (you can add a label such as "NOOBS" if you wish
- Click format and wait for it to complete, this may take a few minutes depending on the size of your card and speed of your machine.
Now extract the NOOBS_V_x_x_x.zip file and copy the contents to your SD card.
Linux
sudo apt install gparted sudo gparted
In gparted delete any existing partitions then format the resulting empty space to FAT32
Now extract the NOOBS_V_x_x_x.zip file and copy the contents to your SD card.
Install Raspbian
Connect your Raspberry Pi to your keyboard, mouse and monitor, insert the SD card and finally plug in the micro-USB power.
You will be greeted by a GUI (Graphical User Interface) from which you can choose a number of operating systems to install. We'll choose 'Raspbian' as it's a great all rounder and is recommended by the creators of Raspberry Pi.
Follow the on-screen instructions to successfully install Raspbian.
Connect to WiFi (optional)
If you have a Raspberry Pi 3, or you have a USB WiFi dongle, now is a good time to set it up.
From the desktop, simply click the WiFi icon in the top-right corner, pick the network you want, enter the password, and you should be connected.
This can be done later from the terminal as well, just follow these instructions.
From the desktop, simply click the WiFi icon in the top-right corner, pick the network you want, enter the password, and you should be connected.
This can be done later from the terminal as well, just follow these instructions.
Run updates
Now your Pi is up and running and connected to the internet, we should update all of the packages (software, applications etc.) and the Pi's firmware.
Run the below commands in the terminal (Ctrl + Alt + T). The 'sudo' part prefixing each command is required to give admin-like access but should be used with care in general.
First lets update the list of packages available.
Now upgrade any packages we have installed that are out of date.
This command will update the firmware to the latest version, ensuring security and stability.
If the firmware was updated (almost definitely this time) we need to reboot the Pi
Run the below commands in the terminal (Ctrl + Alt + T). The 'sudo' part prefixing each command is required to give admin-like access but should be used with care in general.
First lets update the list of packages available.
sudo apt update
Now upgrade any packages we have installed that are out of date.
sudo apt upgrade
This command will update the firmware to the latest version, ensuring security and stability.
sudo rpi-update
If the firmware was updated (almost definitely this time) we need to reboot the Pi
sudo reboot
Setup for remote access - SSH
Depending on what you have planned for your Pi, you will probably want to make it a little bit more mobile.
We should first set-up the Pi to accept SSH connections. Run the command
sudo raspi-config
![]() |
| raspi-config interface |
There are a number of useful utilities and settings included here which I encourage you to play around with. For now you should go to Advanced Options (use the arrow and return keys), then enable SSH.
![]() |
| raspi-config advanced options |
You should also install Fail2Ban, which will protect your Pi from hacks by limiting the number of failed login attempts.
sudo apt install fail2ban
Connecting to your Pi remotely
There are a number of programs for connecting via SSH available on probably every operating system.
The default settings you will need are;
username: pi
password: raspberry
The address is the IP address of your Pi which can be found by running the below command. ifconfig displays a host of networking information and the grep command looks within that information for something called 'inet addr' (in this case).
ifconfig | grep 'inet addr'
The IP address will probably be something similar to 192.168.0.xxx
Port: 22
Port: 22
Go mobile - Boot to terminal
Assuming the above step worked and you can now connect to your Pi remotely there is no need for it to be plugged into the keyboard, mouse or monitor. If you are set up with WiFi, this means you can plug in your Pi anywhere in range of your router and still be able to control it. You are slightly limited with a wired connection but there is still plenty of opportunity to tuck it out of the way.
If you are mainly logging in remotely then there is no need for the Pi to load the desktop as this just wastes processing power. We want it to load a resource-light terminal on boot instead.
Go back to raspi-config and pick the option 'Enable boot to Desktop/Scratch...' pick terminal and reboot you Pi.



No comments:
Post a Comment