QT Serial port communication for Android



  • 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.



  • @gokulmaha Can you please elaborate your problem.

    I am not getting it.
    It would be best if you can provide some of the code snippet

    Are you able to make build file for Android.? Or you are able to build it but the code is not working on Android?



  • AFAIK QSerialPort requires root, so probably it doesn't work because you don't have root permissions on your android device.


  • Moderators

    @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.



  • 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.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.