linuxcan-busbeagleboardcanutils

How to get CANbus working on beaglebone green


I am having trouble getting CAN working on my beaglebone green using can-utils. I have a bitscope hooked up to the CAN pins but I'm not seeing any output..

Beaglebone version:

$ uname -a
Linux beaglebone 4.4.155-ti-r152

Setting up can1 interface:

$ config-pin p9.24 can
$ config-pin -q p9.24
P9_24 Mode: can
$ config-pin p9.26 can
$ config-pin -q p9.26
P9_26 Mode: can

$ sudo ip link set can1 up type can bitrate 125000
$ sudo ifconfig can1
can1      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:10
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:196

Using can-utils for transmitting single CAN frames:

$ cansend can1 123#1122334455667788
$ cansend can1 5A1#00.01.02.03.04

I should at least see an output from pins p9.24 p9.26 but I don't, and I can't figure out why..

Any help is appreciated!!


Solution

  • Thanks to Benoît for the suggestion:

    I had to terminate pins p9.24 and p9.26 with a 120 Ohm resistor In order to get any messages to display on my bitscope.

    If the canbus is not terminated, the can interface will fail and any messages transmits will not work. The can interface will need to be set down and up again to be able to try sending another message.