Lua Scripting

It's all about the code!
mtmotorsport
Posts: 89
Joined: Wed Mar 31, 2021 10:00 pm

Re: Lua Scripting

Post by mtmotorsport »

Ahh, so just flip the X axis order?
Matt
MT Motorsport / EcotecMiata
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Lua Scripting

Post by AndreyB »

mtmotorsport wrote:
Tue Jun 28, 2022 4:02 am
Ahh, so just flip the X axis order?
exactly
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
kjn260
Posts: 9
Joined: Sun Nov 07, 2021 10:59 pm

Re: Lua Scripting

Post by kjn260 »

So to do some bench hardware coding in Lua, RusEFI simulator now supports interaction to a physical hardware can device (via SocketCan) on Linux!
image.png
image.png (453.86 KiB) Viewed 25643 times
Which means, with just a standard can adapter (I am using a peak clone) I can attach simulator to a real can device and do Lua Development.

What a time to be alive.
image.png
image.png (1.65 MiB) Viewed 25643 times
So I am going to do some tidy up on the iDrive code and see what we can come up with.

@mck1117 is a deadset legend.
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: Lua Scripting

Post by mck1117 »

kjn260 wrote:
Mon Jul 04, 2022 9:30 am
Which means, with just a standard can adapter (I am using a peak clone) I can attach simulator to a real can device and do Lua Development.
It also means, curiously, your PC now responds to OBD2 PID requests.
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Lua Scripting

Post by AndreyB »

Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Lua Scripting

Post by AndreyB »

kjn260 wrote:
Mon Jul 04, 2022 9:30 am
So to do some bench hardware coding in Lua, RusEFI simulator now supports interaction to a physical hardware can device (via SocketCan) on Linux!
they wonder if we have reinvented a portion of https://forum.chibios.org/viewtopic.php?t=4861
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Lua Scripting

Post by AndreyB »

New hooks to adjust closed loop boost target https://github.com/rusefi/rusefi/wiki/Lua-Scripting#setboostadd
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
007adr
Posts: 19
Joined: Wed Aug 03, 2022 2:04 am

Re: Lua Scripting

Post by 007adr »

AndreyB wrote:
Thu Jul 14, 2022 5:10 pm
New hooks to adjust closed loop boost target https://github.com/rusefi/rusefi/wiki/Lua-Scripting#setboostadd
im not a smart person, can you or some other smart person, have a step by step guide for dummies, i would like to increase boost with ethanol content and do a timing multiplier based on ethenol content and im sure lua can do it, i can understand the basics of the script, but im unable to implement them into tuner studio
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Lua Scripting

Post by AndreyB »

As of today Lua scripting is only availbe in rusEFI console - tuner studio does not have provisions for multi-line text entry.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
007adr
Posts: 19
Joined: Wed Aug 03, 2022 2:04 am

Re: Lua Scripting

Post by 007adr »

Yes but the tables are so I imagine you build the script
In the console with an “id” so you can assign table values in tuner studio


Sent from my iPhone using Tapatalk
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Lua Scripting

Post by AndreyB »

007adr wrote:
Fri Aug 12, 2022 12:57 am
i would like to increase boost with ethanol content and do a timing multiplier based on ethenol content and im sure lua can do it, i can understand the basics of the script, but im unable to implement them into tuner studio
I can help once the vehicle is overall running under rusEFI. On the one hand do not worry you'll have it, on the other hand please understand that I have to set priorities based on actual vehicle needs.
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
007adr
Posts: 19
Joined: Wed Aug 03, 2022 2:04 am

Re: Lua Scripting

Post by 007adr »

AndreyB wrote:
007adr wrote:
Fri Aug 12, 2022 12:57 am
i would like to increase boost with ethanol content and do a timing multiplier based on ethenol content and im sure lua can do it, i can understand the basics of the script, but im unable to implement them into tuner studio
I can help once the vehicle is overall running under rusEFI. On the one hand do not worry you'll have it, on the other hand please understand that I have to set priorities based on actual vehicle needs.
Understand I’ll stop bugging,


Sent from my iPhone using Tapatalk
TBM
Posts: 5
Joined: Mon Jun 21, 2021 3:56 pm
Github Username: TurboMarian
Slack: Marian

Re: Lua Scripting

Post by TBM »

I wonder if it is possible to implement a simple ALS (anti lag) strategy using LUA script. I will ask for your opinion whether it is feasible at all.
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Lua Scripting

Post by AndreyB »

Short answer is yes. A more specific question would be needed fpr more specifuc answer
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
TBM
Posts: 5
Joined: Mon Jun 21, 2021 3:56 pm
Github Username: TurboMarian
Slack: Marian

Re: Lua Scripting

Post by TBM »

AndreyB wrote:
Sun Sep 04, 2022 4:28 pm
Short answer is yes. A more specific question would be needed fpr more specifuc answer
Thanks for the quick reply Andrei. I don't quite know how to do it. If you have an idea or a ready script, I can test it (at my own risk) on my car. Otherwise, I will work on it slowly and share the script when it's ready.
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Lua Scripting

Post by AndreyB »

Let's assume

Code: Select all

print (1 and "1 is true" or "1 is false")
print (0 and "0 is true" or "0 is false")
print (nil and "nil is true" or "nil is false")
Q1: what would you expect the output to be?

Q2: WHY IS IT SO WEIRD?!
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Lua Scripting

Post by AndreyB »

PS: Q3 what shall we do about it?!
image.png
image.png (15.66 KiB) Viewed 22212 times
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: Lua Scripting

Post by mck1117 »

lua has true and false and they work fine
User avatar
AndreyB
Site Admin
Posts: 14292
Joined: Wed Aug 28, 2013 1:28 am
Location: Jersey City
Github Username: rusefillc
Slack: Andrey B

Re: Lua Scripting

Post by AndreyB »

image.png
image.png (21.92 KiB) Viewed 22212 times
Very limited telepathic abilities - please post logs & tunes where appropriate - http://rusefi.com/s/questions

Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
mck1117
running engine in first post
running engine in first post
Posts: 1493
Joined: Mon Jan 30, 2017 2:05 am
Location: Seattle-ish

Re: Lua Scripting

Post by mck1117 »

Post Reply