Page 1 of 1

Lua variable errors

Posted: Sat Feb 15, 2014 2:31 am
by redparchel
I'm running into something that I'm unsure if it's a known limitation of this implementation of lua, my set up, or me just doing it wrong. When trying to use variables in the lua scripting my code fails to upload to the RCP correctly. I see that using vars should be possible as they're used on the latest Facebook posts about the shift light, but I know it's completely possible they're using a sweet new unreleased/undocumented firmware. some examples of my attempts:

Code: Select all

function onTick()
  varA=0
end
I write this to the RCP, reboot the RCP and and read it again from the RCP and RA shows this:
"function onTick()
varA
This also happens when trying to set a variable to the output of a function:

Code: Select all

function onTick()
  varB = getGpsSpeed()
end
becomes:
"function onTick()
varB
RCP firmware 1.2.6
RA v1.1.14
Windows XP (it's the only windows box I have)


Sidenote: is there a method of logging output somewhere from lua, like a println to the logs for trouble shooting (i saw this mentioned on the forums as an idea but not if it had made it in as a feature)

thanks!

Posted: Mon Feb 17, 2014 1:47 am
by rdoherty
Hey redparchel, this looks like a bug in RaceAnalyzer. Not sure why it's clobbering your Lua script. I'll look into it more.

Posted: Mon Feb 17, 2014 1:49 am
by brentp
Hi, redparchel - we're working on that very problem. Thanks for your patience and hang tight for an update!

Posted: Mon Feb 17, 2014 6:15 pm
by redparchel
Most excellent! Thanks for looking into this.

Posted: Mon Apr 07, 2014 10:42 pm
by brentp
Be sure to get v1.2.8 firmware and the latest version of RCP - we've made many improvements around this area.

Posted: Tue May 06, 2014 2:07 am
by mattlqx
Running 1.2.8 and 1.1.15, still can't get it to write properly. If anything is in the onTick() function, the write "fails" at 96%. The read back results in a truncation of what I tried to write and a random string of garbage. If I have a blank onTick(), then write completes 100% okay.

Posted: Sun Jun 08, 2014 11:34 pm
by brentp
Hi mattlqx,

We've identified the problem you're seeing in the 1.2.8 firmware and we have a preliminary fix in the V2 beta firmware, where we've fixed the lua script read/write routine.

Stay tuned for that release coming up in a few days - thanks for your patience!

-Brent