edgetx icon indicating copy to clipboard operation
edgetx copied to clipboard

feat: ELRS bind command support

Open 3djc opened this issue 10 months ago • 32 comments

This PR brings support to CRSF bind and ping frames.

  • you can now easily loan model using Bind and Unbind buttons from Model Setup screen without using the ELRS LUA script. Please note that those buttons will only appears on ELRS module that run ELRS 3.4 or later

image

image

  • module version screen (under SYS//Info) now show much more info on ELRS modules

image

image

  • also add module info to radio without pxx2

Fixes #4906

3djc avatar Apr 22 '24 09:04 3djc

@3djc this will need support for color LCD as well, right?

raphaelcoeffic avatar Apr 23 '24 04:04 raphaelcoeffic

@3djc this will need support for color LCD as well, right?

@raphaelcoeffic Should be working on colorlcd

3djc avatar Apr 23 '24 05:04 3djc

Tested successfully on TX16S using RM Ranger and RM ER6, so colorlcd is fine as I said :)

I'm thinking about adding one cheerp audio feedback, as since only one frame is sent, the regular binding sound is not heard. Maybe one play of it is more in line with what a user would expect

3djc avatar Apr 23 '24 06:04 3djc

Added detection of streaming receiver, in which case bind button is turned to unbind (and frame is then sent to receiver for it to go in bind mode instead of radio module)

Added audio feedback

3djc avatar Apr 23 '24 08:04 3djc

This flippin works so good I love it (tried colorlcd and bw128x64). So easy without digging into multiple layers of lua.

Someone needs to test this on Crossfire though, because I think their bind procedure is backwards from ours? It has been several years since I've used it but I think the TX goes into bind mode continuously and then the RX completes the bind (where ours the RX is continuous and the TX completes it).

I'm not sure if their TX handles the bind command or if they only implemented the RX side too.

CapnBry avatar Apr 23 '24 14:04 CapnBry

Have more polish to add to this so th Captain doesn't get alarmed :D

3djc avatar Apr 23 '24 14:04 3djc

This flippin works so good I love it (tried colorlcd and bw128x64). So easy without digging into multiple layers of lua.

Someone needs to test this on Crossfire though, because I think their bind procedure is backwards from ours? It has been several years since I've used it but I think the TX goes into bind mode continuously and then the RX completes the bind (where ours the RX is continuous and the TX completes it).

I'm not sure if their TX handles the bind command or if they only implemented the RX side too.

This feature is now available only to ELRS modules (version >= 3.4), not Crossfire :)

3djc avatar Apr 24 '24 10:04 3djc

Tested on TX16S (colorlcd) / T14 (128x64 but no module version page) / Boxer (128x64), and my long laundry list of concerns / issues (on Discord) have been addressed by this fabulous PR. Thanks so much, what a wonderful ease-of-use feature for binding or sharing a model with a friend, something I see a lot a races.

There's the issue of the user hitting Unbind in flight, which will disconnect the receiver. This is recoverable by simply rebinding, which occurs at the 50Hz (longest range) packet rate so it should not be an issue. I can also set the module type to OFF or change the receiver number in flight so I consider this to be of roughly the same risk level: None*

CapnBry avatar Apr 24 '24 15:04 CapnBry

To avoid unbinding during flight, could also check the arming state? If armed, do not allow to unbind (if we know the module is ExpressLRS module, then at least the ExpressLRS Lua is able to fetch the state of ExpressLRS RF "armed" or not. Thus EdgeTX should be able to get this info out of the module as well. Although RF armed state might not 100% correlate to the model arming state, if on the model side further checks are done or another channel is used for arming, nevertheless this could be a step towards eliminating users not unbinding during flight).

rotorman avatar Apr 24 '24 16:04 rotorman

A lot of complications for an illusion of safety imho

3djc avatar Apr 24 '24 16:04 3djc

A lot of complications for an illusion of safety imho

We've had the possibility of enabling "Bind" on the radio for basically all modules regardless of telemetry status, without anyone complaining about it.

raphaelcoeffic avatar Apr 24 '24 17:04 raphaelcoeffic

To avoid unbinding during flight, could also check the arming state?

No new functionality will ever be tied to Armed state, as many users are unaware of "Arming" via CH5 and are using as a general purpose channel.

Also, if the user is 3 menus deep in their model settings changing the active transmitter module while flying and hits UNBIND... just press it again to re-bind. They weren't actively controlling the model anyway so all illusion of "safety" was already out the window. 😆

CapnBry avatar Apr 24 '24 17:04 CapnBry

They weren't actively controlling the model anyway so all illusion of "safety" was already out the window. 😆

You have no idea what @rotorman is doing while his aircraft is in the air 😅 Don't tempt him with such challenges!

raphaelcoeffic avatar Apr 24 '24 17:04 raphaelcoeffic

You have no idea what @rotorman is doing while his aircraft is in the air 😅 Don't tempt him with such challenges!

😂 Plus, what if he wants to bind to something else while he is already flying! He'd have to unbind while armed.

CapnBry avatar Apr 24 '24 18:04 CapnBry

Does this still say "rf signal critical / telemetry recovered" when doing a bind after an unbind? Just wondering if it should clear the state as if it were the initial connection when you do the unbind :thinking:

