Help, Firmware update caused Lua script to stop working

Discussion on the Lua Scripting capabilities for RaceCapture/Pro. Also see the <a href="http://autosportlabs.net/RaceCapturePro_Lua_Scripting">Lua Scripting Guide</a>

Moderators: JeffC, stieg

Post Reply
F1 Dennis
Posts: 22
Joined: Thu Oct 05, 2017 12:26 am

Help, Firmware update caused Lua script to stop working

Post by F1 Dennis »

My Lua script for mapping some CAN channels stopped working after I updated my firmware yesterday.
I double checked and my CAN bus setting are still switched on.
Not sure where to even start with fixing this because it was working fine before the update and then just stopped. Brent, is there anything I should check first? Something that needs to be added to the Lua script for it to be ok with the update?
please help. track day tomorrow and trying to load up today

Dennis

F1 Dennis
Posts: 22
Joined: Thu Oct 05, 2017 12:26 am

Post by F1 Dennis »

Update:
I reinstalled the firmware one more time and it cleared it up. Everything works now.
I guess there may have been some glitch on the first install.

when in doubt reboot, reinstall, etc right?

thanks

brentp
Site Admin
Posts: 6274
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Hi Dennis,

Glad you got things working. Thanks for your patience and persistence!
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

F1 Dennis
Posts: 22
Joined: Thu Oct 05, 2017 12:26 am

Post by F1 Dennis »

Update:
Unfortunately I still have a bug with this. I thought it was fixed because it works correctly when my MacBook is plugged in via usb, but then won't read the CAN line without it.

Race Capture pro mk3. firmware 2.17.0
Mac osx app 1.16.0
iPad and iPhone app 1.15.2

Problem:
car's CAN line using Lua script to parse produces 0 value for all channels unless I connect the laptop.
(used to work fine before firmware update)

Example:
If I turn on the car and racecapture mk3 without connecting the laptop, all mobile devices then connected will read 0 for the CAN line and the SD card will also record 0 for these channels.
But if I connect the MacBook and turn the system on then all the CAN channels are working properly. Once this is working I can connect with a mobile device and the CAN channels read correctly.

The other CAN 2 is working fine with CAN mapping for my izze tire temp and pressure sensors

brentp
Site Admin
Posts: 6274
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Hi,

Can you clarify how you have the CAN data connected? Is the CAN bus with the problems connected to CAN1, and the Izze sensors connected to CAN2?

And CAN2 sensors always work correctly, regardless of laptop connection?
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

F1 Dennis
Posts: 22
Joined: Thu Oct 05, 2017 12:26 am

Post by F1 Dennis »

Yes, as you described.
My car's CAN is connected to CAN1 and I'm using Lua Script to parse the feed. (This is the problem CAN)
Izze sensors are on CAN2 and using RC's built in CAN mapping. (This works fine even when CAN1 is broken.)

Update:
I noticed there was another firmware update so updated from 2.17.0 to 2.17.2 and it seems to have cleared up the problem.
Perhaps there was an issue with 2.17.0
I made sure test multiple times to make sure the problem doesn't come back as it did before. So far so good.
I'll see if making edits to the Lua Script or other things causes the issue to return.

F1 Dennis
Posts: 22
Joined: Thu Oct 05, 2017 12:26 am

Post by F1 Dennis »

After further testing the issue still persists.

Unfortunately it seems very random. Sometimes when I boot up the system it will work fine. Then I'll turn it off for a minute and back on and can line will not work. I noticed now that the (!) error LED will blink red when the problem occurs.
I thought that updating the firmware or reloading a configuration was fixing it, but it seems that just using the reboot button on the firmware screen clears it up. -but not every time.
Weather it'll work on boot up seems a bit random, But more often than not, once it stops working it won't fix until I reload the config and hit reboot.
It behaves the same weather I turn on the unit by plugging in the usb to my laptop or by turning on the car to give it power.

Please let me know what else I can do to diagnose and fix this.
Thanks

brentp
Site Admin
Posts: 6274
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Hi,

When it is failing, what are you seeing in the RC log when the system boots up? Are you seeing a Lua memory issue?

If possible, try deleting your script, and then verify it boots up correctly with an empty script, then try updating it again, noting any messages in the logs.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

F1 Dennis
Posts: 22
Joined: Thu Oct 05, 2017 12:26 am

Post by F1 Dennis »

Thank you Brent.
I didn't think to check this log before.
It was a Lua Script memory error.

I trimmed down the Lua by eliminating a few of the less important channels I was recording from there.
I also did the same in my CAN 2 mapping. Couldn't hurt to keep everything as lean as possible.

Not sure if the recent firmware updates made less memory available or if it was all the new CAN 2 mapping channels I added with some tire temp sensors I installed at the same time.
Either way, it seems to be fixed.

Thank you for the help Brent!

brentp
Site Admin
Posts: 6274
Joined: Wed Jan 24, 2007 6:36 am

Post by brentp »

Glad you got it fixed, and thanks for the update!

Post Reply