How to make a USB device register as HID?

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











up vote
0
down vote

favorite












I have a hardware device which I'd like to communicate with in C via the HID library. But this device does not show up as HID. Is there a way to make it so (with a udev rule maybe) ?



$ dmesg
usb 1-2: new full-speed USB device number 7 using xhci_hcd
usb 1-2: New USB device found, idVendor=104d, idProduct=3001
usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-2: Product: ESP301 Motion Control
usb 1-2: Manufacturer: NEWPORT Corp.
usb 1-2: SerialNumber: 0000000000000000

$ lsusb -v
Bus 001 Device 007: ID 104d:3001 Newport Corporation
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x104d Newport Corporation
idProduct 0x3001
bcdDevice 1.01
iManufacturer 1 NEWPORT Corp.
iProduct 2 ESP301 Motion Control
iSerial 3 0000000000000000
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 2
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0002 1x 2 bytes
bInterval 1
Device Status: 0x0001
Self Powered









share|improve this question

























    up vote
    0
    down vote

    favorite












    I have a hardware device which I'd like to communicate with in C via the HID library. But this device does not show up as HID. Is there a way to make it so (with a udev rule maybe) ?



    $ dmesg
    usb 1-2: new full-speed USB device number 7 using xhci_hcd
    usb 1-2: New USB device found, idVendor=104d, idProduct=3001
    usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    usb 1-2: Product: ESP301 Motion Control
    usb 1-2: Manufacturer: NEWPORT Corp.
    usb 1-2: SerialNumber: 0000000000000000

    $ lsusb -v
    Bus 001 Device 007: ID 104d:3001 Newport Corporation
    Device Descriptor:
    bLength 18
    bDescriptorType 1
    bcdUSB 1.10
    bDeviceClass 255 Vendor Specific Class
    bDeviceSubClass 0
    bDeviceProtocol 0
    bMaxPacketSize0 8
    idVendor 0x104d Newport Corporation
    idProduct 0x3001
    bcdDevice 1.01
    iManufacturer 1 NEWPORT Corp.
    iProduct 2 ESP301 Motion Control
    iSerial 3 0000000000000000
    bNumConfigurations 1
    Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 39
    bNumInterfaces 1
    bConfigurationValue 2
    iConfiguration 0
    bmAttributes 0xa0
    (Bus Powered)
    Remote Wakeup
    MaxPower 100mA
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 0
    bAlternateSetting 0
    bNumEndpoints 3
    bInterfaceClass 255 Vendor Specific Class
    bInterfaceSubClass 0
    bInterfaceProtocol 0
    iInterface 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x81 EP 1 IN
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0040 1x 64 bytes
    bInterval 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x01 EP 1 OUT
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0040 1x 64 bytes
    bInterval 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x83 EP 3 IN
    bmAttributes 3
    Transfer Type Interrupt
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0002 1x 2 bytes
    bInterval 1
    Device Status: 0x0001
    Self Powered









    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have a hardware device which I'd like to communicate with in C via the HID library. But this device does not show up as HID. Is there a way to make it so (with a udev rule maybe) ?



      $ dmesg
      usb 1-2: new full-speed USB device number 7 using xhci_hcd
      usb 1-2: New USB device found, idVendor=104d, idProduct=3001
      usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      usb 1-2: Product: ESP301 Motion Control
      usb 1-2: Manufacturer: NEWPORT Corp.
      usb 1-2: SerialNumber: 0000000000000000

      $ lsusb -v
      Bus 001 Device 007: ID 104d:3001 Newport Corporation
      Device Descriptor:
      bLength 18
      bDescriptorType 1
      bcdUSB 1.10
      bDeviceClass 255 Vendor Specific Class
      bDeviceSubClass 0
      bDeviceProtocol 0
      bMaxPacketSize0 8
      idVendor 0x104d Newport Corporation
      idProduct 0x3001
      bcdDevice 1.01
      iManufacturer 1 NEWPORT Corp.
      iProduct 2 ESP301 Motion Control
      iSerial 3 0000000000000000
      bNumConfigurations 1
      Configuration Descriptor:
      bLength 9
      bDescriptorType 2
      wTotalLength 39
      bNumInterfaces 1
      bConfigurationValue 2
      iConfiguration 0
      bmAttributes 0xa0
      (Bus Powered)
      Remote Wakeup
      MaxPower 100mA
      Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 0
      bAlternateSetting 0
      bNumEndpoints 3
      bInterfaceClass 255 Vendor Specific Class
      bInterfaceSubClass 0
      bInterfaceProtocol 0
      iInterface 0
      Endpoint Descriptor:
      bLength 7
      bDescriptorType 5
      bEndpointAddress 0x81 EP 1 IN
      bmAttributes 2
      Transfer Type Bulk
      Synch Type None
      Usage Type Data
      wMaxPacketSize 0x0040 1x 64 bytes
      bInterval 0
      Endpoint Descriptor:
      bLength 7
      bDescriptorType 5
      bEndpointAddress 0x01 EP 1 OUT
      bmAttributes 2
      Transfer Type Bulk
      Synch Type None
      Usage Type Data
      wMaxPacketSize 0x0040 1x 64 bytes
      bInterval 0
      Endpoint Descriptor:
      bLength 7
      bDescriptorType 5
      bEndpointAddress 0x83 EP 3 IN
      bmAttributes 3
      Transfer Type Interrupt
      Synch Type None
      Usage Type Data
      wMaxPacketSize 0x0002 1x 2 bytes
      bInterval 1
      Device Status: 0x0001
      Self Powered









      share|improve this question













      I have a hardware device which I'd like to communicate with in C via the HID library. But this device does not show up as HID. Is there a way to make it so (with a udev rule maybe) ?



      $ dmesg
      usb 1-2: new full-speed USB device number 7 using xhci_hcd
      usb 1-2: New USB device found, idVendor=104d, idProduct=3001
      usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      usb 1-2: Product: ESP301 Motion Control
      usb 1-2: Manufacturer: NEWPORT Corp.
      usb 1-2: SerialNumber: 0000000000000000

      $ lsusb -v
      Bus 001 Device 007: ID 104d:3001 Newport Corporation
      Device Descriptor:
      bLength 18
      bDescriptorType 1
      bcdUSB 1.10
      bDeviceClass 255 Vendor Specific Class
      bDeviceSubClass 0
      bDeviceProtocol 0
      bMaxPacketSize0 8
      idVendor 0x104d Newport Corporation
      idProduct 0x3001
      bcdDevice 1.01
      iManufacturer 1 NEWPORT Corp.
      iProduct 2 ESP301 Motion Control
      iSerial 3 0000000000000000
      bNumConfigurations 1
      Configuration Descriptor:
      bLength 9
      bDescriptorType 2
      wTotalLength 39
      bNumInterfaces 1
      bConfigurationValue 2
      iConfiguration 0
      bmAttributes 0xa0
      (Bus Powered)
      Remote Wakeup
      MaxPower 100mA
      Interface Descriptor:
      bLength 9
      bDescriptorType 4
      bInterfaceNumber 0
      bAlternateSetting 0
      bNumEndpoints 3
      bInterfaceClass 255 Vendor Specific Class
      bInterfaceSubClass 0
      bInterfaceProtocol 0
      iInterface 0
      Endpoint Descriptor:
      bLength 7
      bDescriptorType 5
      bEndpointAddress 0x81 EP 1 IN
      bmAttributes 2
      Transfer Type Bulk
      Synch Type None
      Usage Type Data
      wMaxPacketSize 0x0040 1x 64 bytes
      bInterval 0
      Endpoint Descriptor:
      bLength 7
      bDescriptorType 5
      bEndpointAddress 0x01 EP 1 OUT
      bmAttributes 2
      Transfer Type Bulk
      Synch Type None
      Usage Type Data
      wMaxPacketSize 0x0040 1x 64 bytes
      bInterval 0
      Endpoint Descriptor:
      bLength 7
      bDescriptorType 5
      bEndpointAddress 0x83 EP 3 IN
      bmAttributes 3
      Transfer Type Interrupt
      Synch Type None
      Usage Type Data
      wMaxPacketSize 0x0002 1x 2 bytes
      bInterval 1
      Device Status: 0x0001
      Self Powered






      udev hid






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 28 at 14:26









      dargaud

      2211310




      2211310




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          HID itself is not really a device type, but a standard protocol for interacting with a wide variety of device types (and isn't even dependent on USB, it's also used over Bluetooth, I2C, and potentially other lower-level communications protocols). The device itself has to support the protocol though, otherwise it won't understand what your software is saying to it.



          In your case, the device in question presents a single endpoint identifying as a vendor specific class (VSC), which is a fancy way of saying that the designers thought it didn't fit any of the other standard USB device types. Some such devices may have special commands that can be sent to them to switch them to a different mode, which may include a command for switching it into HID mode, and should be covered in the documentation for the device.



          Realistically though, you could just as easily use libusb to talk directly to the device using whatever it's normal command set is, and skip the overhead of HID.






          share|improve this answer






















            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%2f484679%2fhow-to-make-a-usb-device-register-as-hid%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            HID itself is not really a device type, but a standard protocol for interacting with a wide variety of device types (and isn't even dependent on USB, it's also used over Bluetooth, I2C, and potentially other lower-level communications protocols). The device itself has to support the protocol though, otherwise it won't understand what your software is saying to it.



            In your case, the device in question presents a single endpoint identifying as a vendor specific class (VSC), which is a fancy way of saying that the designers thought it didn't fit any of the other standard USB device types. Some such devices may have special commands that can be sent to them to switch them to a different mode, which may include a command for switching it into HID mode, and should be covered in the documentation for the device.



            Realistically though, you could just as easily use libusb to talk directly to the device using whatever it's normal command set is, and skip the overhead of HID.






            share|improve this answer


























              up vote
              1
              down vote



              accepted










              HID itself is not really a device type, but a standard protocol for interacting with a wide variety of device types (and isn't even dependent on USB, it's also used over Bluetooth, I2C, and potentially other lower-level communications protocols). The device itself has to support the protocol though, otherwise it won't understand what your software is saying to it.



              In your case, the device in question presents a single endpoint identifying as a vendor specific class (VSC), which is a fancy way of saying that the designers thought it didn't fit any of the other standard USB device types. Some such devices may have special commands that can be sent to them to switch them to a different mode, which may include a command for switching it into HID mode, and should be covered in the documentation for the device.



              Realistically though, you could just as easily use libusb to talk directly to the device using whatever it's normal command set is, and skip the overhead of HID.






              share|improve this answer
























                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                HID itself is not really a device type, but a standard protocol for interacting with a wide variety of device types (and isn't even dependent on USB, it's also used over Bluetooth, I2C, and potentially other lower-level communications protocols). The device itself has to support the protocol though, otherwise it won't understand what your software is saying to it.



                In your case, the device in question presents a single endpoint identifying as a vendor specific class (VSC), which is a fancy way of saying that the designers thought it didn't fit any of the other standard USB device types. Some such devices may have special commands that can be sent to them to switch them to a different mode, which may include a command for switching it into HID mode, and should be covered in the documentation for the device.



                Realistically though, you could just as easily use libusb to talk directly to the device using whatever it's normal command set is, and skip the overhead of HID.






                share|improve this answer














                HID itself is not really a device type, but a standard protocol for interacting with a wide variety of device types (and isn't even dependent on USB, it's also used over Bluetooth, I2C, and potentially other lower-level communications protocols). The device itself has to support the protocol though, otherwise it won't understand what your software is saying to it.



                In your case, the device in question presents a single endpoint identifying as a vendor specific class (VSC), which is a fancy way of saying that the designers thought it didn't fit any of the other standard USB device types. Some such devices may have special commands that can be sent to them to switch them to a different mode, which may include a command for switching it into HID mode, and should be covered in the documentation for the device.



                Realistically though, you could just as easily use libusb to talk directly to the device using whatever it's normal command set is, and skip the overhead of HID.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 28 at 23:29

























                answered Nov 28 at 20:14









                Austin Hemmelgarn

                5,89411016




                5,89411016



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f484679%2fhow-to-make-a-usb-device-register-as-hid%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown






                    Popular posts from this blog

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

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay