← All tools

Message & Error Explainer

What an ArduPilot message means and what to do about it

Українська

The rangefinder's input pin is not set, or cannot be used

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

What ArduPilot says:

An analog rangefinder (RNGFNDn_TYPE 1) or a PWM one (5 or 22) is read through a pin of the flight controller, named by RNGFNDn_PIN. “not set” means the parameter is still -1. A PWM sensor also needs the pin to be a free GPIO (a general-purpose pin): “invalid” means this board has no pin with that number, and “set SERVOn_FUNCTION=-1” means the pin is a servo/motor output that still works as an output.

What to do, most likely first

  1. The sensor is not analog or PWM at all: a serial or I2C lidar was given the wrong type.

    CheckTypes 1, 5 and 22 are only for sensors that give a voltage or a pulse width on one signal wire.

    FixSet RNGFNDn_TYPE to your sensor's own type (20 for a TFmini or TF-Luna on a UART) and reboot.

  2. RNGFNDn_PIN was never set.

    FixSet RNGFNDn_PIN to the pin the signal wire is on: an analog input number for an analog sensor, a GPIO number for a PWM one. Your board's ArduPilot documentation page lists both.

  3. The pin is one of the servo/motor outputs and is still set up as an output.

    CheckThe message names the output: “set SERVO9_FUNCTION=-1” is output 9.

    FixSet that SERVOn_FUNCTION to -1 (GPIO) and reboot: outputs become GPIO pins only at start-up. Nothing else (a motor, a servo) may be wired to that output.

  4. The pin number does not exist on this board: it was copied from another board's parameters.

    FixUse a pin number from your own board's documentation; the numbers differ from board to board.

Parameters to look at

ParameterWhat it is
RNGFND1_TYPERangefinder type
RNGFND1_PINRangefinder pin
RNGFND2_TYPERangefinder type
RNGFND2_PINRangefinder pin
SERVO9_FUNCTIONServo output function
SERVO10_FUNCTIONServo output function
The code that sends it

RNGFNDN_PIN=N, set SERVON_FUNCTION=-1

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

RNGFNDN_PIN not set

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

RNGFNDN_PIN=N invalid

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