QT Serial port communication for Android
-
wrote on 19 Jul 2017, 05:26 last edited by
Hi there, I am working on a cross-platform application which is about getting a data(commonly weight) from precision balance and to display it on the connected (target)device.
FOR Windows PC
Using <QtSerialport> I can get the list of connected ports and I am able to get the data.FOR Android
-
The same code is not working
-
How to access the port
-
Is there any 3rd party library available?
Note: Connection is done with RS232 to USB for PC(windows)
RS232 to OTG for mobile devices. -
-
wrote on 24 Jul 2017, 07:47 last edited by Avtansh Sharma
@gokulmaha Can you please elaborate your problem.
I am not getting it.
It would be best if you can provide some of the code snippetAre you able to make build file for Android.? Or you are able to build it but the code is not working on Android?
-
wrote on 24 Jul 2017, 08:25 last edited by tomasz3dk
AFAIK QSerialPort requires root, so probably it doesn't work because you don't have root permissions on your android device.
-
AFAIK QSerialPort requires root, so probably it doesn't work because you don't have root permissions on your android device.
@tomasz3dk Do you mean QSerialPort requires root on Android? Because on Linux you don't have to be root to use QSerialPort if you set up access rights for the serial device properly.
-
wrote on 24 Jul 2017, 11:41 last edited by
Yes it requires root on Android (look here) probably it's the same problem, and yes you don't have to be root on Linux, if you have access rights to serial device as normal user.
1/5