On 7/8/11 1:59 AM, Oliver Hartkopp wrote:
How do I create a virtual CAN interface? (Sorry for the n00b question ...)

Always welcome :-)

Thank you!

http://lxr.linux.no/#linux+v2.6.39/Documentation/networking/can.txt#L607

There's also a script i personally use in /etc/init.d which creates four vcans (vcan0 .. vcan3) by default:

http://svn.berlios.de/wsvn/socketcan/trunk/etc/can_if

Well, this is interesting :

   [wgn@dess-aopen1 ~]$ sudo ip link add dev vcan01 type vcan
   RTNETLINK answers: Operation not supported

However, that document pointed out some other interesting things to look at. It looks like the connection is, itself, having deeper problems. When I run the ip details command, then run the cansend command, the the ip details command, it looks like the TX connection dies. (I modified the cansend command to display the packet it thinks it's sending; it just involved removing a comment.) I should point out that candump continues to hum along, showing traffic from the connected device ...

   [wgn@dess-aopen1 ~]$ ip -details -statistics link show can0
   3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state
   UNKNOWN qlen 10
        link/can
        can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
        bitrate 250000 sample-point 0.875
        tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
        esd_usb2: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..1024 brp-inc 1
        clock 60000000
        re-started bus-errors arbit-lost error-warn error-pass bus-off
        0          1          0          0          0          0
        RX: bytes  packets  errors  dropped overrun mcast
        26639      3392     1       0       0       0
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0

   [wgn@dess-aopen1 ~]$ cansend can0 18EA0001#03.F0.01
   18EA0001  [3] 03 F0 01

   [wgn@dess-aopen1 ~]$ ip -details -statistics link show can0
   3: can0: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state
   DOWN qlen 10
        link/can
        can state ERROR-PASSIVE (berr-counter tx 0 rx 144) restart-ms 0
        bitrate 250000 sample-point 0.875
        tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
        esd_usb2: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..1024 brp-inc 1
        clock 60000000
        re-started bus-errors arbit-lost error-warn error-pass bus-off
        0          4737       0          274        274        273
        RX: bytes  packets  errors  dropped overrun mcast
        80703      10167    4737    0       0       0
        TX: bytes  packets  errors  dropped carrier collsns
        0          0        0       0       0       0

Any thoughts on this? Any idea where to look next?

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

Reply via email to