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

2.8RC1 ELRS Lua BLE Joystick stops working when long press exit #2436

Closed
1 task done
RipperGOT opened this issue Oct 1, 2022 · 7 comments · Fixed by #2573
Closed
1 task done

2.8RC1 ELRS Lua BLE Joystick stops working when long press exit #2436

RipperGOT opened this issue Oct 1, 2022 · 7 comments · Fixed by #2573
Labels
bug/regression ↩️ A new version of EdgeTX broke something color Related generally to color LCD radios

Comments

@RipperGOT
Copy link

Is there an existing issue for this problem?

  • I have searched the existing issues

What part of EdgeTX is the focus of this bug?

Transmitter firmware

Current Behavior

In 2.7 when you activate the BLE joystick you can do a long press to exit lua and it stays active. In 2.8 if you long press to exit, it stops working.
Sometimes I get this error: Script syntax error ?:0: attempt to index field '?' (to nil value)
I also see the Lua a little lazy

Expected Behavior

You could long press RTN to exit the LUA and keep it active.

Steps To Reproduce

1 Enter in ELRS LUA-BLE Joystick and activate
2 Long press RTN to exit to model screen
3 BLE stop working

Version

Other (Please specify below)

Transmitter

Radiomaster TX16S / TX16SMK2

Anything else?

IMG_20221001_155608

@RipperGOT RipperGOT added bug 🪲 Something isn't working triage Bug report awaiting review / sorting labels Oct 1, 2022
@pfeerick pfeerick changed the title 2.8RC1 BLE Joystick It stops working when you do a long press to exit. 2.8RC1 ELRS Lua BLE Joystickstops working when long press exit Oct 2, 2022
@pfeerick pfeerick changed the title 2.8RC1 ELRS Lua BLE Joystickstops working when long press exit 2.8RC1 ELRS Lua BLE Joystick stops working when long press exit Oct 2, 2022
@RipperGOT
Copy link
Author

In RC3 the ELRS lua is still lazy and the BLE joystick crashes from time to time. I also can't get out of the BLE without it disconnecting.

@pfeerick
Copy link
Member

By lazy, do you mean slow? As I've noticed that also, and it's not LVGL specific as B&W also seems sluggish at times.

@pfeerick
Copy link
Member

PK from ELRS just commented that we must be sending the EVT_VIRTUAL_EXIT event on exit (which I think we are), whereas 2.7 just killed the script. So somehow that is probably triggering the stopping of wifi/ble that would happen on a short RTN press.

@RipperGOT
Copy link
Author

Exactly, it's slow. It looks like lag.

@raphaelcoeffic
Copy link
Member

Exactly, it's slow. It looks like lag.

This is caused by the fact that we switched to LVGL, and the LUA script does a full redraw on each frame. It is faster on radios that do not require the screen buffer to be inverted in software (T18, NV14, EL18). The screen inversion (180° rotation) in software costs us around 20ms on each frame. That does add up to the rest, which makes it look slower.

@raphaelcoeffic
Copy link
Member

PK from ELRS just commented that we must be sending the EVT_VIRTUAL_EXIT event on exit (which I think we are), whereas 2.7 just killed the script. So somehow that is probably triggering the stopping of wifi/ble that would happen on a short RTN press.

This is probably caused by the fact the event still gets passed to the script while we actually kill it. I can check if there isn't some weirdness here.

@gagarinlg
Copy link
Member

Long term goal: expose the UI API to Lua in a way, that LVGL handles partialnredraws of Lua scripts

@raphaelcoeffic raphaelcoeffic added bug/regression ↩️ A new version of EdgeTX broke something color Related generally to color LCD radios and removed triage Bug report awaiting review / sorting bug 🪲 Something isn't working labels Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/regression ↩️ A new version of EdgeTX broke something color Related generally to color LCD radios
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants