RegisterSearchFAQMemberlistUsergroupsLog in
Reply to topic Page 1 of 1
Error writing script: An unspecified error occured, why?
Author Message
Reply with quote
Post Error writing script: An unspecified error occured, why? 
I wanted to try my staged, variable frequency shift light, but I got this error. So I figured I did something wrong writing the script since software is not my forte, so I made a very simple script.

Code:
--[[--Pin assignments
RPM is pin 20 / FreqIn channel 0
First light is pin 6 / FreqOut channel 0 / #2 on shift light - green
Second light is pin 5 / FreqOut channel 1 / #1 on shift light - yellow
Third light is pin 4 / FreqOut channel 2 / #3 on shift light - red
--]]--

setTickRate(15)

function onTick()
   setPwmDutyCycle(0, 25)
   setPwmDutyCycle(1, 50)
   setPwmDutyCycle(2, 75)
end


I think this is so simple there can't be anything wrong with it, but even with this very simple script I get this error when I try to "write" the script to the device. What am I doing wrong?

Update, when I read back the configuration, after re-starting RaceAnalyzer the script was there, so it wrote. But the sensor monitor shows FreqOut1, FreqOut2, FreqOut3 at 100%. So clearly my above script is not running. Sad

View user's profile Send private message
Reply with quote
Post  
Can you try it without the big comment block at the top?

Wait for the big MK1 firmware and app update in the next day or two; there will be a number of fixes and improvements in the Lua scripting.

It's a big deal!


_________________
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
Ok, so I tried this, and no "unspecified error":

Code:
setTickRate(15)

function onTick()
   setPwmDutyCycle(0, 25)
   setPwmDutyCycle(1, 50)
   setPwmDutyCycle(2, 75)
end


I thought the big block comment was possible based on this, but either it doesn't like it or I didn't get it right.
http://luatut.com/crash_course.html
But maybe I'm still doing something wrong because even with the above code FreqOut1, 2, 3 are 100% according to sensor monitoring. So the lights are completely off. Sad I unplugged and re-plugged the unit, which I thought should reboot and run the script automatically, but it doesn't look like the script runs Sad

I have to be able to do something simple, and get it working before I start something complicated and don't know which end is up when it doesn't work....

View user's profile Send private message
Reply with quote
Post  
We're working on getting the new MK1 firmware up today (happy new year!) - it has a ton of fixes, including a bunch for the Lua runtime. You should wait for that before you bang your head further. Hold tight!


_________________
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter
View user's profile Send private message Send e-mail
Reply with quote
Post  
Yes, Happy New Year! This is my hobby for fun, sitting in a cold garage tinkering with the RCPro in my car.

I've been banging my head on this quite a bit, even got to writing a "bug report" for the functionality not working as expected.
http://www.autosportlabs.org/viewtopic.php?p=21965#21965

I am running the RaceAnalyzer 1.1.15 and Firmware 1.2.7 on the original Mk1 hardware.

I wasn't sure if the firmware v2.0.8 available for download is the beta version, or latest release. (Website was a little confusing to me on this.)

I'm also running the latest RaceAnalyzer. It looks like the RaceCapture App replaces RaceAnalyzer? I was reluctant to make the change until I at least got my script working as expected.

View user's profile Send private message
Reply with quote
Post  
I've got my embedded geek hat on today for work.. here's a thought. Trim down the total amount of text in a single comment, so the whole thing is less than 250 characters (think txt message). Right now you're at 277, including the begin/end flags. For example - just take out the first full line "RPM is pin 20 / FreqIn channel 0" and retry it. That gets you down to 239 characters.

It might not matter once the new release is up, but sometimes it's still interesting to learn new ways that things can break.


_________________
------------
Learning Race Capture Pro... on someone else's car
Learning Python/Kivy on my own PC
View user's profile Send private message
Reply with quote
Post  
You actually hit it on the head. The older firmware sometimes had a problem writing more than a page's (256) worth of script. That's been fixed in the latest firmware.

Speaking of which, still fixing a number of little bugs in the latest release, which we'll provide in lock-step with the MK1 and MK2 firmware updates. We're set up to do simultaneous firmware releases for MK1 and MK2!

Working on it for today, hopefully.

View user's profile Send private message Send e-mail
Reply with quote
Post  
Updated V2 firmware for MK1 announced here http://www.autosportlabs.org/viewtopic.php?t=4323

You should find that the Lua scripting will work better with this version. Enjoy!


_________________
Brent Picasso
CEO and 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 cannot download files in this forum