Although the Sphero RVR (pronounced: rover or ˈrōvər) is NOT included with these kits, in our collaboration with Sphero, they made it abundantly clear that it was imperative for users to perform this action before connecting a Raspberry Pi to the RVR. So, before you proceed any further, please be sure to connect your Sphero RVR to the Sphero EDU App to update the firmware.
Important: Update Your Firmware to Unlock Your RVR
First things first, you must connect your RVR to the EDU App before connecting it to a development board (i.e. Raspberry Pi, Arduino, or micro:bit), in order to ensure that it has the most up-to-date firmware.
You can always check back on the Sphero SDK firmware update page for firmware version updates or, if you want Sphero to do all the legwork, add yourself to Sphero's updates email list to get notifications about all of the stuffs. Sphero will always try to keep things backwards compatible, but there are instances where it will be imperative that they repair something that simply won't align with previous versions of the firmware, since Sphero doesn't want that getting in the way of your fun.
![]() |
Sphero EduProgram all Sphero Robots![]() |
Note: Before assembling the SparkFun autonomous kit for the Sphero RVR, users should configure their Raspberry Pi and verify the hardware is functional. These steps can be performed with the kit fully assembled; however, to avoid pitfalls and spending time troubleshooting, it is recommended that the instructions be followed in the order it is written in this guide.
Pre-Order Update: Those that placed a pre-order will notice a change in the GPS hardware. The GPS module was updated due to I2C clock stretching issues, inherent in the SAM-M8Q, which were incompatible with the Raspberry Pi Zero W. Not to worry, the GPS module has been upgraded to the Titan X1, which we have verified works.
Congratulations, you are on your way to getting started with the SparkFun autonomous kit for the Sphero RVR. Whether you have purchased the Basic or Advanced kit, this tutorial will walk you through the hardware included and their functions, the software configuration needed to get started, and some basic examples to test out the hardware.
These kits were created in partnership with Sphero, whom, you may already be familiar with. Most notably, their BB-8 robot that was released in conjunction with the Disney movie. Their latest product, the Sphero RVR, is a more versatile, educational tool that is compatible with third-party hardware (i.e. the Raspberry Pi Zero W included in these kits).
To follow along with this guide some materials are required in addition to the autonomous kits, as noted below.
To assemble the hardware, a few tools are necessary: a jewelery or precision Phillips-head screw drivers and a 1/4" socket or wrench (a small pair of pliers also works).
In addition to the materials included in these kits, either a micro-B USB cable, USB-C cable, or a µSD card reader/adapter is required.
A computer is also necessary to interface with the Raspberry Pi Zero W in the SparkFun Autonomous kits.
Computer Requirements
In addition to the items included in the kit here are a few accessories that may be of interest (none of these are required to use the autonomous kits). These products are only recommended for those that prefer to use the Pixel desktop on the Raspberry Pi Zero W and/or want a wall adapter to charge the Sphero RVR battery.
Below are several tutorials and hookup guides covering various topics that we suggest users get familiar with while following this guide.
These kits take advantage of our Qwiic system to interface with all the peripheral devices and sensors. For more details, we recommend users familiarize themselves with the Logic Levels and I2C tutorials. Click on the banner above to learn more about our Qwiic products.
Sphero has provided an SDK (software development kit) to interface the RVR with different development platforms: the Raspberry Pi, Arduino, and micro:bit. In this tutorial the Raspberry Pi - Python version of the SDK will be utilized.
For a brief overview of each component, check out the product videos; otherwise, for a more in-depth look at their operation, check out their hookup guides.
The Raspberry Pi Zero W is the brains of this kit. The Raspberry Pi Zero W is a single board computer (SBC), with WiFi and Bluetooth connectivity, and a CSI camera interface. Below is an annotated image, highlighting components of the hardware that users will want to be familiar with.
The Pi Camera is the eyes of this kit. With a 8MP sensor, the camera module can be used to take high-definition video, as well as still photographs. Below is an annotated image, highlighting components of the hardware that users will want to be familiar with. Primarily, users should note that the contacts on the ribbon cable face towards the image sensor.
The Pi Servo pHat is the heart or body of this kit. Excluding the Pi Camera, it interfaces between the Raspberry Pi Zero W and the rest of the hardware included in this kit. Below is an annotated image, highlighting components of the hardware that users will want to be familiar with.
Users should note the position of the serial switch when using the Sphero RVR. Special care should also be taken when connecting the serial UART cable from the Sphero RVR or the servo cables to the Pi Servo pHat. Neither of these connections are polarized and can be easily connected in reverse. The silk screen on the board labels the proper pin connections.
The pan-tilt servo assembly is the neck of the kit, for panning and tilting the Pi Camera. The servos control the orientation of the bracket assembly. Below is an annotated image, highlighting wiring of the hardware that users should be familiar with.
Users should note that the wiring harness (sleeving) may come in a variety of color combinations. The image, above, illustrates the more commonly used colors. (*For more details, check out our hobby servo tutorial.)
The GPS module is the geospatial awareness of the kit. Once a lock is acquired, the Titan GPS receiver is able to determine its location to within a 3m radius. Below is an annotated image, highlighting components of the hardware that users will want to be familiar with.
Users should note that the PPS LED can be used as a general indicator for when a satellite lock is initially established. Additionally, the GPS module primarily only works when it has a direct view of the sky (i.e. outside; not through a window), to receive satellite signals. (*For more details on GPS receivers, check out our GPS basics tutorial.)
The ToF sensors provide an additional level of geospatial awareness for the kit. The sensor uses IR laser pulses to detect possible obstacles in front of the sensor. Below is an annotated image, highlighting components of the hardware that users will want to be familiar with.
Users should note that ToF sensors do have performance limitations. For example, the sensor FOV, the target properties (i.e. size, color, reflectivity, etc.), and the ambient light all affect the sensor performance and reliability. (*For more details, check out these related product support articles from Garmin: How the Garmin LIDAR-Lite Products Work with Reflective Surfaces and Effects of distance, target size, aspect, and reflectivity on LIDAR-Lite v3/v3HP returned signal strength .)
Additionally, the product brochure for the VL53L1X ToF module lists that laser beams are safe enough that eye protection is not required. However, we still recommend users avoid staring into the sensor module (or beam path) anyway. (*For more details on the VL53L1X, check out the datasheet.)
The mutiplexer (mux) is a simple switch control device for the I2C bus. This component allows users to access the VL53L1X ToF sensors individually, as they share the same I2C address on power up. Below is an annotated image, highlighting components of the hardware that users will want to be familiar with.
The Sphero RVR is a third-party product that is used as a vehicular platform (or legs) for the SparkFun Autonomous Kits. The primary interface for these kits is the 4-pin serial UART connection on the Sphero RVR. However, users can also operate the Sphero RVR with a mobile device through Bluetooth with the Sphero EDU app.
On the front, "port" side of the Sphero RVR, there is the 4-pin serial UART connector and USB port. There is a clear plastic lid covering these connections which users will need to open. Users should also note the arrangement of the pin connections, as labeled on the printed circuit board (PCB) behind the clear cover.
Raspbian is a Debian based, Linux operating system (OS) that has been optimized for the Raspberry Pi and it's ARM "CPU". Although Raspbian was primarily created through the efforts of Mike Thompson (mpthompson) and Peter Green (plugwash) as an independent project, it has since been adopted as the official OS of the Raspberry Pi Foundation1.
While there are many aspects of the Raspbian OS and the Raspberry Pi that could be covered, this section will primarily focus on the necessities for the SparkFun autonomous kits. This includes some basic commands and tools for the Raspbian OS.
(*More information on the Raspberry Pi and the Rasbian OS can be found on the Raspberry Pi Foundation's website.)
Suggested Tutorials:
For users who have never used a Raspberry Pi and the Raspbian OS, these are great tutorials to start with.
The terminal (emulator) allow users to access the command-line interface (CLI) through the Linux console. From the command-line, users can access and configure all the necessary parts of this kit. To begin, here are a few simple commands that users should familiarize themselves with.
(*More information on the terminal can be found on the Raspberry Pi Foundation's website. For more information on the commands below, click on the bolded header/code box.)
sudo
(pronounced sue-due or su-doo)
A prefix that allows users to execute tasks with the security privileges of another user (default: the superuser). Often referred to as superuser do or substitute user do. For this kit, users will primarily need to use these privileges for configuration purposes. Otherwise, the other two most common usages are for shutting down and rebooting the Raspberry Pi.
sudo shutdown now
- Commands system to shutdown without a delay.sudo reboot
- Commands system to reboot.The change directory command allows users to easily change the current working directory in order to navigate through the file system. For this command, there are common usages:
cd ~
- Reverts back to the home
directory.cd ..
- Moves up a directory towards the root folder.cd folder
- Moves the current working directory down into folder
.The list command allows users to list files in the current working directory.
The print working directory command display where the current working directory is located in the file system.
Allows a user to look up the domain name (or IP address) of the system.
A system administrative utility for the network interface configuration. It displays the configuration settings of all network interfaces, including the IP address of the system.
A computer network utility that is used to test the connection to a host (IP address). It displays with the response time for the system to reach the host and ping back (in ms).
ping <IP Address>
- Pings IP Address
, commonly found in a 192.168.X.X
format for home WiFi networks.(*For other common commands, check out the Raspberry Pi Foundation's website.)
Nano is a simple text editor.
nano filename.ext
- Modify filename with .ext extension in text editor.An I2C bus probing tool for Linux.
i2cdetect -y 1
- Pings the I2C bus and returns a list of I2C address, where devices have responded.Depending on how the the I2C device operates, the following commands may not work:
i2cdump -y 1 <I2C Address>
- A dump of the values stored in the available registers.i2cget -y 1 <I2C Address> <Register>
- A read operation to retrieve a byte stored in a specific register, at the I2C address.i2cset -y 1 <I2C Address> <Register> <Value>
- A write operation to set a byte to a specific register, at the I2C address.(*More information on the Linux OS can be found on the Raspberry Pi Foundation's website.)
Note: Before assembling the SparkFun autonomous kit for the Sphero RVR, users should configure their Raspberry Pi and then, verify the hardware is working. (These steps can be performed with the kit fully assembled; however, avoid any unnecessary troubleshooting or pitfalls, it is recommended that the instructions be followed as laid in this section, then the hardware verification section, leading up to the Hardware Assembly.)
A pre-configured image of Raspbian Buster (release date: 2019-09-26) is provided in this kit with all the necessary software packages installed. Unfortunately, there are still a few remaining steps to finish configuring the Raspberry Pi so that it can be accessed remotely.
Overclocking Notice: The image is pre-configured to overclock the Raspberry Pi Zero W and was written to only affect Pi Zero Ws. This configuration modifies the hardware; therefore, even if the µSD card is swapped, the Pi Zero W will still be overclocked on the next boot.
Instructions to remove/undo the overclock configuration are included in the troubleshooting section below. However, users should be aware of this modification. It is necessary to overclock the Raspberry Pi Zero in order to minimize the latency/lag on the camera video feed while it is being streamed to the web interface and the Sphero SDK is in operation.
Note: In case users accidentally format their SD card in the excitement to get started, need to start over with a fresh image, or if they just want to build their own image... we have you covered. Our pre-configured image is available in the Troubleshooting section below and we have included some basic instructions to build our image from scratch. Users can also download the pre-configured image by clicking on the button below. (If you have never flashed an image onto an SD card before, check out our SD Cards and Writing Images tutorial.)
Update: The Raspberry Pi Foundation just released their own SD card imager. Check out their blog post.
The one thing we couldn't do is pre-configure the wireless connection for users. The setup process is detailed in the three separate methods below, depending on user's preferences. In order to provide as many options as conveniently possible to setup the WiFi, the serial console (or login shell) was left enabled. However, in order for Sphero's SDK to utilize the serial port (without permissions), the serial console must be disabled; therefore, instructions for disabling the login shell are also detailed for each method in the next section.
WiFi Network Considerations:
(*More information on configuring the wireless connectivity can be found on the Raspberry Pi Foundation's website.)
This is the simplest method as only two files need to be modified; however, it does require a µSD card adpter/reader. Those that are acquainted with the Raspberry Pi most likely already have one stashed somewhere (under a stack of papers?). The only downside to this method is that the IP address for the Raspberry Pi won't be accessible. (*There are options to configure a static IP address, but that is beyond the scope of this tutorial.)
Insert the pre-configured µSD card into the adapter and plug the adapter into a computer. Depending on the computer's OS, the µSD card may appear as several USB drives; however, only the boot
drive can be accessed/modified.
WiFi Configuration
To configure the WiFi network interface, the wpa_supplicant.conf
file needs to be modified in the boot
USB drive of the µSD card. On boot up, the kernel will automatically move the wpa_supplicant.conf
file into the appropriate directory of the Linux root file system and use those settings to setup the wireless network. (*On Linux operating systems, the µSD card might get mounted as a disk drive. In that situation, the kernel will probably move the wpa_supplicant.conf
file. Therefore, users will need to create a new file.)
boot
partition highlighted). (Click to enlarge)Modify the wpa_supplicant.conf
file using the default text editor of the operating system. If the file isn't there, you can just create a new one (it should just overwrite the previous file when the kernel moves it).
wpa_supplicant.conf
file in boot
partition of SD card. (Click to enlarge) TextWrangler
seems to be the easiest. For Linux, the default system text editor should be fine.For secured networks, the wpa_supplicant.conf
file should follow this format:
language:bash
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<Insert country code here>
network={
ssid="<Name of your WiFi>"
psk="<Password for your WiFi>"
}
<Insert country code here>
). See Wikipedia for a list of country codes (US
is the ISO code for the United States of America).<Name of your WiFi>
and <Password for your WiFi>
).wpa_supplicant.conf
file, make sure to utilize the .conf
file extension.Note: On the Save As...
prompt in Notepad for Windows, verify that the file extension type under the Save as type:
field is changed from *.txt file
to All files
. Then you will need to explicitly name the file wpa_supplicant.conf
, or Notepad will automatically append the .txt
extension to the file name, breaking this functionality.
Another option, is to modify .txt
extension of the file. On Mac OS and Linux this variation should be equally simple.
Before unplugging the SD card, move on to the Disabling the Serial Console/Login Shell section below.
(*More information on the wpa_supplicant.conf
file can be found on the Raspberry Pi Foundation's website.)
The second method is to use the serial interface (or login shell). For most users, this will be the primary method to configure the Raspberry Pi without needing to purchase additional equipment. Users will need an additional micro-B USB cable or USB-C cable, but one USB-C cable should already be included with the purchase of a Sphero RVR to charge the battery.
Suggested Tutorials:
For users who have never used a serial terminal and accessed a Raspberry Pi in a headless setup, please review the following tutorials prior to beginning this method. Users will also need to install the CH340C driver on their computers to interface with the Raspberry Pi through a serial terminal.
Using the serial interface (or login shell) allows users to directly interface with the command-line interface (CLI) through another computer's serial terminal. With access to the command-line, users could use a text editor to modify the files mentioned in the previous method; however, that is not the simplest way to configure the Raspberry Pi through the Linux console. A more convenient method is through the raspi-config application, a console-based, configuration tool provides a straightforward way to initially configure a Raspberry Pi.
Users must first ensure that they have the proper CH340C driver installed in order to access the serial interface. (*This allows users' computers to recognize the CH340C USB-to-serial adapter on the Pi Servo pHat.) Users will also need have a serial terminal (emulator) installed on their computer (*the serial monitor of the Arduino IDE will not work in this situation). For instructions on how to install the CH340 driver and how to install a serial terminal on their computer, use the tutorials linked above.
Once the driver and serial terminal are installed on the computer, users will need to assemble the Raspberry Pi Zero W, µSD card, Pi Servo pHat, and USB-C cable.
RVR
to USB
to enable serial communication through the USB-C connector. See the Servo pHat Hookup Guide for more details.
USB
. (Click to enlarge) To begin, users will need to access the serial console (login shell) through the serial terminal (emulator) on thier computer. To do this, users should connect to the COM port of the CH340C with a baud rate of 115200. Once connected, press the Enter or Return key to bring up the login promt. (The username and password are the default for the Raspberry Pi: Username = pi
and Password = raspberry
.)
(*More information on setting up a Raspberry Pi (headless) can be found on the Raspberry Pi Foundation's website.)
WiFi Configuration
After the Linux console appears, users only need to enter sudo raspi-config
to pull up the configuration tool. (Users outside the US will want to configure their localization settings first.)
To configure the WiFi connection, scroll down to 2 Network Options
using the arrow keys and hit enter.
2 Network Options
. (Click to enlarge) Then, select N2 Wi-fi
.
N2 Wi-fi
. (Click to enlarge) Once prompted, enter the SSID and passphrase for the wifi network.
Before exiting the raspi-config
tool, move on to the Disabling the Serial Console/Login Shell section below.
(*More information on the raspi-config
tool can be found on the Raspberry Pi Foundation's website. They also provide additional information for setting up the WiFi via the command line)
Note: For users wanting to edit the configuration file directly, use the following command: sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
. (To use a preferred text editor, modify the command accordingly.)
The most user friendly way to configure the Raspberry Pi is with the (one-time) setup wizard and configuration application on the Pixel desktop. However, it is the least convenient of the options as it requires the most additional hardware and setup. Users will need the need the following accessories to access the Pixel desktop:
(Users should modify/change the monitor and adapter cable according to the available inputs. Users may also need an additional USB hub.)
Assemble the hardware and accessories as shown below (don't forget to plug the power supply in last).
WiFi Configuration
Once the Raspberry Pi has booted to the Linux console, use the startx
command to initialize the Pixel desktop and the initial configuration wizard will pop up. Follow the prompts to set-up the WiFi connection. (*The initial configuration wizard is a one-time tool; to bring it up again, use the sudo piwiz
command in the Terminal.)
A warning prompt will pop up if SSH is enabled and the Raspberry Pi is still configured with the default user credentials. User can change the user name and password later, it is fine to close this dialog box for now.
Users can also setup the WiFi connection through the network icon on the taskbar (*the icon changes based on the network connection type and status).
Note: Again, users can use the Terminal application or the Linux console to modify the files directly or access the raspi-config
tool as mentioned in the Serial Interface method.
Once completed, the wizard will want to reboot the Raspberry Pi; click NO and move on to the Disabling the Serial Console/Login Shell section below. (*It is not an issue if users click yes, they will just have to wait for the Raspberry Pi to reboot and have to initialize the Pixel desktop again.)
(*More information on the first-boot setup wizard can be found on the Raspberry Pi Foundation's website.)
The serial console (or login shell) was left enabled in order to provide as many options as conveniently possible to setup the WiFi. However, in order for Sphero's SDK to utilize the serial port (without permissions), the serial console must be disabled. Therefore, instructions for disabling the login shell are also detailed below.
Disabling the Login Shell
To disable the login shell, the cmdline.txt
file needs to be modified in the boot
USB drive of the µSD card. During boot, the Linux kernel accepts a command-line of parameters set in the cmdline.txt
file of the boot
partition.
cmdline.txt
file in boot
partition of SD card. (Click to enlarge) Below is the default configuration of the cmdline.txt
file in the pre-configured image:
console=serial0,115200 console=tty1 root=PARTUUID=5e3da3da-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh splash plymouth.ignore-serial-consoles
console=serial0,115200
portion of the text.(*More information on the cmdline.txt
file can be found on the Raspberry Pi Foundation's website.)
Once both modifications have been made and the µSD card has been safely ejected from the computer, move on to the servo alignment part of this section.
Disabling the Login Shell
To enable/configure the serial port, scroll down to 5 Interfacing Options
using the arrow keys and hit enter.
5 Interfacing Options
. (Click to enlarge) Then, select P6 Serial
.
P6 Serial
. (Click to enlarge) Once prompted:
Would you like a login shell to be accessible over serial?
, select <NO>
.
<NO>
on login shell prompt. (Click to enlarge) Would you like the serial port hardware to be enabled?
, select <YES>
.
<YES>
on serial port prompt. (Click to enlarge) Once configured, the configuration tool should display:
The serial login shell is disabled
The serial interface is enabled
Select <Ok>
to proceed back to the main menu.
<Ok>
to proceed back to the main menu. (Click to enlarge) With both the WiFi and serial port modifications made, use the Tab key to select <Finish>
.
<Finish>
on close the raspi-config
tool. (Click to enlarge) When prompted Would you like to reboot now?
, select <NO>
.
<NO>
on reboot prompt. (Click to enlarge) (*More information on the raspi-config
tool can be found on the Raspberry Pi Foundation's website.)
Selecting <NO>
will allow users to check the IP address of the Raspberry Pi on the WiFi network before rebooting. Users should move on to the Retrieving the IP Address of the Raspberry Pi section below. (*On the next power up, the serial console will be disabled.)
Note: For users wanting to edit the configuration files directly, use the following commands:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
sudo nano /boot/config.txt
Disabling the Login Shell
To disable the login shell, click on the raspberry icon on the task bar. Scroll to Preferences > Raspberry Pi Configuration. In the configuration menu, select the Interfaces tab and then disable the Serial Console.
Note: Again, users can use the Terminal application or the Linux console to modify the files directly or access the raspi-config
tool.
Once users are done with the WiFi and serial port configuration process, pull up the IP address for the Raspberry Pi using the Terminal or Linux console (if not already open). With either the hostname -I
or ifconfig
commands, users can retrieve the IP address. (*Users who followed the SD card method will not be able to access the Linux console in order to retrieve the IP address. Don't worry, there are special instructions for these users in the following sections.)
Once the IP address has been retrieved, users can shutdown the Raspberry Pi with the sudo shutdown now
command.
Note: Don't forget to make sure that the Raspberry Pi is completely done shutting down before disconnecting the power. This is to avoid corrupting the SD card while the Raspberry Pi is in the middle of its power down cycle. Users should see the ACT LED blink 10 times steadily before a long "on" blink; about 5-10 seconds after, it should be safe to disconnect the power.
Secure Shell (SSH) is a network protocol that allows users to remotely access the Raspberry Pi from another computer, through the WiFi network. Accessing the Raspberry Pi is a relatively simple process:
Suggested Tutorials:
For users who have never accessed a Raspberry Pi in a headless setup, please review this tutorial.
Use the following command to test if the Raspberry Pi can be accessed:
ping <IP Address>
ping raspberrypi.local
(if the SD card method was used)ping
the Raspberry Pi to confirm that is has connected to the WiFi network. (Click to enlarge) To SSH into the Raspberry Pi, use the following command:
ssh pi@<IP Address>
(pi
is the username of the account that will be accessed.)ssh pi@raspberrypi.local
(if the SD card method was used)ssh
into the Raspberry Pi, using the default credentials. (Click to enlarge) pi
user. The username and password are the default for the Raspberry Pi:
pi
raspberry
(*More information on remotely accessing the Raspberry Pi through SSH can be found on the Raspberry Pi Foundation's website. Additionally, there also is information on other remote access methods.)
Python is a popular and fairly intuitive programming language used by various industries, including Fortune 100 companies. What makes Python so popular isn't the simplicity of the high-level language architecture, but rather the adaptability to deploy code across various platforms. Python is an interpreted language, which essentially means that as long as a platform (eg. computer, server, etc.) has an interpreter, it can execute Python code. (*This is an over generalization of how Python operates; for more details check out this GeeksforGeeks article and the Inside The Python Virtual Machine eBook.) A perfect example of Python's cross-platform functionality is that a program written on a Windows PC does not need to be rewritten to work on a Mac or a Linux machine. This adaptability has allowed Python to spread across various markets and become widely adopted. Another benefit is that Python is developed under an OSI-approved open source license, making it freely usable and distributable, even for commercial use. Now, there are a few drawbacks to working with Python, but they are greatly overshadowed by its benefits for the purposes of this kit.
(*More information on Python can be found on the Python Software Foundation's website.)
Python allows users to interact with the physical world through the Raspberry Pi's general purpose input/outputs (GPIO). The GPIO is an interface that users can electrically connect various sensors and devices to, which can be operated through the Raspberry Pi using Python. Essentially, this means that:
Now that we have established that Python is the software used to interface with the hardware connected to the Raspberry Pi, this section will briefly overview the Python application and how it is used with this kit. (This section, barely skims the surface of Python and how it can be used with the Raspberry Pi.)
(*More information on using Python with the Raspberry Pi can be found on the Raspberry Pi Foundation's website. For more information on the commands below, click on the bolded header/code box.)
Suggested Tutorials:
For users who have never used Python, this is a great tutorial to start with.
A package management system for installing Python 3 packages hosted on PyPI.
pip3 install <Package Name>
- Installs a Python package (and any linked dependencies) hosted on PyPI.pip3 uninstall <Package Name>
- Removes a Python package hosted on PyPI.pip3 install --upgrade <Package Name>
- Updates a Python package hosted on PyPI.A simple shell program for Python 3 to write and execute line by line Python instructions.
for
or while
) and if
statements, users will need to hit Enter twice to close the loop or statement.exit()
or Ctrl + D- Exit shell.%save <Filename> <Line Numbers>
- Save Line Numbers
to Filename.py
%save -r test 1-10
- Saves lines 1 to 10 to test.pyExecutes programs using Python 3.
python3 filename.py
- Executes filename.py with Python 3.A packaging tool for Python that is designed to consolidate and simplify a development workflow. This is primarily for the Sphero SDK.
pipenv shell
- Launches shell for virtual environment.exit
or Ctrl + D- Exit shell.This section contains instructions for testing all the hardware in the kit to verify that everything is working. These are individualized tests for the hardware which can be used to help troubleshoot these devices later on. It is recommended that users test components individually (as laid out in this section) to reduce the number of unknown variables.
The first component to test is the Raspberry Pi. Assemble the Raspberry Pi, Pi Servo pHat, and SD card as shown below. Users can power the device either through the 4-pin connector or the USB-C connector on the Pi Servo pHat.
It should power on, boot, connect to the WiFi network (configured previously), and be accessible through the SSH protocol when working properly.
Once powered, you should see a green LED turn on. While the Raspberry Pi Zero W is booting, the green LED will flash indicating that the SD card is being accessed.
It will take a minute or two for the Raspberry Pi to finish booting and connect to the WiFi network. Once connected to the WiFi network, the Raspberry Pi can either be pinged or mapped from another computer (on the same network). The simplest method is to ping
the Raspberry Pi using the following command in your Terminal or Command Prompt. Users that have the IP address of the Raspberry Pi should ping that IP address; otherwise, if users have forgotten or used the SD card method, they can ping the domain name raspberrypi.local
. The limiting factor to using the domain name, is that only ONE Raspberry Pi can be on the network at a time; otherwise, users will run into contention issues and will likely connect to the wrong Raspberry Pi.
ping <IP ADDRESS>
or ping raspberrypi.local
(*More information on determining the Raspberry Pi's IP address can be found on the Raspberry Pi Foundation's website.)
Once users have pinged the Raspberry Pi and verified that it is connected to the network, they can access it remotely through the SSH protocol. On a modern computer OS, this can be done through the Terminal or Command-Prompt. However, users with more outdated systems will need to use an SSH client like Putty (see the Headless Raspberry Pi Setup tutorial). Using the Command-Prompt or Terminal, enter the following command:
ssh pi@<IP ADDRESS>
or ssh pi@raspberrypi.local
Again, if users have forgotten the IP address or used the SD card method, they can ping the domain name raspberrypi.local
(the same limiting factor applies regarding the number of Raspberry Pis connected to the network).
Once connected, users will be prompted to login. If the login prompt doesn't show up after few moments, press the Enter or Return key to bring up the login prompt. The username and password are the default for the Raspberry Pi: Username = pi
(used in ssh
command) and Password = raspberry
.
For users creating a new SSH connection, there may also be an authentication prompt. Type yes
to continue.
The authenticity of host '[IP Address]' can't be established.
ECDSA key fingerprint is SHA256: [Bunch of numbers and letters].
Are you sure you want to continue connecting (yes/no)?
ifconfig
or hostname -I
commands as mentioned in the Software Overview: Part 1 - Raspbian OS section.
Once users have remotely accessed the Raspberry Pi, the test is complete. Shutdown the Raspberry Pi using the sudo shutdown now
command as mentioned in the Software Overview: Part 1 - Raspbian OS section. (*Remember... before unplugging the power or removing the SD card, be sure to verify that the Raspberry Pi has completely shutdown to avoid corrupting the SD card.)
Once users have verified that the they can remotely access the Raspberry Pi, it is time to test the Raspberry Pi camera web interface. Connect the Raspberry Pi camera to the Raspberry Pi Zero W as shown below (take note of what side the gold contacts are on).
Once the camera is connected and the Raspberry Pi is powered on (via the Pi Servo pHat), wait for the Raspberry Pi to finish booting and connecting to the WiFi network. Then, remotely access the Raspberry Pi using the SSH protocol from another computer and login.
Once logged in, users will want to test the Pi Camera web interface.
Change the current working directory to the RPI_Cam_Web_Interface
folder.
cd RPI_Cam_Web_Interface
from the home
directory.cd ~/RPI_Cam_Web_Interface
from any other location.RPI_Cam_Web_Interface
folder. (Click to enlarge) RPI_Cam_Web_Interface
directory:
./start.sh
- Start the Camera./stop.sh
- Stop the CameraUse ./start.sh
to initialize the stream for the video feed from the Pi Camera.
<IP ADDRESS>/html
. (Again, if users have forgotten the IP address or used the SD card method, they can use the domain name raspberrypi.local
in place of the <IP address>
.) Users should see something similar to the images below.Once users are finished testing the Pi Camera, use ./stop.sh
to terminate the video feed.
Once video feed is terminated, shutdown the Raspberry Pi using the sudo shutdown now
command as mentioned in the Software Overview: Part 1 - Raspbian OS section. (*Remember... before unplugging the power or removing the SD card, be sure to verify that the Raspberry Pi has completely shutdown to avoid corrupting the SD card.)
The Pi Servo pHat plays a central roll for connecting everything to the Raspberry Pi. After testing the Raspberry Pi above, users should have already verified that power is being passed through the Pi hat (pHat). This section will focus on the servo control of the Pi Servo pHat; the following Qwiic Devices section will verify the I2C functionality through the pHat.
Although the Pi Servo pHat isn't actally a Qwiic device, the servo controller IC does use the I2C bus. A simple test to verify that it is responding is to use the i2cdetect -y 1
command to ping the I2C bus. By default, the servo controller IC should be at the 0x40 I2C address. If the general call address is enabled, the 0x70 I2C address may appear as well.
This test will verify that the Pi Servo pHat can control the servos and that the servos are functioning properly. Additional instructions are also provided below to assist in pre-alignment of the pan-tilt servos prior to assembly. This will help to avoid damaging the servo on their inaugural operation as well as streamline the assembly process.
Users will need to assemble the Raspberry Pi Zero W with the Pi Servo pHat and attach a servo to Channel 0. Double check that the wiring is aligned properly.
Once the everything is assembled and the Raspberry Pi is powered on, wait for the Raspberry Pi to finish booting and connecting to the WiFi network. Then, remotely access the Raspberry Pi using the SSH protocol from another computer and login.
Once logged in, users will want to run the servo example code.
Change the current working directory to the sparkfun_autonomous_kit
folder.
cd sparkfun_autonomous_kit
from the home
directory.cd ~/sparkfun_autonomous_kit
from any other location.sparkfun_autonomous_kit
folder. (Click to enlarge) Inside the sparkfun_autonomous_kit
directory is the qwiic_library_examples
folder. Change the current working directory to the qwiic_library_examples
folder.
ls
command list the files in the directory and to verify it is there.cd qwiic_library_examples
command.qwiic_library_examples
folder. (Click to enlarge) Inside the qwiic_library_examples
directory is the PiServoHat
folder. Change the current working directory to the PiServoHat
folder.
ls
command list the files in the directory and to verify it is there.cd PiServoHat
command.PiServoHat
folder. (Click to enlarge) Inside the PiServoHat
directory is the ex1_full_sweep_with_90_deg_servo.py
example code. Execute the example code.
ls
command list the files in the directory and to verify it is there.python3 ex1_full_sweep_with_90_deg_servo.py
.ex1_full_sweep_with_90_deg_servo.py
example code. (Click to enlarge) sudo shutdown now
command as mentioned in the Software Overview: Part 1 - Raspbian OS section. Then, swap the servos. (*Remember... before unplugging the power or removing the SD card, be sure to verify that the Raspberry Pi has completely shutdown to avoid corrupting the SD card.)
PiServoHat
directory:
cd sparkfun_autonomous_kit/qwiic_library_examples/PiServoHat
from the home
directory.cd ~/sparkfun_autonomous_kit/qwiic_library_examples/PiServoHat
from any other location.That completes the Pi Servo pHat hardware test, shutdown the Raspberry Pi using the sudo shutdown now
command as done previously. Users can choose to pre-align their servos (recommended) or move on to testing the Qwiic devices.
To help users avoid damaging their servos for the pan-tilt bracket, an example pre-alignment code has been provided. The example code will align the pan (or horizontal movement) servo at 45° and the tilt (or vertical movement) servo at 37°. To pre-align the servos, users will need to assemble the Raspberry Pi Zero W with the Pi Servo pHat and two servos.
Once everything is assembled and the Raspberry Pi is powered on, wait for the Raspberry Pi to finish booting and connecting to the WiFi network. Then, remotely access the Raspberry Pi using the SSH protocol from another computer and login.
Once logged in, users will want to run the servo pre-alignment example.
Change the current working directory to the sparkfun_autonomous_kit
folder.
cd sparkfun_autonomous_kit
from the home
directory.cd ~/sparkfun_autonomous_kit
from any other location.sparkfun_autonomous_kit
folder. (Click to enlarge) Inside the sparkfun_autonomous_kit
directory is the servo_pre_alignment.py
example code. Execute the example code.
ls
command list the files in the directory and to verify it is there.python3 servo_pre_alignment.py
.servo_pre_alignment.py
example code. (Click to enlarge) sudo shutdown now
command as mentioned in the Software Overview: Part 1 - Raspbian OS section. (*Remember... before unplugging the power or removing the SD card, be sure to verify that the Raspberry Pi has completely shutdown to avoid corrupting the SD card.)By now, users should have verified the functionality of the Raspberry Pi, the Pi Servo pHat, the servos, and the I2C bus. This section will verify the I2C functionality from the Pi Servo pHat with each Qwiic device, individually.
A simple test for users to check the connectivity of any attached I2C devices can be performed by pinging them with i2c-tools
. In the command-line enter i2cdetect -y 1
and a readout of any detected devices will appear. For example, the servo controller IC should be at the 0x40 I2C address. (If the general call address is enabled, the 0x70 I2C address may appear as well.)
This is a table of the default I2C addresses for the hardware included in these kits.
Hardware |
Pi Servo pHat (Not a Qwiic Device) |
Titan GPS Module | Qwiic Mux (TCA9548A) | VL53L1X ToF Sensor |
---|---|---|---|---|
Default I2C Address | 0x40 | 0x10 | 0x70 | 0x29 |
For this test users will want to be in a location with their WiFi network coverage and a clear view of the sky. Access to an open window is a feasible option; however, it is not guaranteed to work. For example, on the bottom floor of a tall building, even if users stuck the GPS module out the window, it may still have issues getting a positional lock. If possible, a clearing or field, just outside a house or building, where there is still WiFi coverage is the ideal testing location.
Users will need to assemble the Raspberry Pi Zero W with the Pi Servo pHat and attach the Titan (X1) GPS module using a Qwiic cable. To power the setup, users can use 4-pin UART cable and the Sphero RVR to make the test setup portable and carry it outside.
Once everything is assembled, power the Raspberry Pi by pressing the power button on the side of the Sphero RVR. Wait for the Raspberry Pi to finish booting and connecting to the WiFi network. Then, remotely access the Raspberry Pi using the SSH protocol from another computer and login.
Once logged in, users will want to run the GPS example code.
Change the current working directory to the sparkfun_autonomous_kit
folder.
cd sparkfun_autonomous_kit
from the home
directory.cd ~/sparkfun_autonomous_kit
from any other location.sparkfun_autonomous_kit
folder. (Click to enlarge) Inside the sparkfun_autonomous_kit
directory is the hardware_pre_test
folder. Change the current working directory to the hardware_pre_test
folder.
ls
command list the files in the directory and to verify it is there.cd hardware_pre_test
command.hardware_pre_test
folder. (Click to enlarge) Inside the hardware_pre_test
directory is the TitanX1
folder. Change the current working directory to the TitanX1
folder.
ls
command list the files in the directory and to verify it is there.cd TitanX1
command.TitanX1
folder. (Click to enlarge) Inside the TitanX1
directory is the gps_data.py
example code. Execute the example code.
ls
command list the files in the directory and to verify it is there.python3 gps_data.py
.gps_data.py
example code. (Click to enlarge) If it is working properly, users should see clear readout from the GPS module. It may take a minute or two for the GPS module to get an initial lock; the PPS LED is usually a good general indicator of a possible initial lock on the modules position. (The PPS LED is not necessarily an absolute indication that the module has a fix on its position.)
Additionally, the backup battery has enough energy for the GPS module to store pertinent data for a few days. Therefore, if the module has had a recent positional lock in the area, it may re-acquire its position a lot quicker.
Once users are finished testing, use Ctrl+C to terminate the script.
sudo shutdown now
command as mentioned in the Software Overview: Part 1 - Raspbian OS section. (*Remember... before unplugging the power or removing the SD card, be sure to verify that the Raspberry Pi has completely shutdown to avoid corrupting the SD card.)Users who purchased the Basic kit should move on to the Hardware Assembly section. Otherwise, if you have the Advanced kit, continue below to finish testing the VL53L1X ToF sensors and the Qwiic Mux.
For this test users will want to be in an indoor location. Although the ToF sensor should be more than powerful enough to operate in daylight conditions, it would be advisable to test indoors to remove ambient light as a variable for the testing conditions. Users will need to assemble the Raspberry Pi Zero W with the Pi Servo pHat and attach one of the VL53L1X ToF distance sensors using a Qwiic cable.
Once everything is assembled, power the Raspberry Pi and wait for it to finish booting and connecting to the WiFi network. Then, remotely access the Raspberry Pi using the SSH protocol from another computer and login.
Once logged in, users will want to run the distance sensor example code.
Change the current working directory to the sparkfun_autonomous_kit
folder.
cd sparkfun_autonomous_kit
from the home
directory.cd ~/sparkfun_autonomous_kit
from any other location.sparkfun_autonomous_kit
folder. (Click to enlarge) Inside the sparkfun_autonomous_kit
directory is the qwiic_library_examples
folder. Change the current working directory to the qwiic_library_examples
folder.
ls
command list the files in the directory and to verify it is there.cd qwiic_library_examples
command.qwiic_library_examples
folder. (Click to enlarge) Inside the qwiic_library_examples
directory is the VL53L1X
folder. Change the current working directory to the VL53L1X
folder.
ls
command list the files in the directory and to verify it is there.cd VL53L1X
command.VL53L1X
folder. (Click to enlarge) Inside the VL53L1X
directory is the ex1_read_distance.py
example code. Execute the example code.
ls
command list the files in the directory and to verify it is there.python3 ex1_read_distance.py
.ex1_read_distance.py
example code. (Click to enlarge) sudo shutdown now
command as mentioned in the Software Overview: Part 1 - Raspbian OS section. Then, swap the ToF sensors. (*Remember... before unplugging the power or removing the SD card, be sure to verify that the Raspberry Pi has completely shutdown to avoid corrupting the SD card.)
VL53L1X
directory:
cd sparkfun_autonomous_kit/qwiic_library_examples/VL53L1X
from the home
directory.cd ~/sparkfun_autonomous_kit/qwiic_library_examples/VL53L1X
from any other location.This completes the VL53L1X ToF distance sensor test, shutdown the Raspberry Pi using the sudo shutdown now
command as done previously and move on to testing the Qwiic Mux below.
This is the last and final test! The VL53L1X ToF distance sensor has a "software" configurable I2C address; however it is "volatile", upon re-powering the device, it will automatically reset to the default I2C address. This is where the Qwiic Mux comes in. It is used to isolate the sensors, initially, so that the I2C address of one of the sensors can be reconfigured on power up. Again, since this test will use the VL53L1X sensors, users will want to be in an indoor location.
Users will need to assemble the Raspberry Pi Zero W with the Pi Servo pHat and attach the Qwiic Mux with a Qwiic cable. Then, on the Qwiic Mux, users should attach one of the VL53L1X ToF distance sensors to channels 0 or 4, using the Qwiic cables.
Once everything is assembled, power the Raspberry Pi and wait for it to finish booting and connecting to the WiFi network. Then, remotely access the Raspberry Pi using the SSH protocol from another computer and login.
Once logged in, users will want to run the VL53L1X address change example code.
Change the current working directory to the sparkfun_autonomous_kit
folder.
cd sparkfun_autonomous_kit
from the home
directory.cd ~/sparkfun_autonomous_kit
from any other location.sparkfun_autonomous_kit
folder. (Click to enlarge) Inside the sparkfun_autonomous_kit
directory is the vl53l1x_change_i2c_address.py
example code. Execute the example code.
ls
command list the files in the directory and to verify it is there.python3 vl53l1x_change_i2c_address.py
.vl53l1x_change_i2c_address.py
example code. (Click to enlarge) Follow the prompts of the example code. When selecting which channel on the Mux to enable, select the channel that the VL53L1X ToF distance sensor is attached to (i.e. channels 0 or 4, from the instructions earilier). If users have successfully performed the I2C address change, they should be able to test the sensor on the new I2C address. Once users are finished testing, use Ctrl+C to terminate the script.
sudo shutdown now
command as mentioned in the Software Overview: Part 1 - Raspbian OS section. (*Remember... before unplugging the power or removing the SD card, be sure to verify that the Raspberry Pi has completely shutdown to avoid corrupting the SD card.)
This completes all the hardware pre-test; please, move on to the Hardware Assembly section below.
Note: Before assembling the SparkFun autonomous kit for the Sphero RVR, users should configure their Raspberry Pi and then, verify the hardware is working. (These steps can be performed with the kit fully assembled; however, avoid any unnecessary troubleshooting or pitfalls, it is recommended that the instructions be followed in the order presented.)
Now that we have verified that all the hardware is operational, let's assemble the SparkFun autonomous kit! To begin assembling the kit with the Sphero RVR, follow the corresponding guide.
This section will focus on getting started with the Sphero SDK.
sphero-sdk-raspberrypi-python
folder using the following command:
cd ~/sphero-sdk-raspberrypi-python
sphero-sdk-raspberrypi-python
folder, users will need to spawn a shell in a virtual environment using the pipenv shell
command.
python3 <File Name>.py
exit
or Ctrl+D.This example will focus on getting the Keyboard ⌨️ Control example from the Sphero SDK working while streaming the Raspberry Pi's camera video feed. (*For more details on the Keyboard ⌨️ Control example, check out Sphero's webpage.)
To begin, users should remotely access the Raspberry Pi through the SSH protocol (see the Remote Access with SSH section).
Once users have logged in, change the current working directory to the RPi_Cam_Web_Interface
folder using the following command:
cd RPi_Cam_Web_Interface
Once inside the RPi_Cam_Web_Interface
folder, users can utilize the following two commands to enable/disable the web service for the camera and pan-tilt servo controls.
./start.sh
command../stop.sh
command.After the web service is enabled, users can bring up a live stream of the video feed from the camera using a web browser on the remote computer. The url for the web interface is: <IP Address>/html
(users can also use raspberrypi.local/html
). If the url doesn't work, try adding the http://
prefix (eg. http://raspberrypi.local/html/
).
Users should then return to the home
directory using either the cd ~
or cd ..
command.
Note: Don't forget to move the serial switch on the Pi Servo pHat to RVR
so that the serial communication passes through the 4-pin UART header for the Sphero RVR.
RVR
. (Click to enlarge)
Next, to begin using the Sphero SDK, users should change the current working directory to the sphero-sdk-raspberrypi-python
folder using the following command:
cd sphero-sdk-raspberrypi-python
Once inside the sphero-sdk-raspberrypi-python
folder, users will need to spawn a shell in a virtual environment using the pipenv shell
command (this will create a virtual environment if one doesn't already exist). This is the most important step to "initializing" the Sphero SDK; otherwise, users will run into issues executing any of the examples.
After the shell has been activated, users should move the current working directory to the keyboard_control
folder using the following command:
cd projects/keyboard_control
Once inside the keyboard_control
folder, users will need to start the drive_with_wasd_keys.py
Python example code with the following command:
python3 drive_with_wasd_keys.py
You may see a few initialization printouts like:
Checking RVR firmware versions...
Checking CMS firmware versions...
Firmware check done.
Wait a minute or two for the script to finish initializing. Once complete, users should be able to use the W, A, S, D, and Space Bar keys to control the Sphero RVR.
Have fun driving the RVR around, don't forget to play with the servo controls on the web interface.
Use Ctrl+C to interrupt the keyboard control script. The example code will then display:
Keyboard Interrupt...
Press any key to exit.
and prompt user to Press any key to exit.
. Pressing another key will exit the script. To exit the virtual environment shell, type exit
or Ctrl+D.
To disable the web interface, change back to the RPi_Cam_Web_Interface
directory and use the ./stop.sh
command.
To use both VL53L1X ToF sensors, users will need to use the Qwiic Mux to access a single sensor and change the I2C address. Then users will need to access both sensors through the Qwiic Mux to retrieve the distance data. The following instructions will get users started on this process with the included example code.
To begin, users should remotely access the Raspberry Pi through the SSH protocol (see the Remote Access with SSH section).
The VL53L1X ToF distance sensor has a "software" configurable I2C address; however it is "volatile", upon re-powering the device, it will automatically reset to the default I2C address. This is where the Qwiic Mux comes in. It is used to isolate the sensors, initially, so that the I2C address of one of the sensors can be reconfigured on power up.
Once logged in, change the current working directory to the sparkfun_autonomous_kit
folder.
cd sparkfun_autonomous_kit
from the home
directory.cd ~/sparkfun_autonomous_kit
from any other location.Inside the sparkfun_autonomous_kit
directory is the vl53l1x_change_i2c_address.py
example code. Execute the example code.
ls
command list the files in the directory and to verify it is there.python3 vl53l1x_change_i2c_address.py
.Follow the prompts of the example code. When selecting which channel on the Mux to enable, select one of the channels that the VL53L1X ToF distance sensor is attached to (i.e. either channel 0 or 4). If users have successfully performed the I2C address change, they should be able to test the sensor on the new I2C address. Use Ctrl+C to terminate the script.
Note: The entries to the prompts in the .gif above are: y, y, y, y, 0, 41, 85, and y.
Update: The Assembly Guide has been modified to use channels 3 and 4 on the Qwiic Mux. Users can either move the cable (i.e. from channel 3 to channel 0) or modify the entries into the prompts (i.e. enter 3 instead of 0).
Now that users have modified the I2C address of one of the sensors, they can use the example code to get readings from both sensor.
Inside the sparkfun_autonomous_kit
directory is the hardware_pre_test
folder. Change the current working directory to the hardware_pre_test
folder.
cd hardware_pre_test
command.Inside the hardware_pre_test
directory is the VL53L1X
folder. Change the current working directory to the VL53L1X
folder.
ls
command list the files in the directory and to verify it is there.cd VL53L1X
command.Inside the VL53L1X
directory is the dual_sensors.py
example code. Execute the example code.
ls
command list the files in the directory and to verify it is there.python3 dual_sensors.py
.Follow the prompts of the example code. When selecting, which channel on the Mux to enable, select both of the channels that the VL53L1X ToF distance sensors are attached to (i.e. channels 0 and 4). If users have successfully performed the I2C address change, they should be able to designate the I2C address of the front and rear sensors. Once users are finished testing, use Ctrl+C to terminate the script.
Note: The entries to the prompts in the .gif above are: y, y, y, 0, y, 41, n, 85, and 41.
Update: The Assembly Guide has been modified to use channels 3 and 4 on the Qwiic Mux. Users can either move the cable (i.e. from channel 3 to channel 0) or modify the entries into the prompts (i.e. enter 3 instead of 0).
Do you think something is broken? Let's try some of these common troubleshooting tips before looking for technical assistance. This section is written in a hierarchical fashion to make it easier for users to follow from top to bottom. If you know what you are looking for an don't see it right away, don't forget to try a "Google" search; often, someone else has already run into the same issue and may have posted a solution.
If you have never tried to troubleshoot a device before, this is a great beginners guide of common points that novices (and even some experienced users) should check.
In the event that you lose or break any parts, the components of the kits are linked below. (*Unfortunately, the mounting plate and 3/4" 4-40 standoffs for advanced kit are unavailable at this time.)
For all things related specifically to the Sphero RVR and/or the Sphero SDK, head over to the Sphero SDK website. They have troubleshooting guides for the RVR and SDK software.
If you can't find the information you need in their troubleshooting guides, their community forum is a great place to find and ask for help.
RVR
.
RVR
. (Click to enlarge) pipenv shell
) to use the example code.exit
.If you have accidentally erased you SD card, it has become corrupted, or you need to start from scratch... the pre-configured image of Raspbian can be downloaded using the button below.
If you have never flashed an image onto an SD card before, check out our SD Cards and Writing Images tutorial.
To undo the overclock configuration, modify the config.txt
file using sudo nano boot/config.txt
. Scroll down to the bottom and under [pi0w]
change:
over_voltage=4
force_turbo=1
to:
over_voltage=6
force_turbo=0
(*More information on overclocking can be found on the Raspberry Pi Foundation's website.)
For users looking to build their own image, here are basic instructions. If you know what you are doing then these should be easy to follow. If you don't know what you are doing, download the pre-configured image. (*Assisting customers with building their own custom Raspbian image is beyond the scope of this tutorial and our technical support team).
RPi_Cam_Web_Interface
code from the GitHub repository.sparkfun-qwiic
Python package using pip3
.RPi_Cam_Web_Interface
folder.start.sh
and stop.sh
bash scripts to use and terminate the servo control firmware.Testing the hardware is a great place to start, refer to the Initial Hardware Tests section in this guide for testing all the hardware included in these kits.
If there something you are trying to do with a specific piece of hardware, go back to the Initial Hardware Tests section to verify it is working with the example code. If the device is working with the example code, then there is possibly an issue with the code you have written. Otherwise, if the device isn't responding properly, users double check if any of the "tricks of the trade" (i.e. tips) below apply.
Have you tried searching the internet for a solution to your issue? Often with common issues, someone else will have run into the same issue and there will be a few posts on it with solutions, if not workarounds.
(*Search engines like Google are great resources! There are entire forums and resources out there that are dedicated to specifically, supporting the use of the Raspberry Pi and/or Python.)
If you are getting weird characters when typing, double check that the keyboard map is configured properly. You can set the localization and keyboard map using sudo raspi-config
.
Double check the WiFi network. As mentioned in the Configure the Raspberry Pi section, the Raspberry Pi Zero W supports 2.4GHz 802.11n wireless LAN and is only compatible with 2.4GHz networks. It will not connect to a 5GHz WiFi network.
If you are in an office or school setting, you may be on an enterprise network. Check with your IT network administrator about making sure that you have the necessary permissions and configurations in place to utilize our kit.
If you have multiple Raspberry Pi's on a single network, try powering the rest off and just using the Raspberry Pi you are trying to troubleshoot. This should isolate any bandwidth issues that may occur if you have too many devices connected to the network at once.
Use the WiFi router's network monitoring tools to verify that the Raspberry Pi and the remote computer are on the network.
Try to ping
the Raspberry Pi or ssh
in. Try using both the IP address and raspberrypi.local
methods.
ping <IP Address>
ssh <IP Address>
ping raspberrypi.local
ssh pi@raspberrypi.local
Re-enable the serial console/login shell. Using an SD card reader, add console=serial0,115200
back to the cmdline.txt
file on the SD card. Then use the Pi Servo pHat for the headless setup.
ifconfig
hostname -I
ping <IP Address of Remote Computer>
ping <IP Address of Router>
ping google.com
wpa_supplicant.conf
file. Do you have the correct country code in?
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
If your Raspberry Pi isn't connecting to the WiFi network, you should re-configure the WiFi. Even if you know you have setup the credentials properly, it was working prviously, or it is on the network... sometimes, resetting the WiFi configuration can help. Users should try both the wpa_supplicant.conf
file and raspi-config
tool methods.
By default the camera lens should be screwed in with the focus set to ∞. Although it is not advisable, the sensor can be refocused.
If you are having serial connection issues with the Sphero SDK:
RVR
.
RVR
. (Click to enlarge) Test the serial port on the Raspberry Pi, re-enable the serial console/login shell.
console=serial0,115200
back to the cmdline.txt
file on the SD card.If the serial port on the Pi works, it may be an issue with the UART cable. Try testing for continuity with a multimeter if you have one.
If none of the Qwiic (I2C) devices are responding or you get an IOError, this may be an I2C issue.
raspi-config
tool.i2cdetect -y 1
.The GPS needs a view of the sky; check out our GPS Basics tutorial.
If you see the PPS LED is blinking, but you are not getting any positional data you may not have a lock from enough satellites. The PPS LED doesn't guarantee a positional lock, based on the datasheet, it usually indicates a NMEA sentence was received at some point.
The Titan X1110 receiver is only compatible with GPS and GLONASS satellites.
My servo is behaving inconsistently... unfortunately, these are inexpensive servos. (*The Pan/Tilt Bracket Kit costs ~$7. Standard servo costs ~$25-40/each on average.)
The ToF sensor does have performance limitations. For example, the sensor FOV, the target properties (i.e. size, color, reflectivity, etc.), and the ambient light all affect the sensor performance and reliability. Check out these related support articles from Garmin:
The VL53L1X does not permanently store any I2C address changes. On each power up cycle, the sensor reverts to the default I2C address. (*There is no work around... we have already asked the manufacturer. That is why the Qwiic Mux was added to the kit.)
Need help?
If your product is not working as you expected or you need technical information, head on over to the SparkFun Technical Assistance page. Otherwise, if you have already tried the troubleshooting tips above, the SparkFun Forums are a great place to find and ask for help. (If this is your first visit, you'll need to create a Forum Account to post questions.)
For more information on the SparkFun Autonomous Kit and the included hardware, check out the resources below:
Interested in other robotics projects? Check out some of our robotics related tutorials below:
learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado