Using Raspberry Pi as Data Transmission and Video Transmission for Drones

Using Raspberry Pi as a data transmission and video transmission device, transmitting the flight control telemetry (Mavlink) data and camera video over a WIFI network to a remote ground station. This application is based on the Rpanion-server software.
Rpanion-server is an open-source software that can be installed on any computer with a Linux (or Linux-based operating system such as Ubuntu, Raspberry) operating system. It provides a web-based interface where you can configure the Raspberry Pi network, telemetry routing parameters, camera video parameters, and log data from the connected flight controller. After installing this software on the Raspberry Pi, you can connect to the Raspberry Pi’s WIFI network from your computer on the ground to obtain telemetry information from the drone and control the aircraft’s takeoff, landing, and route planning; you can also view the video from the drone’s camera. The logical topology of Rpanion-server is shown in the diagram below:
Using Raspberry Pi as Data Transmission and Video Transmission for Drones

Hardware Preparation

(1) Raspberry Pi 3 or 4, Pi2 may also work, but I haven’t tested it. (2) Raspberry Pi CSI camera (3) USB card reader (4) A set of Pixhawk series flight controllers, the latest model is FMUV6X, using Pixhawk4-Mini as an example here. (5) Computer
Using Raspberry Pi as Data Transmission and Video Transmission for Drones

Software Preparation

(1) The integrated Rpanion-server software Raspberry Pi operating system image, download link:https://github.com/stephendade/Rpanion-server/releases/download/v0.7.0/Rpanion-Server-0.7.0-RasPiOS.img.xzReaders interested in research can download the source code from GitHub and compile and install it on the Raspberry Pi. (2) Image burning software Balena etcher, download link:https://www.balena.io/etcher/(3) gstreamer-1.0-msvc-x86_64-1.18.4, a plugin for creating streaming media applications, must be installed on the computer running the ground station to display the camera video. The Raspberry Pi image on the drone already includes this plugin, so users do not need to install it themselves. (4) QgroundControl ground station software

Installation and Setup of Rpanion-server

(1) Prepare an 8G MicroSD card and connect it to the computer via the card reader; (2) Install and open Balena etcher, click “Flash from file” to select the previously downloaded Raspberry Pi operating system image, select the 8G card as the target device, and click “Flash” to start burning;
Using Raspberry Pi as Data Transmission and Video Transmission for Drones
(3) After waiting for the burning to complete, insert the card into the Raspberry Pi, connect it to power via USB TypeC, and wait 1-2 minutes for the Raspberry Pi to boot up. You can connect a monitor to the Raspberry Pi’s MicroHDMI port to check if it has booted successfully. If it starts normally, you will see the system booting to the login screen on the monitor, as shown in the figure below:
Using Raspberry Pi as Data Transmission and Video Transmission for Drones
(4) Search for WIFI on your computer, and you will see a network with the SSID rpanion, and the password is rpanion123.
Using Raspberry Pi as Data Transmission and Video Transmission for Drones
(5) After connecting, access the browser and visithttp://10.0.2.100:3000, you will log into the Rpanion-server setup page.
Using Raspberry Pi as Data Transmission and Video Transmission for Drones
(6) Click on the Flight Logs page to set how the Raspberry Pi processes telemetry data sent by the flight controller. Telemetry Logs record all telemetry data, and Bin Logs only record flight logs, which are included in the telemetry data packets and are automatically recorded by default. If you want to save all telemetry data on the Raspberry Pi, you can check Enable Telemetry Logging, and you will see the recorded log files in the File Name section.
Using Raspberry Pi as Data Transmission and Video Transmission for Drones
(7) Click on the Flight Controller page to set the parameters of the Raspberry Pi’s serial port so that it can correctly receive telemetry data sent by the flight controller. Serial Device specifies the serial port number of the Raspberry Pi, and the current version of the image only supports serial0 as one serial port; Baud Rate sets the baud rate of the serial port, try to choose 921600, the higher the rate, the faster the connection speed; MAVLink Version choose 2.0, almost all versions from the last two years support 2.0 except for very old firmware flight controllers;
MAVLink dialect select Ardupilot; UDP Outputs here you need to add a new connection for the interconnection between the ground station and the Raspberry Pi. Click Add, and in the pop-up window, enter the IP address of the computer running the QGroundControl ground station (after connecting to the Raspberry Pi’s network, you can obtain the IP address using ipconfig in the command line window), the port number is fixed at 14550.
Using Raspberry Pi as Data Transmission and Video Transmission for DronesUsing Raspberry Pi as Data Transmission and Video Transmission for DronesAfter setting up, click Start Telemetry to start recording and forwarding telemetry data. Note that these settings will be saved on the SD card, and the next time you power on, it will run automatically without needing to set it again.
(8) Click on NetWork Config for network settings, including WIFI network SSID, password, Raspberry Pi’s IP address, etc., which will not be detailed here.
Using Raspberry Pi as Data Transmission and Video Transmission for Drones
(9) Click on Video Streaming to set up camera and video transmission.https://make.quwj.com/storage/uploads/images/16160/1616080872comje39gzt.png
At this point, the software installation and setup of the Raspberry Pi is complete, and we can proceed to the next step.

