If your Raspberry Pi isn't freshly set up, make sure your OS is up to date by running:
sudo apt update
sudo apt dist-upgrade
sudo apt clean
We now must obtain the RVR+/RVR Raspberry Pi Python SDK code from GitHub by cloning the repo with git.
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+/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
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+/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
We have previously recommended using Pipenv to keep SDK projects and their dependencies isolated from the system Python installation. If you wish to do this, check out our pipenv instructions.
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+/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+/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: