A rangefinder is switched on in the parameters, but no driver started for it
What ArduPilot says:
- Rangefinder 0x…: Not Detected
RNGFNDn_TYPE is not 0, but at power-on ArduPilot could not start a driver for that rangefinder (the number in the message says which: 1 is RNGFND1). Drivers are started once, at boot: a serial sensor needs a port set to the rangefinder protocol, an I2C sensor has to answer on the bus at that moment. Nothing is tried again later, so the message stays until the cause is fixed and the flight controller rebooted.
What to do, most likely first
The type was set or changed, and the flight controller has not been rebooted since.
FixReboot. If the message is gone, that was all.
It is a serial rangefinder (TFmini, TF-Luna, LightWare), and no serial port is set to the rangefinder protocol.
CheckFind which UART the sensor's wires go to (the Board & Wiring Planner shows which pad is which UART) and read that port's
SERIALn_PROTOCOL: it must be 9 (Rangefinder). The first serial rangefinder takes the first port with 9, the second takes the next one.FixSet that port's
SERIALn_PROTOCOLto 9 andSERIALn_BAUDto the sensor's speed (115 for 115200, what a TFmini uses), then reboot.No rangefinder is fitted: the parameter is left over from another aircraft's file.
FixSet
RNGFNDn_TYPEto 0 for the rangefinder named in the message and reboot.An I2C rangefinder did not answer at boot: it had no power, SDA and SCL are swapped, or the address is wrong.
CheckMany lidars are fed from the battery side: on USB alone they are still off while the board boots and looks for them. Compare
RNGFNDn_ADDRwith the address in the sensor's manual.FixPower the aircraft from the battery (props off), correct the wiring or
RNGFNDn_ADDR, and reboot.This firmware was built without the driver for that sensor type.
CheckThe Firmware Inspector lists what a firmware file was built with. Boards with 1 MB of flash leave many rangefinder drivers out.
FixBuild a firmware with the driver, or choose a sensor the firmware supports.
Parameters to look at
| Parameter | What it is |
|---|---|
RNGFND1_TYPE | Rangefinder type |
RNGFND2_TYPE | Rangefinder type |
RNGFND1_ADDR | Bus address of sensor |
SERIAL1_PROTOCOL | Telem1 protocol selection |
SERIAL2_PROTOCOL | Telemetry 2 protocol selection |
SERIAL3_PROTOCOL | Serial 3 (GPS) protocol selection |
SERIAL4_PROTOCOL | Serial4 protocol selection |
SERIAL5_PROTOCOL | Serial5 protocol selection |
Where to do it:Board & Wiring PlannerFirmware InspectorFirmware Builder
The code that sends it
Rangefinder 0x…: Not Detected
libraries/AP_RangeFinder/AP_RangeFinder.cpp RangeFinder::prearm_healthy() · Open in ArduPilot Copter-4.7.1