Hello Zac,
I’m not sure either why it is not working for you but some hints that I can give:
When building on a non-Xenomai-system, we are using a typedef of rt_dev_ioctl
to ioctl
(so we can use the same code in both cases). So while it also says “rt_dev_ioctl” in the error message, it is not really using a Xenomai function.
According to the output of initialize_can_bus.sh
the problem is that for some reason the CAN interface is not found (which results in the error you are getting). When initialised successfully, netstat -i
should give an output similar to this (i.e. listing some CAN interfaces):
» netstat -i felixwidmaier@roboch2
Kernel Interface table
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
can0 16 147734829 1 14800 0 2664560 0 0 0 ORU
can1 16 147575173 1 14798 0 2664560 0 0 0 ORU
can2 16 147707895 0 14802 0 2664560 0 0 0 ORU
can3 16 147844091 0 14805 0 2664560 0 0 0 ORU
can4 16 147789673 0 14801 0 2664560 0 0 0 ORU
can5 16 147930441 0 14805 0 2664560 0 0 0 ORU
enp0s31f 1500 4242396 0 0 0 26317 0 0 0 BMRU
enp180s0 1500 387300956 0 0 0 278401296 0 0 0 BMRU
lo 65536 33824 0 0 0 33824 0 0 0 LRU
Regarding USB vs PCI: I did some test with USB devices some time ago. From what I remember, there was no need to change anything to make it work with the USB device, so in general it should work. So I am not sure why it is not found in your case but at least this is the place where you should start debugging.
Note: We do still have some unresolved problems getting it to work reliably with CAN FD devices, though (both USB and PCI). So in case you decide to get a PCAN-PCI card, better get one without the “FD” capability. This issue is unrelated to the interface not being found, though.
Best,
Felix