Nice job rtgree01 with your install. I was looking at the mbed stuff as well. There are many ways to work with CAN BUS, I even seen some CAN BUS stuff built with the Raspberry Pi. You're more than welcome to use this thread for details of your CAN BUS integration as it fits with the title and this thread wasn't meant to be just about my implementation.
Yes there are different networks in the car. My car has the Drive train, Comfort and infortainment busses. Some other VW's just have Drive Train and Comfort busses. Also some information is shared between the busses. You will have to poke around to see what's available.
Great, just ordered an Arduino One, a can bus shield and some kind of extended starters kit with tons of components. Can't wait to play around with it and start sniffing the bus. There are lots of possibilities with it.
I've been doing the same with a BMW,
I had also been doing all of my reverse engineering using an Arduino with a Canbus shield. I have now made my own version of this with the ATMEGA and CANBUS drivers.
For more information on my BMW work please see these links:-
The little board I have made is shown below. I have been testing this for the past week in my car and it seems very stable. Essentially this is exactly the same as the Arduino with canbus shield, it's just a bit smaller
If you are using an Arduino with the Sparkfun Canbus Stack then writing back to the can bus is quite simple, you only need to send the ID, length and the relevant data packets. I can strobe the interior light with the routine / loop below.
Write 1E3 02 F1 FF
Write 1E3 02 F0 FF
If you are using the Sparkfun Can bus Stack with a BMW then you will need to add the line below to the Canbus.h file
#define CANSPEED_100 9 // CAN speed at 100 kbps
In case it is of use to anyone, I have uploaded the Arduino code and the library I use for streaming Canbus commands at the link below:-
The Canbus directory will need to be copied into the libraries directory of Arduino.
This is working with Arduino 0022. (You will need to change the name of some of the includes if you want to work with Rev 1.01 or later)
Note that I haven't included the code for writing back to the bus in this sketch. I haven't tidied that bit up yet!
Nice board Trevor. Small and compact, I can see plenty of uses for it. I'm thinking of adding Can Bus to my monitor to control things like backlight settings, input selection for reverse camera and a few other things. A board that size would be perfect for that.
Anyone knows where I can find the can.h library of the projects that's being used here: http://secuduino.blogspot.nl/2011/10...a-english.html ?
Searched everywhere, downloaded tons of CAN libraries but they weren't the one. That library seems to be very easy and spot on.
I contacted them about that file when I first started and was told that they only provide that file if you purchase their Can Bus shield. I believe someone did post a copy of it on the Arduino.cc forums a few months back but I don't have the exact link.
Also I've seen good things about the Can Bus library from here too. It may be the same one from secuduino
Last edited by that_kid; 01-19-2013 at 06:26 PM.
If someone has that specific library I would be really thankful. It seems very easy and straightforward.
Here is some information about what I have done on my car...
Originally, I used a CANUSB device. It worked well, but required the computer to do anything. I was able to record and decode all the messages required to control the OEM amplifier and Sirius satellite radio, and then I decoded some of the other messages as well. First, I used some software from canhack.org that recorded all the messages to a sql database. That helped me figure out most everything I know.... I was able to then write some messages back to the can bus. I can lock/unlock the car doors, pop the trunk open, among other things. I also wrote a plugin for RideRunner to do everything in an integrated way. It worked well, until I tried to fix a ground loop.... fried the CANUSB device...
So I found the mbed microcontroller. It hardly needs any extra components to do CAN, and has a ton of other features.... USB host and device, ethernet, serial, i2c, digital in/outs, analog in/out.... All without really requiring many extra components. I breadboarded a design and got everything to work again.... Then I got to work making it work in a standalone manner... and then set about doing the communication over ethernet (multicast). I updated my plugins (amplifier control/steering wheel controls, sirius audio input). I also wrote a couple of apps to watch the data come in live... telling me when any value changes. I also wrote a utility that is similar to Wireshark... I can specify the what bits do what, and then chart them over time.
There are a few downsides to my mbed design. It needs a regulated power supply. Also, it is not a low power device. It will run down the car battery over time. To fix that, I will need a smaller, lower power, simpler microcontroller. I'm not going to fix that in my next revision.... at least not yet.
If people are interested, I have the eagle schematic and bill of materials for my current board. It is really only a break out board, but it has worked for nearly a year. I can also provide my RideRunner plugins.