UART in Python Container: Permission denied

I am trying to use a UART from within a container. I followed the instructions here:

However, when starting the Debug Session in VSCode, I get the error [Errno 13] Permission denied ‘/dev/ttymxc1’, see screenshot attached. This usually means that the user is not part of the dialout group, but even after adding the torizon user (which should be the one running the container!?), the error persists.

I modified the Dockerfile from the gps example and replaced the python script with my own. This works without issue, so I guess there must be some configuration issue within VSCode. As far as I can tell, the serial port is mapped correctly to the container. When changing the identifier to a non-existent one, i.e. /dev/ttymxc5, the error message also changes to a file not found error.

Any help is appreciatedlink text

Sorry, there’s a point missing in the instructions (I’ll fix that ASAP), you’ve to set buildcommands property of your configuration to:

RUN usermod -a -G dialout torizon

this will ensure that the user is inside the dialout group and able to access UART.
We have groups mirrored between the base image and our debian containers, so they use the same GID, making permissions easier to read and change.
Sorry for the problem.

Thank You, that worked!

Perfect. Thanks for the feedback.