On 03.01.2011 20:45, bruce bushby wrote:
> Hi

Hi Bruce,

> 
> Today I found socketcan and started jumping about the house celebrating
> :) I've been playing with the "arm cortex m3" cpu  using this board:
> http://mbed.org/forum/news-announcements/topic/900/     
> ...but when I connect it to my Audi A4 I can't read anything.....hence
> the joy of finding socketcan and the hope of being able to work from my
> laptop.
> 
> I'm hoping the list can offer me some quick start pointers
> 
> I'm using Fedora 13, ran some modprobes and have the following modules
> loaded:
> can_bcm                11446  0
> can_raw                 5705  0
> can_dev                 7212  0
> can                    30238  2 can_bcm,can_raw

That's pretty fine.

> 
> I then used svn:
> svn checkout svn://svn.berlios.de/socketcan/trunk
> <http://svn.berlios.de/socketcan/trunk>
> 

You don't need to compile the kernel modules in your case as they already come
with your Fedora (as you've shown above).

> I compiled the modules and then I compiled the can-utils as I want to
> use "candump", this brings me to my first question:
> 
> 1. Can I use the berlios can-utils with the existing Fedora kernel
> modules listed above?

Yes.

> I then ran the "ip" commands to bring up the interfaces (Using the
> standard Fedora can modules listed above):
> 
> ip link add type vcan
> ip link add dev can0 type vcan
> ifconfig can0 up

Funny idea - but you only created a virtual CAN interface named 'can0' ;-)

> 
> and I now have:
> can0      Link encap:UNSPEC  HWaddr
> 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
>           UP RUNNING NOARP  MTU:16  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
> 
> vcan0     Link encap:UNSPEC  HWaddr
> 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
>           NOARP  MTU:16  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
> 
> 
> but the next question is:
> 2. How do I associate a usb port with can0? .. I think my above
> interfaces are only virtual.

Yes, you are right with your assumption.

You need to have a 'real' CAN driver that creates a CAN netdevice for your
hardware adapter. E.g. there are currently two USB adapters in the Mainline
kernel that create CAN netdevices for their specific CAN-USB-hardware.

> My goal is to connect a VAG-COM cable (obd2 -> usb) to my laptop, bring
> up can0 associating the interface with the usb port and then use
> "candump" to sniff my cars canbus......

When you connect the OBD2 connector, you would also need some kind of OBD2
application for Linux/SocketCAN that knows how to perform the OBD2 protocol.

OBD2 is not only 'CAN' ... it is a protocol.

I don't know whether the VAG-COM adapter cable is able to be a transparent CAN
interface or if there is a special abstract protocol on the USB to trigger
predefined OBD2 commands with the CAN-CPU inside the VAG-COM adapter.

Regards,
Oliver
_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to