add RDY ready-to-arm sensor - #308
Open
ramiss wants to merge 1 commit into
Open
Conversation
Publishes a synthetic telemetry sensor "RDY" that reads 100 when the
flight controller is effectively ready to arm and 0 otherwise, so EdgeTX
logical switches can drive Special Functions (VTX power, custom sounds).
No sound or output logic lives in the script; it only publishes the value.
Ready is either:
- a "using GPS" statustext received during the CURRENT FC power cycle
(ArduPilot's "EKF3 IMUx is using GPS"), or
- the repeating 0x5002 GPS STATUS frame reporting gpsStatus >= 3,
gpsHdopC <= 14 (HDOP 1.4) and numSats >= 10
The composite fallback exists because statustexts are fire-once over a
lossy link, while the 0x5002 frames repeat and self-heal.
The state must not survive an FC power cycle, so three independent resets
clear it: the "ArduCopter V" boot banner in the 0x5000 handler, 800 ticks
(8s) without a passthrough frame, and resetTelemetry() / reset().
Sensor: appId 0x060F, subId 0, instance 2 (instances 0 and 1 are already
used by Fuel and ARM). It is deliberately published BEFORE the
telemetryEnabled() guard in setSensorValues(): inside the guard, link loss
returns early and EdgeTX keeps serving the last value, so RDY would freeze
at 100 with the vehicle unplugged and a VTX logical switch would stay
latched on.
The statustext hook is added to both the S.Port 0x5000 handler and the
CRSF 0xF1 branch in crossfirePop(), so it works on CRSF/ELRS links too.
Applies to all OpenTX/EdgeTX colour and B&W variants. Behaviour is
identical to before when the new conditions never fire. Ethos is
unchanged (no setTelemetryValue equivalent in that API).
Note: the B&W .luac binaries under SD/SCRIPTS/TELEMETRY are not
regenerated here, as the repo has no build step; they need recompiling
from SRC/ for the sensor to appear on B&W radios.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Publishes a synthetic telemetry sensor "RDY" that reads 100 when the flight controller is effectively ready to arm and 0 otherwise, so EdgeTX logical switches can drive Special Functions (VTX power, custom sounds). No sound or output logic lives in the script; it only publishes the value.
Note: I am working on a future PR that utilizes this same added sensor, but pulls the actual ready to arm state when using ELRS 4.0 with the new Mavlink to CRSF capability.
For this PR, ready is either:
The composite fallback exists because statustexts are fire-once over a lossy link, while the 0x5002 frames repeat and self-heal.
The state must not survive a FC power cycle, so three independent resets clear it: the "ArduCopter V" boot banner in the 0x5000 handler, 800 ticks (8s) without a passthrough frame, and resetTelemetry() / reset().
Sensor: appId 0x060F, subId 0, instance 2 (instances 0 and 1 are already used by Fuel and ARM). It is deliberately published BEFORE the telemetryEnabled() guard in setSensorValues(): inside the guard, link loss returns early and EdgeTX keeps serving the last value, so RDY would freeze at 100 with the vehicle unplugged and a VTX logical switch would stay latched on.
The statustext hook is added to both the S.Port 0x5000 handler and the CRSF 0xF1 branch in crossfirePop(), so it works on CRSF/ELRS links too.
Applies to all OpenTX/EdgeTX colour and B&W variants. Behaviour is identical to before when the new conditions never fire. Ethos is unchanged (no setTelemetryValue equivalent in that API).
Note: the B&W .luac binaries under SD/SCRIPTS/TELEMETRY are not regenerated here, as the repo has no build step; they need recompiling from SRC/ for the sensor to appear on B&W radios.