Repository navigation
Add MSP functions to get/set binding information - #3554
Conversation
|
Oh Lorde help me, there's no saving ourselves from the layout of this project! 😭 |
|
Tested with
|
pkendall64
left a comment
There was a problem hiding this comment.
OMG this is going to cause me a few issues down the line with my LR2021 and Arduino3 PRs!
Still, that's a me problem I guess 😭
|
Thanks PK. Let me know if you'd like me to help with getting this over to your branch. There's not many changes at the radio level, with this happening mostly in handset / routing, and the UID members shouldn't be in radio either, but I do understand the wincing. Hope it won't be too much trouble. This was such an easy PR until I went back and tried to merge the RX and TX code. 😣 I've switched them and merged the get/set into one ID for simplicity. I was using the old standard MSP names since we had precedent of using it for the "set MODEL_ID" function over MSP
Does this naming meet your approval? I'm open to anything but the number (45) has to stay the same since I am using the set model_id message we created back in 2.0 or whenever. EDIT: Updated the lua script in the OP with the updated MSP IDs |
It's the other PRs that are there now that may be affected, but it shouldn't be too bad.
Looks good 👍 |
pkendall64
left a comment
There was a problem hiding this comment.
Looks good now, thanks
mha1
left a comment
There was a problem hiding this comment.
Phew, quite the refactor to get this in. Tested on Nomad and SuperP. Not only works as expected but even connects, reconnect,, arms, disarms as it should.
|
Even though this is approved, I'll wait until @pkendall64 merges his 3 part refactors and then I can make sure all the shuffling things around is still good. |
Fixes the joystick which broke in #3554
|
This is something I needed so much! Can you please make a simpler lua script that just sets a preset bindphrase to the receiver? |
|
@poweredjj a Lua for the MSP bind phrase you mean?
|
|
OzDruiD is correct, you can not set a bindphrase using this method to a receiver that is not connected because there's no way to send complex data to a receiver that isn't bound. You're in luck though, we do have a way to set the bindphrase on a receiver that isn't bound: you put the receiver into bind mode, then hit Bind on the TX, which sends the bindphrase to an ubound RX! 🙂 |
When I'm flying with another pilot we often switch between our fpv drones (having the same rates, modes, switches, etc.). So, the setup would look like this: Each lua script would have a different bindphrase hardcoded, so that one pilot could "pass" his currently bound drone to the other. |
|
@poweredjj if you use the latest full unfiied lua scripts and then use the bind_phrase.zip lua - it keeps up 5 previous bind phrases. I used it on saturday and sunday to swtich back and forth between my radios bind phrase and my modify my friends craft. It works great this way, yes its not hardcoded and needs some cosmetic lvgl tuneup - but i think the focus on a community wide tool that can do exactly what you want is great. Next message I will upload a picture of my actual transmitter screen with example Bindphrases as favourties. So - bascially, you and your firend, so both have this setup, both have each others bind pharse in the fav list (plus 3 others if yuou like), then its just 2 clicks - choose each others bindphrase from the list - click "set" as the default it sets your transmitter. OR if its a (bound) RX .. 3 clicks- change drown down to receiver, click the new bind phrase, click Set |
|
Ummm
I dont think LVGL which is used in this is supported yet on B&W radios I am afraid. |
I mean, I need a really simple script in which I can manually put my bindphrase. One for each pilot and that's it. I don't really need any interface to begin with... |




Extends support for our own
MSP_ELRS_RXTX_CONFIG(formerly namedMSP_SET_RX_CONFIG) MSP messages to support get/set the UID and set the UID by binding phrase. This allows lua scripts or engineering QA to programmatically set / clear the binding information without going through the binding process. Both receiver and transmitter support this message, and setting it to blank will clear binding info.To reviewers: Sorry about all the code reorg 🙂↕️ I spent an hour writing this and then 3 days trying to make the dependencies not be circular. Details below.
Limitation
The MSP message has to fit in one packet so bind phrases need to be less than 52 characters.
Lua test
elrs-phrase.zip
A little EdgeTX lvgl demo tool script for being able to test this function. I would unalive myself if I had to enter my bind phrase on a B&W screen, but the function works on B&W radios too if someone wants to manage their bind phrase with a scroll wheel like they just got the high score on Space Invaders.
Set which device you want to change the phrase on, hit Set. You can also get the current UID with the Refresh button.
Code reorg
We have a bit of a problem with how much our libraries depend on each other and the main codebase, which is sort of the opposite of how libraries work. I got into a circular dependency where this new code (shared between RX and TX) relied on config-> OTA -> Handset -> CrsfProtocol -> back to this code, all of which tried to bring in common and device. I've moved some things from common.cpp and Handset into OTA, which allows OTA to be a true library, only needing FIFO and CRC, both of which are also true libraries. This broke the loop and I think these are all OTA things anyway?