feat: send handset RTC to ELRS modules - #7645
Conversation
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? |
|
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 |
5f0da0b to
6964eb9
Compare
|
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. |
|
All of the new code should be conditional on RTCLOCK being defined. |
|
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. |
|
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. |
|
I'll fix the ELRS code. I saw the comment you made on the ELRS PR #3701 |
No problem for me... not spending any time on it until the upstream changes are approved... |
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_WRITEframe 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 oncrossfireInit/crossfireDeInit.Both CRCs are
crc8poly0xD5: 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_IDandELRS_HANDSET_TIME_IDare removed, neither had any other user.lastTimeSync[]are removed, leaving a single send per module init.Related PRs
0x14video receiver address and relays the MSP message to the backpack. This is the counterpart to this PR and supersedes Send handset time to the TX backpack to set its RTC ExpressLRS/ExpressLRS#3701, against which the original revision of this PR was written.