Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT wiringpi serial communication
Forum Update on Monday, May 27th 2025

QT wiringpi serial communication

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 2 Posters 3.9k Views
  • 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.
  • R Offline
    R Offline
    rapid84
    wrote on last edited by
    #1

    Hi,
    i want to use wiringpi for serial communication with qt. i need to read the incoming data continuously. I have read slot and signals but i could not write any working code. Sending data is more easy but i have problem with reading data. I have tried to write first connection like this;

    connect(sender, SIGNAL(destroyed()), this, SLOT(objectDestroyed()));
    

    but it doesnt work.

    http://wiringpi.com/reference/serial-library/

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Is there any reason you cannot use the Qt serial library ?
      http://doc.qt.io/qt-5/qtserialport-index.html
      http://doc.qt.io/qt-5/qtserialport-terminal-example.html

      It would provide for reading incoming data continuously very easy.

      The terminal program sample will read and show any incoming data.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rapid84
        wrote on last edited by
        #3

        well, beside serial comm, i will need adc and gpio driving. wiringpi provides these for my embedded platform.

        mrjjM 1 Reply Last reply
        0
        • R rapid84

          well, beside serial comm, i will need adc and gpio driving. wiringpi provides these for my embedded platform.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          ok.
          The wiringpi don't use signal and slot so you cannot connect that way.
          You should use it like any C/C++ library.

          But you could use a Qtimer + a slot and call
          int serialDataAvail (int fd) ; to check if anything to read and then call
          int serialGetchar (int fd) ;
          to get the input.

          http://stackoverflow.com/questions/17784409/linking-a-function-to-a-timer-with-qt

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rapid84
            wrote on last edited by
            #5

            @mrjj
            can the Qt serial library be used for embedded systems? Maybe there is a way to use it...

            mrjjM 1 Reply Last reply
            0
            • R rapid84

              @mrjj
              can the Qt serial library be used for embedded systems? Maybe there is a way to use it...

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by mrjj
              #6

              @rapid84
              Well I know people use Qt on this board
              so no reason the QSerial should not work.

              Do you know if the serial controller is a normal one?

              1 Reply Last reply
              0
              • R Offline
                R Offline
                rapid84
                wrote on last edited by
                #7

                @mrjj
                yes, there is only rx tx port on mcu.

                mrjjM 1 Reply Last reply
                0
                • R rapid84

                  @mrjj
                  yes, there is only rx tx port on mcu.

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @rapid84
                  well its easy to test if it works. Just take the Terminal example and run
                  it to see if will setup and open comport.

                  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