Multi serial port application
-
yes i am in dialout group....
-
crw-rw---- 1 root dialout 4, 68 Dec 11 13:22 /dev/ttyS4
-
@jsulm said in multi serial port application:
ls -lh /dev/ttyS4
crw-rw---- 1 root dialout 4, 68 Dec 11 13:22 /dev/ttyS4
-
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
-
sudo usermod -a -G dialout veera
-
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 -
i have verified with minicom slot machine cable is connected with ttyS4 so i am trying with this port
-
i have tried ttyS0 and ttyS1 also it is not able to open the serial port....
-
mrjj Lifetime Qt Championreplied to veera 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 ?
-
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. -
-
yes i have rebooted system now opened successfully ......Thank you so much
-
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 -
@jsulm I know :) But it does not hurt either and before explaining what logging out an in again means...
38/49