Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QtSerialPort on Android (Qt.5.12.x)
Forum Updated to NodeBB v4.3 + New Features

QtSerialPort on Android (Qt.5.12.x)

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
9 Posts 4 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • md2012M Offline
    md2012M Offline
    md2012
    wrote on last edited by md2012
    #1

    Hi,
    Today I was working on a little project that reads some data from a sensor by a CP210x serial/USB device.
    on my ubuntu, I use ttyUSB0 to connect to my device but on the Android device it's not working and the serial port open function returns false for the operation result.
    I also tried ttyUSB1,2,3,4 and no luck.
    With the help of some other software looks like the device is located in /dev/bus/001/131 not in /dev/tty*.
    Any idea what is wrong or what should i do?

    KroMignonK 1 Reply Last reply
    0
    • K Offline
      K Offline
      kuzulis
      Qt Champions 2020
      wrote on last edited by kuzulis
      #2

      What's error code returned? (I suspect that is is 'permisison' error).

      BTW: QSerialPort don't supported on Android. Use it on own risk.

      1 Reply Last reply
      1
      • md2012M Offline
        md2012M Offline
        md2012
        wrote on last edited by
        #3

        There is no actual error code. the function only returns a boolean value.
        about the support thing i think it supports the android os because there is no library build error or log which indicates any sort of problem.

        1 Reply Last reply
        0
        • md2012M md2012

          Hi,
          Today I was working on a little project that reads some data from a sensor by a CP210x serial/USB device.
          on my ubuntu, I use ttyUSB0 to connect to my device but on the Android device it's not working and the serial port open function returns false for the operation result.
          I also tried ttyUSB1,2,3,4 and no luck.
          With the help of some other software looks like the device is located in /dev/bus/001/131 not in /dev/tty*.
          Any idea what is wrong or what should i do?

          KroMignonK Offline
          KroMignonK Offline
          KroMignon
          wrote on last edited by
          #4

          @md2012 said in QtSerialPort on Android (Qt.5.12.x):

          Any idea what is wrong or what should i do?

          Are you sure this hardware is supported by Android? Which version of Android you are using?
          To me, it looks like Android did not recognize the hardware.

          It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

          1 Reply Last reply
          0
          • md2012M Offline
            md2012M Offline
            md2012
            wrote on last edited by
            #5

            Android version is 7.
            The os itself I'm not sure but i installed someother serial interaction softwares from google play and it works just fine.

            1 Reply Last reply
            0
            • md2012M Offline
              md2012M Offline
              md2012
              wrote on last edited by
              #6

              I also used QSerialPortInfo::availablePorts() and the list is empty.

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kuzulis
                Qt Champions 2020
                wrote on last edited by
                #7

                @md2012 said in QtSerialPort on Android (Qt.5.12.x):

                There is no actual error code.

                There are QSerialPort::error()

                With the help of some other software looks like the device is located in /dev/bus/001/131 not in /dev/tty*.

                No, the serial port should be located in /dev/tty. If there are no serial port exists, this means that the Android kernel don't see that device (there are no appropriate drivers).

                1 Reply Last reply
                1
                • md2012M Offline
                  md2012M Offline
                  md2012
                  wrote on last edited by md2012
                  #8

                  so according to this link and the evidence cp210x is not supported by the android and i need to take another approach to the matter.
                  Anyway, I will share the result as soon as it's done.

                  D 1 Reply Last reply
                  0
                  • md2012M md2012

                    so according to this link and the evidence cp210x is not supported by the android and i need to take another approach to the matter.
                    Anyway, I will share the result as soon as it's done.

                    D Offline
                    D Offline
                    doomdi
                    wrote on last edited by
                    #9

                    @md2012

                    Hi!

                    Did you solve it? I have same problem.

                    help me :)

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved