@tcochunk Welcome to Microsoft Q&A forum!
Are you following any documentation for the steps?
Unhandled exception. System.AggregateException: One or more errors occurred. (Access to the port '/dev/ttyACM0' is denied.)
---> System.UnauthorizedAccessException: Access to the port '/dev/ttyACM0' is denied.
---> System.IO.IOException: Permission denied
As per the error message, it is related to permissions for accessing the serial port
/dev/ttyACM0. This error can occur if the user running the container does not have the necessary permissions to access the serial port.
To fix this issue, you can try adding the container user to the
dialout group on the host, which should grant it access to serial devices. You can do this by adding the following line to your Dockerfile:
$ sudo usermod -a -G dialout <your-username>
<your-username> with the name of the user that the container runs as.
After running the command, please log out and log back in for the group changes to take effect. Make sure to restart your Pi as well.
Once you've added your user to the
dialout group and restarted, both running the code directly on the Pi and inside the container should have the necessary permissions to access
Please try above suggestions and let us know if that helps.
If this answers your query, do click Accept Answer and Yes if this answer helpful. And, if you have any further query do let us know.