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. Use pseudo terminals with qt-serial on OSX

Use pseudo terminals with qt-serial on OSX

Scheduled Pinned Locked Moved Solved General and Desktop
serialpseudo-terminal
6 Posts 4 Posters 923 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.
  • A Offline
    A Offline
    AlexanderB
    wrote on last edited by
    #1

    Hi all!

    I'm trying to use pseudo terminals in a QT application on OSX, but run into an exception when starting the program.

    I am using eg /dev/ptyp0 and /dev/ttyp0. When using those with screen I can open both and see the input of the one echoed in the other.

    I am using the QT async serial port example to connect to /dev/ttyp0, but always get the following error:

    QSocketNotifier: Invalid socket 7 with type Read, disabling...
    

    What am I doing wrong, and does someone have a working example?

    Thanks in advance!

    aha_1980A 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      What are these two devices ?

      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
      • A AlexanderB

        Hi all!

        I'm trying to use pseudo terminals in a QT application on OSX, but run into an exception when starting the program.

        I am using eg /dev/ptyp0 and /dev/ttyp0. When using those with screen I can open both and see the input of the one echoed in the other.

        I am using the QT async serial port example to connect to /dev/ttyp0, but always get the following error:

        QSocketNotifier: Invalid socket 7 with type Read, disabling...
        

        What am I doing wrong, and does someone have a working example?

        Thanks in advance!

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @kuzulis Any idea?

        Qt has to stay free or it will die.

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

          I have not ideas. I just can say that:

          1. Pseudo terminals are not a serial ports.
          2. Try to use socat.
          3. Any errors related to QSocketNotifier - is not a QSerialPort issues (you can address it to QtCore team). :)
          A 1 Reply Last reply
          2
          • K kuzulis

            I have not ideas. I just can say that:

            1. Pseudo terminals are not a serial ports.
            2. Try to use socat.
            3. Any errors related to QSocketNotifier - is not a QSerialPort issues (you can address it to QtCore team). :)
            A Offline
            A Offline
            AlexanderB
            wrote on last edited by
            #5

            @kuzulis said in Use pseudo terminals with qt-serial on OSX:

            I have not ideas. I just can say that:

            1. Pseudo terminals are not a serial ports.

            I know, but they do behave as serial ports. From the first link: "Thus two programs talk to each other via this method and one program on ttyp3 thinks it's talking to a serial port.".

            1. Try to use socat.

            Can I use socat to mock a serial device? What I want to do is to mock a serial device, so that it responds to requests from my actual program as if it was an actual device (with a somewhat limited/fixed response).

            As long as my actual program connects to a serial port, I am fine with any other solution!

            1. Any errors related to QSocketNotifier - is not a QSerialPort issues (you can address it to QtCore team). :)

            Is this the right sub-forum for it, or should I post my question in another one as well?

            Thanks in advance!

            1 Reply Last reply
            0
            • A Offline
              A Offline
              AlexanderB
              wrote on last edited by
              #6

              @kuzulis I've had a look at socat, and that looks to work! I now have a small example where I can write/read from a serial port. On the other end I am using screen, and my program picks up data as expected!

              Thanks for the pointer to socat! Didn't know about it..

              1 Reply Last reply
              1

              • Login

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