Docker: KISS-Modem on /dev/ttyACM0 not accessible #102

Closed
opened 2026-10-27 09:33:15 +01:00 by adam · 9 comments
Owner

Hi, I hope i'm doing this right...

I built the Docker-Image on a Raspberry Pi zero and had Problems with connecting the KISS-Modem on /dev/ttyACM0

My Solution:
i added usermod -a -G dialout $USER to the dockerfile:

# Create the group and user in order to run without root privileges
RUN groupadd --gid "$PGID" "$GROUP" \
    && useradd --uid "$PUID" --gid "$PGID" --home-dir "$HOME_DIR" --create-home --shell /usr/bin/bash "$USER" \
    && usermod -a -G dialout $USER

Hi, I hope i'm doing this right... I built the Docker-Image on a Raspberry Pi zero and had Problems with connecting the KISS-Modem on /dev/ttyACM0 My Solution: i added `usermod -a -G dialout $USER` to the dockerfile: ``` # Create the group and user in order to run without root privileges RUN groupadd --gid "$PGID" "$GROUP" \ && useradd --uid "$PUID" --gid "$PGID" --home-dir "$HOME_DIR" --create-home --shell /usr/bin/bash "$USER" \ && usermod -a -G dialout $USER ``` <!-- github-sync-id:4609337143 -->
adam closed this issue 2026-10-27 09:33:15 +01:00
Author
Owner

@yellowcooln

@yellowcooln <!-- github-comment-id:4646472819 -->
Author
Owner

I will have a PR in to fix shortly.

I will have a PR in to fix shortly. <!-- github-comment-id:4654879933 -->
Author
Owner

Without docker built on native Raspberry OS the KISS-TNC is recognized but does not RXing or TXing, maybe same issue?

Without docker built on native Raspberry OS the KISS-TNC is recognized but does not RXing or TXing, maybe same issue? <!-- github-comment-id:4656023757 -->
Author
Owner

@UnImAtrIXzEr0 and @StreetPiet can either of you test the new pymcdev docker image?

tags:
  - pymcdev/pymc-repeater:dev
  - pymcdev/pymc-repeater:sha-2b7b2b5
@UnImAtrIXzEr0 and @StreetPiet can either of you test the new pymcdev docker image? ```yaml tags: - pymcdev/pymc-repeater:dev - pymcdev/pymc-repeater:sha-2b7b2b5 ``` <!-- github-comment-id:4660183627 -->
Author
Owner

Without docker built on native Raspberry OS the KISS-TNC is recognized but does not RXing or TXing, maybe same issue?

Usually, a user who needs serial port access, needs to be in the dialout group as far as i know.

> Without docker built on native Raspberry OS the KISS-TNC is recognized but does not RXing or TXing, maybe same issue? Usually, a user who needs serial port access, needs to be in the dialout group as far as i know. <!-- github-comment-id:4661952871 -->
Author
Owner

@UnImAtrIXzEr0 and @StreetPiet can either of you test the new pymcdev docker image?

tags:

  • pymcdev/pymc-repeater:dev
  • pymcdev/pymc-repeater:sha-2b7b2b5

Hi. I tested both images with a fresh install on my Intel Machine. Both images show the same behaviour:
Access to /dev/ttyACM0 denied.
Here is what i did for both images:

  • added /dev/ttyACM0 to devices in docker-compose.yml
  • docker compose up (Log showed error with KISS Modem)
  • Looked at the Web Frontend: Radio Degraded Error
  • docker compose exec -u root pymc-repeater /bin/bash
  • useradd repeater dialout && exit
  • then i restarted the service in the Web Frontend
  • Kiss-Modem worked!
  • after a docker compose up --force-recreate
  • again: Radio degraded error
