HOWTO Install DepthAI on a Raspberry Pi 4B for the ARNEIS project


The following document explains how to install Luxonis DepthAI software on a Raspberry Pi for the ARNEIS project.


  • One Raspberry Pi prepared as detailed in “HOWTO Prepare a Raspberry Pi 4B for the ARNEIS project”.

  • One MicroSD card of at least 4GB.

    • IMPORTANT: The card should be blank, or at least should not contain any important data since it will be completely erased.

    • Tested with a SanDisk Ultra 256 GB MicroSDXC

  • One desktop PC or laptop for formatting the SD card and controlling the RPi

    • OS: A recent version of Windows or Linux or macOS

    • The PC should have a MicroSDHC card reader. Alternatively, an additional USB MicroSD card reader is required

  • Fast internet connection

Step-by-step instructions

Prepare the Raspberry Pi

Follow the instructions at

Install DepthAI


Logged in as pi@rpi4gm35, type the following command to install DepthAI software:

sudo apt update
sudo apt install -y python3-pip python3-venv

mkdir -p ~/github/luxonis
cd ~/github/luxonis
git clone

Now create a Python virtualenv:

cd ~/github/luxonis/depthai
python3 -m venv virtualenv
source virtualenv/bin/activate
pip install -U pip

Install requirements:


Install some missing binary packages (for some unknown reasons neither pip nor virtualenv automatically install them)

sudo apt-get -y install libatlas-base-dev python3-h5py

Add a new udev rule for the script to be able to access the OAK-D-Lite device correctly.

echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="03e7", MODE="0666"' \
    | sudo tee /etc/udev/rules.d/80-movidius.rules
sudo udevadm control --reload-rules \
    && sudo udevadm trigger

Check Linux kernel messages

sudo dmesg -w

Connect the OAK-D-Lite to one USB 3.0 port of the Raspberry Pi using a USB 3.0 cable (USB-A to USB-C).

As soon as the OAK-D-Lite gets recognize the following messages should be displyed on the kernel log:

[ 5253.298901] usb 1-1.2: new high-speed USB device number 4 using xhci_hcd
[ 5253.429951] usb 1-1.2: New USB device found, idVendor=03e7, idProduct=2485, bcdDevice= 0.01
[ 5253.429971] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5253.429987] usb 1-1.2: Product: Movidius MyriadX
[ 5253.430002] usb 1-1.2: Manufacturer: Movidius Ltd.
[ 5253.430017] usb 1-1.2: SerialNumber: 03e72485

Run the demo script


Result: The program is executed correctly on the Raspberry Pi.


Note 1: First execution of

The first time that is launched, it may take a few minutes before the camera windows are be displayed.

Note 2: Launching from a remote shell

The script should be invoked from a terminal on the main Raspberry Pi display.

If the command is invoked from a remote SSH shell, make sure that the DISPLAY environment variable is properly set before launching the demo script.


(.venv) pi@rpird102:~/github/luxonis/depthai $ export DISPLAY=:0.0
(.venv) pi@rpird102:~/github/luxonis/depthai $ python3
Using depthai module from:  /home/pi/github/luxonis/depthai/.venv/lib/python3.7/site-packages/
Depthai version installed:
Setting up demo...
Available devices:
[0] 19443010E106F01200 [X_LINK_UNBOOTED]
USB Connection speed: UsbSpeed.SUPER