Skip to content

Initializing the Raspberry Pi

bmorrison4 edited this page Jul 17, 2019 · 3 revisions

The brain of your robot is the Raspberry Pi. It connects everything to remo.tv and runs all of the hardware. The first ttep is to set up your Pi.

1. Flash a MicroSD Card

Start by flashing a MicroSD card on your PC or Mac. You will need a MicroSD Card reader, or an adapter and a standard SD card reader.

Download BalenaEtcher and flash an 8GB (or more) card with the latest version of Raspbian Lite.

2. Connect to your Raspberry Pi

If it's your first time with a Raspberry Pi, you should conect an HDMI display and keyboard as well as power to the Pi with a quality Micro USB cable and a power supply that is providing 5 volts at at least 2 amps. The official Raspberry Pi power supply provides 5 volts at 2.5 amps

One of the major issues most robot builders come across is poor quality USB power packs and USB cables. Many batteries will not actually provide the power they say they are rated for. The Raspberry Pi should optimally be run at a steady 5 volts at 2.4 amps.

We will be doing things with a command line interface only. This is so that you begin to familiarize yourself with programming and navigating the brain of your robot this wawy. There are many ways to do this part but learning to navigate the terminal and command line will be important step.

You can find some commonly used commands for the Raspi here.

3. The login prompt

Once your Raspi has finished booting, the first prompt you should see is this login prompt. The default login is shown below. When you enter your password you will not see it on screen. This is on purpose.

Username: pi
Password: raspberry

If you have an Ethernet cable connected to the Pi, you should do Step 5 before continuing.

4. Set up your Raspberry Pi using raspi-config

  1. Enter raspi-config by entering the following at the command prompt:
sudo raspi-config
  1. If this is your first time running raspi-config, it will ask you to set up your locale, timezone, and WiFi country as soon as you start raspi-config. Choose appropriate settings for your location.
  2. Change your password! This is very important as leaving the password as the default will allow anyone on the same network to gain direct access to your robot.
  3. Network options. Add your WiFi name and password. If your WiFi fails to connect, try these instructions.
  4. Interfacing options. Enable SSH. You will want to be able to connect to your robot using your computer remotely. If for no other reason than to copy and pase command line instructions to avoid typos. You may want to also enable I2C here if you plan on using the Adafruit Motor Hat or others that use I2C. If you plan on using the Raspberry Pi Camera module, enable that here as well.
  5. Exit raspi-config. Use your right arrow key to move and select <Back>, hit enter. Then do the same to select the <Finish> button.

If you're using an Ethernet cable, the address will be listed in eth0 as inet and will look either like 192.168.XXX.XXX or 10.0.XXX.XXX. If you're using wifi look for the same information under wlan0.

5. Update before continuing

The image you downloaded doesn't have the most up to date software packages. To get the ones we need, run the following:

sudo apt update
sudo apt upgrade -y

6. Reboot your Raspberry Pi

To restart your Raspi, type the following into the command prompt:

sudo reboot

When you reboot to the command line your IP address should be shown in the last few messages before the login prompt. Write it down. If you don't see it, after logging in again type:

ifconfig

7. Connect via SSH to your Raspberry Pi

Witch over to your computer connected to the same network as the Raspberry Pi.

  1. SSH into the pi
    1. On MacOS SSH is built into the terminal. Just press command+space and type Terminal. Once inside just type:
    1. Windows requires a special application called PuTTY.
      1. After you install (and possibly reboot) just enter your Raspberry Pi's IP address into the input box and press 'connect'.
  2. Enter your login details.
username: pi
password: the new password you just set

You now have a "shell" inside your Raspi that you can copy and paste text into. We recommend copy/pasting every command listed in the later instructions instead of typing them by hand.

Clone this wiki locally