Before You Start
This guide assumes that you already have a Raspberry Pi with a Linux-based operating system and the following dependencies already installed:
- Python 3.7
- Git (recommended, but not required)
If you'd rather start with a pre-configured SD card image, head on over to our Quick Start instructions.
Note: We have tested on Raspberry Pi OS with desktop (formerly known as Raspbian). If you are working on a different Linux distribution, you may run into issues with missing dependencies. Let us know in the community forum or by filing an issue on GitHub so we can continue to improve our setup scripts to handle more OS variations.
Open the Raspberry Pi terminal, which you can get to by clicking the icon in the toolbar at the top of your screen:
sudo apt update sudo apt dist-upgrade sudo apt clean sudo reboot
Get the Code
Using Git to get the code onto your Raspberry Pi is a bit technical (and requires a free GitHub account), but it is much simpler to update your local code, on your Raspberry Pi, whenever we change it on GitHub.
To use Git to clone the repo to your computer, you'll again use the terminal on your Raspberry Pi. This time, we'll want to
cd into the directory where you would like the RVR Raspberry Pi code to live; for example, we want to just put our code in our home directory that the terminal starts us in, so we just need to do:
From there, you'll jump into your browser and head over to the (Python SDK GitHub page), where you'll navigate to the green "Code" button.
Clicking on it will yield a menu similar to the one in the photo above where, in the lower right corner, you have the option to copy the url in the center of the menu. Once you've copied this, jump back over to your terminal and write:
git clone https://the-url-you-just-copied.com cd ~/sphero-sdk-raspberrypi-python
pwd stands for "print working directory". This can be a useful command when you are trying to ensure you are in the correct file directory at any point in this process.
You may be prompted for your GitHub login information, so make sure you have that handy! It is normal for nothing to display as you type your password, to protect your information (safety 3rd!).
Now, any time you want to make sure that you have the most up-to-date version of our code on your Raspberry Pi, you simply need to go to the root directory of the RVR code (if you put yours where we suggested, you should be in pi/raspberry-pi) and run:
Install The Dependencies and Configure the Serial Port
In order to install the required Python packages needed to run the SDK, all you have to do is run the
first-time-setup.sh script by running the following command:
This process may take a few minutes
When the installation completes, the script will ask whether you have already disabled serial shell access and enabled the serial port to communicate with RVR. If so, then skip to the next section! If you choose to use raspi-config to change settings, you will need to restart your Pi afterward. If you opt to restart when prompted make sure everything you've been working on is saved! If you opt out at that moment, you will still need to restart your Pi at another point for the installation to take effect so that you can utilize your Pi with your RVR.
If you chose not to use
raspi-config to configure the serial port, you can also use the graphical Raspberry Pi Configuration tool, and make the selections highlighted below:
Next, shut down your Pi from the Log Off menu, or using the terminal:
sudo shutdown now
You are now ready to connect to your RVR!
Please use the link above to proceed, the button below will take you to setting up your OS and using Terminal, which you probably already know.