[SOLVED]-Qt open port problem
-
wrote on 12 Aug 2014, 13:23 last edited by
hi,
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.htmland I am getting this error:
Status: Not running, Can't oprn ttyUSB0, error code 2.
I use my device information:
Port: ttyUSB0
Location: /dev/ttyUSB0
Description: USB-Srial Controller
Manufacturer: Prolific Technology Inc.
Serial number:
Vendor Identifier: 67b
Product Identifier:2303
Busy: Noand i am using ubuntu 12.04.
How can I fix this error?
thanks
-
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).
-
wrote on 13 Aug 2014, 06:34 last edited by
I solved the problem with "chmod". I did not have permission to access serial ports.
before:
@hamdi@eng:~$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Aug 12 15:31 /dev/ttyUSB0@after:
@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.
thanks
-
That's a security hole you opened there
1/5