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
4 of 4 related issues to LUA io library #3003
Comments
Can you post the whole Lua script as an example that demonstrates all three issues you have: opening file, writing to it and closing. Tnx. |
Confirmed, the problem is that Lua in this case uses f_printf() with format string ".14g" which is not supported by ff.c. |
So it's ready for me to test? How do I download this version you fixed? Sorry, I'm new to Github, and never built this project. Can you make it easy for me? |
The fixes are not yet in main branch, so they are not available in nightly builds. I can prepare a custom build for you, but for that I need to know which radio you have: Taranis, Taranis Plus or X9E? And which language? |
T Plus. English. Thanks! |
Here is your bin file: http://downloads-21.open-tx.org/test/opentx-taranisplus-lua-en-2.1.5-io.bin Here is a version with Here is my small standalone script (execute from the SD browser): local function run(event)
print("c1")
local f = io.open("foo.bar", "a")
io.write(f, "first line\r\nsecond line\r\n")
io.write(f, 4, "\r\n", 35.6778, "\r\n") -- one can write multiple items at the same time
local foo = -4.45
io.write(f, foo, "\r\n")
io.close(f)
return 1 -- this will end the script execution
end
return { run=run } Remember that you are working with unofficial OpenTX release, so use it with caution preferably not with any expensive model. Also make a backup of your EEPROM before flashing (just in case something goes wrong). The Lua io library is somewhat different from the official version, you can find preliminary docs here: opentx/lua-reference-guide#3 Report back on your findings. |
io.write(fh,"any string") is OK
io.write(fh,stringvarname) is OK
io.write(fh,numvarname) writes .14g to the file
io.write(fh,2) writes .14g
io.write(fh,2.2) writes .14g
This is only on Taranis. All good on PC sim. That's how I know my syntax is correct?
The text was updated successfully, but these errors were encountered: