[beagleboard] Possible to interface w/ vehicle CAN Bus?

The regular Bone has a CAN addon that costs more than the Bone itself. I ordered 2 supposedly the kernel supports CAN over socket.


Most US Autos use j1939 or other CAN stacks on top of can so you would have to do some packet deciphering after you soldered an OBD connector to the wires hanging off the CAN addon.


are you going to plug this all into a cigarette lighter to USB adapter? please send pictures

— On Wed, 5/29/13, jasmith86@gmail.com jasmith86@gmail.com wrote:


> From: jasmith86@gmail.com jasmith86@gmail.com
> Subject: [beagleboard] Possible to interface w/ vehicle CAN Bus?
> To: beagleboard@googlegroups.com
> Date: Wednesday, May 29, 2013, 7:03 PM
>
> I now have a shiny new BeagleBone Black in the mail, so please excuse the fact that I am completely new to the community :slight_smile:
>
> I am interested in interfacing with my car’s CAN bus (at least initially only sniffing the bus) through the OBD-II port, and am currently interested in the hardware side of it:
>
> 1. Does the BBB have the ability to communicate with a Controller Area Network out of the box?
>
> 1. Is there a BBB cape that would allow me to sniff my vehicle’s CAN bus?
>
> I don’t necessarily mind having to hack together code on the software side, but my main question at the moment is where to start on the hardware side.
>
> If anyone could point me in the right direction, I would appreciate it! Thanks :slight_smile:
>
> –
> For more options, visit http://beagleboard.org/discuss
> —
> You received this message because you are subscribed to the Google Groups “BeagleBoard” group.
> To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



|

From the bit of research I have done, my car ('04 Volvo v70 - US market) supports the ISO-9141(-2) CAN protocol – so I am not entirely sure if any of the capes mentioned thus far would necessarily work with it, but I guess I have plenty more research to do :smiley:

If anyone knows of an alternative to using a cape (all of which seem to be significantly more expensive than what I paid for the BBB), I would certainly be interested in exploring cheaper options!

As far as my setup goes, I haven’t even begun prototyping yet, so for the moment I will just be using a cig adapter, but I will be sure to upload pics when I have progress to show :slight_smile:

I did not purchase either of the CAN capes, I just built a simple “cape”, basically a perf board with a header and attached a CAN transceiver and DB9 connector. Since there was no eeprom, I had to initialize the CAN bus in the kernel. After that you can use candump to see the CAN activity, or use SocketCAN in a C++ application.

and what will you do with the data you get from OBD port assuming you send the right commands?

At this point I am primarily just interested in seeing what all information is sent over the CAN bus, but eventually I would want to stream selected output to either my phone/tablet or just log selective information.

My (currently limited) understanding of how the CAN protocol works is that all of the distinct control units in the vehicle are constantly sending messages over the bus, so I would just save/display the information I decide to target.

I still have a lot of digging to do, but eventually I would like to experiment with injecting commands onto the bus (ie put the front-driver window down, etc) – but this involves a lot more effort to ensure messages don’t go off-bus or cause the ECU to throw diagnostic trouble codes (DTCs). Right now I just want to experiment with BBB’s CAN capabilities as it relates to my vehicle.

Brent,

Are there any guides/resources you would recommend for me to build this?

Sure I can put something together. Let me get back to you tomorrow on this.

Awesome! I really appreciate it :slight_smile:

It doesnt hurt to dream big and I am no expert but I did work on an ECU in 92 and I dont think injecting commands onto the bus is general knowledge and supported over OBD but hey you get this working you can land a job in Detroit (-:
Best of luck I would start with the HW

I think the previous poster was referring to PCANView which sniffs can over USB

Hehe, yeah that is more or less my feeling on it too! But at the very least it should be a learning experience to dig around on the CAN Bus network :wink:

James,

I attached two pictures that show what my “cape” looked like. Two of the wires are broken, and because I don’t have a use for it anymore, I don’t plan on repairing it. I used a SN65HVD231D (http://www.digikey.com/product-search/en?lang=en&site=us&KeyWords=SN65HVD231D&x=0&y=0) CAN transceiver and actually got it for free from TI if you order samples. The wiring is pretty straightforward… connect P9.26 to pin 1, and P9.24 to pin 4. Then your CANH and CANL get wired to the right pins on your ODB II connector. That’s really all that is required for the hardware, but let me know if you have other questions.

IMG_20130530_171712.jpg

IMG_20130530_171723.jpg

This is a tranciever chip wired to a connector where is the connection to the Bone the header you mentioned

Look at the second picture. On the back of the perf board is a 2 row header that connects 3.3V, GND, dcan1_tx, and dcan1_rx. I did not bother making a header for all 46 pins on the bone… only the ones I needed.

Hi Brent,

Can you elaborate on how you did do to initialize the can on kernel?
Any guide as James request would be really helpful.

Which kernel did you used? 3.2.x or 3.8.x?

I’m developing a similar solution for a CAN interface, no EEPROMs.

Cheers,
Paulo

Someone has communicated with CANbus sensor without any extra transceiver using built-in CANbus,
device tree descriptor need to be edit, but I was not successful following the tutorial. I can not found the CAN device after restart

http://www.aero-box.co.uk/beaglebone-black#TOC-Enable-CANbus-device

Someone has communicated with CANbus sensor without any extra transceiver using built-in CANbus,
device tree descriptor need to be edit, but I was not successful following the tutorial. I can not found the CAN device after restart

http://www.aero-box.co.uk/beaglebone-black#TOC-Enable-CANbus-device

I think you are misinterpreting the blog: if you look carefully at the picture you’ll see he has 4 wires coming from the canbus: 2 for power and ground, the other 2 voor CANBUS. These two wires go to a chip, which will probably be the Canbus tranceiver.

https://gitorious.org/linux-can/can-utils

http://en.wikipedia.org/wiki/SocketCAN