Inconsistent obd.read()

Inquiry and support for Freematics products
Post Reply
jmoges
Posts: 2
Joined: Sun Sep 06, 2015 4:46 am

Inconsistent obd.read()

Post by jmoges »

I'm using the UART obd2 adapter and I've been testing in my car (Toyota Tacoma) and motorcycle (Triumph Daytona 675). In my car I'm able to get the data (RPM and throttle position) without any problems. Using the same code on my motorcycle and

Code: Select all

obd.read(PID_RPM, rpmValue)
doesn't always return true.

Yesterday when I was testing I wouldn't get anything to return. This morning I tried again and obd.read() would return RPM and throttle position when I didn't change any code. Then I tried seeing what was being returned with some print statements and obd.read() was still returning what was expected. Eventually obd.read() started returning 0's. I tried running the arduino a few times and tried different ways of connecting the obd2 adapter (plug in the adapter first, then turn on and start the bike; turn the bike on, plug in the adapter, then start the bike; etc.). I couldn't get obd.read() to return 1's again.

Does this sound like something that happens a lot? Is there anything I can try or look at to get my motorcycle to consistently return RPM and throttle position? Could it be an issue with my obd2 connection on the motorcycle? I'm a little lost with this problem.

Thanks
stanley
Site Admin
Posts: 1039
Joined: Sat Mar 01, 2014 3:15 am

Re: Inconsistent obd.read()

Post by stanley »

On Arduino Uno, never use Serial.print as the OBD-II UART adapter uses serial for communication. Use of Serial.print will interrupt the communication.
jmoges
Posts: 2
Joined: Sun Sep 06, 2015 4:46 am

Re: Inconsistent obd.read()

Post by jmoges »

I guess I should have said I'm using a Mega. I'm using pins 18-19 for the adapter, pins 0 and 1 are left alone. Would that still cause a problem?
Post Reply