telemetry lua script running to often

openTx has introduced a range of new features, ideas and bling. It is fast becoming the firmware of choice for many users. openTx will run on ALL current hardware platforms, including the gruvin9x and sky9x boards. Work has already started to support the new FrSky X9D radio!
Post Reply
User avatar
nicholgd
Posts: 70
Joined: Tue Sep 03, 2013 4:29 pm
Country: -
Location: Herefordshire

telemetry lua script running to often

Post by nicholgd »

Hi,
I have written a lua script that displays the models GPS location and also writes the last valid location to a text file. This is so that the location can be read in the field in the case of a lost model and entered into a smart phone geolocator app. This is particularly valid for slope soaring where the slope can be vast and the bracken 6ft high. With no pen usually available the data will be lost if the TX is turned off or model changed . I know the data could be available in the log files but the lua does not easily allow reading from the end of a possibly large csv file.
I can display the gps data on a telemetry screen and save the gps location to a txt file. BUT as I am running the script as a telemtry script so that the txt file is continualy up dated. The problem is that the tx is spending so much time writing to the text file the response of the user tx interface is really slowed down and sluggish.
Is there anyway to get the script called less often?
Last edited by nicholgd on Fri Mar 29, 2019 4:48 pm, edited 1 time in total.
Geoff N

User avatar
Kilrah
Posts: 11109
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: tlua elm script running to often

Post by Kilrah »

No, but you can/should keep track of when your script was last executed or how many times it has and return without doing anything if it's too soon/often.
User avatar
nicholgd
Posts: 70
Joined: Tue Sep 03, 2013 4:29 pm
Country: -
Location: Herefordshire

Re: telemetry lua script running to often

Post by nicholgd »

yes obvious when its pointed out to you. A check if the data has changed since last the last write and that say 1 to 2 seconds has also passed should help considerably.
Thanks for the help
Geoff N

Post Reply

Return to “openTx”