Multi serial port application
-
wrote on 11 Dec 2017, 10:13 last edited by
i tried using this command on the qt project path also not able to open the serial ports.....
-
wrote on 11 Dec 2017, 10:31 last edited by
yes i am in dialout group....
-
wrote on 11 Dec 2017, 10:34 last edited by
crw-rw---- 1 root dialout 4, 68 Dec 11 13:22 /dev/ttyS4
-
wrote on 11 Dec 2017, 10:36 last edited by
@jsulm said in multi serial port application:
ls -lh /dev/ttyS4
crw-rw---- 1 root dialout 4, 68 Dec 11 13:22 /dev/ttyS4
-
wrote on 11 Dec 2017, 10:44 last edited by
Are you sure you really have 4 serial ports? Which kind of machine have you got?
In some case, with a beaglebone board for example, you have to enable the third and fourth serial port with a special kernel parameter. -
Hi
Often you have to add your user to the dialout group to be allowed to use itusermod -a -G dialout MY_USER_NAME
as @mrdebug asks/says
-
wrote on 11 Dec 2017, 11:06 last edited by
sudo usermod -a -G dialout veera
-
wrote on 11 Dec 2017, 11:08 last edited by
in my desktop using two serial ports using right now may be in built its four i guess.....
-
@veera Make sure your user is member of dialout group
-
Also if you are having ONLY 2 serial ports why are you then
trying the /dev/ttyS4 port ???
i would giess on
/dev/ttyS0
or
/dev/ttyS1 -
wrote on 11 Dec 2017, 11:22 last edited by
i have verified with minicom slot machine cable is connected with ttyS4 so i am trying with this port
-
wrote on 11 Dec 2017, 11:23 last edited by
i have tried ttyS0 and ttyS1 also it is not able to open the serial port....
-
Lifetime Qt Championwrote on 11 Dec 2017, 11:34 last edited by mrjj 12 Nov 2017, 11:43
ok. not sure what could be wrong with your linux if you have added
yourself (your username) to dial out group and you are sure that the port exists.What linux are you using ?
-
wrote on 11 Dec 2017, 11:57 last edited by
ubuntu 16.04 LTS ,i opened serial port now if i choose the run in terminal its opening please help how to set sudo password in qt instead of choosing run in terminal directly need to open
-
ubuntu 16.04 LTS ,i opened serial port now if i choose the run in terminal its opening please help how to set sudo password in qt instead of choosing run in terminal directly need to open
@veera said in multi serial port application:
ubuntu 16.04 LTS ,i opened serial port now if i choose the run in terminal its opening please help how to set sudo password in qt instead of choosing run in terminal directly need to open
If you need the sudo password than setting yourself into dialout group did not work!
Have your rebooted your PC after you put yourself into dialout?
Hint: call
error()
when opening the serial port fails to get more information about the error. -
@veera said in multi serial port application:
ubuntu 16.04 LTS ,i opened serial port now if i choose the run in terminal its opening please help how to set sudo password in qt instead of choosing run in terminal directly need to open
If you need the sudo password than setting yourself into dialout group did not work!
Have your rebooted your PC after you put yourself into dialout?
Hint: call
error()
when opening the serial port fails to get more information about the error. -
wrote on 11 Dec 2017, 15:21 last edited by
yes i have rebooted system now opened successfully ......Thank you so much
-
wrote on 11 Dec 2017, 15:23 last edited by
how to write and read the hexbytes such as unsigned char ch1[] = {0X01,0X04,0X0F} etc from serial port......
-
how to write and read the hexbytes such as unsigned char ch1[] = {0X01,0X04,0X0F} etc from serial port......
@veera
Hi
Hex is a notation and not a format.
The bytes are still just bytes.
QByteArray has
QByteArray::fromHex
http://doc.qt.io/qt-5/qbytearray.html#fromHex
and
http://doc.qt.io/qt-5/qbytearray.html#toHex
37/49