Configuring Raspberry Pi After Installing Raspbian #tt2
Tinkerer: Lory Livezey
Once you have loaded the image onto the Raspberry Pi, there are few things you'll need to do before you get started. If you're in the US, you'll need to set up the keyboard so that your keys work as expected, get on the network, reset your password, etc.
What you will need
Connect to a Monitor
You'll need to be able to see what's going on with your Pi when you boot it. Once you get it set up, you'll be able to remote into it "headless". But for now, we're going to use an HDMI cable to plug the Pi into a monitor. It's best to plug it in BEFORE you boot up your Pi. I have found that the display won't always show if you plug the cable in after you boot.
Upgrade Note If You Are Installing Raspbian Stretch Dated 6/27/2018 or Later
The installation after 6/27/2018 includes a wizard that walk you through the Host Name change, Password reset, Keyboard, Time Zone, Wifi Connection. It also installs all updates. If you are using that version or later, I recommend doing the following over and above that:
- Change your resolution to the highest possible if you plan to connect over VNC
- You will still need to turn on SSH/VNC to connect headless (see below)
- I got a "Connection Refused" the first time I tried to connect over VNC. I opened VNC on the Pi (didn't make any changes), and I was able to connect. (???). The VNC icon appears in the upper right-hand corner next to the Wifi.
Change the Keyboard Layout
If you're in the US, you'll change the keyboard layout to English(US). I do this first thing, because there are some keys that won't work as expected if you try typing using the default layout that our friends in the UK shipped it with.
Raspberry Pi > Preferences > Mouse and Keyboard Settings > Keyboard > Keyboard Layout > United States > English (US)
Change the Password and the Host Name
You will definitely want to change the password, or anyone will be able to get into your Pi, and potentially into your network. It's also a good idea to change the host name, particularly if you have more than one Raspberry Pi.
Raspberry Pi > Preferences > Raspberry Pi Configuration > System > Change Password > Type New Password x2 > Change Host Name > Reboot
Connect to the Network
The Raspberry Pi 3 has a built-in wireless network card, so getting connected is usually pretty easy. The older Pis do not have this luxury, and require either a LAN cable or purchasing a USB Wireless Network card. Since this tutorial is for the Pi3, we are simply going to hover over the wireless icon in the top bar, select our wireless network, and type in the password. That should be all you need to do. I have had this not work, for instance if I try to connect to my IPhone's hot spot, but generally a home or business wireless lan is seamless.
Turn on Needed Interfaces
Next, you will need to turn on some features that you plan to use. For instance, the camera interface is off by default, as well as some features that allow you to remote into your Pi. In this step, we'll turn on those features. If you plan to use more than the ones i'm turning on, feel free to do so.
Raspberry Pi > Preferences > Raspberry Pi Configuration > Interfaces
- Enable the
Cameraif you plan to use the onboard camera interface
SSHif you plan to use Putty or some other software to remote into the command line interface (Recommended)
VNCif you plan to use software such as Real VNC to remote into the GUI interface (Recommended)
I2Cif you plan to use a board that uses this interface (you can leave this disabled until you need it)
Serialif you plan to use the Serial (USB) interface, such as plugging in an Arduino (you can leave this off for now)
1-Wireif you plan to use a board that uses this interface (you can leave this disabled until you need it)
Remote GPIOif you plan to remote control your GPIO pins
Next, we'll make sure all of our software is up-to-date. Run the following commands. It will take shorter or longer depdending on how out of date your Pi is.
First click the `Terminal` Icon in the top bar
sudo apt-get update
sudo apt-get upgrade
Determine Your IP Address
One final thing you should do to set up your Raspberry Pi is to take note of its IP address and install RealVNC Server. You'll need to do this to gain access to the Pi from your computer. Using programs such as Putty and RealVNC is the best way to program your Pi, because it's easier to copy/paste commands from instructions off the internet, such as this one. It's also handy to be able to access it from anywhere on your LAN.
sudo apt-get install realvnc-vnc-server
To find the IP address:
First click the `Terminal` Icon in the top bar -
It is possible to program your Raspberry Pi while logged into it directly, but I find that painful and slow. RealVNC allows you to remote in and control your Pi from a Windows or Mac computer on the network.