A rangefinder's driver is running, but no readings arrive
What ArduPilot says:
- Rangefinder 0x…: Not Connected
- Rangefinder 0x…: No Data
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
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).
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_PROTOCOL9 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.
The baud rate or the sensor type does not match the sensor.
Check
SERIALn_BAUDmust be the sensor's speed (115 means 115200).RNGFNDn_TYPEmust 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.
A MAVLink or DroneCAN rangefinder (a companion computer, a CAN node) has stopped sending.
CheckFor
RNGFNDn_TYPE10 the ground station's MAVLink inspector should showDISTANCE_SENSORmessages 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
| Parameter | What it is |
|---|---|
RNGFND1_TYPE | Rangefinder type |
RNGFND2_TYPE | Rangefinder type |
SERIAL1_BAUD | Telem1 Baud Rate |
SERIAL2_BAUD | Telemetry 2 Baud Rate |
SERIAL1_PROTOCOL | Telem1 protocol selection |
SERIAL2_PROTOCOL | Telemetry 2 protocol selection |
SERIAL3_PROTOCOL | Serial 3 (GPS) protocol selection |
SERIAL4_PROTOCOL | Serial4 protocol selection |
Where to do it:Board & Wiring Planner
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