← All tools

Message & Error Explainer

What an ArduPilot message means and what to do about it

Українська

A pulse input cannot be read on the pin you chose

WarningRangefinder, optical flow, camera, OSD and other devices

What ArduPilot says:

The feature named first (RangeFinder_PWM, HC_SR04, Button, FuelLevelPWM or RSSI) measures the width of pulses on a pin, and for that the pin must be able to interrupt the processor. The pin number at the end could not be set up that way: it is not one of this board's GPIO pins, or another input already uses the same interrupt line. The feature reads nothing. “Failed to detach…” appears when the pin is changed and the old one could not be released; a reboot clears it.

What to do, most likely first

  1. The pin number is not a GPIO pin of this board.

    CheckThe Board & Wiring Planner shows the GPIO number of each output of your board.

    FixChoose a pin your board's documentation lists as GPIO, set that output's SERVOn_FUNCTION to -1 (GPIO), and reboot.

  2. Two pulse inputs share one interrupt line of the processor.

    FixMove one of them to another pin.

Parameters to look at

ParameterWhat it is
RNGFND1_PINRangefinder pin
RSSI_ANA_PINReceiver RSSI sensing pin
BTN_PIN1First button Pin
BATT_FL_PINFuel level analog pin number
The code that sends it

…: Failed to detach interrupt from N

libraries/AP_HAL/GPIO.cpp AP_HAL::PWMSource::set_pin() · Open in ArduPilot Copter-4.7.1

…: Failed to attach interrupt to N

libraries/AP_HAL/GPIO.cpp AP_HAL::PWMSource::set_pin() · 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