Hello everyone,
I’ve been using lua scripts for ages, without any problems, but lately, I’m getting some really weird and kind of random error messages.
My lua scripts are in the @ROMFS/scripts/ directory, so I’m building the scripts into the firmware. Everything works fine in SITL, but as soon as I try to upload them to my CubeOrangePlus, sometimes I get random errors. Sometimes they are referring to syntax errors in specific lines (like “204: syntax error near ‘local’” - but there is no “local” keyword anywhere near that line), sometimes they are showing syntax errors in a couple of different scripts, then after a reboot the error changes, but is still weird, because it references errors like functions are not closed, or that the script has more than 100 local variables, which is not possible, since there are way less variables in that script.
It looks almost as the scripts get “merged” into each other, or they cut out in the middle of the script (that would explain why some functions are missing the “end” keyword, although it is clearly in the script - and again, it works in SITL).
I’m out of things to debug. What could cause things like these? Could it be file encoding? Line endings? Weird hidden characters? I tried to rule out these, but maybe someone had a similar issue.
Thanks in advance!