Fixing channel issue with ELRS Mavlink-rc: number of channels is not set by default #11969
+2
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
If you are using ELRS MAVLINK setup as per: https://www.expresslrs.org/software/mavlink/ then the number of channels will never be set. Hence it will remain 0 -- even though there is clearly control data going through. This is because ELRS is not sending a full
RC_CHANNELS
packet, only channel update packets viaRC_CHANNELS_RAW
, to update the position of the values. Therefore, the number of channels is not set.This ELRS system forwards BOTH the RC and the Mavlink on the same ELRS link. Using one TX and one RX, you get to have both Mavlink and RC. The Mavlink is forwarded via the backpack chip in the TX to the wifi. You can then connect to this wifi and QGC picks it up automatically, via zero-conf (I think! Very cool) and "just works". Which is great. But the RC doesn't SEEM to work, because the number of channels is never set.
TL;DR:
RC_CHANNELS
is never sent, onlyRC_CHANNELS_RAW
, sochancount
is never set.Test Steps
We get connectivity of Mavlink forwarded via ELRS + backpack in the TX via WiFi, however, the radio channels cannot be calibrated, and it cannot arm, because the number of channels is seen as 0. With this fix, calibration works and the craft can be armed.
How to Reproduce
Connect as per above. Observe that calibration is not possible, the QGC says there is no controller connected.
Checklist:
Related Issue
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.