Flight Control Settings

After installing QgroundControl and gstreamer on the computer, connect the flight controller to the computer using a USB data cable, and then open QgroundControl to set up the flight controller. (1) Set the flight controller telemetry data interface parameters. To successfully connect the flight controller to the Raspberry Pi, ensure that both sides have consistent serial port parameter settings. In this example, we are using the flight controller’s Telemetry1 interface, and the setup method for other Telemetry interfaces is similar. Using the default MAVlink data packet sending rate of 1200B will lead to insufficient bandwidth and frequent errors, so first set the data packet sending rate to above 9600B;
Using Raspberry Pi as Data Transmission and Video Transmission for Drones
Set the data packet rate in parameters->MAVlink page
Using Raspberry Pi as Data Transmission and Video Transmission for Drones
Then set the Telemetry1 serial port baud rate to 921600 in parameters->serial page.
Using Raspberry Pi as Data Transmission and Video Transmission for Drones
After setting, restart the flight controller (either power off or soft restart) to make the parameters effective.
(2) Set the video input source. Qgroundcontrol supports RSTP video stream input, and you only need to set the Video parameters in the general page. Select RTSP Video Stream for Video Source and fill in the RSTP URL given on the Raspberry Pi Video Streaming settings page “rstp://10.0.2.100:8554/video.” Aspect Ratio is the video width-to-height ratio, most cameras are 16:9 widescreen, so use the default value of 1.7777. If your camera is not 16:9, please fill in the actual value; otherwise, the picture will be distorted.
Using Raspberry Pi as Data Transmission and Video Transmission for Drones
At this point, the flight controller setup is complete. Disconnect the USB cable from the flight controller and proceed to the next step.
5. Assembly and Wiring. First, assemble each module onto the frame, and then connect each module according to the wiring diagram below.
Using Raspberry Pi as Data Transmission and Video Transmission for Drones
Using Raspberry Pi as Data Transmission and Video Transmission for Drones
Completed assembly image
Using Raspberry Pi as Data Transmission and Video Transmission for Drones

Connecting to QGC Ground Station

After assembly is complete, connect the battery, and after the flight controller and Raspberry Pi have booted up, connect the computer to the Raspberry Pi’s WiFi and then open the QGC software. You will find that the flight controller will automatically connect. After the connection progress bar completes, you will see a summary information of the flight controller, as shown below:
Using Raspberry Pi as Data Transmission and Video Transmission for Drones
Click the mouse to switch to the flight page, and you will see that the camera video is already overlaid on the map. If you move the aircraft manually, you will see the aircraft’s attitude change accordingly.
Using Raspberry Pi as Data Transmission and Video Transmission for Drones
At this point, the data and video transmission based on Raspberry Pi is complete. However, due to the low transmission power of the WIFI module on the Raspberry Pi and the limited gain of the antenna integrated on the board, the communication distance is limited. The author has tested the Raspberry Pi 3B and 4B in open urban areas, and the communication distance is only about 50 meters. It may increase in good electromagnetic environments in the wild.
This is just a simple application of the Raspberry Pi, and the next goal is to achieve autonomous obstacle avoidance.

Using Raspberry Pi as Data Transmission and Video Transmission for Drones

● How does railway wireless communication achieve “waves never die”? Unveiling

● TK-3601D: The smallest radio station released by Kenwood

● How does railway wireless communication achieve “waves never die”? Unveiling

● Beidou Tiandi Company and Huawei jointly developed a collaborative intercom communication system

Using Raspberry Pi as Data Transmission and Video Transmission for Drones

Leave a Comment

×