pfeerick avatar Apr 26 '24 07:04 pfeerick

Does this still say "rf signal critical / telemetry recovered" when doing a bind after an unbind? Just wondering if it should clear the state as if it were the initial connection when you do the unbind 🤔

I think those need to stay, as they serve as confirmation that your order was executed (or as a warning in case you did not realize unbind will ... you know... unbind)

3djc avatar Apr 26 '24 07:04 3djc

I do feel like the "telemetry recovered" should stay, because there's no other visual indicator on that screen that shows that there's a connection and it provides some feedback. The packet rate field always shows the packet rate whether something is connected or not, so I think it is helpful.

As far as the "RF Signal Critical" I think I agree that we should change that behavior on our side. It is because when the connection drops on the receiver, the LQ is forced to 0% so the LQ in the first telemetry packet reflects that. I think we can reduce that by resetting LQ to 100 when leaving bind mode, but it still could trigger on the reconnection just like any new connection. I'll put it up for a vote if it goes in as a bugfix for 3.4 though since it really isn't a bug and not really high severity.

CapnBry avatar Apr 26 '24 12:04 CapnBry

We need "something" to indicate loss of signal, not sure RF Signal critical is worse than anything else

3djc avatar Apr 26 '24 13:04 3djc

Oh for sure, 100% agree. The telemetry lost / telemetry recovered is a great indicator. The "RF Signal Critical" just doesn't need to be there, but that's because its coming from ExpressLRS and EdgeTX is doing the correct thing when we report it.

CapnBry avatar Apr 26 '24 13:04 CapnBry

Yes, it was probably more the "RF Signal Critical" that I was having issue with more than the telemetry recovered... as a "telemetry lost" on unbind, and "telemetry recovered" on bind is good audio feedback.. whereas the RF signal is not actually "critical". So if you can clear that in on ELRS at some point that would be great! :) But it is only lipstick, nothing critical in any way.

On Fri, Apr 26, 2024 at 11:46 PM Bryan Mayland @.***> wrote:

Oh for sure, 100% agree. The telemetry lost / telemetry recovered is a great indicator. The "RF Signal Critical" just doesn't need to be there, but that's because its coming from ExpressLRS and EdgeTX is doing the correct thing when we report it.

— Reply to this email directly, view it on GitHub https://github.com/EdgeTX/edgetx/pull/4907#issuecomment-2079430240, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJ66KPEPHEM5FOSABJBIK3Y7JLDDAVCNFSM6AAAAABGSOHUP6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZZGQZTAMRUGA . You are receiving this because you commented.Message ID: @.***>

pfeerick avatar Apr 27 '24 09:04 pfeerick

100% agreed

3djc avatar Apr 27 '24 09:04 3djc

Can we get some translations for this please :pray:

With ELRS, this will change to Unbind once bound: image image

#define TR_MODULE_UNBIND               BUTTON("Unbind")
  • [x] @zyren CN / TW
  • [x] @Eldenroot CZ
  • [x] @HThuren DA
  • [x] @ParkerEde / @TheIsotopes / @froqstar DE
  • [x] @Pat6874 FR
  • [x] @robustini IT
  • [x] @ToshihiroMakuuchi JP
  • [x] @ulfhedlund SE
  • [x] @ajjjjjjjj PL
  • [x] @zandorsp PT
  • [x] @kobakirill RU
  • [x] UA (thanks to Salo on Discord)

pfeerick avatar May 05 '24 04:05 pfeerick

PT #define TR_MODULE_UNBIND BUTTON("Unbind")

(There is no good translation)

zandorsp avatar May 05 '24 07:05 zandorsp

JP #define TR_MODULE_UNBIND BUTTON("バインド解除")

ToshihiroMakuuchi avatar May 05 '24 08:05 ToshihiroMakuuchi

PL

#define TR_MODULE_UNBIND BUTTON("Unbind")

(same story as with PT)

ajjjjjjjj avatar May 05 '24 09:05 ajjjjjjjj

DE #define TR_MODULE_UNBIND BUTTON("Trennen")

ParkerEde avatar May 05 '24 09:05 ParkerEde

DA #define TR_MODULE_UNBIND BUTTON("Afkobl")

HThuren avatar May 05 '24 10:05 HThuren

IT #define TR_MODULE_UNBIND BUTTON("Unbind")

(There is no good translation at the moment, I have to do more checking because in IT there are some BIND and some ASSOCIA)

robustini avatar May 05 '24 10:05 robustini

FR:

#define TR_MODULE_UNBIND BUTTON("Délier")

Le dim. 5 mai 2024 à 12:53, Marco Robustini @.***> a écrit :

IT #define TR_MODULE_UNBIND BUTTON("Unbind")

(There is no good translation at the moment)

— Reply to this email directly, view it on GitHub https://github.com/EdgeTX/edgetx/pull/4907#issuecomment-2094756184, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6HE7XL2FOZALMS44JP2MJ3ZAYFTPAVCNFSM6AAAAABGSOHUP6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJUG42TMMJYGQ . You are receiving this because you were mentioned.Message ID: @.***>

Pat6874 avatar May 05 '24 17:05 Pat6874

CZ:

#define TR_MODULE_UNBIND BUTTON("Odpárovat")

Eldenroot avatar May 05 '24 19:05 Eldenroot