RegisterSearchFAQMemberlistUsergroupsLog in
Reply to topic Page 1 of 1
resetConfig: Flashing Default Script: FAILED
Author Message
Reply with quote
Post resetConfig: Flashing Default Script: FAILED 
This is more of a bug report than a question expecting an answer.

After several iterations of modifying lua scripts I will eventually get the following error:

lua: Failed to allocate memory for script buffer.

When this error pops up the RCP gets very unstable and has to be hard-reset. Usually I would expect this error would happen with a lua script that is too long. However, even with lua scripts that I *know* have worked before and also tried examples from the wiki.

So, naturally, I went to do a resetConfig over the TTY (which usually fixes any bad state with RCP). And I get the following error when doing resetConfig:

Code:
0 [email protected] ~$ sudo miniterm.py /dev/ttyACM0 115200
--- Miniterm on /dev/ttyACM0  115200,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---



=============================================
Welcome to RaceCapture/Pro MK3 version 2.12.0
=============================================

Available Commands:

resetConfig   : Resets All configuration Data to factory default Usage: resetConfig
testSD        : Test Write to SD card. Usage: testSD <lineWrites> <periodicFlush> <quietMode>
startTerminal : Starts a debugging terminal session on the specified port. Usage: startTerminal <port> <baud> [echo 1|0]
setLogLevel   : Sets the log level Usage: setLogLevel <level>
logGpsData    : Enables logging of raw GPS data from the GPS Mouse Usage: logGpsData <1|0>
viewLog       : Prints out logging messages to the terminal as they happen Usage: viewLog
setSerialLog  : Enables/disables logging of  serial device for debug purposes Usage: setSerialLog <port> <0|1>
flashConfig   : Flashes the NVRAM with the current configuration of the LoggerConfig Usage: flashConfig
showTasks     : Show status of running tasks Usage: showTasks
version       : Gets the version numbers Usage: version
showStats     : Info on system statistics. Usage: showStats
sysReset      : Reset the system Usage: sysReset [bootloader 0|1]
lua           : Enter the lua script interpreter. Usage: lua
reloadScript  : Reloads the current script. Usage: reloadScript
RaceCapture/Pro MK3 > resetConfig

Flashing Default Logger Config: PASS
Flashing Default Script: FAILED       <<<<< UH OH?!?
Flashing Default Tracks: PASS


I try this several times with the same result. And the lua script persists.

Now when I go in through the RCP App interface and delete the script, then do a resetConfig it works.

I guess my ultimate question is now that the interface supports CAN Mapping, is there any reason to be using the E46 Lua script on the wiki? Is the built-in CAN mapping feature going to be more stable than the lua script method?

[/code]

View user's profile Send private message
Reply with quote
Post  
Hi,

The built-in CAN mapping is designed to be the primary CAN mapping tool for RaceCapture/Pro /Apex - and the Lua scripting is still there to cover the unusual mapping scenarios that the direct CAN mapping cannot handle. A combination of both can be used.

Both approaches are described here: https://wiki.autosportlabs.com/CAN_Bus_Integration

The Lua scripting runtime is designed in such a way to prevent compromising system stability when it runs out of memory. Do you have an example of a script that reproduces this problem? We'd like to characterize the issue if possible.

Thanks!


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
Brent
I found the original post by eacmen.
This is exactly the same problem I have.
Once you hit the limit it becomes unstable and difficult to recover, even with small scripts you get the "lua: Failed to allocate memory for script buffer."

View user's profile Send private message
Reply with quote
Post  
Right. This is a side effect of increasing the memory limit by 20% in the 2.13.0 firmware. This problem does not happen in the 2.12.x firmware.

We will work to make it easier to recover from this in an upcoming firmware. In the meantime, take extra care to not hit the memory limit.

Thanks,


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
OK. I will be counting bytes next time.

In the meantime, can you tell me how to reset that memory?

I can't load even shorter scripts that worked before.

View user's profile Send private message
Reply with quote
Post  
Try temporarily downgrading to 2.12.0 firmware to see if you can reset the configuration.

View user's profile Send private message Send e-mail
Reply with quote
Post  
This is what I did and it worked:

saved configuration not to loose analog sensors.
Downgraded to 2.12.0
flashed an empty script
resetConfig (via Putty)

upgraded to 2.13.5
The scripts worked again.

Not sure which of the steps really erased the configuration, but it is working again.

View user's profile Send private message
Reply with quote
Post  
Thanks for the update. We'll work to get flashing of the default script working reliably with 2.13.6 or 2.14.0.


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
Was this issue addressed in the new beta version?
Should I try the longer script or not yet?
I don't want to block it again, it is realy hard to recuperate.

View user's profile Send private message
Reply with quote
Post  
No, the beta version strictly has the long-promised feature of enabling pit-to car alerts. We'll address this in the production non-beta release.

Thanks!


_________________
Brent Picasso
Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum