Getting Started
BrickPi3 Installation FAQ
For Raspberry Pi 3B+, 4, and 5. Written for educators who want to use BrickPi3 with LEGO motors and sensors — headless setup over SSH, no monitor required.
Getting Started
For Raspberry Pi 3B+, 4, and 5. Written for educators who want to use BrickPi3 with LEGO motors and sensors — headless setup over SSH, no monitor required.
| Situation | Recommended option |
|---|---|
| I want the simplest setup and I'm starting from scratch | Option A — pip install on a fresh Raspberry Pi OS |
| I want the full source code and example projects | Option B — Install via git clone |
| I have an ethernet cable + router handy, and want a fully pre-configured image | Option C — Download the ready-made image |
pip on a fresh Raspberry Pi OSThis is the recommended approach for most users. You flash a standard Raspberry Pi OS image yourself (which means you can pre-configure WiFi), then install BrickPi3 with a single command.
Flash Raspberry Pi OS to your microSD card
brickpi. Click Next.Insert the card, power on the Pi, and SSH in.
Insert the microSD card into the Pi and plug in power. After about a minute, open a terminal on your laptop and type:
ssh yourusername@brickpi.local
Replace yourusername and brickpi with whatever you set in the wizard. You will be asked for your password and then land at a command prompt on the Pi.
brickpi.local doesn't work
You can find the Pi's IP address by logging into your router's admin page — open a browser on your laptop and try 192.168.1.1, 192.168.0.1, or 10.0.0.1. Look for a list of connected devices; the Pi will appear with the hostname you chose. Then SSH using its IP directly:
ssh yourusername@192.168.x.x
Create and activate a virtual environment (see the Setting up a Python virtual environment section below):
python3 -m venv ~/.venv/brickpi
source ~/.venv/brickpi/bin/activate
Install BrickPi3:
pip install brickpi3
Run the setup script to enable SPI, I2C, VNC, and other required interfaces. The script was installed alongside the package into your virtual environment:
source ~/.venv/brickpi/lib/python3.*/site-packages/brickpi3/scripts/install_trixie.sh
python3.* part matches whichever Python version is on your Pi (e.g. python3.11, python3.12). The * wildcard handles this automatically — no need to type the version number.
python3 -c "import brickpi3; print('BrickPi3 installed successfully!')"
git cloneUse this if you want the complete source code and the sample projects folder. The setup steps are identical to Option A — the only difference is how the library is installed.
Create and activate a virtual environment (see the Setting up a Python virtual environment section below):
python3 -m venv ~/.venv/brickpi
source ~/.venv/brickpi/bin/activate
Clone the repository into the directory of your choice, then enter it:
git clone https://github.com/DexterInd/BrickPi3.git
cd BrickPi3
Run the setup script to install BrickPi3 and enable SPI, I2C, VNC, and other required interfaces:
source Software/Python/brickpi3/scripts/install_trixie.sh
The Projects/ folder inside the cloned repository contains ready-to-run example programs for motors, sensors, and more.
Modern Raspberry Pi OS (Trixie / Debian 13) will refuse to install Python packages system-wide with pip by default. The clean solution is to use a virtual environment — a self-contained folder where Python packages are installed without touching the rest of the system.
You only need to do this once. Run these commands on the Pi after SSHing in:
# Create a virtual environment at ~/.venv/brickpi
python3 -m venv ~/.venv/brickpi
# Activate it (your prompt will change to show '(brickpi)')
source ~/.venv/brickpi/bin/activate
source ~/.venv/brickpi/bin/activate
To make this automatic on login, add that line to the end of your ~/.bashrc file:
echo 'source ~/.venv/brickpi/bin/activate' >> ~/.bashrc
We provide a complete Raspberry Pi OS image with BrickPi3 already installed and configured — SPI, I2C, SSH, and everything else is already set up.
Because this is a pre-built image, there is no way to enter your WiFi password before first boot. You must connect your Raspberry Pi to a router using an ethernet cable for the first boot. Once you are connected and logged in, you can configure WiFi from the command line.
Download the image (about 1–2 GB):
Write it to your microSD card:
Find the Pi's IP address by logging into your router's admin page (usually 192.168.1.1 or 192.168.0.1 in a browser) and looking for a device named brickpi in the connected devices list.
SSH into the Pi:
ssh brickpi@brickpi.local
Default password: robots1234
(Optional) Add your WiFi credentials so you no longer need the ethernet cable:
sudo nmcli device wifi connect "YourNetworkName" password "YourPassword"
After this you can unplug the ethernet cable and reconnect over WiFi.
All three options work on Raspberry Pi 3B+, 4, and 5. The 3B+ is the recommended model — it is well-tested with BrickPi3 and widely available second-hand.
Yes. BrickPi3 connects LEGO NXT and EV3 motors and sensors to a Raspberry Pi.
These are communication interfaces that let the Raspberry Pi talk to the BrickPi3 hardware. They are off by default on a fresh Raspberry Pi OS. The install_trixie.sh script in Options A and B takes care of enabling them automatically. The ready-made image (Option C) already has them enabled.
pip install.This means you are not inside a virtual environment. Activate yours first:
source ~/.venv/brickpi/bin/activate
If you haven't created one yet, see the Setting up a Python virtual environment section above. As a last resort you can force the install with --break-system-packages, but using a virtual environment is the right approach.
brickpi.local..local names to work.