← All tools

Message & Error Explainer

What an ArduPilot message means and what to do about it

Українська

A rangefinder's driver is running, but no readings arrive

Stops itRangefinder, optical flow, camera, OSD and other devices

What ArduPilot says:

The driver for this rangefinder started, but it gets no distance readings. “No Data” appears after 0.2 s of silence from a serial or PWM sensor and 0.5 s from a MAVLink or DroneCAN one. “Not Connected” is the state before the first reading ever arrives, or an analog sensor whose pin cannot be read. A distance outside the sensor's range does not stop arming: standing on the ground, below the sensor's minimum, is fine.

What to do, most likely first

  1. The sensor has no power: on USB alone most boards do not feed the 5 V rail the lidar is on.

    CheckConnect the battery (props off): the message should go away within a second.

    FixTest with the battery connected. If the sensor needs more current than the board's 5 V pad gives, feed it from a separate 5 V regulator (BEC).

  2. TX and RX are swapped, or the sensor is on another UART than the one set to the rangefinder protocol.

    CheckThe sensor's TX goes to the flight controller's RX. The port with SERIALn_PROTOCOL 9 must be the one the wires go to; the Board & Wiring Planner shows which pad is which UART.

    FixCorrect the wiring, or move the 9 to the port the sensor is really on, and reboot.

  3. The baud rate or the sensor type does not match the sensor.

    CheckSERIALn_BAUD must be the sensor's speed (115 means 115200). RNGFNDn_TYPE must be the exact family: a TFmini or TF-Luna on a UART is 20, not 19 (TF02) or 27 (TF03).

    FixSet both to the sensor's own values and reboot.

  4. A MAVLink or DroneCAN rangefinder (a companion computer, a CAN node) has stopped sending.

    CheckFor RNGFNDn_TYPE 10 the ground station's MAVLink inspector should show DISTANCE_SENSOR messages several times a second. A DroneCAN sensor announces itself at boot with “RangeFinder[0]: added DroneCAN node”.

    FixStart the sender again, or fix the link it uses, before flying.

With no rangefinder fitted the right setting is RNGFNDn_TYPE 0. A rangefinder that drops out on the bench will drop out in the air, where Copter uses it for height in surface tracking and landing.

Parameters to look at

ParameterWhat it is
RNGFND1_TYPERangefinder type
RNGFND2_TYPERangefinder type
SERIAL1_BAUDTelem1 Baud Rate
SERIAL2_BAUDTelemetry 2 Baud Rate
SERIAL1_PROTOCOLTelem1 protocol selection
SERIAL2_PROTOCOLTelemetry 2 protocol selection
SERIAL3_PROTOCOLSerial 3 (GPS) protocol selection
SERIAL4_PROTOCOLSerial4 protocol selection
The code that sends it

Rangefinder 0x…: Not Connected

libraries/AP_RangeFinder/AP_RangeFinder.cpp RangeFinder::prearm_healthy() · Open in ArduPilot Copter-4.7.1

Rangefinder 0x…: No Data

libraries/AP_RangeFinder/AP_RangeFinder.cpp RangeFinder::prearm_healthy() · Open in ArduPilot Copter-4.7.1

Written here for Copter 4.6. In the tool you choose your vehicle and version, see your own parameter values beside the ones named here, and drop a flight log to have every message in it explained.

Open it in the Message & Error Explainer