Handling of COMMAND-parameters: what to do if CONFIRMATION_NEEDED of the device does not come through?

Open
#16 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Active
Tech stack
lua
Domain
embedded-iot

Research direction

No files or tests are named; start with the COMMAND-parameter state machine on the unified-lua-lsp branch and trace statuses 0x01, 0x03, 0x04, 0x05, and 0x06. Compare the Lua behavior with the CRSF queue and the provided radio traces. Done means the expected poll behavior is established and the Lua handles a missing confirmation without incorrectly treating the device as ready.

Written by the indexing model from the issue text.

Description

This refers to the new unified-lua-lsp branch!

There are problems with teh state-machine of COMMAND-parameters.

The LUA starts the command sending a parameter write (0x2d) and status 0x01.

The devices answers with confirmation_needed (0x03).

Now sometimes (mostly on b&w radio) the LUA shows the dialog with the info-text and sends (status 0x04) if confirmed or (status 0x05) if canceled.

But sometimes and mostly on colorLCD (TX16SMK3) it sends out a poll (0x06) although no timeout set (timeout = 0x00) for the command-parameter

This looks to me as if the answer (0x03) is lost (maybe ota or overwritten in the EdgeTx crsf-queue) and the LUA uses some small timeout and starts polling.
It polls then two times and the device responds allways with (ready 0x00), since this is unexpected.

Image Image

So, is this the expected behaviour?

How should the device respond to the poll (0x06) if it expects a confirm (0x04) or a cancel (0x05)?
Should it again send a confirmation_needed (0x03)?

Edit: I don't think the confirmation_needed(0x03) is lost ota since it works with TBS Agent. Therefore the reason might be that the answer gets lost for the LUA due to too fast / too slow script loop?

Dominant language
Lua
Stars
13
Forks
6
Avg merge
2d 21h
Merged PRs (30d)
10

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ExpressLRS/Lua

All issues in ExpressLRS/Lua

Similar issues

More Lua issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.