What's new
Aloft Forums

Welcome to Aloft Forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Luac "Script Syntax Error - Not Enough Memory":

yardsail

New User
I'm running into a memory issue that prevents me from running a Luac script more than once without cycling the transmitter (Taranis X7S) power to clear the memory.

The script is for adjusting the settings of the Brain 2 (from MSH electronics) helicopter flight controller from the transmitter. It is downloaded from the MSH Electronics website:

The first time the script is run, everything works fine. But if I exit the script and then try to run it again, it gives the error "Script Syntax Error - Not Enough Memory."
I've checked the memory and it does actually show full after running the script.
Memory before running script: 78504b
Memory after running script: 16b

Cycling the transmitter power does seem to clear the memory and then the script can be run again.

I've already contacted the FrSky service center about this. Their only advice so far has been to update the SD card contents to match the OpenTX version (2.3.11), which it already is (https://downloads.open-tx.org/2.3/release/sdcard/opentx-x7/sdcard-128x64-2.3V0035.zip).

I also contacted MSH Electronics about the issue. They said that the script has been verified with an earlier version of OpenTX. According to the ReadMe, it was tested with OpenTX version 2.2.4.

Is there some way to manually clear the memory, other than cycling the transmitter power?

Thanks!
 
You may have a corrupted SD card. This can occur if you do not eject the SD card after being connected to a computer or if you remove it from your radio while its powered on. Move the card to a windows machine, window may be able to repair the registry..

Update OTX to version 2.3.11 may also help. 2.;2.4 is pretty old.
 
Well I did just do the error checking of the SD card in windows, it said "Windows successfully scanned the drive. No errors were found."

By the way, I am running OpenTX version 2.3.11. MSH Electronics said they tested the script with version 2.2.4.
 
FYI just saw this over on another forum which explains that the issue I am having is due to a bug in the OpenTX LUA interpreter (I'm now running 2.3.14).
It is written by BrainDev of MSH electronics, the developer of the script:

"In order to keep costs down, the RAM size in the first FrSky transmitters (EG Taranis Q7) was very small and LUA apps had to be very small in order to be loaded in the remaining available free RAM not used by OpenTX OS and consequently could have very little code and text strings had to be shortened as much as possible. In addition, it was necessary that the apps had already been precompiled using an emulator (LUAC) to further reduce the amount of RAM occupied during loading. In the later and more expensive transmitters (EG: Horus) fortunately FrSky started to increase the size of the available RAM.

In addition the LUA interpreter of OpenTX has always had a small bug whereby when closing a LUA app it does not completely free the RAM variables leaving some occupied. This means that with apps that are "at the limit" in size, at the second execution they do not work because the free RAM space is reduced compared to the first execution (after power on and initialization)."


This is exactly what I am seeing. On the first execution the script works fine, but on the second execution it fails to run and give the "Not Enough Memory" error described in the first post.
The script can still be made to work, it is just a small annoyance to have to cycle the transmitter power if you want to run it more than once during a flying session.
 
Back
Top