[SOLVED]-Qt open port problem
I am trying to run Qt's own example but I could not to open port with Qt although the device attached to the serial port.
I am trying to run this example: http://qt-project.org/doc/qt-5/qtserialport-blockingslave-example.html
and I am getting this error:
Status: Not running, Can't oprn ttyUSB0, error code 2.
I use my device information:
Description: USB-Srial Controller
Manufacturer: Prolific Technology Inc.
Vendor Identifier: 67b
and i am using ubuntu 12.04.
How can I fix this error?
Hi and welcome to devnet,
Just an educated guess but what are the user:group rights on the device ?
Probably something like root:tty or an equivalent.
You would need then to ensure that your user is in that group.
Make sure you are setting up the connection correctly (parity, baud rate, etc.), and also verify your operating system actually does see any data on the port (use another program to read from ttyUSB0, or read it with cat).
I solved the problem with "chmod". I did not have permission to access serial ports.
@hamdi@eng:~$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Aug 12 15:31 /dev/ttyUSB0@
@hamdi@eng:~$ sudo chmod 777 /dev/ttyUSB0
hamdi@eng:~$ ls -l /dev/ttyUSB0
crwxrwxrwx 1 root dialout 188, 0 Aug 12 15:31 /dev/ttyUSB0@
also there are different type for chmod like chmod 664, chmod +r etc.
That's a security hole you opened there