CAN setup across two boards

133 views
Skip to first unread message

rj...@umich.edu

unread,
Jul 12, 2018, 2:45:37 AM7/12/18
to BeagleBoard
Hi,

I'm trying to set up can on my beaglebone black. Right now I just want to know it works by communicating via CAN across two different boards.

I was able to send and receive can over one board with vcan, but am currently unable to get can working over two boards

On each board I have run the following commands

config-pin P9_24 can
config
-pin P9_26 can
sudo modprobe can
sudo modprobe can
-dev
sudo modprobe can
-raw
sudo ip link
set can0 up
sudo ifconfig can0 up


This is what I get when I run 

debian@beaglebone:~/Desktop/can_code$ ifconfig can0
can0
: flags=193<UP,RUNNING,NOARP>  mtu 16
        unspec
00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets
0  bytes 0 (0.0 B)
        RX errors
0  dropped 0  overruns 0  frame 0
        TX packets
0  bytes 0 (0.0 B)
        TX errors
0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt
169


I have set up two BBB's by connecting two CAN transceivers as shown in the schematic:



I have tried running on board 1
 cansend can0 5A1#01.02.03.04.05

and board 2
 candump can0


but I am unable to get a reading on board 2.

What steps do I need to take to get can communication between my two boards?

Thank you

Jason Kridner

unread,
Jul 12, 2018, 11:17:41 AM7/12/18
to BeagleBoard
https://gist.github.com/jadonk/90d3462c8569d11fa3f7caf14f4769f1

rx:
ip link set can0 type can bitrate 500000
ifconfig can0 up
candump can0

tx:
ip link set can0 type can bitrate 500000
ifconfig can0 up
cansend can0 123#DEADBEEF

rj...@umich.edu

unread,
Jul 12, 2018, 12:54:03 PM7/12/18
to BeagleBoard
I have run those lines of code, but candump doesn't print anything

Yiling Cao

unread,
Jul 13, 2018, 12:04:43 AM7/13/18
to beagl...@googlegroups.com
ip link set can0 type can bitrate 500000 triple-sampling on #bitrate can be 125000 or 500000
ifconfig can0 up
cansend can0 5A1#11.22.33.44.55.66.77.88
candump can0


--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/1b45dbec-4aca-42b0-ae06-7cbf6801dc04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Reply all
Reply to author
Forward
0 new messages