How to use Libudev to find out which ports are connected to my Usb

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I made a kind of module. Different sensors are placed in the module. I connected the module to Raspberry Pi through RS232 converter. I am using Libudev to automatically find out which Pi port has RS232 converter using Vendor Id and Product Id and reading data from it successfully and displaying it on front-end. Now my problem is that I have two modules now and both are connected with same Pi and both RS232 Vendor id and Product id are same . In front end I have made an option to select module 1 or 2. How do I differentiate between both converters aside from Vendor id and Product id. It would be best if the solution can be provided through Libudev.
P.S : Currently Libudev detects the most recent port I plugged the RS232 converter in.









share

























    up vote
    0
    down vote

    favorite












    I made a kind of module. Different sensors are placed in the module. I connected the module to Raspberry Pi through RS232 converter. I am using Libudev to automatically find out which Pi port has RS232 converter using Vendor Id and Product Id and reading data from it successfully and displaying it on front-end. Now my problem is that I have two modules now and both are connected with same Pi and both RS232 Vendor id and Product id are same . In front end I have made an option to select module 1 or 2. How do I differentiate between both converters aside from Vendor id and Product id. It would be best if the solution can be provided through Libudev.
    P.S : Currently Libudev detects the most recent port I plugged the RS232 converter in.









    share























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I made a kind of module. Different sensors are placed in the module. I connected the module to Raspberry Pi through RS232 converter. I am using Libudev to automatically find out which Pi port has RS232 converter using Vendor Id and Product Id and reading data from it successfully and displaying it on front-end. Now my problem is that I have two modules now and both are connected with same Pi and both RS232 Vendor id and Product id are same . In front end I have made an option to select module 1 or 2. How do I differentiate between both converters aside from Vendor id and Product id. It would be best if the solution can be provided through Libudev.
      P.S : Currently Libudev detects the most recent port I plugged the RS232 converter in.









      share













      I made a kind of module. Different sensors are placed in the module. I connected the module to Raspberry Pi through RS232 converter. I am using Libudev to automatically find out which Pi port has RS232 converter using Vendor Id and Product Id and reading data from it successfully and displaying it on front-end. Now my problem is that I have two modules now and both are connected with same Pi and both RS232 Vendor id and Product id are same . In front end I have made an option to select module 1 or 2. How do I differentiate between both converters aside from Vendor id and Product id. It would be best if the solution can be provided through Libudev.
      P.S : Currently Libudev detects the most recent port I plugged the RS232 converter in.







      linux raspberry-pi udev serial-port





      share












      share










      share



      share










      asked 2 mins ago









      Usman Khan

      92




      92

























          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480282%2fhow-to-use-libudev-to-find-out-which-ports-are-connected-to-my-usb%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f480282%2fhow-to-use-libudev-to-find-out-which-ports-are-connected-to-my-usb%23new-answer', 'question_page');

          );

          Post as a guest













































































          w,h 7RcVZUob,BuLdr6jfN,6n
          dKkg4 3vdOJ

          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          How many registers does an x86_64 CPU actually have?

          Displaying single band from multi-band raster using QGIS