K-line

All sensor specific discussions! Temperature, pressure, steering angle, brake and throttle, etc. Post adaptations of OEM-style sensors, and also your clever DIY hacks and custom designs here too!

Moderators: JeffC, rdoherty, stieg

Post Reply
zechdz
Posts: 44
Joined: Sun Nov 08, 2015 3:04 pm

K-line

Post by zechdz »

Any information on how I would be able to read from a custom k-line, not full obd2.

Would it be doable through lua scripting and reading a digital input?
vroom

stieg
Posts: 100
Joined: Fri Dec 20, 2013 1:37 am
Location: Madison, WI
Contact:

Post by stieg »

Sounds like you are talking about bit banging the K line (pin 7) through LUA using the GPIO lines. I have never seen this done before using LUA. Based on the ISO9141-2 spec you would not be able to achieve this as RCP can only drive a signal as high as 5V. The standard dictates that you need 9.6V minimum to replicate a "high" value on the line. See http://www.onboarddiagnostics.com/page03.htm for more info.
Andrew Stiegmann (Stieg)
Principal Engineer
Autosport Labs Inc.

zechdz
Posts: 44
Joined: Sun Nov 08, 2015 3:04 pm

Post by zechdz »

Thanks for looking that up. Just looking for other ways to get the bikes data, so i can free up analog lines for other fun things :-D
vroom

stieg
Posts: 100
Joined: Fri Dec 20, 2013 1:37 am
Location: Madison, WI
Contact:

Post by stieg »

No worries. I learned something too.
Andrew Stiegmann (Stieg)
Principal Engineer
Autosport Labs Inc.

JJLudemann
Posts: 16
Joined: Thu Apr 14, 2016 12:53 pm
Location: Pattaya, Thailand
Contact:

Post by JJLudemann »

It seems to me that if you can connect the K-line to the RaceCapture Pro CAN bus connector at the physical level, then the RaceCapture PID protocol should just work. This guy has a schematic of how to go from the single K-line to separate transmit & receive lines:

http://www.clubwrx.net/forums/tutorials ... duino.html

These Tx & Rx lines could then be connected to a serial-to-Canbus adapter.

Sparkfun also has a K-line to serial adapter:

https://www.sparkfun.com/products/9555

Then you could connect the serial port to something like this:

http://gridconnect.com/rs232-can-converter.html

Plug that into the CAN-bus connector on the RaceCapture Pro, and you're talking to your ECU. I need something like this so I can communicate with the ECU on my 2007-2008 Suzuki GSX-R1000 engine.

Does this make sense to anybody?

-JJ
LudemannEngineering.com

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

Post by brentp »

An alternative to CAN, you can also use the aux serial port of RaceCapture/Pro MK2 and use Lua scripting to communicate over the serial connection.
Brent Picasso
CEO and Founder, Autosport Labs
Facebook | Twitter

JJLudemann
Posts: 16
Joined: Thu Apr 14, 2016 12:53 pm
Location: Pattaya, Thailand
Contact:

USB / Serial / Bluetooth Communication to GSX-R1000 ECU

Post by JJLudemann »

I see the Lua scripting page says the USB port is available as serial port 0, but recommends against using it as it " may interfere with normal operations of the unit". Is this still the case?

I already have a device, the HealTech OBD Tool for Suzuki ( http://shop.bluemonkeymotorsports.com/H ... _p_12.html ), that already works to connect the USB port of a laptop PC to the GSX-R1000 ECU. I could put USB sniffer software on the laptop's USB port, figure out the communications protocol, then re-implement it in a Lua script if I could just connect it to the RaceCapture USB port. Failing that, maybe I could get a USB to serial converter and plug it into the RC aux serial port.

The problem with connecting the RC serial port directly to the GSXR diagnostic port is that the GSXR wants a 2000 ms hi, 25 ms low, 25 ms high sequence on TxData to initialize, and I don't think I can make this with the RC serial port. Is there some way to directly control the TxData line? This initialization is already taken care of by the HealTech gizmo.

The Lua script page says it's OK to use the Bluetooth port, so maybe I can put a USB to Bluetooth converter on the HealTech gizmo and do it that way...

I'm going to order hardware for all these approaches, but would appreciate any ideas on the best direction to proceed.

-JJ
LudemannEngineering.com

stieg
Posts: 100
Joined: Fri Dec 20, 2013 1:37 am
Location: Madison, WI
Contact:

Post by stieg »

I see the Lua scripting page says the USB port is available as serial port 0, but recommends against using it as it " may interfere with normal operations of the unit". Is this still the case?
Yes. The code that makes use of the USB port is not designed with external use in mind.
I already have a device, the HealTech OBD Tool for Suzuki ( http://shop.bluemonkeymotorsports.com/H ... _p_12.html ), that already works to connect the USB port of a laptop PC to the GSX-R1000 ECU. I could put USB sniffer software on the laptop's USB port, figure out the communications protocol, then re-implement it in a Lua script if I could just connect it to the RaceCapture USB port.
I doubt that plugging in the GSX-R1000 to the RCP unit will even work since (at least on the RaceCapture unit) they are both USB guest devices. The GSX unit would need to support the USB OTG (on the go) spec that allows it to work as both USB host and USB guest devices. I doubt it supports that.
Failing that, maybe I could get a USB to serial converter and plug it into the RC aux serial port.
This is more probable to work.
The problem with connecting the RC serial port directly to the GSXR diagnostic port is that the GSXR wants a 2000 ms hi, 25 ms low, 25 ms high sequence on TxData to initialize, and I don't think I can make this with the RC serial port. Is there some way to directly control the TxData line? This initialization is already taken care of by the HealTech gizmo.
At this time there is no support to do this in our code on our serial ports. Sounds like a PITA.
The Lua script page says it's OK to use the Bluetooth port, so maybe I can put a USB to Bluetooth converter on the HealTech gizmo and do it that way...
Our Bluetooth module only works with tablets and computers as a client. it is not capable of being a host to another Bluetooth device.
I'm going to order hardware for all these approaches, but would appreciate any ideas on the best direction to proceed.
Go USB to serial and use the auxiliary port on the front of MK2 to read in and parse the data. Hands down the best approach of the above mentioned. Or see if there is a way to bypass that annoying serial requirement and go serial to serial directly.
Andrew Stiegmann (Stieg)
Principal Engineer
Autosport Labs Inc.

JJLudemann
Posts: 16
Joined: Thu Apr 14, 2016 12:53 pm
Location: Pattaya, Thailand
Contact:

GSX-R1000 to HealTech to Serial Converter

Post by JJLudemann »

That's exactly the feedback I needed. Thank you!

First approach will be (GSX-R1000 diagnostic port) to (HealTech gizmo to USB) to (USB to serial converter) to RC aux serial port.

-JJ
LudemannEngineering.com

Post Reply