@Thomas
I grabbed terminal output from the radio. Spirit script does not generate a lot of output, but when it works, then every screen (on enter) generates "Event received" (when entering the screen) and "dis" (when it read data).
However when it fails to read data, it does not print "dis". Example output I got:
Code:
dis
Event received: 0 97 0 0 35
dis
Event received: 0 97 0 0 35
Event received: 0 97 0 0 35
Event received: 0 97 0 0 35
Event received: 0 97 0 0 35
Event received: 0 97 0 0 35
Event received: 0 97 0 0 35
Event received: 0 97 0 0 35
Event received: 0 97 0 0 35
Here it went fine with one screen, but then it failed to read data. And further going around screens will always fail. And in such case it always fails to set FBL to "LED steady state".
I also looked at LUA API calls script is invoking at runtime (I hope you don't mind this bit of "reverse engineering"). Observations are:
- Sometimes LuaSensor:getParameter returns nil. I assume this is because of lost frame, either when requesting data from telemetry, or getting it back. This results in some parameter value missing and text box being "greyed out"
- Sometimes scripts falls into infinite loop of trying to get parameter. it is calling `getParameter` all the time, always receiving `nil`. In such case it fails to read any other data, for any screen, and fails to set FBL to "steady" state on exit. I can go around screens and UI works, but is not transferred anymore.
- I didn't check deeply, but on first look it seems, that this "infinite loop" starts, if script fails to read the first parameter on each screen, which is requestParameter(138).
I don't paste detailed outputs here as I'm not sure if it is fine. The script is precompiled for some reason, so I suspect you don't want to share its details maybe.
But to me it seems that frame loss is always going to happen, and script has to accomodate for this.
I could not find any detailed information about this LUA API of `requestParameter`, `getParameter`, `writeParameter`, but I assume they do not have any built in retry protocol.
I hope this helps and sorry for reverse engineering if this is any problem.