USB barcode scanner configurationReseting USB for scannerWD MyBook 3TB - Gparted failed & HDD partitions...

What happens if a creature that would fight isn't on the battlefield anymore?

Early arrival in Australia, early hotel check in not available

Word for being out at night during curfew

What's the word for the soldier salute?

Why in a Ethernet LAN, a packet sniffer can obtain all packets sent over the LAN?

Meaning of「〜てみたいと思います」

Why does getw return -1 when trying to read a character?

Why is this int array not passed as an object vararg array?

What does "Ich wusste, dass aus dir mal was wird" mean?

Why doesn't Rocket Lab use a solid stage?

Is it a bad idea to replace pull-up resistors with hard pull-ups?

How to cope with regret and shame about not fully utilizing opportunities during PhD?

Does the 500 feet falling cap apply per fall, or per turn?

Was there ever any real use for a 6800-based Apple I?

A curve pass via points at TiKz

Why was the Ancient One so hesitant to teach Dr. Strange the art of sorcery?

How can a Lich look like a human without magic?

How can I answer high-school writing prompts without sounding weird and fake?

How to select certain lines (n, n+4, n+8, n+12...) from the file?

Create a list of all possible Boolean configurations of three constraints

Why can't RGB or bicolour LEDs produce a decent yellow?

Can a tourist shoot a gun in the USA?

Is the schwa sound consistent?

Do atomic orbitals "pulse" in time?



USB barcode scanner configuration


Reseting USB for scannerWD MyBook 3TB - Gparted failed & HDD partitions recovery?How to downgrade USB 3.0 to USB 2.0?Brother scanner and missing /dev/bus/usb entry?Redirecting USB scanner to windows machineusb: device descriptor read/64, error -110USB ports keep resetting on LinuxPrevent Linux kernel from setting USB device configurationPL2303/PL2303X USB-Serial driverSend command to USB device (FingerPrint Scanner) with no driver for Linux






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















The setting



I need to write program that to be able to use several types of barcode scanners, connected on USB port.



All these scanners have mode of type "serial port emulation" where (on my understanding) they should behave like simple byte stream device.



But one of the scanners behaves differently. It sends only fixed length (64 bytes) blocks, where the first byte is the length of the data, then the data bytes and padded with zeros up to the end of the block.



Every block can be read only in single read operation on the device. Even one read byte, causes the whole block to disappear from the IO stream.



The scanner is detected (using lsusb) as a HMI device:



Bus 001 Device 002: ID 05e0:0600 Symbol Technologies
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x05e0 Symbol Technologies
idProduct 0x0600
bcdDevice 0.01
iManufacturer 1 Symbol Technologies, Inc, 2008
iProduct 2 Symbol Bar Code Scanner
iSerial 3 S/N:44F1BF6A7CCE45DEB787C6D4A63A1B62 Rev:PAACLS00-001-R015
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 34
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 8 Bus Powered
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 40
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 3
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0002
(Bus Powered)
Remote Wakeup Enabled


For comparison, here is the lsusb output about another scanner, that behaves as a normal byte stream device:



Bus 001 Device 003: ID 067e:0803 Intermec Technologies Corp. VCP, Barcode scanner
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 2 Communications
bDeviceSubClass 2 Abstract (modem)
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x067e Intermec Technologies Corp.
idProduct 0x0803 VCP, Barcode scanner
bcdDevice 2.58
iManufacturer 1 Intermec
iProduct 2 SR31T
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 67
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 0
iInterface 0
CDC Header:
bcdCDC 1.10
CDC ACM:
bmCapabilities 0x00
CDC Union:
bMasterInterface 0
bSlaveInterface 1
CDC Call Management:
bmCapabilities 0x00
bDataInterface 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 255
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 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 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0


The dmesg output on plugging in barcode scanner:



