# Deploy with RockPi

Connecting OAK devices to RockPi single-board computers (SBCs) brings AI vision capabilities to low-cost, high-performance
platforms. To install the DepthAI library on a RockPi device, follow these steps to install dependencies and the library itself
through pip. Prebuilt wheels for various platforms can be checked on [PyPi](https://pypi.org/project/depthai/).

#### RockPi 4

#### RockPi 4 SE

#### Radxa Zero

#### Radxa Zero

## Installing DepthAI on Radxa Zero

To install DepthAI on Radxa Zero, which are based on the Amlogic S905Y2 processor, you can follow the steps below.

Currently tested OS versions include:

 * Armbian Focal (desktop)
 * Armbian Focal (minimal, X11 needs further setup)

You will have to first run through initial setup steps (setting password, timezone, etc.). Once the OS is set up, you can proceed
with the following steps to install DepthAI.

### Connect to WiFi

Since Radxa Zero does not have an Ethernet port, you will need to connect to WiFi to download and install the necessary packages.
You can use the following command to connect to a WiFi network:

```bash
nmcli d wifi connect "your_wifi_ssid" password "your_wifi_password"
```

### apt update/upgrade

Open a terminal window and run the following commands to update your system:

```bash
sudo apt update && sudo apt upgrade
```

### Dependencies

Install the DepthAI dependencies:

```bash
sudo wget -qO- https://docs.luxonis.com/install_dependencies.sh | bash
```

This script should handle most dependency installations. Double-check for any Radxa Zero dependencies if this script fails.

### venv

It's a good practice to use a Python virtual environment:

```bash
sudo apt install python3-venv
python3 -m venv depthai-env
source depthai-env/bin/activate
```

Ensure you activate the virtual environment before proceeding with the DepthAI installation.

### DepthAI repo

Clone the DepthAI repository and install the library

```bash
#Clone github repository
git clone https://github.com/luxonis/depthai-python.git
cd depthai-python
python3 examples/install_requirements.py
```

### Edit .bashrc

Last step is to edit .bashrc with the line:

```bash
echo "export OPENBLAS_CORETYPE=ARMV8" >> ~/.bashrc
```

## Power Considerations for OAK on Radxa Zero

Make sure to use a Y-adapter to power the OAK device. The Radxa Zero may not be able to provide enough power to the OAK device
through a single USB port.

## Connecting to Radxa Zero Remotely

Similar to other SBCs, you can connect to your Radxa Zero remotely via SSH for headless operation:

```bash
ssh username@radxa_ip_address
```

Ensure that SSH is enabled on your Radxa. The process for enabling SSH may vary slightly depending on the specific OS version you
are using.

For graphical applications or to display GUI elements from your RockPi to a local machine, X11 forwarding can be used with the -X
flag:

```bash
ssh -X username@radxa_ip_address
```

> **Enable X11 forwarding**
> By default, X11 forwarding won't work on Armbian, because it is missing the
> `xauth`
> package. You can install it with the following command:
> ```bash
> sudo apt install xauth
> ```
> After installing
> `xauth`
> , exit the SSH session and reconnect with the
> `-X`
> flag to enable X11 forwarding.

#### RockPi 4

## Installing DepthAI on RockPi 4

To install DepthAI on RockPi 4, you can follow the steps below.

Currently tested OS versions include:

 * Ubuntu Server (20.04)
 * Debian 11 Desktop

### apt update/upgrade

Open a terminal window and run the following commands to update your system:

```bash
sudo apt update && sudo apt upgrade
```

### Dependencies

Install the DepthAI dependencies:

```bash
sudo wget -qO- https://docs.luxonis.com/install_dependencies.sh | bash
```

This script should handle most dependency installations. Double-check for any RockPi-specific dependencies if this script fails.

### venv

It's a good practice to use a Python virtual environment:

```bash
sudo apt install python3-venv
python3 -m venv depthai-env
source depthai-env/bin/activate
```

Ensure you activate the virtual environment before proceeding with the DepthAI installation.

### DepthAI repo

Clone the DepthAI repository and install the library

```bash
git clone https://github.com/luxonis/depthai-python.git
cd depthai-python
python3 examples/install_requirements.py
```

### Edit .bashrc

Last step is to edit .bashrc with the line:

```bash
echo "export OPENBLAS_CORETYPE=ARMV8" >> ~/.bashrc
```

## Power Considerations for OAK on RockPi

While RockPi devices are generally capable of powering OAK cameras directly via USB, it's wise to monitor the power draw,
especially when connecting multiple peripherals. For high-power OAK devices or multiple USB devices, consider an externally
powered USB hub or specific power arrangements recommended by OAK documentation.

## Connecting to RockPi Remotely

Similar to other SBCs, you can connect to your RockPi remotely via SSH for headless operation:

```bash
ssh username@rockpi_ip_address
```

Ensure that SSH is enabled on your RockPi. The process for enabling SSH may vary slightly depending on the specific OS version you
are using.

For graphical applications or to display GUI elements from your RockPi to a local machine, X11 forwarding can be used with the -X
flag:

```bash
ssh -X username@rockpi_ip_address
```

If using Debian 11 Desktop, you can also use VNC for full graphical desktop access:

Or, set up VNC for full graphical desktop access:

 * Install a VNC server on your RockPi.
 * Enable and configure the VNC server.
 * Connect using a VNC client from another computer.

#### RockPi 4 SE

## Installing DepthAI on RockPi 4 SE

To install DepthAI on RockPi 4 SE, you can follow the steps below.

Currently tested OS versions include:

 * Ubuntu Server (20.04)
 * Debian 11 Desktop

### apt update/upgrade

Open a terminal window and run the following commands to update your system:

```bash
sudo apt update && sudo apt upgrade
```

### Dependencies

Install the DepthAI dependencies:

```bash
sudo wget -qO- https://docs.luxonis.com/install_dependencies.sh | bash
```

This script should handle most dependency installations. Double-check for any RockPi-specific dependencies if this script fails.

### venv

It's a good practice to use a Python virtual environment:

```bash
sudo apt install python3-venv
python3 -m venv depthai-env
source depthai-env/bin/activate
```

Ensure you activate the virtual environment before proceeding with the DepthAI installation.

### DepthAI repo

Clone the DepthAI repository and install the library

```bash
#Clone github repository
git clone https://github.com/luxonis/depthai-python.git
cd depthai-python
python3 examples/install_requirements.py
```

### Edit .bashrc

Last step is to edit .bashrc with the line:

```bash
echo "export OPENBLAS_CORETYPE=ARMV8" >> ~/.bashrc
```

## Power Considerations for OAK on RockPi

While RockPi devices are generally capable of powering OAK cameras directly via USB, it's wise to monitor the power draw,
especially when connecting multiple peripherals. For high-power OAK devices or multiple USB devices, consider an externally
powered USB hub or specific power arrangements recommended by OAK documentation.

## Connecting to RockPi Remotely

Similar to other SBCs, you can connect to your RockPi remotely via SSH for headless operation:

```bash
ssh username@rockpi_ip_address
```

Ensure that SSH is enabled on your RockPi. The process for enabling SSH may vary slightly depending on the specific OS version you
are using.

For graphical applications or to display GUI elements from your RockPi to a local machine, X11 forwarding can be used with the -X
flag:

```bash
ssh -X username@rockpi_ip_address
```

If using Debian 11 Desktop, you can also use VNC for full graphical desktop access:

Or, set up VNC for full graphical desktop access:

 * Install a VNC server on your RockPi.
 * Enable and configure the VNC server.
 * Connect using a VNC client from another computer.
