Drobotics logo DROBOTICSTechnical Library

Guides Guide

Installing Rpanion Server on Raspberry Pi for Pixhawk Telemetry

All Guides

Introduction

Rpanion Server is a powerful node.js based server for companion computers used in Mavlink-based vehicles (Ardupilot, PX4). It provides a web-based interface for configuring system settings such as network, telemetry, and video streaming directly from your companion computer.

Note: This guide is particularly useful for users in China or other regions with restricted internet access, as it provides alternative methods for downloading required packages.

Prerequisites

  • Raspberry Pi (3/4/Zero 2W) with Ubuntu 22.04 installed
  • Internet connection (with potential restrictions)
  • Basic knowledge of Linux command line
  • Pixhawk flight controller
  • Access to another computer with internet connection (for SCP transfers if needed)

Installation Steps

1System Preparation

Begin by updating your system and installing basic dependencies:

sudo apt update
sudo apt upgrade -y
sudo apt install -y git meson ninja-build pkg-config \
 gstreamer1.0-plugins-good libgstrtspserver-1.0-dev \
 python3-pip libudev-dev libusb-1.0-0-dev

2Installing mavlink-router

mavlink-router is required for MAVLink message routing. Download and install it:

Challenge: Network restrictions may prevent direct download

Solution: Use SCP to transfer files from another computer

On your local machine (not the Pi):

wget https://gitlab.com/mavlink-router/mavlink-router/-/archive/master/mavlink-router-master.zip

Transfer to Raspberry Pi using SCP:

scp mavlink-router-master.zip user@raspberrypi.local:~

On the Raspberry Pi:

unzip mavlink-router-master.zip
cd mavlink-router-master

Manually download and install the MAVLink C library:

wget https://hub.fastgit.org/mavlink/c_library_v2/archive/refs/heads/master.zip -O mavlib.zip
unzip mavlib.zip -d modules/
mv modules/c_library_v2-master/* modules/mavlink_c_library_v2/
rm mavlib.zip

Build and install:

meson setup build.
ninja -C build
sudo ninja -C build install

Verify installation:

which mavlink-routerd # Should return: /usr/local/bin/mavlink-routerd

3Installing Node.js

Rpanion Server requires Node.js v20 or higher. The default Ubuntu repositories may contain an older version.

Remove existing Node.js installations:

sudo apt remove --purge nodejs npm
sudo apt autoremove --purge

Challenge: Network restrictions may prevent downloading Node.js directly on Pi

Solution: Download on another computer and transfer via SCP

On your local machine:

wget https://nodejs.org/dist/v20.18.0/node-v20.18.0-linux-arm64.tar.xz

Transfer to Raspberry Pi:

scp node-v20.18.0-linux-arm64.tar.xz user@raspberrypi.local:~

On the Raspberry Pi:

tar -xf node-v20.18.0-linux-arm64.tar.xz
sudo cp -r node-v20.18.0-linux-arm64/* /usr/local/

Update system links:

sudo rm -f /usr/bin/node /usr/bin/npm
sudo ln -s /usr/local/bin/node /usr/bin/node
sudo ln -s /usr/local/bin/npm /usr/bin/npm

Verify installation:

node --version # Should return: v20.18.0
npm --version # Should return: 10.8.2

4Installing Rpanion Server

Install remaining dependencies:

sudo apt install -y \
 gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-ugly \
 gstreamer1.0-plugins-bad python3-netifaces network-manager \
 python3-dev python3-gst-1.0 dnsmasq jq libxml2-dev \
 libxslt1-dev python3-lxml python3-numpy python3-future \
 gpsbabel zip

Challenge: Rpanion Server.deb package may not download directly

Solution: Download on another computer and transfer via SCP

On your local machine, download the Rpanion Server package:

wget https://github.com/stephendade/Rpanion-server/releases/download/v0.11.4/rpanion-server_0.11.4_arm64.deb

Transfer to Raspberry Pi:

scp rpanion-server_0.11.4_arm64.deb user@raspberrypi.local:~

On the Raspberry Pi, install the package:

sudo dpkg -i --force-all rpanion-server_0.11.4_arm64.deb
sudo apt install -f

Start and enable the service:

sudo systemctl enable rpanion-server
sudo systemctl start rpanion-server

Check the service status:

sudo systemctl status rpanion-server

Success: If everything worked correctly, you should see that the Rpanion Server is active and running.

Verification and Testing

Verify that Rpanion Server is running correctly:

sudo systemctl status rpanion-server
# Should show: active (running)

Check that the server is listening on the correct port:

ss -tlnp | grep:3001
# Should show Node.js listening on port 3001

Accessing the Web Interface

Open a web browser and navigate to:

http://<your-pi-ip-address>:3001

Use the default credentials to log in:

  • Username: admin
  • Password: admin

Important: Change the default password after your first login for security reasons.

Connecting to Pixhawk

To connect your Pixhawk flight controller:

  1. Connect the Pixhawk to the Raspberry Pi via USB or telemetry radio
  2. In the Rpanion web interface, go to Settings > Connections
  3. Add a new connection with the appropriate parameters:
    • For USB: Select the correct serial port (usually /dev/ttyACM0)
    • For telemetry radio: Set the appropriate baud rate (usually 57600)
  4. Save the configuration and check for telemetry data

Troubleshooting Common Issues

Issue: Service fails to start due to dependency problems

Solution: Check logs with journalctl -u rpanion-server -f and ensure all dependencies are installed

Issue: Cannot access web interface

Solution: Check firewall settings and ensure port 3001 is open: sudo ufw allow 3001

Issue: No telemetry data from Pixhawk

Solution: Verify physical connections and check serial port permissions: sudo usermod -aG dialout $USER (requires reboot)

Conclusion

Despite the challenges of network restrictions and dependency conflicts, we successfully installed Rpanion Server on a Raspberry Pi running Ubuntu 22.04. The key to success was:

  1. Using alternative download sources when direct downloads failed
  2. Manually installing dependencies when package management failed
  3. Using SCP to transfer files from another computer when needed
  4. Verifying each step before proceeding to the next

With Rpanion Server now running, you have a powerful platform for managing your drone's companion computer capabilities, including telemetry routing, video streaming, and network configuration.

Success: Your Rpanion Server is now ready for operation. Happy flying!