[19415.108131] usb 1-1: new full-speed USB device number 4 using xhci_hcd
[19415.252278] usb 1-1: New USB device found, idVendor=05e0, idProduct=0600
[19415.252295] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[19415.252305] usb 1-1: Product: Symbol Bar Code Scanner
[19415.252313] usb 1-1: Manufacturer: Symbol Technologies, Inc, 2008
[19415.252321] usb 1-1: SerialNumber: S/N:44F1BF6A7CCE45DEB787C6D4A63A1B62 Rev:PAACLS00-001-R015
[19415.273661] hid-generic 0003:05E0:0600.0008: hiddev0,hidraw6: USB HID v1.10 Device [Symbol Technologies, Inc, 2008 Symbol Bar Code Scanner] on usb-0000:00:10.0-1/input0


The question:



How to configure Linux to handle this scanner as a byte stream device?










share|improve this question
















bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Not sure I understand the question. If it's a HID device, you should be able to access it through the Linux HID infrastructure. Please edit your question with dmesg output after you plug it in, you should get a hidraw device and probably also a /dev/input/eventX device. Run evtest on this device and see what happens.

    – dirkt
    Mar 6 '17 at 7:41











  • @dirkt These USB barcode scanners can be configured to act as different devices. The common use is like a keyboard device, but in my case this is not useful. There is another mode "serial port emulation" where the barcode scanner emulates byte stream device. The scanner in the question is configured this way, but is still recognized as a HID device (compare with the second example in the question, where the scanner behaves properly) and can be read only on blocks.

    – johnfound
    Mar 6 '17 at 8:04











  • @dirkt Also, regardless that the device is recognized as HID device, it does not appear to be handled as a keyboard.

    – johnfound
    Mar 6 '17 at 8:07











  • So how do you know this particular scanner can be configured for serial port emulation? Maybe (1) it can't, or (2) it needs vendor specific commands which you can't guess. Anyway, please still provide output of dmesg, and dump the HID descriptor: As root, mount -t debugfs none /sys/kernel/debug, then the first line of /sys/kernel/debug/hid/<dev>/rdesc is the raw descriptor. Parse here or with hidrd, possibly it contains hints how to switch.

    – dirkt
    Mar 6 '17 at 10:01











  • Also, still try evtest, it will tell you as what the events show up, if not as key presses.

    – dirkt
    Mar 6 '17 at 10:01


















1















The setting



I need to write program that to be able to use several types of barcode scanners, connected on USB port.



All these scanners have mode of type "serial port emulation" where (on my understanding) they should behave like simple byte stream device.



But one of the scanners behaves differently. It sends only fixed length (64 bytes) blocks, where the first byte is the length of the data, then the data bytes and padded with zeros up to the end of the block.



Every block can be read only in single read operation on the device. Even one read byte, causes the whole block to disappear from the IO stream.



The scanner is detected (using lsusb) as a HMI device:



Bus 001 Device 002: ID 05e0:0600 Symbol Technologies
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x05e0 Symbol Technologies
idProduct 0x0600
bcdDevice 0.01
iManufacturer 1 Symbol Technologies, Inc, 2008
iProduct 2 Symbol Bar Code Scanner
iSerial 3 S/N:44F1BF6A7CCE45DEB787C6D4A63A1B62 Rev:PAACLS00-001-R015
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 34
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 8 Bus Powered
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 40
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 3
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0002
(Bus Powered)
Remote Wakeup Enabled


For comparison, here is the lsusb output about another scanner, that behaves as a normal byte stream device:



Bus 001 Device 003: ID 067e:0803 Intermec Technologies Corp. VCP, Barcode scanner
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 2 Communications
bDeviceSubClass 2 Abstract (modem)
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x067e Intermec Technologies Corp.
idProduct 0x0803 VCP, Barcode scanner
bcdDevice 2.58
iManufacturer 1 Intermec
iProduct 2 SR31T
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 67
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 0
iInterface 0
CDC Header:
bcdCDC 1.10
CDC ACM:
bmCapabilities 0x00
CDC Union:
bMasterInterface 0
bSlaveInterface 1
CDC Call Management:
bmCapabilities 0x00
bDataInterface 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 255
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 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 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0


The dmesg output on plugging in barcode scanner:



