Hey guys,
I have my ECU positioned in a pretty tight and potentially warm area and would like to occasionally use a fan to get air circulating in that area as a precaution. I thought about using a Temp input, running a sensor and using a LUA script to switch on the fan if it gets too warm in there.
But then I realized Rusefi actually can show and log the MCU temp. So I thought about running a LUA script to activate the fan based on the MCU temp and not using up an extra Temp input and cut down on the bulk of wiring. It looks like I can't get Internal MCU temps with LUA using the getSensor function since it's not a defined sensor name.
I was wondering if there's another function that I can use to access this info. I plan to set it up with a basic script curve, or even if I just set it up as a switch in the LUA script, that would work too.
Alex
ECU Temperature to LUA script
- AndreyB
- Site Admin
- Posts: 13671
- Joined: Wed Aug 28, 2013 1:28 am
- Location: Jersey City
- Github Username: rusefillc
- Slack: Andrey B
Re: ECU Temperature to LUA script
https://github.com/rusefi/rusefi/wiki/Lua-Scripting#basics
All outputs from the firmware can be read via the universal getOutput() hook
https://github.com/rusefi/rusefi/blob/master/firmware/controllers/lua/generated/output_lookup_generated.cpp looks weird because https://github.com/rusefi/rusefi/issues/4867 needs to be finished to make this usable. Are you a software developer by any chance to help? If not we are waiting for a software developer who could help, pretty basic change since very much similar generator already works for calibration, or something like that.
All outputs from the firmware can be read via the universal getOutput() hook
https://github.com/rusefi/rusefi/blob/master/firmware/controllers/lua/generated/output_lookup_generated.cpp looks weird because https://github.com/rusefi/rusefi/issues/4867 needs to be finished to make this usable. Are you a software developer by any chance to help? If not we are waiting for a software developer who could help, pretty basic change since very much similar generator already works for calibration, or something like that.
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
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
-
- running engine in first post
- Posts: 1452
- Joined: Mon Jan 30, 2017 2:05 am
- Location: Seattle-ish
Re: ECU Temperature to LUA script
we can at least hand 'em a fish this time, the relevant output to read in this case is called internalMcuTemperature, so you'd call
Code: Select all
getOutput('internalMcuTemperature')
Re: ECU Temperature to LUA script
I used to develop software in the past on a professional basis, but I can no longer call myself a software developer. We're probably talking about 15+ years since my last professional software development work. Pre-Github, which is close to being over my head. I have been wrenching on cars for too long.AndreyB wrote: ↑Fri Mar 17, 2023 10:55 pmhttps://github.com/rusefi/rusefi/wiki/Lua-Scripting#basics
All outputs from the firmware can be read via the universal getOutput() hook
https://github.com/rusefi/rusefi/blob/master/firmware/controllers/lua/generated/output_lookup_generated.cpp looks weird because https://github.com/rusefi/rusefi/issues/4867 needs to be finished to make this usable. Are you a software developer by any chance to help? If not we are waiting for a software developer who could help, pretty basic change since very much similar generator already works for calibration, or something like that.
Thank you. I didn't spot it in the official list of outputs seen here https://github.com/rusefi/rusefi/blob/master/firmware/controllers/sensors/sensor_type.h so I didn't think to try it.mck1117 wrote: ↑Fri Mar 17, 2023 10:58 pmwe can at least hand 'em a fish this time, the relevant output to read in this case is called internalMcuTemperature, so you'd call
Code: Select all
getOutput('internalMcuTemperature')
But thank you
- AndreyB
- Site Admin
- Posts: 13671
- Joined: Wed Aug 28, 2013 1:28 am
- Location: Jersey City
- Github Username: rusefillc
- Slack: Andrey B
Re: ECU Temperature to LUA script
Actually found a shortcut enjoy https://github.com/rusefi/rusefi/blob/master/firmware/controllers/lua/generated/output_lookup_generated.cpp
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
Always looking for C/C++/Java/PHP developers! Please help us see https://rusefi.com/s/howtocontribute
Re: ECU Temperature to LUA script
Thanks guys. I've implemented it and it works as intended. It saves me some time since I don't have to wire up another sensor for ECU Temp.