Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rx Specific lua params #1362

Merged
merged 23 commits into from Feb 28, 2022
Merged

Rx Specific lua params #1362

merged 23 commits into from Feb 28, 2022

Conversation

StonedDawg
Copy link
Member

@StonedDawg StonedDawg commented Jan 27, 2022

add ability to change some RX specific parameters, such as Antenna diversity capable RX doesn't have to rebuild firmware to activate or deactivate Diversity mode.

edit :
this PR now adds these parameter to each RX :

  1. antenna Mode (for diversity RX only) : antenna B, antenna A, diversity
  2. enable selected RX wifi (while the one in wifi connectivity > enable RX wifi, is a broadcast command to all rx that are powered on)
  3. telemetry power to rx that has a PA
  4. firmware version and hash

@StonedDawg StonedDawg marked this pull request as draft January 27, 2022 10:51
@StonedDawg StonedDawg force-pushed the rx_lua_param branch 2 times, most recently from 59c5d97 to de63704 Compare February 2, 2022 00:22
@pkendall64
Copy link
Collaborator

Do you think we can change the POWER_MIN/MAX to an array like the TX module. I know that some RX's have 4 values that can be "configured". And have a default power setting as well.

@StonedDawg
Copy link
Member Author

@pkendall64 well, our initial discussion was just about "low power" and "standard" for RXes option, but yeah now I see some RXes has 4 calibrated value already... i'll get on that once I figured out why my config.commit crashes it :(

@CapnBry
Copy link
Member

CapnBry commented Feb 2, 2022

I'm all for Lua params for the RX, but you 100% need to not copy paste code from the TX to make new code out of it. All the Lua functions you've copied we'll now have in two places. Every line of code that's identical or serves the same function needs to be common to both code bases, not copy pasted and possibly modified.

I also have a ton of other config changes pending a config version change so I'd like the config storage to be separate so we can get them all at once. We can make the config PR first then you can apply the Lua on top of that once the storage is in place.
https://github.com/orgs/ExpressLRS/projects/2

@StonedDawg StonedDawg force-pushed the rx_lua_param branch 3 times, most recently from 466c17e to 039865a Compare February 4, 2022 04:29
src/src/rx_main.cpp Outdated Show resolved Hide resolved
src/lib/POWERMGNT/POWERMGNT.h Show resolved Hide resolved
@StonedDawg StonedDawg marked this pull request as ready for review February 4, 2022 07:23
@StonedDawg
Copy link
Member Author

@CapnBry I think this is ready, i'm good with this now or wait for your upcoming config changes

src/src/rx_main.cpp Outdated Show resolved Hide resolved
@StonedDawg StonedDawg force-pushed the rx_lua_param branch 2 times, most recently from c8dbac8 to 100697c Compare February 15, 2022 13:14
@pkendall64
Copy link
Collaborator

I added a commit that make the commit section a lot cleaner and doesn't require changes to the radio driver code.
So I reverted those parts and fixed it.

@StonedDawg
Copy link
Member Author

cool! thanks @pkendall64 !

Copy link
Member

@JyeSmith JyeSmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with EP and Zorro.

When starting rx wifi lua will lock up. This is probably because the rx is no longer responsive. Can we force a lua refresh back to the device menu?

@pkendall64
Copy link
Collaborator

pkendall64 commented Feb 27, 2022

Tested with EP and Zorro.

When starting rx wifi lua will lock up. This is probably because the rx is no longer responsive. Can we force a lua refresh back to the device menu?

I ran into this with the "Loan Model" code I'm working on. I think whats happening is the command is sent to the RX, but the LUA then goes into polling mode and the packets can't be delivered to the MSP sender is stuck. Probably the best solution is for the TX to reset the MSP sender on disconnect.

Edit: I think the best solution is for the RX to wait for poll message (which sets the status back to idle) and introduces a 1/2 second deferred execution of the action. Doing this will allow the status message to be returned via the radio to the TX module so it can stop it's polling/waiting.

ugly code base but working

fix conflict

cleanup before it gets messy
clean up

more cleanup

more cleanup

enlarge packet size
@AaryanL
Copy link

AaryanL commented Apr 23, 2022

Hi!
Is that already working?

telemetry power to rx

Can't see any rx settings in current FW

@StonedDawg
Copy link
Member Author

@RM-FPV it's in master branch already.

@AaryanL
Copy link

AaryanL commented Apr 23, 2022

Is it in V2.4.0 ?
I couldn't see it was mentioned in any release.

@StonedDawg
Copy link
Member Author

@RM-FPV if you don't know how to flash master branch, it would be better to stick with the released version (or jump to discord and we can help you if you really want to use master). anyway this will be available in 3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants