OBD2: PID read fail:

Discussion and research on OBDII integration, especially on OEM specific PIDs from Ford, GM, Chevrolet, BMW, Porsche, Audi, Toyota, Volkswagen, Mazda, Honda, Subaru, Mitsubishi and others.
z28pwr
Posts: 10
Joined: Wed Jan 18, 2017 4:49 am

OBD2: PID read fail:

Post by z28pwr »

I'm seeing numerous OBD2: PID read fail: errors when polling the log (1 every 3 seconds) and it seems to get worse the more PID's I try to query. I increased the tick rate to 25 and it helped a little. Is this a bug or is there a wiring issue somewhere? I'm running RC Pro MK2 2.10.2?
Straight roads are for fast cars turns are for fast drivers

dewittpayne
Posts: 67
Joined: Sun Dec 11, 2016 1:07 am

Post by dewittpayne »

It's possible that the PID you're requesting is not available on the OBD bus for your car. Rather than add PID's, try looking at them one at a time to see were the problem might be.

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

Post by brentp »

Good tip. Not all ECUs support all OBDII PIDs. What PIDs are you trying to query?

The ones that seem to be always supported is RPM and throttle position; those should always work.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

FHB-PERFORMANCE
Posts: 24
Joined: Sun Mar 20, 2016 7:13 am
Location: Melbourne-Australia / Sao Paulo-Brazil

I have same issue - Fixed running on older firmware version

Post by FHB-PERFORMANCE »

For a simple example,

If I write the script below using Firmware 2.9 or latter - like 2.10.2:

pedalId = addChannel("PedalPosition",10)
function onTick()
local pedalPosition = readOBD2(73)
setChannel(pedalId, pedalPosition)
end

I have the red led flashing showing as a error

However, if write the same script using 2.8.7 firmware version it works.

PS: I am just connecting RCP MK2 on my computer and not connected to the vehicle at the time I am flashing the this script.

So, I believe that there is an error on the "readOBD2" command in the newer versions.

Brent, could you check it?

Thanks,
Felipe

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

Post by brentp »

We fixed a bug in the older firmware so that it properly returns a 'nil' value if the OBDII PID was not successfully returned by the ECU.

Here's an example of checking for a nil value:

etId = addChannel("EngineTemp", 10, 0, 0, 300)
function updateEngineTemp()
local eTmp = readOBD2(5)
if eTmp ~= nil then
setChannel(etId, eTmp)
end
end

Hope this helps,
-Brent
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

z28pwr
Posts: 10
Joined: Wed Jan 18, 2017 4:49 am

Post by z28pwr »

Brent, I continue to be plagued by this issue where it only reads the RPM every so often and the biggest problem is that as the car is moving up in the RPM's it only reads it every 400 RPM's or so which is an issue. I didn't have this problem when using EcuTek for logging on my other Miata.

Below is my log showing that once I get into the higher RPM's it's only reading it every 400 or so RPM's.


699043 1493403181733 13.74 -0.24 -0.57 0.84 8 0 1 1 1 1 6181 185 29.921553 -97.871384 65.84 0.28 656.5 9 3 1.5 1 1.705 0 0 1.688 0.2333 2
699083 1493403181773 -0.22 -0.52 0.94 8 -1 1
699123 1493403181813 -0.22 -0.51 0.81 8 -1 1
699163 1493403181853 -0.23 -0.47 0.88 9 0 0
699203 1493403181893 -0.24 -0.48 0.86 9 0 -1
699243 1493403181933 -0.23 -0.52 0.84 10 0 -2 1 1 1 185 29.921545 -97.871323 66.85 0.283 656.2 9 3 1.5 1 1.705 0 0 1.6883 0.2367 2
699283 1493403181973 -0.23 -0.54 0.96 10 0 -3
699323 1493403182007 -0.22 -0.6 0.89 10 1 -3
699363 1493403182047 -0.21 -0.63 1 10 2 -3
699403 1493403182092 -0.22 -0.65 1.06 10 2 -2
699443 1493403182132 -0.23 -0.62 1 9 2 -2 1 1 1 185 29.921536 -97.871262 67.83 0.287 656 9 3 1.5 1 1.705 0 0 1.6885 0.24 2
699483 1493403182172 -0.23 -0.57 0.94 9 0 -1
699523 1493403182214 -0.21 -0.56 0.88 9 -1 1
699563 1493403182254 -0.2 -0.54 0.84 9 -1 2
699603 1493403182294 -0.21 -0.54 0.87 10 0 2
699643 1493403182334 -0.22 -0.59 0.93 10 1 1 1 1 1 185 29.921526 -97.871201 68.7 0.291 655.7 9 3 1.5 1 1.705 0 0 1.6888 0.2433 2
699683 1493403182374 -0.22 -0.63 0.93 11 2 0
699723 1493403182414 -0.22 -0.65 0.98 10 1 -1
699763 1493403182454 -0.21 -0.66 1.03 9 0 0
699803 1493403182494 -0.21 -0.64 1.01 9 0 1
699843 1493403182534 -0.21 -0.62 1 10 0 1 1 1 1 185 29.921514 -97.87114 69.82 0.295 655.3 9 3 1.5 1 1.705 0 0 1.689 0.2467 2
699883 1493403182574 -0.18 -0.61 0.98 10 0 0
699923 1493403182614 -0.18 -0.61 1.03 11 0 -1
699963 1493403182654 -0.18 -0.64 1.03 12 2 -2
700003 1493403182694 -0.19 -0.68 1.05 12 2 -3
700043 1493403182734 13.73 -0.19 -0.69 1.03 12 3 -3 1 1 1 6478 185 29.921497 -97.871071 70.55 0.299 654.6 9 3 1.5 1 1.705 0 0 1.6886 0.25 2
700083 1493403182774 -0.19 -0.71 1 11 1 -2
700123 1493403182814 -0.17 -0.72 0.94 11 1 0
700163 1493403182854 -0.18 -0.71 0.92 11 1 1
700203 1493403182894 -0.18 -0.71 0.97 12 1 0
700243 1493403182934 -0.18 -0.69 0.97 12 2 -1 1 1 0 185 29.921482 -97.87101 71.44 0.303 654 9 3 1.5 1 1.705 0 0 1.6887 0.2533 2
700283 1493403182974 -0.17 -0.7 0.99 13 2 -1
700323 1493403183007 -0.19 -0.72 0.98 12 2 -2
700363 1493403183047 -0.18 -0.74 0.95 12 1 -2
700403 1493403183093 -0.17 -0.74 1.01 12 1 -2
700443 1493403183133 -0.16 -0.75 1.05 12 1 -2 1 1 0 185 29.921459 -97.870949 72.5 0.307 653.3 9 3 1.5 1 1.705 0 0 1.6886 0.2567 2
700483 1493403183173 -0.17 -0.76 1.03 12 1 -2
700523 1493403183213 -0.18 -0.78 0.96 12 1 0
700563 1493403183253 -0.18 -0.78 1.05 12 1 0
700603 1493403183293 -0.17 -0.77 1.06 12 1 0
700643 1493403183333 -0.18 -0.77 0.96 12 1 -1 1 0 0 185 29.921436 -97.870888 73.35 0.311 652.7 9 3 1.5 1 1.705 0 0 1.6884 0.26 2
700683 1493403183373 -0.17 -0.78 0.99 12 0 -2
700723 1493403183413 -0.16 -0.76 0.96 12 0 -2
700763 1493403183453 -0.17 -0.82 0.88 13 0 -1
700803 1493403183493 -0.15 -0.81 1.01 13 0 -1
700843 1493403183533 -0.17 -0.85 0.94 13 0 -2 1 0 0 185 29.921412 -97.870827 73.87 0.315 652 9 3 1.5 1 1.705 0 0 1.6882 0.2633 2
700883 1493403183573 -0.16 -0.85 0.92 13 0 -2
700923 1493403183613 -0.13 -0.85 0.97 13 0 -2
700963 1493403183653 -0.15 -0.88 0.88 13 1 0
701003 1493403183693 -0.13 -0.83 0.96 12 0 1
701043 1493403183733 13.78 -0.14 -0.81 0.86 12 1 2 1 0 0 7051 185 29.921387 -97.870758 74.77 0.319 651.3 9 3 1.5 1 1.705 0 0 1.6876 0.2667 2




Here is the header for my log file:

