How to add myself to the dialout group?

I need to add myself to the dialout group for the Arduino IDE flatpak to be able to upload code to my micro-controller which is connected via USB.

$ ls -lah /dev/ttyACM0
crw-rw----. 1 root dialout 166, 0 Oct 25 12:34 ttyACM0

I have tried running this command as root:
grep -E '^dialout:' /usr/lib/group >> /etc/group
and then running this command.
useradd -aG dialout $USER

But, that last command does not add my user to the dialout group.
When I run groups I still only see my username and wheel.

I have also tried logging out and back in after running useradd but that doesn’t see to do anything.

This post is related to my other one here: Arduino IDE Flatpak Permission Error

To work around that, you can manually edit /etc/group and /etc/gshadow and add your user there:

/etc/group:

...
dialout:x:18:username
...

/etc/gshadow:

...
dialout:::username
...

Hi @Siosm, I have the same problem. I am trying to use Thonny in a toolbox to access my Pyboard, but it will not connect to /dev/ttyACM0 due to a permission error. I have tried all the fixes suggested in various tutorials on the net, and your suggestions above, and yet the error persists. At least now, after I did the mods you suggested, the “groups” command shows “ian dialout” whereas before it showed only “ian wheel”. (i seem to have lost “wheel”, not sure what that is anyway).

Inside the toolbox the “ls” command shows the owner and group as nobody and nobody. I’ve tried logging out and in again, and also rebooting the PC, but still Thonny won’t connect to the device.

Is there anything else I can try? Or have I done something wrong?

I’m on SB33 (upgraded yesterday)

Thanks.

Apparently toolbox does not keep your host groups inside the toolbox container.

The easiest work around I can think of is to chown the device to your user:

$ sudo chown username: /dev/tty/ACM0

That should make it available to Flatpak or toolbox applications.

That is the admin group sudoer users are normally put into in Fedora. The info is described here https://docs.fedoraproject.org/en-US/quick-docs/adding_user_to_sudoers_file/. You want this as it gives you your admin privileges.

Many thanks to @Siosm and @jakfrost, I have at last gained access to my device through Thonny! It took a fair bit of mucking around but I eventually got there.

Thanks again for all your help.

:wink: Ian

I think the proper method is https://docs.fedoraproject.org/en-US/fedora-silverblue/troubleshooting/#_unable_to_add_user_to_group.

EDIT: It seems this is precisely what you posted.

But what I do in my machine is precisely

grep -E '^dialout:' /usr/lib/group >> /etc/group
usermod -aG dialout ${USER}

and it works, so I am a bit confused now

I think you are first creating a dialout group from the default group settings for dialout, then adding your user to that group with the second command.