Skip to content

Conversation

@CapnBry
Copy link
Member

@CapnBry CapnBry commented May 28, 2025

This makes a changes the lua's internal behavior to skip doing any crossfireTelemetryPush() when the user presses ENTER and delay the next bad/good fetch. This is to fix the issue of occasional (too frequent) times where changing a value doesn't work and the value goes back to its original value.

Issue

Way too frequently, changing a value in the lua and pressing ENTER results in the value reverting to its original value when the automatic refresh takes place. To reproduce:

  • Set packet rate to 150Hz. I believe this happens more frequently on lower packet rates but I did not analyze this.
  • Enter into the VTX Admin folder
  • Switch Channel to 1 (ENTER and let it reload)
  • Switch Channel to 2 (ENTER and let it reload)
  • Switch Channel to 3 (ENTER and let it reload)
  • ...

Eventually one of these changes will not take effect and revert to the previous value. The timing on this is the problem so it is highly variable. The frequency of failure can be increased by changing the lua to poll bad/good more frequently (change linkstatTimeout = time + 10 in refreshNext for 100ms).

Problems

After much analysis, there's two reasons this happens:

  1. The lua has already queued a bad/good query request in the same loop, the "save" command will be dropped by EdgeTX and never get to the TX module. Only one telemetry push per loop seems to work. This happens about 1 in 10 times at a 100ms poll interval.
  2. The save is pushed, but the bad/good query occurs on the next loop. Because there is no real queue on the TX side, the bad/good query overwrites the save command. This is actually insanely rare and I could only see this happen once in the hundreds of tests.

Solutions

  1. If there is an ENTER event, just skip doing any crossfireTelemetryPush that lua loop.
  2. Delay the next bad/good fetch for at least 1.2s after servicing the ENTER event.

* Skip any pushing before servicing ENTER
* Delay next bad/.good query for 1.2s after save
@pkendall64 pkendall64 merged commit 3036bc2 into ExpressLRS:3.x.x-maintenance Jun 1, 2025
48 checks passed
@CapnBry CapnBry deleted the lua-skip-push branch June 3, 2025 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants