The objective is receiving the data from the Ground module to air module and decoding it without a controller board such as PX4 or Navio.
- Start with loopback test on the RPi4. Connect the
Tx pin of the RPi4 to the
Rx pin of the RPi4 with a jumper wire.
- Install cutecom/minicom/putty on RPi4 to test the loopback. I used minicom to do the loopback test. The following tutorial Serial Port Debugging 101 : Loopback Test gives a good explanation of doing loopback tests. However, it did not work for me.
Disable the serial console along with Bluetooth and enable the UART port of the RPi4. By default
/dev/serial0 port will be UART interface port.
After enabling the UART port on RPi4, I followed the steps provided by @tlfong01 in the link Rpi UART to GPS Module Connection Problem (with Serial Loopback and Repeat Send Byte Python Program) and executed the python program to test the working of the UART Port on RPi4. It worked. I was getting the output as given in the code description.
I was sure that my UART port is up and working. Next step was to connect the FPV air module to the UART port and receive data.
Download the Mission Planner Software on a windows host. Connect the FPV ground radio Module to the windows host. Configure the FPV ground and air Radio module using Mission Planner.
Start Mission Planner software. Go to Initial setup -> Optional Hardware -> Sik Radio. Configure the Baud, Airspeed and click on Save settings. Once the settings are saved, click on the option "Copy required to remote." This will configure FPV Ground and Air Radio Modules.
Connect the FPV Air Module's
Tx to the RPi4's
Rx pin and
Rx pin to the RPi4's
Tx Pin respectively. Make sure the Green led on the Air and Ground module is blinking solid, indicating both are connected.
Copy the following python code onto the RPi4 and change the serial port name and baud rate as per the configuration.
import serial, string
output = " "
ser = serial.Serial("/dev/serial0", 57600, 8, 'N', 1, timeout=1)
output = ser.readline()
Run the python code on RPi4. The code will read from the serial0 port and display it on the terminal.
In Mission Planner software, click on the terminal option and make sure to have the configuration as shown here .
Make sure APM is selected. Start sending text messages from the Mission planner terminal and receive it at the RPi4's terminal (Receivers End).
tlfong01's suggested references.
(1) AliExpress 3DR 500MW Radio Telemetry 433Mhz 915Mhz Air and Ground Data Transmission Module for APM Pixhawk Flight Control FPV - US$25
(2) 3DR Radio V2 Quick Start Guide - 3D Robotics
(3) Mission Planner Documentation - Ardupilot
(4) Mission Planner Commands (MAVLink protocol) - Ardupilot
(5) APM 2.8 Flight Controller with Built-in Compass Arduino Compatible
(6) Pixhawk PX4 AutoPilot 2.4.7 32-bit ARM Flight Controller with 4G SD Card - US$90
(7) PX4 Autopilot User Guide -Master
(8) Terminal Mode Mission Planner
(9) Rpi UART to GPS Module Connection Problem (with Serial Loopback and Repeat Send Byte Python Program)
(10) Rpi3 to Arduino Serial UART Communication Tutorial
(11) Rpi3 LIRC Library and UART IR Transceiver Setup Problem
Appendix A - Mission Planner Servo Command - MAV_CMD_DO_REPEAT_SERVO
Cycle a servo PWM output pin between its mid-position value and a
specified PWM value, for a given number of cycles and with a set