Due to new devices at home that exchange data via Modbus RTU and Can, I wanted to take the opportunity to “play around” with both protocols to make the house even smarter at best. With a BeagleBone Green Wireless and a BeagleBone Black Wireless still on hand, it made sense to use the BeagleBone® Comms Cape advertised on your site for testing. Both were ordered from Digi-Key and delivered quickly.
First: Disillusionment, as “only” two naked boxes were delivered, without documentation and without any link to a Wiki or similar.
Sources I found on this:
- Beagleboard:BeagleBone cape interface spec - eLinux.org
- https://github.com/beagleboard/capes/tree/master/beaglebone/Comms
My problem: The BBs do not talk to each other.
Status (dmesg partially):
Device I
debian@BeagleBone:~$ dmesg
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.10.168-ti-r71 (voodoo@rpi4b4g-02) (gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1bullseye SMP PREEMPT Fri Sep 1 04:05:07 UTC 2023
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Black Wireless
…
[ 9.237625] Freeing unused kernel memory: 1024K
[ 9.238468] Run /init as init process
[ 9.238483] with arguments:
[ 9.238491] /init
[ 9.238497] with environment:
[ 9.238504] HOME=/
[ 9.238511] TERM=linux
[ 9.238518] uboot_detected_capes=BBORG_COMMS,
...
Device II
debian@BeagleBone:~$ dmesg
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.10.168-ti-r71 (voodoo@rpi4b4g-02) (gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1bullseye SMP PREEMPT Fri Sep 1 04:05:07 UTC 2023
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Green Wireless
…
[ 9.289883] Run /init as init process
[ 9.289898] with arguments:
[ 9.289906] /init
[ 9.289913] with environment:
[ 9.289919] HOME=/
[ 9.289926] TERM=linux
[ 9.289933] uboot_detected_capes=BBORG_COMMS,
I think the two Capes have been properly recognised.
I have activated the Canbus on both units as follows:
debian@BeagleBone:~$ sudo modprobe can
debian@BeagleBone:~$ sudo modprobe can-dev
debian@BeagleBone:~$ sudo modprobe can-raw
debian@BeagleBone:~$ sudo ip link set can1 up type can bitrate 115200
debian@BeagleBone:~$ sudo ifconfig can1 up
dmesg says can is running:
debian@BeagleBone:~$ dmesg | grep can
[ 43.232214] c_can_platform 481cc000.can: c_can_platform device registered (regs=d27d78b0, irq=46)
[ 43.279717] c_can_platform 481d0000.can: c_can_platform device registered (regs=9064f815, irq=47)
[ 53.031698] wlcore: WARNING This default nvs file can be removed from the file system
[ 178.012869] can: controller area network core
[ 186.499703] can: raw protocol
[ 202.786333] c_can_platform 481d0000.can can1: bitrate error 0.1%
[ 202.786705] c_can_platform 481d0000.can can1: setting BTR=0519 BRPE=0000
[ 202.809239] IPv6: ADDRCONF(NETDEV_CHANGE): can1: link becomes ready
More info:
debian@BeagleBone:~$ ip a
4: can0: <NOARP,ECHO> mtu 16 qdisc noop state DOWN group default qlen 10
link/can
5: can1: <NO-CARRIER,NOARP,UP,ECHO> mtu 16 qdisc pfifo_fast state DOWN group default qlen 1000
link/can
debian@BeagleBone:~$ sudo networkctl
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 usb0 gadget no-carrier configuring
3 usb1 gadget no-carrier configuring
4 can0 can off unmanaged
5 can1 can no-carrier unmanaged
6 wlan0 wlan routable configured
7 SoftAp0 wlan routable configured
7 links listed.
Attempts with cangen can1
and cansniffer can1
remain unsuccessful.
When the can cable is removed, I see this:
[29678.107021] c_can_platform 481d0000.can can1: bus-off
Questions:
- is there any reasonable documentation/documentation for sold capes (70,- EUR after all)? For example, I would have known what the two LEDs on the boards are for. Besides, RS485 is also on the agenda.
- Does anyone have any ideas on how to get the capes to talk?
Regards.