olliw42 / mLRS

2.4 GHz & 915/868 MHz & 433 MHz/70 cm LoRa based telemetry and radio link for remote controlled vehicles
GNU General Public License v3.0
295 stars 67 forks source link

add lua supports B/W screen,5 fixed parameters #83

Closed seanwang338 closed 1 year ago

seanwang338 commented 1 year ago

add lua for small B/W screen radio. Only save five fixed parameters infomation to avoid out of memory. They are BindPhrase/Mode/TxPwr/RxPwr/RxOutMode

olliw42 commented 1 year ago

@jasonwang01 this is absolutely outstanding. awesome.

I'm on vaccation currently and can't really look at it, but few comments come to mind

just nitpicking :)

maybe you could post your script in the rcgroups and/or discord threads, to seek testers. I recall some users indicated they could test.

again, great work!

seanwang338 commented 1 year ago

i don't know how to optimize lua to avoid the out of memory, it's hard to do :( so just ignore storing many parameters except those five. even can't add a bootloader option because radio throw out not enough memory it's a temporary solution, is better to post in the rcgroups/discord instead merge in github, sorry i hurriedly share it :) i'm reading elrs lua for get some ideas, maybe need reduce the parameter storing by multipart load. for example, read main list/tx list/rx list when entering their page

have a wonderful vacation

olliw42 commented 1 year ago

@jasonwang01 don't appologize it is fantastic that you make his effort, and that you share your result here !! Even if you may not yet find it perfect, it will give ideas and trigger further work. It is just great to see.

For that reason I also reopen this PR, so that it doesn't disappear and stays on top for us to discuss.

Probably one indeed needs what you suggested elsewhere, namely this param_by_index function. I will see if I can add it next week, so to not block the bw efforts.

Are you running this on EdgeTx, or OpenTx?

olliw42 commented 1 year ago

@jasonwang01 there is a positive report on your script by VRqualer here: https://www.rcgroups.com/forums/showpost.php?p=51056625&postcount=1732

olliw42 commented 1 year ago

@jasonwang01 I have added support for calling a parameter by index (as you've suggested here https://github.com/olliw42/mLRS/issues/74#issuecomment-1556623859). In the latest commit you also find an example lua script where this mechanism is used instead of the RequestList approach. It shoudl help you to realize how the byIndex mechanism is used.

hopefully this helps you to get better along with a bw script

note: the code can be much simplified, in the example code I tried to do just minor changes, I uesd it to test/confirm that the new mechanism is working note 2: a simplification is alos possible by stripping out all this mbridge stuff, on bw radios only crsf is a viable option. This may also save few bytes.