Softivation

Why Pixhawk telemetry drops in the air

Telemetry drops but the signal looks full in Mission Planner. Use the RADIO_STATUS fields to tell whether the link is saturated or weak, and measure your own link.

Furkan IŞIKAY 9 min read

The drone takes off and everything is normal for the first few minutes. Then the stream of numbers on the Mission Planner screen stops and the icon on the map freezes. After a while it comes back on its own, then cuts out again.

Most people assume it's a range problem and go looking for an antenna. Sometimes they're right. But the same symptom can appear when the drone is only fifty meters from the ground station, and then swapping the antenna fixes nothing.

There is a way to tell them apart. The radio reports the link's own status to the autopilot. You just need to know where to look.

The radio already tells you its status

The SiK radio inserts its own status message into the MAVLink stream. Mission Planner shows it as a signal bar, but the bar hides the most important information inside it.

This message answers four separate questions: what your side hears, what the other side hears, how much free space is left in the radio's transmit buffer, and what the noise floor is. If the difference between the two sides' signals is large, the problem is one-directional and it's clear which end's antenna to work on.

The buffer is the part that really misleads. Buffer fill is not a signal indicator, and it can fill up even when the signal is perfect.

Why it freezes when the signal is full

When more data arrives than the radio can carry, it fills the buffer. The autopilot sees this and slows its own send rate. So most of the time the screen is frozen by the autopilot's own braking. The signal can be perfectly good at that moment.

This brake isn't arbitrary; it follows fixed thresholds. In the figure, look at how much is added to the send interval on each report as the free buffer space shrinks.

As the buffer fills, the autopilot slows its own sending

Step chart: if free buffer space is below 20 percent, 60 ms is added to the send interval on each report; between 20 and 50, 20 ms is added. 50 to 90 is a dead band. Above 90, 20 ms is subtracted, and above 95, 40 ms is subtracted.
What to look at: the two steps on the left. No matter how good the signal is, once free buffer space drops below 50%, the data reaching the screen gets sparse.

When the buffer drops below twenty percent, sixty milliseconds is added to the send interval on each report. The total slowdown stops within two seconds, but the time between messages can stretch up to sixty seconds.

The most common mistake starts here: raising the stream rates in Mission Planner because the screen froze. Raising the rate on an already saturated link fills the buffer further, and the autopilot throttles harder.

Know the fields of the message

The message the radio generates itself is called RADIO_STATUS (message 109). These are the fields behind Mission Planner's signal bar:

FieldWhat it tells you
rssithe signal your side hears
remrssithe signal the other side hears
txbuffree space left in the radio's transmit buffer (%)
noisethe noise floor
rxerrorsnumber of bad packets since power-up
fixednumber of packets corrected by ECC

The thresholds above come from the handle_radio_status function in libraries/GCS_MAVLink/GCS_Common.cpp in the ArduPilot source: txbuf below 20 adds 60 ms, below 50 adds 20 ms, above 90 subtracts 20 ms, above 95 subtracts 40 ms.

Measure your own link

Instead of looking at the signal bar, produce numbers. The code below counts the frames dropped on the link from gaps in the MAVLink sequence numbers and, if a radio status message arrives, prints its fields.

Run it once while the drone is on the ground with the motors off. Then run it again with the motors running. The difference between the two outputs shows how much of the interference the motors generate.

Python
from pymavlink import mavutil
import time

# If a SiK radio is attached: mavutil.mavlink_connection('/dev/ttyUSB0', baud=57600)
baglanti = mavutil.mavlink_connection('tcp:127.0.0.1:5760')
baglanti.wait_heartbeat()
print('heartbeat received, measurement starting')

# On Copter stream rates default to zero, request the stream first
for akis, hiz in [(mavutil.mavlink.MAV_DATA_STREAM_EXTENDED_STATUS, 2),
                  (mavutil.mavlink.MAV_DATA_STREAM_POSITION, 3),
                  (mavutil.mavlink.MAV_DATA_STREAM_EXTRA1, 4)]:
    baglanti.mav.request_data_stream_send(
        baglanti.target_system, baglanti.target_component, akis, hiz, 1)

son_seq = None
bosluk = saglam = bozuk = 0
baslangic = time.time()

while time.time() - baslangic < 60:
    msg = baglanti.recv_match(blocking=True, timeout=2)
    if msg is None:
        continue
    if msg.get_type() == 'BAD_DATA':
        bozuk += 1
        continue
    saglam += 1
    seq = msg.get_header().seq
    if son_seq is not None:
        fark = (seq - son_seq) & 0xFF
        if fark != 1:
            bosluk += (fark - 1) & 0xFF
    son_seq = seq
    if msg.get_type() == 'RADIO_STATUS':
        print('rssi=%d remrssi=%d txbuf=%d noise=%d rxerrors=%d'
              % (msg.rssi, msg.remrssi, msg.txbuf, msg.noise, msg.rxerrors))

