I've set up an Adroid application doing just that through bluetooth. You can find the source code here: https://github.com/eiannone/CBT-Diagnostic (see also here: http://forum.canb.us/discussion/comment/580/#Comment_580)
I would like to port it to a desktop app using serial port. It shouldn't be too difficult.
I got all information about OBDII protocol on wikipedia page: https://en.wikipedia.org/wiki/OBD-II_PIDs
Basically you have to send a broadcast CAN request using msgId/address 07DF and then listen for responses from id 07E0 - 07E7 .
The first byte of the CAN packet data is the "command mode", the second is the PID command, and the others are command data.
For example, to get all supported OBDII PIDs you must use mode 01 - "Show current data", and then command 00 - "Show supported pids".
The CAN packet request is the following:
07DF 02 01 00 0000000000
07DF is the broadcast address
02 is the number of data bytes
01 is the OBD mode (Show current data)
00 is the command PID "Show supported PIDS"
The rest of 0s are unused data bytes
To send this command with CBT you have to send the following serial port command:
02 01 07 DF 02 01 00 00 00 00 00 00 08
On my Mazda 3 I receive this CAN response:
07E8 06 41 00 98 3B 80 11 00
07E8 is the device id
06 is the number of additional data bytes
41 is the OBD mode, same as request mode (01h) with 40h added
00 is the PID code (same as request)
98 3B 80 11 is hex string with supported PIDs encoded, which translates to PID supported: 01, 04, 05, 0B, 0C, 0D, 0F, 10, 11, 1C, 20 (see Wikipedia for decoding)
To ease dealing with OBD protocol I implemented mask filtering on firmware for CAN messages id. That's because ODB II CAN messages id are only in the range from 0x7E8 to 0x7EF.
The "-flto" flag activates the GCC linker plugin for Link-Time-Optimization (LTO), but some windows versions of Arduino IDE don't include this plugin.
Since version 1.6.4 the plugin was permanently removed as it is not correctly delivered in the AVR GCC tool chain for Arduino.
See here: http://couponsmeup.appspot.com/github.com/mikaelpatel/Cosa/issues/338
I have the same problem compiling on windows. It seems related to a "-flto" compile option added to platform.txt file with last code commit.
To solve the problem just edit file CANBus-Triple\avr\platform.txt and remove all occurencies of "-flto" string. There are three of them, on lines 11, 14 and 18.
If you are on windows and have .net framework installed you can try this console application written in C#: http://goo.gl/2iY4mb
I've created it using my <a href="https://github.com/eiannone/CANBus-Triple-Dll">windows dll</a>. It's built on .net framework v 4.5.2
<code>CBTConsole.exe [COM port name] [bus] [output file]</code>
Here is the source code for my app: https://github.com/eiannone/CBT-Diagnostic
To ease dealing with OBD protocol I implemented mask filtering on firmware for CAN messages id. That's because ODB II CAN messages id are only in the range from 0x7E8 to 0x7EF. You can find it in my <a href="https://github.com/eiannone/CANBus-Triple/tree/can-mask">v0.5.1 can-mask branch</a>.
I suggest also to disable bluetooth rate limiting, in order to avoid missing some CAN packets when you receive quick responses from the car.
The apk is here: https://github.com/eiannone/CBT-Diagnostic/releases/download/0.1alpha/android-debug.apk
@jamesatfish, serial communication service UUID is 7a1fb359-735c-4983-8082-bdd7674c74d2
I subscribed to its characteristic b0d6c9fe-e38a-4d31-9272-b8b3e93d8657 (with indicate method), and send commands to its other characteristic b0d6c9fe-e38a-4d31-9272-b8b3e93d8658 (with notify method).
But they are interchangeable. You can also use the same characteristic to write and receive data (subscribe).
My app is working quite well now. I am implementing some OBD II communication through CAN messages, following Wikipedia Article on OBD II (https://en.wikipedia.org/wiki/OBD-II_PIDs).
If I've time I will publish the code during this weekend.
I used this library (Cordova plugin) for BLE: https://github.com/randdusing/BluetoothLE