Skip to content

feat: send handset RTC to ELRS modules - #7645

Open
JustinRipley wants to merge 3 commits into
EdgeTX:mainfrom
LVTY-AI:elrs-handset-time-sync
Open

feat: send handset RTC to ELRS modules#7645
JustinRipley wants to merge 3 commits into
EdgeTX:mainfrom
LVTY-AI:elrs-handset-time-sync

Conversation

@JustinRipley

@JustinRipley JustinRipley commented Aug 13, 2026

Copy link
Copy Markdown

Summary

Send the radio handset RTC to an ExpressLRS transmitter module, so the ELRS backpack path can propagate the radio clock to downstream devices (VRx backpack, goggles).

The time is sent as an MSPv2 message encapsulated in a CRSF MSP_WRITE frame addressed to the video receiver (0x14), a normal MSP packet routed the way any packet reaches the VTX. ExpressLRS relays it to the backpack without interpreting it.

The frame is sent once per module init, after the module identifies as ELRS and its device query completes. Outgoing frames replace channel packets, so this deliberately does not resend on a timer; timeSyncSent[] latches and re-arms only on crossfireInit/crossfireDeInit.

Both CRCs are crc8 poly 0xD5: the MSP one covers flags through payload, the CRSF one covers the type byte through the MSP CRC.

Changes from the previous revision of this PR

This PR previously sent the time as a CRSF extended Parameter Write frame using a phantom field id (0x3C), resent every 60 seconds. Review feedback on the corresponding ExpressLRS PR asked for a proper MSP packet addressed to the video receiver rather than a synthetic parameter, and for the message not to be sent repeatedly. Both are addressed here:

  • PARAMETER_WRITE_ID and ELRS_HANDSET_TIME_ID are removed, neither had any other user.
  • The 60-second resend and lastTimeSync[] are removed, leaving a single send per module init.

Related PRs

Comment thread radio/src/pulses/crossfire.cpp Outdated
@pfeerick

pfeerick commented Aug 14, 2026

Copy link
Copy Markdown
Member

This allows the ELRS TX firmware/backpack path to propagate the radio clock to downstream devices.

Just checking, is the framework for this already in place in ELRS tx/backpack firmware, or something yet to be implemented? Any minimum versions users will need to be aware of?

@pfeerick pfeerick added the enhancement ✨ New feature or request label Aug 14, 2026
@JustinRipley

JustinRipley commented Aug 14, 2026

Copy link
Copy Markdown
Author

The framework has already been PR'd on the ELRS and Backpack sides. In theory, the entire pipeline from BF --> ELRS --> EdgeTX --> ELRS --> Backpack --> Goggles/other devices is all in place once all PR's are merged. I can't say on minimum versions yet. I believe only Betaflight has this merged into 2026.6.1 at this time. ELRS has a pending PR, and Backpack has a pending PR

@JustinRipley
JustinRipley force-pushed the elrs-handset-time-sync branch from 5f0da0b to 6964eb9 Compare August 14, 2026 04:55
@pfeerick

Copy link
Copy Markdown
Member

For betaflight that would only be the GPS PR, wouldn't it... i.e. allowing the GPS on the craft to be the source of the time, if it has one? i.e. betaflight/betaflight#15167 As otherwise I would have thought it would really only be the ELRS TX and backpack PRs that are related to this.

@philmoz

philmoz commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

All of the new code should be conditional on RTCLOCK being defined.

@JustinRipley

Copy link
Copy Markdown
Author

Yes, betaflight/betaflight#15167 is the Betaflight part of this. I was working on syncing GPS time to the HDZero goggles in this case, but it should allow for GPS time to sync to any device with backpack. The radio can already be updated with GPS time if you're on ELRS 4.0.0+, Betaflight 2026.6.1, and EdgeTX 2.12.1. This is simply extending the RTC sync to downstream devices over backpack. Although yes, this should work without the GPS time, as it would simply sync the radio's RTC time. In my case, the radio RTC battery is dead though, so GPS is required for accurate time.

I will also amend the PR to have the code be conditional on RTCLOCK being defined.

@CapnBry

CapnBry commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

We're a hard NO on this by the way, @pfeerick . ExpressLRS will not accept the changes needed to make this happen, so you're just wasting EdgeTX dev time. Let's take it back to the ELRS PR.

@JustinRipley

JustinRipley commented Aug 18, 2026

Copy link
Copy Markdown
Author

I'll fix the ELRS code. I saw the comment you made on the ELRS PR #3701

@pfeerick

Copy link
Copy Markdown
Member

We're a hard NO on this by the way, @pfeerick . ExpressLRS will not accept the changes needed to make this happen, so you're just wasting EdgeTX dev time. Let's take it back to the ELRS PR.

No problem for me... not spending any time on it until the upstream changes are approved...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement ✨ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants