uaefi pps and rpm over can bus as primary signals
Posted: Thu Nov 27, 2025 2:27 am
helllo, im trying to get tps and rpm from my nissan titan into a rusefi uaefi to use it as an electronic bypass valve as a standalone unit. ive only been able to get the signals working as luagauges but i cant figure out how to send them as signals to the ecu. tunerstudio version 3.3.01 and uaefi firmware 20251018. is this possible? im sure im missing something. im very new to this lua stuff so cut me some slack.
thanks for any and all help.
this is my lua script that makes the gauges work if it helps.
-- Titan VK56 CAN -> uaEFI via Lua
-- TPS & RPM from CAN go into LuaGauge1/2
-- and are read back with getSensor("LuaGauge1/2")
setTickRate(50)
-- subscribe to Titan CAN IDs
canRxAdd(0x231) -- TPS
canRxAdd(0x23D) -- RPM
-- helper: 16-bit little-endian
local function u16le(data, offset0)
local lo = data[offset0 + 1] or 0
local hi = data[offset0 + 2] or 0
return lo + hi * 256
end
function onCanRx(bus, id, dlc, data)
-- TPS: ID 0x231, byte index 2 (0-based) = data[3]
if id == 0x231 and dlc >= 3 then
local raw = data[3] or 0
local tps = raw * 0.5 -- 0–100 %
-- drive LuaGauge1
setLuaGauge(1, tps)
-- print("TPS raw=" .. raw .. " tps=" .. tps)
end
-- RPM: ID 0x23D, bytes 3 & 4 (0-based) = data[4], data[5]
if id == 0x23D and dlc >= 5 then
local raw = u16le(data, 3)
local rpm = raw * 3.09 -- your scaling
-- drive LuaGauge2
setLuaGauge(2, rpm)
-- print("RPM raw=" .. raw .. " rpm=" .. rpm)
end
end
function onTick()
-- use CAN TPS/RPM as your "primary inputs" for uaEFI logic
local tps = getSensor("LuaGauge1") -- CAN TPS (%)
local rpm = getSensor("LuaGauge2") -- CAN RPM
-- Example: sanity debug
-- if tps and rpm then
-- print("CAN TPS=" .. tps .. " RPM=" .. rpm)
-- end
-- TODO: later, use tps/rpm here to drive the Hellcat bypass valve
end
thanks for any and all help.
this is my lua script that makes the gauges work if it helps.
-- Titan VK56 CAN -> uaEFI via Lua
-- TPS & RPM from CAN go into LuaGauge1/2
-- and are read back with getSensor("LuaGauge1/2")
setTickRate(50)
-- subscribe to Titan CAN IDs
canRxAdd(0x231) -- TPS
canRxAdd(0x23D) -- RPM
-- helper: 16-bit little-endian
local function u16le(data, offset0)
local lo = data[offset0 + 1] or 0
local hi = data[offset0 + 2] or 0
return lo + hi * 256
end
function onCanRx(bus, id, dlc, data)
-- TPS: ID 0x231, byte index 2 (0-based) = data[3]
if id == 0x231 and dlc >= 3 then
local raw = data[3] or 0
local tps = raw * 0.5 -- 0–100 %
-- drive LuaGauge1
setLuaGauge(1, tps)
-- print("TPS raw=" .. raw .. " tps=" .. tps)
end
-- RPM: ID 0x23D, bytes 3 & 4 (0-based) = data[4], data[5]
if id == 0x23D and dlc >= 5 then
local raw = u16le(data, 3)
local rpm = raw * 3.09 -- your scaling
-- drive LuaGauge2
setLuaGauge(2, rpm)
-- print("RPM raw=" .. raw .. " rpm=" .. rpm)
end
end
function onTick()
-- use CAN TPS/RPM as your "primary inputs" for uaEFI logic
local tps = getSensor("LuaGauge1") -- CAN TPS (%)
local rpm = getSensor("LuaGauge2") -- CAN RPM
-- Example: sanity debug
-- if tps and rpm then
-- print("CAN TPS=" .. tps .. " RPM=" .. rpm)
-- end
-- TODO: later, use tps/rpm here to drive the Hellcat bypass valve
end