USB barcode scanner configuration

Clash Royale CLAN TAG#URR8PPP
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
|
show 1 more comment
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
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 withdmesgoutput after you plug it in, you should get ahidrawdevice and probably also a/dev/input/eventXdevice. Runevteston 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 ofdmesg, and dump the HID descriptor: As root,mount -t debugfs none /sys/kernel/debug, then the first line of/sys/kernel/debug/hid/<dev>/rdescis the raw descriptor. Parse here or with hidrd, possibly it contains hints how to switch.
– dirkt
Mar 6 '17 at 10:01
Also, still tryevtest, it will tell you as what the events show up, if not as key presses.
– dirkt
Mar 6 '17 at 10:01
|
show 1 more comment
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
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
drivers usb
edited Mar 6 '17 at 11:49
johnfound
asked Mar 6 '17 at 6:38
johnfoundjohnfound
15810
15810
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 withdmesgoutput after you plug it in, you should get ahidrawdevice and probably also a/dev/input/eventXdevice. Runevteston 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 ofdmesg, and dump the HID descriptor: As root,mount -t debugfs none /sys/kernel/debug, then the first line of/sys/kernel/debug/hid/<dev>/rdescis the raw descriptor. Parse here or with hidrd, possibly it contains hints how to switch.
– dirkt
Mar 6 '17 at 10:01
Also, still tryevtest, it will tell you as what the events show up, if not as key presses.
– dirkt
Mar 6 '17 at 10:01
|
show 1 more comment
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 withdmesgoutput after you plug it in, you should get ahidrawdevice and probably also a/dev/input/eventXdevice. Runevteston 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 ofdmesg, and dump the HID descriptor: As root,mount -t debugfs none /sys/kernel/debug, then the first line of/sys/kernel/debug/hid/<dev>/rdescis the raw descriptor. Parse here or with hidrd, possibly it contains hints how to switch.
– dirkt
Mar 6 '17 at 10:01
Also, still tryevtest, 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
|
show 1 more comment
1 Answer
1
active
oldest
votes
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.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Mar 6 '17 at 12:05
dirktdirkt
16.9k21336
16.9k21336
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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
dmesgoutput after you plug it in, you should get ahidrawdevice and probably also a/dev/input/eventXdevice. Runevteston 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>/rdescis 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