Trying out the bluetooth OBD connector

I want to connect my laptop to my bike in order to both get diagnostic info out as well as hook up new toys to it. The most promising way to do this sounds like the OBD2 diagnostics interface. Unfortunately it doesn't seem to be easy to do on bikes from 2014 or later having the "Fly by Wire" throttle. In the past I've happily connected my KTM 990 Adventure to TuneECU but the 2014 690 Enduro R is not playing a long as easily.

So far I've tried out the


  • Lonelec cable and USB cable to laptop
  • Konnwei KW902 Bluetooth dongle
  • Vgate Scan OBD Bluetooth dongle

Only the Vgate dongle is responding but is not talking to TuneECU. However connecting with a serial comm terminal like Tera Term then it responds to the basic ELM commands. I also wrote a small diagnostic Python program based on python-OBD to try to see what was supported:

import obd
obd.logger.setLevel(obd.logging.DEBUG) # enables all debug informationports = obd.scan_serial()
print(ports)
connection = obd.OBD('\\.\\COM5') # auto-connects to USB or RF portfor command in connection.supported_commands:
    print(command.desc + ":")
    try:
        print(connection.query(command))
    except:
        print("failed")


  1. This will first connect to the COM5 serial port where the Bluetooth adapter is connected to.
  2. It will issue a range of AT command to reset the device (ATZ) and get protocol version 
  3. It then gets all available commands and tries them one at a time
The full response is below and I believe things are going well until it starts issuing commands like

0600

which gets a response 

7E9 03 7F 06 11

which I believe means 

General error (7F)
Your command (06)
Is not supported (11)

However, this is work in progress so comments are of great interest if anyone has more information around this.

Full diagnostic output:




Connected to pydev debugger (build 182.4505.26)
['\\.\\COM4', '\\.\\COM5', '\\.\\COM6']
[obd.obd] ======================= python-OBD (v0.6.1) =======================
[obd.obd] Explicit port defined
[obd.elm327] Initializing ELM327: PORT=\.\COM5 BAUD=auto PROTOCOL=auto
[obd.elm327] Response from baud 38400: b'?\r\r>'
[obd.elm327] Choosing baud 38400
[obd.elm327] write: b'ATZ\r\n'
[obd.elm327] wait: 1 seconds
[obd.elm327] read: b'\r\rELM327 v1.5\r\r>'
[obd.elm327] write: b'ATE0\r\n'
[obd.elm327] read: b'ATE0\rOK\r\r>'
[obd.elm327] write: b'ATH1\r\n'
[obd.elm327] read: b'OK\r\r>'
[obd.elm327] write: b'ATL0\r\n'
[obd.elm327] read: b'OK\r\r>'
[obd.elm327] write: b'ATSP0\r\n'
[obd.elm327] read: b'OK\r\r>'
[obd.elm327] write: b'0100\r\n'
[obd.elm327] read: b'SEARCHING...\r7E9 03 7F 01 11 \r\r>'
[obd.elm327] write: b'ATDPN\r\n'
[obd.elm327] read: b'A6\r\r>'
[obd.protocols.protocol] map ECU 1 --> ENGINE
[obd.elm327] Connected Successfully: PORT=\.\COM5 BAUD=38400 PROTOCOL=6
[obd.obd] querying for supported commands
[obd.obd] Sending command: b'0100': Supported PIDs [01-20]
[obd.elm327] write: b'01001\r\n'
[obd.elm327] read: b'7E9 03 7F 01 11 \r\r>'
[obd.OBDCommand] Message was shorter than expected. Padded message: bytearray(b'\x11\x00\x00\x00')
[obd.obd] Sending command: b'0600': Supported MIDs [01-20]
[obd.elm327] write: b'0600\r\n'
O2 Sensor Monitor Bank 1 - Sensor 4:
[obd.elm327] read: b'7E9 03 7F 06 11 \r\r>'
[obd.obd] finished querying with 13 commands supported
[obd.obd] ===================================================================
[obd.obd] Sending command: b'0604': O2 Sensor Monitor Bank 1 - Sensor 4
[obd.elm327] write: b'0604\r\n'
No tests to report
[obd.elm327] read: b'7E9 03 7F 06 11 \r\r>'
ELM327 version string:
[obd.decoders] Encountered monitor message with non-multiple of 9 bytes. Truncating...
failed
[obd.obd] Sending command: b'0108': Short Term Fuel Trim - Bank 2
Short Term Fuel Trim - Bank 2:
[obd.elm327] write: b'01081\r\n'
[obd.elm327] read: b'7E9 03 7F 01 11 \r\r>'
[obd.obd] Sending command: b'04': Clear DTCs and Freeze data
[obd.elm327] write: b'04\r\n'
-86.71875 percent
Clear DTCs and Freeze data:
[obd.elm327] read: b'7E9 03 7F 04 11 \r\r>'
[obd.obd] Sending command: b'0100': Supported PIDs [01-20]
[obd.elm327] write: b'01001\r\n'
None
Supported PIDs [01-20]:
00010001000000000000000000000000
Calculated Engine Load:
[obd.elm327] read: b'7E9 03 7F 01 11 \r\r>'
[obd.OBDCommand] Message was shorter than expected. Padded message: bytearray(b'\x11\x00\x00\x00')
[obd.obd] Sending command: b'0104': Calculated Engine Load
[obd.elm327] write: b'01041\r\n'
[obd.elm327] read: b'7E9 03 7F 01 11 \r\r>'
6.666666666666667 percent
Get DTCs from the current/last driving cycle:
[obd.obd] Sending command: b'07': Get DTCs from the current/last driving cycle
[obd.elm327] write: b'07\r\n'
[]
[obd.elm327] read: b'7E9 03 7F 07 11 \r\r>'
[obd.obd] Sending command: b'0600': Supported MIDs [01-20]
Supported MIDs [01-20]:
[obd.elm327] write: b'0600\r\n'
[obd.elm327] read: b'7E9 03 7F 06 11 \r\r>'
00010001
DTC Calculated Engine Load:
[obd.obd] Sending command: b'0204': DTC Calculated Engine Load
[obd.elm327] write: b'02041\r\n'
[obd.elm327] read: b'7E9 03 7F 02 11 \r\r>'
6.666666666666667 percent
[obd.obd] Sending command: b'0608': O2 Sensor Monitor Bank 2 - Sensor 4
O2 Sensor Monitor Bank 2 - Sensor 4:
[obd.elm327] write: b'0608\r\n'
[obd.elm327] read: b'7E9 03 7F 06 11 \r\r>'
No tests to report
[obd.decoders] Encountered monitor message with non-multiple of 9 bytes. Truncating...
Voltage detected by OBD-II adapter:
failed
[obd.obd] Sending command: b'0208': DTC Short Term Fuel Trim - Bank 2
DTC Short Term Fuel Trim - Bank 2:
[obd.elm327] write: b'02081\r\n'
-86.71875 percent
[obd.elm327] read: b'7E9 03 7F 02 11 \r\r>'
Get DTCs:
[obd.obd] Sending command: b'03': Get DTCs
[obd.elm327] write: b'03\r\n'
[obd.elm327] read: b'7E9 03 7F 03 11 \r\r>'
[]

Process finished with exit code 0


Comments

Popular posts from this blog

Nav Tower

Getting stuck in New Territories