Page 1 of 1

Only Works on first run

Posted: Wed Jan 18, 2017 4:57 am
by z28pwr
I'm just getting started with Race Capture and want to output the data to the console to later build other scripts and when the script runs the first time it shows the correct value which is 0 for RPM and 127 for engine temperature but then it states that it can't read the values for several iterations. The dashboard seems to show them perfectly fine, any ideas as to why they show up fine initially and then I get a bunch of errors?


Image

Posted: Thu Jan 19, 2017 6:26 pm
by brentp
Calling readOBD2() might return a nil value, meaning no data was returned. You should first check if the value is present before doing anything with it.

e.g.

if engine ~= nil then
println('engine value ' ..engine)
end

Hope that helps!

Posted: Fri Jan 20, 2017 3:14 am
by z28pwr
Thanks Brent, you are correct the issue is that at times it's failing to obtain a reading for that PID and returning the nil value.

I modified the script to account for a nil value but why am I seeing so many OBD2: PID read fail errors? I seem to get one every 3 seconds or so and it does'n t matter what PID I'm checking either. Is this a bug?

Posted: Fri Jan 20, 2017 5:30 am
by brentp
A PID read error means RCP did not receive a response from the ECU. Worth noting, the ECU can only service one PID request at a time.

Do you have OBDII channels also enabled in the top level configuration?

If you don't have the top level OBDII configuration enabled, could you enable that for say, RPM and engine temperature and disable your script temporarily? Do you still get the PID reading errors?

Posted: Sat Jan 21, 2017 9:10 pm
by z28pwr
brentp wrote:A PID read error means RCP did not receive a response from the ECU. Worth noting, the ECU can only service one PID request at a time.

Do you have OBDII channels also enabled in the top level configuration?

If you don't have the top level OBDII configuration enabled, could you enable that for say, RPM and engine temperature and disable your script temporarily? Do you still get the PID reading errors?
Brent, I did have two OBD2 channels enabled (5&12). I removed the script, rebooted rc and still saw the PID errors. I then removed the Channels and the errors went away. Does that mean that I have an issue?

Posted: Sun Jan 22, 2017 9:30 pm
by brentp
With your script removed, try to re-enable just RPM. Ensure:
* CAN and OBDII switches are enabled
* CAN is set to 500K baud

after writing the configuration check OBDII operation with a running engine. Do you see data update in the dashboard and/or messages in the log?