Qt World Summit: Register Today!

QSerialPort PermissionError

  • Hello everyone,

    we're using QSerialPort to access a FTDI USB converter on Ubuntu 16.04 LTS.
    The program is working fine when we start QtCreator in root mode.
    But in user mode but we get permission errors opening our device (resp. any COM port device).
    We added our user to the device group and we also set the access rights to 666:
    crw-rw-rw- 1 root plugdev 188, 0 Sep 28 10:59 /dev/ttyUSB0
    But still no success. Other tools (e.g. a terminal program) are working in user mode.

    Is this a Linux problem or might this be related to Qt? Any ideas would be helpful.

    best regards

  • @ingdb
    I do not know the answer, you may get a better answer from a Qt expert here in due course. But just a heads-up if you do not: you should be able to use strace to monitor system calls made by your app and I believe in the case of opening devices that it shows the /dev device it uses and what error it gets back.

  • ok, that's it :-)
    With strace I found out the problem was a lock in /var/lock
    I removed this now its working.
    Thanks a lot