[19415.108131] usb 1-1: new full-speed USB device number 4 using xhci_hcd
[19415.252278] usb 1-1: New USB device found, idVendor=05e0, idProduct=0600
[19415.252295] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[19415.252305] usb 1-1: Product: Symbol Bar Code Scanner
[19415.252313] usb 1-1: Manufacturer: Symbol Technologies, Inc, 2008
[19415.252321] usb 1-1: SerialNumber: S/N:44F1BF6A7CCE45DEB787C6D4A63A1B62 Rev:PAACLS00-001-R015
[19415.273661] hid-generic 0003:05E0:0600.0008: hiddev0,hidraw6: USB HID v1.10 Device [Symbol Technologies, Inc, 2008 Symbol Bar Code Scanner] on usb-0000:00:10.0-1/input0


The question:



How to configure Linux to handle this scanner as a byte stream device?










share|improve this question
















bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Not sure I understand the question. If it's a HID device, you should be able to access it through the Linux HID infrastructure. Please edit your question with dmesg output after you plug it in, you should get a hidraw device and probably also a /dev/input/eventX device. Run evtest on this device and see what happens.

    – dirkt
    Mar 6 '17 at 7:41











  • @dirkt These USB barcode scanners can be configured to act as different devices. The common use is like a keyboard device, but in my case this is not useful. There is another mode "serial port emulation" where the barcode scanner emulates byte stream device. The scanner in the question is configured this way, but is still recognized as a HID device (compare with the second example in the question, where the scanner behaves properly) and can be read only on blocks.

    – johnfound
    Mar 6 '17 at 8:04











  • @dirkt Also, regardless that the device is recognized as HID device, it does not appear to be handled as a keyboard.

    – johnfound
    Mar 6 '17 at 8:07











  • So how do you know this particular scanner can be configured for serial port emulation? Maybe (1) it can't, or (2) it needs vendor specific commands which you can't guess. Anyway, please still provide output of dmesg, and dump the HID descriptor: As root, mount -t debugfs none /sys/kernel/debug, then the first line of /sys/kernel/debug/hid/<dev>/rdesc is the raw descriptor. Parse here or with hidrd, possibly it contains hints how to switch.

    – dirkt
    Mar 6 '17 at 10:01











  • Also, still try evtest, it will tell you as what the events show up, if not as key presses.

    – dirkt
    Mar 6 '17 at 10:01














1












1








1








The setting



I need to write program that to be able to use several types of barcode scanners, connected on USB port.



All these scanners have mode of type "serial port emulation" where (on my understanding) they should behave like simple byte stream device.



But one of the scanners behaves differently. It sends only fixed length (64 bytes) blocks, where the first byte is the length of the data, then the data bytes and padded with zeros up to the end of the block.



Every block can be read only in single read operation on the device. Even one read byte, causes the whole block to disappear from the IO stream.



The scanner is detected (using lsusb) as a HMI device:



Bus 001 Device 002: ID 05e0:0600 Symbol Technologies
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x05e0 Symbol Technologies
idProduct 0x0600
bcdDevice 0.01
iManufacturer 1 Symbol Technologies, Inc, 2008
iProduct 2 Symbol Bar Code Scanner
iSerial 3 S/N:44F1BF6A7CCE45DEB787C6D4A63A1B62 Rev:PAACLS00-001-R015
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 34
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 8 Bus Powered
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 40
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 3
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0002
(Bus Powered)
Remote Wakeup Enabled


For comparison, here is the lsusb output about another scanner, that behaves as a normal byte stream device:



Bus 001 Device 003: ID 067e:0803 Intermec Technologies Corp. VCP, Barcode scanner
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 2 Communications
bDeviceSubClass 2 Abstract (modem)
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x067e Intermec Technologies Corp.
idProduct 0x0803 VCP, Barcode scanner
bcdDevice 2.58
iManufacturer 1 Intermec
iProduct 2 SR31T
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 67
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 0
iInterface 0
CDC Header:
bcdCDC 1.10
CDC ACM:
bmCapabilities 0x00
CDC Union:
bMasterInterface 0
bSlaveInterface 1
CDC Call Management:
bmCapabilities 0x00
bDataInterface 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 255
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 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 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0


The dmesg output on plugging in barcode scanner:



[19415.108131] usb 1-1: new full-speed USB device number 4 using xhci_hcd
[19415.252278] usb 1-1: New USB device found, idVendor=05e0, idProduct=0600
[19415.252295] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[19415.252305] usb 1-1: Product: Symbol Bar Code Scanner
[19415.252313] usb 1-1: Manufacturer: Symbol Technologies, Inc, 2008
[19415.252321] usb 1-1: SerialNumber: S/N:44F1BF6A7CCE45DEB787C6D4A63A1B62 Rev:PAACLS00-001-R015
[19415.273661] hid-generic 0003:05E0:0600.0008: hiddev0,hidraw6: USB HID v1.10 Device [Symbol Technologies, Inc, 2008 Symbol Bar Code Scanner] on usb-0000:00:10.0-1/input0


The question:



How to configure Linux to handle this scanner as a byte stream device?










share|improve this question
















The setting



I need to write program that to be able to use several types of barcode scanners, connected on USB port.



All these scanners have mode of type "serial port emulation" where (on my understanding) they should behave like simple byte stream device.



But one of the scanners behaves differently. It sends only fixed length (64 bytes) blocks, where the first byte is the length of the data, then the data bytes and padded with zeros up to the end of the block.



Every block can be read only in single read operation on the device. Even one read byte, causes the whole block to disappear from the IO stream.



The scanner is detected (using lsusb) as a HMI device:



Bus 001 Device 002: ID 05e0:0600 Symbol Technologies
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x05e0 Symbol Technologies
idProduct 0x0600
bcdDevice 0.01
iManufacturer 1 Symbol Technologies, Inc, 2008
iProduct 2 Symbol Bar Code Scanner
iSerial 3 S/N:44F1BF6A7CCE45DEB787C6D4A63A1B62 Rev:PAACLS00-001-R015
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 34
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 8 Bus Powered
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.10
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 40
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 3
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0002
(Bus Powered)
Remote Wakeup Enabled


For comparison, here is the lsusb output about another scanner, that behaves as a normal byte stream device:



Bus 001 Device 003: ID 067e:0803 Intermec Technologies Corp. VCP, Barcode scanner
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 2 Communications
bDeviceSubClass 2 Abstract (modem)
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x067e Intermec Technologies Corp.
idProduct 0x0803 VCP, Barcode scanner
bcdDevice 2.58
iManufacturer 1 Intermec
iProduct 2 SR31T
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 67
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
(Bus Powered)
Remote Wakeup
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 0
iInterface 0
CDC Header:
bcdCDC 1.10
CDC ACM:
bmCapabilities 0x00
CDC Union:
bMasterInterface 0
bSlaveInterface 1
CDC Call Management:
bmCapabilities 0x00
bDataInterface 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 255
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 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 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0


The dmesg output on plugging in barcode scanner:



[19415.108131] usb 1-1: new full-speed USB device number 4 using xhci_hcd
[19415.252278] usb 1-1: New USB device found, idVendor=05e0, idProduct=0600
[19415.252295] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[19415.252305] usb 1-1: Product: Symbol Bar Code Scanner
[19415.252313] usb 1-1: Manufacturer: Symbol Technologies, Inc, 2008
[19415.252321] usb 1-1: SerialNumber: S/N:44F1BF6A7CCE45DEB787C6D4A63A1B62 Rev:PAACLS00-001-R015
[19415.273661] hid-generic 0003:05E0:0600.0008: hiddev0,hidraw6: USB HID v1.10 Device [Symbol Technologies, Inc, 2008 Symbol Bar Code Scanner] on usb-0000:00:10.0-1/input0


The question:



How to configure Linux to handle this scanner as a byte stream device?







drivers usb






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 6 '17 at 11:49







johnfound

















asked Mar 6 '17 at 6:38









johnfoundjohnfound

16310




16310





bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 1 hour ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Not sure I understand the question. If it's a HID device, you should be able to access it through the Linux HID infrastructure. Please edit your question with dmesg output after you plug it in, you should get a hidraw device and probably also a /dev/input/eventX device. Run evtest on this device and see what happens.

    – dirkt
    Mar 6 '17 at 7:41











  • @dirkt These USB barcode scanners can be configured to act as different devices. The common use is like a keyboard device, but in my case this is not useful. There is another mode "serial port emulation" where the barcode scanner emulates byte stream device. The scanner in the question is configured this way, but is still recognized as a HID device (compare with the second example in the question, where the scanner behaves properly) and can be read only on blocks.

    – johnfound
    Mar 6 '17 at 8:04











  • @dirkt Also, regardless that the device is recognized as HID device, it does not appear to be handled as a keyboard.

    – johnfound
    Mar 6 '17 at 8:07











  • So how do you know this particular scanner can be configured for serial port emulation? Maybe (1) it can't, or (2) it needs vendor specific commands which you can't guess. Anyway, please still provide output of dmesg, and dump the HID descriptor: As root, mount -t debugfs none /sys/kernel/debug, then the first line of /sys/kernel/debug/hid/<dev>/rdesc is the raw descriptor. Parse here or with hidrd, possibly it contains hints how to switch.

    – dirkt
    Mar 6 '17 at 10:01











  • Also, still try evtest, it will tell you as what the events show up, if not as key presses.

    – dirkt
    Mar 6 '17 at 10:01



















  • Not sure I understand the question. If it's a HID device, you should be able to access it through the Linux HID infrastructure. Please edit your question with dmesg output after you plug it in, you should get a hidraw device and probably also a /dev/input/eventX device. Run evtest on this device and see what happens.

    – dirkt
    Mar 6 '17 at 7:41











  • @dirkt These USB barcode scanners can be configured to act as different devices. The common use is like a keyboard device, but in my case this is not useful. There is another mode "serial port emulation" where the barcode scanner emulates byte stream device. The scanner in the question is configured this way, but is still recognized as a HID device (compare with the second example in the question, where the scanner behaves properly) and can be read only on blocks.

    – johnfound
    Mar 6 '17 at 8:04











  • @dirkt Also, regardless that the device is recognized as HID device, it does not appear to be handled as a keyboard.

    – johnfound
    Mar 6 '17 at 8:07











  • So how do you know this particular scanner can be configured for serial port emulation? Maybe (1) it can't, or (2) it needs vendor specific commands which you can't guess. Anyway, please still provide output of dmesg, and dump the HID descriptor: As root, mount -t debugfs none /sys/kernel/debug, then the first line of /sys/kernel/debug/hid/<dev>/rdesc is the raw descriptor. Parse here or with hidrd, possibly it contains hints how to switch.

    – dirkt
    Mar 6 '17 at 10:01











  • Also, still try evtest, it will tell you as what the events show up, if not as key presses.

    – dirkt
    Mar 6 '17 at 10:01

















Not sure I understand the question. If it's a HID device, you should be able to access it through the Linux HID infrastructure. Please edit your question with dmesg output after you plug it in, you should get a hidraw device and probably also a /dev/input/eventX device. Run evtest on this device and see what happens.

– dirkt
Mar 6 '17 at 7:41





Not sure I understand the question. If it's a HID device, you should be able to access it through the Linux HID infrastructure. Please edit your question with dmesg output after you plug it in, you should get a hidraw device and probably also a /dev/input/eventX device. Run evtest on this device and see what happens.

– dirkt
Mar 6 '17 at 7:41













@dirkt These USB barcode scanners can be configured to act as different devices. The common use is like a keyboard device, but in my case this is not useful. There is another mode "serial port emulation" where the barcode scanner emulates byte stream device. The scanner in the question is configured this way, but is still recognized as a HID device (compare with the second example in the question, where the scanner behaves properly) and can be read only on blocks.

– johnfound
Mar 6 '17 at 8:04





@dirkt These USB barcode scanners can be configured to act as different devices. The common use is like a keyboard device, but in my case this is not useful. There is another mode "serial port emulation" where the barcode scanner emulates byte stream device. The scanner in the question is configured this way, but is still recognized as a HID device (compare with the second example in the question, where the scanner behaves properly) and can be read only on blocks.

