Serial Port configuration in RHEL
-
-
@Nimika That means that user root and group dialout have read/write access, nobody else have any access.
So you either start your app as root, or (much better) add the user you're using (hopefully not root) to the group dialout. -
NEVER EVER use root like that. All the more when developing. It's bad practice and doing so you're opening a gaping security hole.
Add your normal user to the
dialout
group and be done with it. -
QIODevice::OpenMode mode = QIODevice::ReadOnly | QIODevice::Unbuffered;
Did you read documentation? QIODevice::Unbuffered it is unsupported mode.
-
-
Please tell me how to add my normal user to the dialout group?
sudo usermod -a -G dialout theuser -
What is dialout group?
Its a predefined group found in many distros.
From old times it was used to allowed modems
to make connection etc. ( ie allow the user to connect to the internet :)
So often the system has this group and any user in it, have access to /dev/ttySX
-
-
@Nimika
Np. as far as I can see it's the same for Red Hat with ttySX access, so there is
tons on google on the topic on allowing user X to read and write to /dev/ttSxxx
stuff.
http://ithelpblog.com/os/linux/bashandscripts/howto-add-user-to-group-on-linux-redhat-rhel-centos-fedora/ -
@Nimika
Hi
Any user can be granted access to /dev/X devices.
Often it is done via the dialout group as its already assigned to serial devices such as ttyS0 and
any user that is member of that group can use it.
so often
sudo adduser TheUserName dialout
and and reboot is all that is needed.
Adding user to group might have slightly different syntax on RH but concept and rights are 100% the same.:)
http://websistent.com/fix-serial-port-permission-denied-errors-linux/ -
@Nimika said in Serial Port configuration in RHEL:
RHEL is not allowing any other user to add in dialout group.
cant you just use sudo in front?
-
@Nimika RHEL works like any other Linux distribution. To add a user to a group you need to be root. You can either login as root, or just enter su in a terminal window enter your root password and then add the user to the group. su is used to become root in a shell (you need root password).
@mrjj I think on RHEL sudo is usually not used, so sudo will probably not work (as far as I know, I could be wrong as I use Ubuntu).