I’m trying to get our app to read from our Can-Bus interface card. I have the Linux driver compiled and installed in the Kernel.
But when I try to bring up the interface in the container.
root@host:/usr/src/app# ip link set emuccan0 up qlen 1000
Cannot find device "emuccan0"
On the Host OS this does work and a new emuccan0 interface shows up under ifconfig. But how do I expose it to my application container so that our app can work with it?
Yeah, that thread is mine too, but it’s about a different problem.
The complete story is I have to support two different CAN bus interface cards. One from Peak where I can’t get the driver to load in the Kernel. That other thread is about that.
My other card is from Innodisk, they ave their own driver separate from the kernel source tree. That module builds and installs fine in my kernel.
But now Balena does not give me access to the network device Linux makes for me. This thread is about that issue. I figured they are separate issues so I make different posts.
I can try raise this with the OS team to check, but can you confirm that you’re running the container in privileged most first? Just to rule out the easiest options first
Just to clarify my issue, the device driver works, it loads without error. The thing is that CAN bus interface cards are treated as network devices by Linux. And Balena, does not let me interface directly with a network device from the container.
On the Host OS I can run:
ip link set emuccan0 up qlen 1000
And this will give me the emuccan0 network interface like so:
emuccan0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
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)
This is really quite convenient because from our application code we can interact with the CAN bus using simple sockets.
But when I try to run the same ip link command from the container I get:
ip: ioctl 0x8943 failed: No such device
I suspect this is because Linux treats it as a network device and Balena is (for good reason) rather possessive about network devices.
In short I’d like to know how I can interact with the CAN bus sockets from a container.
Yes, that does allow me to reach the canbus interface.
But now my app can’t communicate with the other containers anymore.
Should I abandon isolation and switch the other containers to host mode as well and bind to 127.0.0.1?
Hi @ErikHH I am building an applicaiton using rev pi connect and rev con can module.
I am not able to install can-util . As a result not able to use fucntions from can-util