> [@UnImAtrIXzEr0](https://github.com/UnImAtrIXzEr0) and [@StreetPiet](https://github.com/StreetPiet) can either of you test the new pymcdev docker image? > > tags: > - pymcdev/pymc-repeater:dev > - pymcdev/pymc-repeater:sha-2b7b2b5 Hi. I tested both images with a fresh install on my Intel Machine. Both images show the same behaviour: Access to `/dev/ttyACM0` denied. Here is what i did for both images: - added `/dev/ttyACM0` to devices in docker-compose.yml - `docker compose up` (Log showed error with KISS Modem) - Looked at the Web Frontend: Radio Degraded Error - `docker compose exec -u root pymc-repeater /bin/bash` - `useradd repeater dialout && exit` - then i restarted the service in the Web Frontend - Kiss-Modem worked! - after a `docker compose up --force-recreate` - again: Radio degraded error <!-- github-comment-id:4662914577 -->
Author
Owner

@StreetPiet

I believe I've identified the issue and put together a fix that correctly maps the host's dialout group into the container.

I've opened a test branch here:

https://github.com/yellowcooln/pyMC_Repeater/tree/fix/docker-dialout-group

Commit:
3d97413 — fix: add dialout group to Docker image

If you're able to test it, please update your docker-compose.yml to include:

group_add:
  - "${DIALOUT_GID:-20}"

and set DIALOUT_GID to match the GID of the dialout group on your host:

getent group dialout

For example, if the output is:

dialout:x:20:

then:

DIALOUT_GID=20

The image now creates the dialout group inside the container and adds the repeater user to dialout, gpio, and spi, which should allow access to serial devices without requiring the container to run as root.

If you get a chance to test it, let me know whether it resolves the serial device access issue on your system. And if it does, I will get the changes into repeater on the upstream image.

yellowcooln/pymc-repeater:sha-3d97413
@StreetPiet I believe I've identified the issue and put together a fix that correctly maps the host's `dialout` group into the container. I've opened a test branch here: https://github.com/yellowcooln/pyMC_Repeater/tree/fix/docker-dialout-group Commit: `3d97413` — *fix: add dialout group to Docker image* If you're able to test it, please update your `docker-compose.yml` to include: ```yaml group_add: - "${DIALOUT_GID:-20}" ``` and set `DIALOUT_GID` to match the GID of the `dialout` group on your host: ```bash getent group dialout ``` For example, if the output is: ```text dialout:x:20: ``` then: ```env DIALOUT_GID=20 ``` The image now creates the `dialout` group inside the container and adds the `repeater` user to `dialout`, `gpio`, and `spi`, which should allow access to serial devices without requiring the container to run as root. If you get a chance to test it, let me know whether it resolves the serial device access issue on your system. And if it does, I will get the changes into repeater on the upstream image. ``` yellowcooln/pymc-repeater:sha-3d97413 ``` <!-- github-comment-id:4665615235 -->
Author
Owner

If you get a chance to test it, let me know whether it resolves the serial device access issue on your system. And if it does, I will get the changes into repeater on the upstream image.

yellowcooln/pymc-repeater:sha-3d97413

Hi!

it worked out of the Box for me as non-root docker container.
Well done!

> If you get a chance to test it, let me know whether it resolves the serial device access issue on your system. And if it does, I will get the changes into repeater on the upstream image. > > ``` > yellowcooln/pymc-repeater:sha-3d97413 > ``` Hi! it worked out of the Box for me as non-root docker container. Well done! <!-- github-comment-id:4769298867 -->
Author
Owner

This has now been implemented in the current official Repeater images.

The Docker image adds the non-root repeater user to the dialout group, and the current Compose configuration supports mapping the host’s numeric dialout GID into the container:

group_add:
  - "${DIALOUT_GID:-20}"

Please use the current official image rather than the older pymcdev/* or test images:

image: openhop/openhop-repeater:main

To update an existing installation:

docker compose pull
docker compose up -d --force-recreate

Make sure the serial device is mapped into the container:

devices:
  - /dev/ttyACM0:/dev/ttyACM0

Also check the host’s dialout GID:

getent group dialout

For example, if that returns:

dialout:x:20:

set the following in .env:

DIALOUT_GID=20

The original reporter confirmed that the fixed non-root image worked out of the box. I also verified the current published image and confirmed that the repeater process receives both its built-in dialout membership and a host-configured supplementary GID.

Please try the current official image and Compose configuration. This issue should now be resolved.

This has now been implemented in the current official Repeater images. The Docker image adds the non-root `repeater` user to the `dialout` group, and the current Compose configuration supports mapping the host’s numeric dialout GID into the container: ```yaml group_add: - "${DIALOUT_GID:-20}" ``` Please use the current official image rather than the older `pymcdev/*` or test images: ```yaml image: openhop/openhop-repeater:main ``` To update an existing installation: ```bash docker compose pull docker compose up -d --force-recreate ``` Make sure the serial device is mapped into the container: ```yaml devices: - /dev/ttyACM0:/dev/ttyACM0 ``` Also check the host’s dialout GID: ```bash getent group dialout ``` For example, if that returns: ```text dialout:x:20: ``` set the following in `.env`: ```env DIALOUT_GID=20 ``` The original reporter confirmed that the fixed non-root image worked out of the box. I also verified the current published image and confirmed that the `repeater` process receives both its built-in `dialout` membership and a host-configured supplementary GID. Please try the current official image and Compose configuration. This issue should now be resolved. <!-- github-comment-id:5029685874 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/pyMC_Repeater#102