Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Is it possible to reconnect to input devices (/dev/input/eventX) without restarting the application?
Forum Updated to NodeBB v4.3 + New Features

Is it possible to reconnect to input devices (/dev/input/eventX) without restarting the application?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 2 Posters 850 Views 2 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.
  • M Offline
    M Offline
    MHermann
    wrote on last edited by
    #1

    Hi all,

    I have a qml application running on a RaspberryPi 3.
    At application startup the application "connects" to the different input devices (/dev/inpu/eventX) like touchscreen and barcode reader.
    Sometimes I get the following error message:

    evdevkeyboard: Could not read from input device (No such device)
    

    Then it could be that the barcode reader is not longer available for the application. Maybe the barcode reader reconnects for some reasons.

    Now my question: Is it possible to "connect" to input devices again, without resarting the application?

    Kind regards,
    MHermann

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

      Hi,

      How are you "connecting" to that device in your application ?

      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
      • M Offline
        M Offline
        MHermann
        wrote on last edited by
        #3

        Hi,

        that is the strange thing.
        I am not actively connecting to input devices.
        I think the application handels this on it's own by evdev. If I use QT_LOGGING_RULES, I can see that the application is searching for input devices and connecting to them at start up. But after that, if the input device is turned off or disconnected I get the above mentioned error message. Unfortunately after reconnecting the input device the application does not connect to it again.

        How can I handle this situation?

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

          The thing is, since the device is technically still opened, when you reconnect it, it likely has been given another id.

          Can you verify that ?

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

          M 1 Reply Last reply
          0
          • SGaistS SGaist

            The thing is, since the device is technically still opened, when you reconnect it, it likely has been given another id.

            Can you verify that ?

            M Offline
            M Offline
            MHermann
            wrote on last edited by
            #5

            @SGaist : I can see the system that the device is getting the same id after it "reconnects" to the system.

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

              Then you will have to modify the evdev plugin to see if you can reconnect.

              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

              • Login

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