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. QSerialport Problem
Forum Updated to NodeBB v4.3 + New Features

QSerialport Problem

Scheduled Pinned Locked Moved Mobile and Embedded
15 Posts 3 Posters 5.0k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #4

    Hi,

    Then you should first check the parameters used by minicom to setup the serial port. Are you using exactly the same with your program ?

    Does the device connected to the serial port need an initialization ?

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • I Offline
      I Offline
      Ivan1120
      wrote on last edited by
      #5

      The difference between minicom and my program are only in Baudrate which in minicom is 115200 and my program is 38400. I didn't know whether device need a initialization, i just guess. Because if my program was executed from minicom and everything is OK. I guess minicom did something i missed, but i still couldn't find any clues.

      1 Reply Last reply
      0
      • JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #6

        [quote author="Ivan1120" date="1409794053"]The difference between minicom and my program are only in Baudrate which in minicom is 115200 and my program is 38400.[/quote]The sender and receiver must both be configured to use the same baud rate.

        There are other parameters too. Check that you are using the same parameters on both the sender and the receiver:

        • Baud rate
        • Data bits
        • Stop bits
        • Parity
        • Flow control
        • Termination enabled?
        • Termination character (if enabled)

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        0
        • I Offline
          I Offline
          Ivan1120
          wrote on last edited by
          #7

          Yes, I know that, they are the same. When I sent more data, my program would have a error message like "Resource temporarily unavailable", if i didn't execute my program through "minicom".

          1 Reply Last reply
          0
          • JKSHJ Offline
            JKSHJ Offline
            JKSH
            Moderators
            wrote on last edited by
            #8

            What version of Qt are you using? Does this still happen with Qt 5.3.1?

            It might be related to "this bug":https://codereview.qt-project.org/#/c/85414/ which doesn't look like it has been fixed yet... :(

            But in case it's not a Qt bug, could you show us your serial port code?

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            1 Reply Last reply
            0
            • I Offline
              I Offline
              Ivan1120
              wrote on last edited by
              #9

              Hi:
              u can refer to example named "Terminal". So.....if this is a bug, it means i can't execute my program from touchscreen and should be executed from minicom?? I don't understand the bug of blog u mentioned....

              1 Reply Last reply
              0
              • JKSHJ Offline
                JKSHJ Offline
                JKSH
                Moderators
                wrote on last edited by
                #10

                What version of Qt are you using?

                Can you describe what you mean by "execute my program"? How do you use a touchscreen and minicom to "execute" the program?

                When you said "Terminal" example, do you mean "this one":http://qt-project.org/doc/qt-5/qtserialport-terminal-example.html?

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                1 Reply Last reply
                0
                • I Offline
                  I Offline
                  Ivan1120
                  wrote on last edited by
                  #11

                  1.I'm using Qt 4.8.4, but i take the QSerialport project from Qt5.3.1. It could pass compilation and it also work well on my host computer.
                  2."execute my program" means run it. for example if i want to run my program from "minicom", i should give a command like "./terminal" and if it's from touch screen, i just press the icon and my program will start to run, just like u play ur app on ur smartphone.
                  3.yes

                  1 Reply Last reply
                  0
                  • JKSHJ Offline
                    JKSHJ Offline
                    JKSH
                    Moderators
                    wrote on last edited by
                    #12

                    Hi,

                    [quote author="Ivan1120" date="1409812270"]I don't understand the bug of blog u mentioned....[/quote]There is a bug in QSerialPort. Sometimes, when reading data, QSerialPort returns a "Resource temporarily unavailable" error, even if the resource is available.

                    I still don't fully understand how you have set up your system: Did you use minicom to run your Qt program? Or did you use minicom to read data from your serial port?

                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                    1 Reply Last reply
                    0
                    • I Offline
                      I Offline
                      Ivan1120
                      wrote on last edited by
                      #13

                      Hi, I used minicom to run my Qt program but I also could run my Qt program from the touch screen, because it using matrix syntax that could show my program on the GUI. In my experiment, there were two different results if I used forementioned two methods to run my Qt program. For using minicom to run my Qt program, there are no error and warning on my Qt Program which would used QSerialPort, but for the others, whatever methods(telnet, touchscreen.. etc) I used to run my Qt program, it always would get the error message like "Resource temporarily unavailable". If this was a bug ,why the official have not fixed it, I thought this is a big problem.

                      1 Reply Last reply
                      0
                      • JKSHJ Offline
                        JKSHJ Offline
                        JKSH
                        Moderators
                        wrote on last edited by
                        #14

                        Ok, here is what I understand so far:

                        Your Target has a Touchscreen.

                        Your PC is connected to your Target using serial ports.

                        You use your PC to control your Target in the following different ways:

                        You open minicom on your PC, and use minicom to connect to your Target.

                        You open telnet on your PC, and use telnet to connect to your Target.

                        You built the Qt Terminal Example Program to run on your Target.

                        You tried to launch your Program in the following different ways:

                        You type a command into minicom (see #3.1) to launch the Program. Using this method, your Program produces no errors.

                        You type a command into telnet (see #3.2) to launch the Program. Using this method, your Program produces "Resource temporarily unavailable" errors.

                        You tap an icon on the Touchscreen to launch the Program. Using this method, your Program produces "Resource temporarily unavailable" errors.

                        Is this correct? If so, please tell us:

                        • Which Target serial port does your PC connect to for #3.1?
                        • Which Target serial port does your PC connect to for #3.2?
                        • Which Target serial port does your Program open?
                        • How do you see the error messages for #5.1?
                        • How do you see the error messages for #5.2?
                        • How do you see the error messages for #5.3?
                        • At first, you said you ran the "Terminal" example, then you said you ran a matrix GUI. Do you run both programs at the same time?

                        [quote author="Ivan1120" date="1410743901"]If this was a bug ,why the official have not fixed it, I thought this is a big problem. [/quote]Note that I said you might be seeing this bug. It could be the same issue, or it could be something different. The bug I mentioned is rare. It doesn't affect most people.

                        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                        1 Reply Last reply
                        0
                        • I Offline
                          I Offline
                          Ivan1120
                          wrote on last edited by
                          #15

                          bq. Which Target serial port does your PC connect to for #3.1?

                          I do not really sure what you asked.., I open the port on the target named "ttyUSB1".

                          bq. Which Target serial port does your PC connect to for #3.2?

                          Use telnet only require ip address, in this test, i used 172.22.100.xx to connect the target board.

                          bq. Which Target serial port does your Program open?

                          "ttyO0"

                          bq. How do you see the error messages for #5.1?
                          How do you see the error messages for #5.2?
                          How do you see the error messages for #5.3?

                          Use the API QserialPort provide.
                          @
                          MySerialPort->errorString();
                          @

                          bq. At first, you said you ran the “Terminal” example, then you said you ran a matrix GUI. Do you run both programs at the same time?

                          Matrix GUI start to run when the board boot up and I have wrote some code that make "Terminal" can be showed on the screen through matrix syntax.

                          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