-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
LUAC is not read by edge tx #5230
Comments
I'm not entirely convinced this is a bug but is "by design". Luac was directly
runnable for standalone Lua tools due to memory constraints (primarily b&w
radios). This isn't the case for radios that support widgets. So was never
made possible, to strongly encourage you to ship the source for the widget,
not just the compiled bytecode.
…On Sun, 30 June 2024, 6:26 am i3dm, ***@***.***> wrote:
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
my LUA runs fine and creates a LUAC. if i remove the LUA and leave only
the LUAC, the widget does not appear in the select widget menu at all.
seems LUAC is not read by TX fw.
Expected Behavior
LUAC should run just like LUA.
Steps To Reproduce
1. grab my widget:
https://github.com/i3dm/Zavionix/tree/main/OpenTX-EdgeTX%20Widgets
2. load to edgetx radio or sim.
3. run the widget, LUAC is created.
4. remove LUA file. restart tx.
5. widget is no longer seen and can not be selected.
tested and reproducible on the simulator.
Version
2.10.1
Transmitter
RadioMaster TX16S / TX16SMK2, Other (Please specify below)
Operating System (OS)
*No response*
OS Version
*No response*
Anything else?
tested and reproducible on the simulator.
—
Reply to this email directly, view it on GitHub
<#5230>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJ66KI6747TNDGA225632TZJ4J7LAVCNFSM6AAAAABKDOZFBCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM4DCOJUHA4TKMQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
This was implemented way back from OTX days. Any reason why it shouldn't be implemented in ETX? Any dev can choose whether to post his Lua or Luac. |
True, but that is against the spirit of open source. And any Lua dev should know that a launcher stub should be able to work around this without any trouble if they really insist on not releasing the source. |
@pfeerick not relevant argument. Byte code (luac) has smaller footprint and it's faster. Then there was always source code folder with readable luac files to meet what you call "open source spirit". Luadoc says that if you use loadScript() with 'Tx' argument, it should check for both .lua and .luac and choose .luac if existing. This is true only if both types are on SD alongide. If you remove .lua EdgeTX throws error still looking for .lua This is definetely bug not conected to "spirit" and should be fixed. :) |
I agree. |
You are just repeating what I said above. Did you only read the last reply? Also not relevant since this is about color lcd, not B&W.
This is a logical fallacy - how exactly is the firmware supposed to magically know you distributed the source separately (if at all)?
Did you have to do something special to make it work with TBS Agent Lite widget mode then? As that appears to be doing exactly what you say isn't working there... using a If it does not actually work somehow in accordance with the docs, then yes, that is a bug, which should be raised separately. btw, it's been two weeks since I pinged you about #5181 Still waiting. ;) |
It is logical fallacy indeed @pfeerick
You bet I did. :) To recap
@i3dm
You can also specify full name for loading ommiting loadScript mode ie.
Sorry missed this ping, comenting now. |
How is that a workaround? If Lua is still needed to run? |
*.lua is needed only as /WIDGETS/MY_WIDGET/main.lua rest of loaded scrtipts are *.lua or *.luac whatever you decide in your LUA code. |
Not sure I understand how that works. You add another Lua with one line to allow read Luac? Can you share an example? |
|
just tried this and main.lua is not being read by Edgetx, i can not find it in the widgets list. any idea why? |
|
130ms: f_stat(C:/Users/USER/Documents/EdgeTX/WIDGETS/Test/main.luac) = OK this occurs many times and then... 570ms: f_stat(C:/Users/USER/Documents/EdgeTX/WIDGETS/Test/main.luac) = OK |
|
that will force code.lua to be compiled then point 2 for bigger projects with many folders and lua files I have separate Lua Compiler thar traverse through project folder tree compile every *.lua found into *.luac then deletes *.lua |
I know it's cumbersome for Lua dev but that's because implementation if loadScript API function is not considering *.luac as valid Lua chunk.
That is why I'm not allowing loadScript to automate this proces but I'm compiling files to *.luac then I'm using
BTW last parenthesis mean that you want to execute what's inside code.lua as loaded chunk is treated as function |
last but not least That means below code is valid as long as loaded files are valid Lua chunks (text or compiled)
In project implementation you can use somehing like
Function will only look for files with *.luac extension and prevent compilation. |
this might not be a viable solution for my issue. could this even be done? |
You haven't understood.
Choose solution which best suits your project's needs. |
OK. how do i compile code.lua (which will have the content of my existing mian.lua widget file) ? |
For me best solution is to have another script (compiler) that will just compile files I need to be compiled with |
for some reason i cant seem to cause my lua to compile while your code lua does compile. https://github.com/i3dm/Zavionix/tree/main/OpenTX-EdgeTX%20Widgets |
Starting holiday soon so my calendar is packed. I may have some free slot to have look on holiday but do not promise. |
@JimB40 thank you for your help i managed to get it to work. |
Is there an existing issue for this problem?
What part of EdgeTX is the focus of this bug?
Transmitter firmware
Current Behavior
my LUA runs fine and creates a LUAC. if i remove the LUA and leave only the LUAC, the widget does not appear in the select widget menu at all.
seems LUAC is not read by TX fw.
Expected Behavior
LUAC should run just like LUA.
Steps To Reproduce
tested and reproducible on the simulator.
Version
2.10.1
Transmitter
RadioMaster TX16S / TX16SMK2, Other (Please specify below)
Operating System (OS)
No response
OS Version
No response
Anything else?
tested and reproducible on the simulator.
The text was updated successfully, but these errors were encountered: