Go Down

Topic: Bike interface OBD (Read 82241 times) previous topic - next topic

aster94

#150
Oct 26, 2018, 09:16 pm Last Edit: Oct 27, 2018, 01:46 am by aster94
Hi guys!

I am veeery near to finish a project which i have worked since some times: a library to make the communication with motorbikes which uses the keyword protocol 2000 easy for everyone, in the last months i gained quite a good knowledge about this protocol and obviously i am ready to share it :D

this is my almost finished attempt:
https://github.com/aster94/Keyword-Protocol-2000

I was wondering if someone would like to contribute with the kawasaki/honda/yamaha part, i know almost nothing about these bikes but they should be using the same protocol and all the code is already settled for them

Right now i am testing this on a suzuki GSX-R 600 L1 (2011) but it doesn't respond to the start sequence. I am not sure which is the problem but i guess some echo or maybe suzuki stopped using the KWP before 2011 :(

EDIT: be aware that the documentation on github is not up to date

TriB

Hi,

nice to see how far you got!
I just throw an eye on you code and it will not be able to cover Suzuki and Kawasaki.
What you called PID, is the place of a specific value within the response data. Because Suzuki gives you all information in a single request. But in OBD II and KDS, the PID is per request.
Give me RPM out->0x0C  in<-2500rpm.
That is hard to combine and you more or less double the code with two different approaches. I´m somewhere on half way there. It works, but SDS is quite slow, due to the fact I does not store the values right now.

Right now i am testing this on a suzuki GSX-R 600 L1 (2011) but it doesn't respond to the start sequence. I am not sure which is the problem but i guess some echo or maybe suzuki stopped using the KWP before 2011 :(
Me also got everything running and then, from one day to the other my ECU did not respond to the init protocol anymore.
In my case, it was my datalogger. It sends all outgoing and incoming data to a second arduino, which does all the SD-stuff. Sending a single request took 0,012 secs. But it seems to be enough, that my Suzuki GSX-R600 K6 does not respond anymore. Deactivating that, instantly made it work again. Try it with you debugging-mode.

aster94

#152
Oct 28, 2018, 03:17 pm Last Edit: Oct 28, 2018, 07:19 pm by aster94
Hi trib,

I know that kawasaki needs to ask for every single sensor
this is the reason for a couple of defines in my code: see here and then this

This way calling just one function which is requestSensorsData on both suzuki and kawasaki on suzuki will send just one request (0x21, 0x08) while in kawasaki it will send a group of request :smiley-razz:

EDIT: it seems that it wasn't my fault https://github.com/espressif/arduino-esp32/issues/2004

Bullone

Hi guys,
thanks for all the great informations!
I have an Yamaha Tracer 900 2018 and I suppose my bike is using CAN bus on the diagnostic connector... can you help me to implement an Arduino based board to read some data (TPS, RPM...) via CAN? Is it possible?

TriB

Hi Bullone,

what makes you think that Yamaha uses CAN-Bus?
They are still on K-Line as Suzuki and Kawasaki.

But what changed due to the 2018 EURO6 is, that it is OBD2 compatible.

These are two different things!
CAN-Bus is the way data is sent between ECU, sensors / actuators and diagnostic plug.
K-Line is the way how the diagnostic plug sends and receives data via single line. Sensors and stuff is just communicating by it´s voltage/resistance.

OBD2 is only the language how it speaks to you.

What you can do is to connect a stock ELM327 OBD2 Plug to you diagnostic Plug. Since OBD2 is compatible, you can use it right from the start, like in a car.
No value calculations, no PID translations, ect.

You only need to know which wire is the K-Line, Ground and Voltage, to connect it equivalent to the ELM327 Dongle.

Good luck :)

Bullone

Hi Bullone,

what makes you think that Yamaha uses CAN-Bus?
They are still on K-Line as Suzuki and Kawasaki.

But what changed due to the 2018 EURO6 is, that it is OBD2 compatible.

These are two different things!
CAN-Bus is the way data is sent between ECU, sensors / actuators and diagnostic plug.
K-Line is the way how the diagnostic plug sends and receives data via single line. Sensors and stuff is just communicating by it´s voltage/resistance.

OBD2 is only the language how it speaks to you.

What you can do is to connect a stock ELM327 OBD2 Plug to you diagnostic Plug. Since OBD2 is compatible, you can use it right from the start, like in a car.
No value calculations, no PID translations, ect.

You only need to know which wire is the K-Line, Ground and Voltage, to connect it equivalent to the ELM327 Dongle.

Good luck :)
Wow! Thanks for the info!
I was supposed that on the DLC connector of the recent bike I have to "read" CAN bus data.... have you ever work on Yamaha DLC? I'd liek to do an Arduino board to read TPS, RPM and ECT from the DLC

TriB

No, I haven´t. But since this is standardized, it should be easy as nuts!


Pinout can be found here on Wikipedia.

And here is how to connect it onto your bike. There are several online-shops which sell a connector (for a lot of money). But you can do it by yourself for testing purpose.

Then install Torque, Car Scan or a simple Bluetooth Terminal on your phone, to test the connection.

Bullone

Thank you so much!
Looking on the link you post it make me back confused.... the diagnostic connector has 4 pins: +12V, GND, CAN HI and CAN LOW.... also on the OBDII connector the pin6 and 14 are related to the CAN bus. That means that the diagnostic use CAN instead of k-line?

Sorry but I'm confused, probably my fault! :)

Bullone

What about this post?
https://www.fz09.org/forum/6-fz-09-general-discussion/5491-data-logger-plug-play-devellopement.html

TriB

What about this post?
This is from 2010, as you can see. It also uses K-Line to communicate with the diagnostic interface, like we do here.
As you have said, the new bike from 2018 uses CAN. So how should that help?
And why you don´t follow my idea with an OBD2 dongle?

OBD2 dongles support several communication types (As K-Line and CAN).
Get your bikes diagnostic plug-pinout and combine it with my wiki-link to the ELM327 (OBD2 dongle) pinout.
That´s it!

The ELM327 makes everything for you. You won´t see if it uses K-Line or CAN.

Bullone

Thanks for all the info!
The DLC connector has 4pins: CAN+, CAN-, +12V and GND


aster94

I am enough happy with my library and finally I am ready to promote it to version 1.0.0 and to pubblish it!

Keyword Protocol 2000

This would help you make the interface between motorbikes/cars and arduino easier

Get me on github and tell me if you test it so i can upgrade the list of tested bikes!

TriB

Nice one, @aster94!
Really a lot of work in it.

Currently I am recreating my Gsx-R due to a little accident on a racettrack. But I´ll test your code on both, my K6 and my Kawasaki Z750r.

My solution also does both, but it got less interfaces. My goal was different, I made it OBD2 compatible, so there are plenty of duplicated codes (for conversion, clear diagnostic, and more).
Maybe I´ll try to combine the best of both worlds, when I got time for that.

aster94

Nice one, @aster94!
Really a lot of work in it.

Currently I am recreating my Gsx-R due to a little accident on a racettrack. But I´ll test your code on both, my K6 and my Kawasaki Z750r.

My solution also does both, but it got less interfaces. My goal was different, I made it OBD2 compatible, so there are plenty of duplicated codes (for conversion, clear diagnostic, and more).
Maybe I´ll try to combine the best of both worlds, when I got time for that.
I hope you are ok and I am sure that your bike will get better then before :D

when i started to write this i had to decide between OBDII and KWP2000, both had pro and cos but at the end i choosed for the KWP because it would be faster since it doesn't have to "traslate" request/responses, obviously this also means that my code is less portable!

I can confirm that there is a lot of work in it, it stated as a hobby project but I guess you can understand that soon it took me more time than expected ahahah

Go Up