toplam = saglam + bosluk
oran = 100.0 * bosluk / toplam if toplam else 0.0
print('good=%d gaps=%d corrupt=%d loss=%.2f%%' % (saglam, bosluk, bozuk, oran))

Change the connection line to match your own port. The SiK radio shows up over USB on the ground side, and on Linux it is usually at this address:

Output
/dev/ttyUSB0   57600 baud

If you run the code on a lossless link, you get output like this:

Output
heartbeat received, measurement starting
good=1962 gaps=0 corrupt=4 loss=0.00%

Example: When the map freezes, look at the RADIO_STATUS line the code prints. If rssi and remrssi are both high and txbuf is below 50, the link is saturated. Instead of swapping the antenna, lower the stream rate. If remrssi is clearly lower than rssi, the problem is one-directional. Check the antenna on the drone side first.

Why the link suddenly collapses

A MAVLink frame is dozens of bytes long, so a single corrupted byte throws away the whole frame. That is why loss grows counterintuitively: a two-per-thousand byte loss takes out eighty-two percent of the frames.

If you want to see the code catch the loss yourself, connect it to SITL and add byte loss to the link with the SIM_UART_LOSS parameter. The numbers in the figure come from an 18-second measurement at each step on ArduCopter 4.7.0. In your own measurement the numbers won't come out exactly the same.

Once byte loss reaches two per thousand, most frames are gone

Frame loss by byte loss: at 0 percent, 0 percent; at 0.2 percent, 82.08 percent; at 0.5 percent, 94.07 percent; at 1 percent, 96.05 percent.
What to look at: the steep jump between 0 and 0.2. The dashed line between points only shows the order; it is not an interpolated measurement.

The number of corrupted frames the code counts grows in the same direction: 3, 303, 757 and 1079. In practice the link either works or it has collapsed. There is no in-between zone where you could say "a bit weak but it'll do."

Are both radios on the same settings

If the link never comes up, or drops even on the ground, the next suspect is a settings mismatch. Some settings must be exactly the same on both radios, while others are free.

Settings
Must be the same on both radiosfirmware version, AIR_SPEED, MIN_FREQ, MAX_FREQ, NUM_CHANNELS, NETID, ECC, LBT_RSSI, MAX_WINDOW
Can differSERIAL_SPEED (USB/serial speed), TXPOWER, DUTY_CYCLE

The list is from the SiK Radio Advanced Configuration page on ardupilot.org. If even one of the required settings doesn't match, the link looks like it's established but no data passes.

A solid green LED is misleading. It only shows that the two radios have found each other, not that MAVLink data is passing.

Where the old guides get stuck

To lower the stream rate, almost every source on the internet points to parameters starting with SR0_ and SR1_. None of these names exist in ArduCopter 4.7.0's parameter list.

They have been renamed. They now appear with the MAV1_ and MAV2_ prefixes, and SYSID_MYGCS has become MAV_GCS_SYSID. When you try to write a parameter that doesn't exist, you don't get an error either, nothing just happens.

Output
SR1_EXTRA1      ->  MAV2_EXTRA1
SR1_POSITION    ->  MAV2_POSITION
SYSID_MYGCS -> MAV_GCS_SYSID (default 255)

To see which one applies on your own board, just type MAV in the search box of Mission Planner's full parameter list.

Error Messages and Their Meanings

The lines that appear in Mission Planner's message window when telemetry is cut. All of them are exact texts from the ArduCopter source code.

GCS Failsafe

No heartbeat has come from the ground station for five seconds and FS_GCS_ENABLE is nonzero. The time is set with FS_GCS_TIMEOUT, and the default is 5 seconds. This message doesn't look at signal level, only at the heartbeat counter.

GCS Failsafe - Continuing Pilot Control

The failsafe triggered, but because the pilot kept flying with the transmitter, the autopilot did not intervene. The fourth bit of the FS_OPTIONS parameter does this, and it is on by default.

GCS Failsafe - Continuing Landing

The drone was already landing when the failsafe came, and the continue-landing option (third bit) is on in FS_OPTIONS. The autopilot completes the landing without interrupting it.

GCS Failsafe Cleared

The heartbeat is back. Note: the flight mode does not return to the old one on its own; it stays in whichever mode the failsafe switched to.

What changes in the field

Most of these symptoms don't show up on the bench. Noise on the power line while the motors spin, the antenna position inside the airframe, and the battery mass shadowing the signal all come into play only in flight.

There is a simple rule for measurement: divide the difference between rssi and noise by two, and you get the fade margin in decibels. Every 6 dB doubles the range. With the two radios held one meter apart, a standard SiK radio should read an rssi value above 190.

If it is below that, the antenna or the radio is faulty, and no setting you change in the air will save it.

More on this topic in the course

The lesson on setting up the telemetry link end to end, the decision chain in the source code, and telling faults apart from log signatures is part of the Drone Communication Technologies course.

Was this article helpful?

Free resourcePixhawk and ArduPilot error message glossaryThe 4 messages in this article and similar ones are in the glossary: what they mean, why they appear, what to check first.