diff --git a/libraries/AP_HAL_PX4/RCOutput.cpp b/libraries/AP_HAL_PX4/RCOutput.cpp index 507bc546d8..4ada16dcb4 100644 --- a/libraries/AP_HAL_PX4/RCOutput.cpp +++ b/libraries/AP_HAL_PX4/RCOutput.cpp @@ -55,10 +55,14 @@ void PX4RCOutput::init() } #if !defined(CONFIG_ARCH_BOARD_PX4FMU_V4) - _alt_fd = open("/dev/px4fmu", O_RDWR); - if (_alt_fd == -1) { - hal.console->printf("RCOutput: failed to open /dev/px4fmu"); - return; + struct stat st; + // don't try and open px4fmu unless there is a px4io. Otherwise we + // can end up opening the same device twice + if (stat("/dev/px4io", &st) == 0) { + _alt_fd = open("/dev/px4fmu", O_RDWR); + if (_alt_fd == -1) { + hal.console->printf("RCOutput: failed to open /dev/px4fmu"); + } } #endif