UART Access Issue on Torizon OS with .NET and Docker Configuration

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello Anurag,

Thank you for reaching out with your question. It sounds like you’re making great progress with your project, and I’m here to help you resolve the UART access issue you’re encountering.

To address the ‘Access to the port is denied’ error, please consider the following steps:

  1. Check User Permissions:

    • Ensure that the user running your application inside the Docker container has the necessary permissions to access the UART device. This typically involves adding the user to the ‘dialout’ group, which grants access to serial ports. You can modify your Dockerfile to add the Torizon user to the ‘dialout’ group with the following command:
      RUN usermod -aG dialout torizon
      
    • After making this change, rebuild your Docker image.
  2. Verify Docker Compose Configuration:

    • Double-check your docker-compose.yml file to ensure it correctly maps the UART device from the host to the container. Your configuration seems correct, but it’s always good to verify that the device path is accurate and matches the symlink (e.g., /dev/verdin-uart1).
    • Ensure the devices section in your docker-compose.yml is properly formatted:
      devices:
        - "/dev/verdin-uart1:/dev/verdin-uart1"
      
  3. Test Device Access:

    • After implementing these changes, test accessing the UART device from within the container. You can do this by running a simple command inside the container to check if the device is accessible:
      ls -l /dev/verdin-uart1
      
    • This should confirm that the device is present and accessible.
  4. Debugging:

    • If the issue persists, check the container logs for any additional error messages that might provide more context.
    • Also, ensure that no other process is using the UART device, as this could cause access conflicts.

By following these steps, you should be able to resolve the access issue and successfully communicate with the UART device from your .NET application on Torizon OS.

I hope this helps! If you have any further questions, feel free to ask.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Error using UART in Torizon: Operation not permitted.