IoT Edge CAN Support

Chase Hollingsead 6 Reputation points
2022-01-11T17:15:32.25+00:00

I'm currently working on an IoT Edge Module that needs to read / write data via the host computer's CAN bus ports (can0, can1, etc). Is it possible to bind the CAN bus ports to the IoT Edge module via the deployment.json file? I'm assuming you can since you are able to bind tcp ports, but I haven't seen anything in the Microsoft documentation on how you would bind CAN ports to a container.

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
567 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde | MVP 32,011 Reputation points MVP
    2022-01-12T14:48:54.687+00:00

    Hello @Chase Hollingsead ,

    it seems you want to access a can bus on Linux?

    In general, via the Azure IoT Edge Container Create Options, extra settings regarding the sandbox behavior of an IoT Edge module can be passed.

    This way, eg. access to file system folders, port mappings or serial port access is controlled.

    Here is an example of getting access to /dev/ttyS0, a serial port.

    If a can bus port is available as /dev/can0 or /dev/can1, this could work for you too?

    Next to that, the Azure IoT Edge 'user' needs to have access to the actual device.

    You can give everyone access like this, just to test:

    sudo chmod 777 /dev/????  
    

    Note: In production, perhaps 777 is just a bit too much freedom...

    Keep in mind, this line will need to be added to the crontab on the device to survive a reboot.

    Can you try this out?

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.