– johnfound
Mar 6 '17 at 8:04













@dirkt Also, regardless that the device is recognized as HID device, it does not appear to be handled as a keyboard.

– johnfound
Mar 6 '17 at 8:07





@dirkt Also, regardless that the device is recognized as HID device, it does not appear to be handled as a keyboard.

– johnfound
Mar 6 '17 at 8:07













So how do you know this particular scanner can be configured for serial port emulation? Maybe (1) it can't, or (2) it needs vendor specific commands which you can't guess. Anyway, please still provide output of dmesg, and dump the HID descriptor: As root, mount -t debugfs none /sys/kernel/debug, then the first line of /sys/kernel/debug/hid/<dev>/rdesc is the raw descriptor. Parse here or with hidrd, possibly it contains hints how to switch.

– dirkt
Mar 6 '17 at 10:01





So how do you know this particular scanner can be configured for serial port emulation? Maybe (1) it can't, or (2) it needs vendor specific commands which you can't guess. Anyway, please still provide output of dmesg, and dump the HID descriptor: As root, mount -t debugfs none /sys/kernel/debug, then the first line of /sys/kernel/debug/hid/<dev>/rdesc is the raw descriptor. Parse here or with hidrd, possibly it contains hints how to switch.

– dirkt
Mar 6 '17 at 10:01













Also, still try evtest, it will tell you as what the events show up, if not as key presses.

– dirkt
Mar 6 '17 at 10:01





Also, still try evtest, it will tell you as what the events show up, if not as key presses.

– dirkt
Mar 6 '17 at 10:01










1 Answer
1






active

oldest

votes


















0














Partial answer: If you do have the "special com port driver" for this scanner, and you do have a Windows computer, you can snoop the USB traffic under Windows in the initialization phase of the driver and find out how it switches to the serial configuration. That traffic can then be replayed in Linux using libusb etc.



USB snooping tools for Windows are e.g. usbsnoop or usbcap, google for more.



Looking at the HID descriptor may offer a simpler alternative, though.






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',
    autoActivateHeartbeat: false,
    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%2f349414%2fusb-barcode-scanner-configuration%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









    0














    Partial answer: If you do have the "special com port driver" for this scanner, and you do have a Windows computer, you can snoop the USB traffic under Windows in the initialization phase of the driver and find out how it switches to the serial configuration. That traffic can then be replayed in Linux using libusb etc.



    USB snooping tools for Windows are e.g. usbsnoop or usbcap, google for more.



    Looking at the HID descriptor may offer a simpler alternative, though.






    share|improve this answer




























      0














      Partial answer: If you do have the "special com port driver" for this scanner, and you do have a Windows computer, you can snoop the USB traffic under Windows in the initialization phase of the driver and find out how it switches to the serial configuration. That traffic can then be replayed in Linux using libusb etc.



      USB snooping tools for Windows are e.g. usbsnoop or usbcap, google for more.



      Looking at the HID descriptor may offer a simpler alternative, though.






      share|improve this answer


























        0












        0








        0







        Partial answer: If you do have the "special com port driver" for this scanner, and you do have a Windows computer, you can snoop the USB traffic under Windows in the initialization phase of the driver and find out how it switches to the serial configuration. That traffic can then be replayed in Linux using libusb etc.



        USB snooping tools for Windows are e.g. usbsnoop or usbcap, google for more.



        Looking at the HID descriptor may offer a simpler alternative, though.






        share|improve this answer













        Partial answer: If you do have the "special com port driver" for this scanner, and you do have a Windows computer, you can snoop the USB traffic under Windows in the initialization phase of the driver and find out how it switches to the serial configuration. That traffic can then be replayed in Linux using libusb etc.



        USB snooping tools for Windows are e.g. usbsnoop or usbcap, google for more.



        Looking at the HID descriptor may offer a simpler alternative, though.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 6 '17 at 12:05









        dirktdirkt

        17.8k31438




        17.8k31438






























            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f349414%2fusb-barcode-scanner-configuration%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

            Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

            Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

            Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...