"Interval"|"ms"|0|0|1,"Utc"|"ms"|0|0|1,"Battery"|"Volts"|0.0|20.0|1,"AccelX"|"G"|-3.0|3.0|25,"AccelY"|"G"|-3.0|3.0|25,"AccelZ"|"G"|-3.0|3.0|25,"Yaw"|"Deg/Sec"|-120|120|25,"Pitch"|"Deg/Sec"|-120|120|25,"Roll"|"Deg/Sec"|-120|120|25,"GPIO1"|""|0|1|10,"GPIO2"|""|0|1|10,"GPIO3"|""|0|1|10,"RPM"|""|0|10000|1,"EngineTemp"|"F"|0|300|10,"Latitude"|"Degrees"|-180.0|180.0|10,"Longitude"|"Degrees"|-180.0|180.0|10,"Speed"|"mph"|0.0|150.0|10,"Distance"|"mi"|0.0|0.0|10,"Altitude"|"ft"|0.0|4000.0|10,"GPSSats"|""|0|20|10,"GPSQual"|""|0|5|10,"GPSDOP"|""|0.0|20.0|10,"LapCount"|""|0|0|10,"LapTime"|"Min"|0.0|0.0|10,"Sector"|""|0|0|10,"SectorTime"|"Min"|0.0|0.0|10,"PredTime"|"Min"|0.0|0.0|10,"ElapsedTime"|"Min"|0.0|0.0|10,"CurrentLap"|""|0|0|10


Thanks for your help!
Straight roads are for fast cars turns are for fast drivers

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

Post by brentp »

Hi,

It looks like from your log file header that you have the sample rate for RPM set to 1Hz. try configuring your RPM channel for something higher, like 10, 25 or 50Hz.

While you're at it, you should upgrade to the latest 2.11.0 firmware, since we released it recently, with OBDII changes.
https://www.autosportlabs.com/racecaptu ... -released/
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

z28pwr
Posts: 10
Joined: Wed Jan 18, 2017 4:49 am

Post by z28pwr »

Thanks, I'll give that a try during this weekends race and report back.
Straight roads are for fast cars turns are for fast drivers

z28pwr
Posts: 10
Joined: Wed Jan 18, 2017 4:49 am

Post by z28pwr »

Brent, if I want to hardcode the RPM do I need to purchase the CoilX or can I run the RPM pulse wire to RaceCapture if it's a 2006 Mazda Miata?
Straight roads are for fast cars turns are for fast drivers

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

Post by brentp »

Hi,

Did increasing the sample rate make a difference?

The thing to note is while we go to great lengths to optimize OBDII PID querying - detailed in our blog post here: https://www.autosportlabs.com/racecaptu ... -released/

direct RPM measurement will always beat querying OBDII PIDs or even direct streaming CAN bus data when it comes to minimal latency.

Back to CoilX:

CoilX is typically used for older cars where you don't have an ECU signal with a clean tach signal. Your newer Miata definitely has a clean signal from the ECU, so you don't need CoilX; you can wire it directly.

However, we don't have the exact wiring diagram for your car - our Miata section is somewhat thin:

https://wiki.autosportlabs.com/RaceCapt ... icle_guide

If you go in that direction - please create a new thread in the Sensors section with that topic. Once we figure out the correct tach signal wire for your generation Miata we can get that information updated in the wiki.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

z28pwr
Posts: 10
Joined: Wed Jan 18, 2017 4:49 am

Post by z28pwr »

Brent, I upgraded the firmware to 2.11.0 and increased the frequency to 50Hz and the RPM's stopped displaying in the dashboard but I couldn't mess with it as I had to get to grid. The car is very loud so I try not to turn it on in the neighborhood (non street legal). I've wired a shift light before in my prior NC Miata and it's the yellow / black wire that has the RPM pulse, I'll run this to the Pulse input 1 on the RC.

Thanks
Straight roads are for fast cars turns are for fast drivers

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

Post by brentp »

Thanks for the update. If you can specify what part of the harness has the yellow/black wire we'll be sure to update our wiki.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

z28pwr
Posts: 10
Joined: Wed Jan 18, 2017 4:49 am

Post by z28pwr »

Brent, I have the RPM lead connected but it was displaying half of the RPM value and when trying to set the pulse to half it would lose the channel and error out. This happened when trying to set it to anything below 1. What I ended up doing was multiplying it by 2 in my Lua Script to get the shiftx light to work but of course the Dashboard still showed half.


Image






I'm obtaining the RPM pulse from the black and yellow wire in the PCM wiring harness underneath the stock airbox as shown below. I believe that this is 2BA on the PCM wiring harness.


Image
Straight roads are for fast cars turns are for fast drivers

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

Post by brentp »

So.. first thing I noticed is you have an error in your script. Does this happen consistently when you press the 'Run' button to reload the script?
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

z28pwr
Posts: 10
Joined: Wed Jan 18, 2017 4:49 am

Post by z28pwr »

Re-reading your response and yes, it happens when I hit run to restart the script but I only get the error when I change the pulse to any value below 1. If the value is 1 or greater it works fine as you can see prior to the error as once three error is thrown the script stops running. What error do you see in the script? I tried creating the channel in the script but the RPMS were still half of what they should be.

Thanks
Straight roads are for fast cars turns are for fast drivers

Post Reply