A working demonstration on how to read GMLAN packets using an mbed and a compatible CAN transceiver such as (and tested with) the CAN-Bus demo board. The SparkFun CAN Shield should also work perfectly too, as should just about every MCP2551-based solution (but this code should be portable to other transceivers). Please note to get this to work, you must tie CAN_L to ground and connect CAN_H to the single wire CAN.
GMLAN Sniffer
Introduction
This project makes use of CAN on an LPC1768 to communicate with General Motors GMLAN network via a compatible transceiver. GMLAN is a single wire CAN Bus that operates at 33.333 kbit with 29-bit header packets and is commonly used for transmission of non-critical information between such nodes on automobiles as the following;
- Dash cluster
- Entertainment system (head unit)
- Satellite Navigation (OnStar for example)
- HVAC controls
- Immobiliser / alarm / other security systems
- Door locks and door status
- Power Windows
- Interior / exterior lighting
- Reversing sensors
The list is extensive, for a better idea of what can be done, view the ARBIDs tab on the GMLAN Bible Google Docs spreadsheet (tabs are at the bottom of the page).
Hardware setup
This is just one example of how you can interface with GMLAN using an SKPang CAN-Bus Breakout Board (based around an MCP2551 CAN Transceiver), using these instructions I assembled the following on my trusty prototyping board;
(Click to open high resolution version)
Changes
Revision | Date | Who | Commit message |
---|---|---|---|
8:cdd2bb40e72f | 2012-12-10 | foxdie | Switched back to monitor / sniffing mode, inadvertent change from a project running in parallel I copy/pasted from. |
7:8bc6a5d2ba1e | 2012-12-10 | foxdie | Updated startup information to be more user-friendly |
6:81bd5717b4ed | 2012-12-10 | foxdie | Added support to remotely reboot mbed to activate firmware updates (suitable for deep-installation in automobiles) |
5:f9107433b66a | 2012-12-10 | foxdie | Added rudimentary support for filtering GMLAN packets and migrated header code into its own class |
4:e40a05b32518 | 2012-12-06 | foxdie | Commented code to help assist others in future |
3:ce56713e4201 | 2012-12-06 | foxdie | Removed unneeded code, tested and works. |
2:a285b70981c6 | 2012-12-06 | foxdie | Cleaned up obsolete code and comments |
1:3daf1c9b3315 | 2012-12-06 | foxdie | Properly presents information however still needs verification on packets being accurate |
0:f08f63171361 | 2012-12-05 | foxdie | Initial version - logs but oddly formatted data |