usb barcode scanner support

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Pandor

usb barcode scanner support

Post by Pandor »

hi,
I work as a service technician, and recently switched to Linux Mint 19 Cinamon on my work laptop.
I have a konig barcode scanner that i really need to use, but it does not seem to work at all.

On windows it is plug and play. recognised as a HID device, and i can just scan with a press of the button, into a text editor/application of choice.
On linux on the other hand, it doesn't even react to a button press. so it does not scan at all.

dmesg:

Code: Select all

[ 2293.679514] usb 2-3: new full-speed USB device number 9 using xhci_hcd
[ 2293.921585] usb 2-3: string descriptor 0 read error: -22
[ 2293.921595] usb 2-3: New USB device found, idVendor=10c4, idProduct=88a6, bcdDevice= 0.01
[ 2293.921598] usb 2-3: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 2293.923593] hid-generic 0003:10C4:88A6.0007: hiddev0,hidraw0: USB HID v1.10 Device [HID 10c4:88a6] on usb-0000:00:14.0-3/input0
[ 2293.924824] input: HID 10c4:88a6 as /devices/pci0000:00/0000:00:14.0/usb2/2-3/2-3:1.1/0003:10C4:88A6.0008/input/input22
[ 2293.980150] hid-generic 0003:10C4:88A6.0008: input,hidraw1: USB HID v1.10 Keyboard [HID 10c4:88a6] on usb-0000:00:14.0-3/input1
lsusb -v -d10c4:

Code: Select all

Bus 002 Device 009: ID 10c4:88a6 Cygnal Integrated Products, Inc. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x10c4 Cygnal Integrated Products, Inc.
  idProduct          0x88a6 
  bcdDevice            0.01
  iManufacturer           0 
  iProduct                2 (error)
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0042
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      0 
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      52
         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             255
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval             255
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      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      78
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)
The scanner:
https://www.konigelectronic.com/compute ... in-content
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Pandor

Re: usb barcode scanner support

Post by Pandor »

Thanks for the link, but i can't find anything usefull there.
Besides a list of working scanners, and some workarounds.

I did notice that my scanner does not report
bInterfaceProtocol as keyboard. As i've seen most other scanners do. In windows it is detected and listed as a keyboard. And functions as such. But in linux it doesnt do anything at all. It doesnt even scan when i press the button. Maybe it needs a specific patch...

Unless i get this working i'll be forced to go back to windows, as i really need the scanner to work on the field.
AlbertP
Level 16
Level 16
Posts: 6701
Joined: Sun Jan 30, 2011 12:38 pm
Location: Utrecht, The Netherlands

Re: usb barcode scanner support

Post by AlbertP »

Do you see any keyboard device when you run:

Code: Select all

xinput list
Also, do you know the make & model of the barcode scanner?
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.
Pandor

Re: usb barcode scanner support

Post by Pandor »

Xinput does list it as a virtual core keyboard.

HID 10c4:88a6 id=12 [slave keyboard (3) ]
Red_is

Re: usb barcode scanner support

Post by Red_is »

hi all
I have the same problem with the same bar code scan. Any Evolution ?

cheers
kukamuumuka

Re: usb barcode scanner support

Post by kukamuumuka »

Red_is wrote: Sat Oct 20, 2018 4:28 pm hi all
I have the same problem with the same bar code scan. Any Evolution ?

cheers
I have two different barcode scanners, and both of them are working out of box. To test your scanner open some text editor like Xed or Pluma read the test code, so the code appears into text editor. You can find a test code from
http://mail.plasticprinters.com/pdfdocs ... tSheet.pdf
rodojpm

Re: usb barcode scanner support [Updated]

Post by rodojpm »

I've been having the same problem with the same scanner. I've found a solution that allows me to enable the scanner and read barcodes.

Requisites:
  • python3 (installed on linux mint by default in latest versions)
  • pyusb (follow the instructions on the official github page)
Instructions
  • Save the code below on a file ending with .py (anywhere in your computer)
  • Open the terminal
  • Run the command python3 /path/to/file.py &
  • Enjoy!
You may also want to create a startup script

Code

Code: Select all

import usb.core
import time

# Find the device and initialize it
dev = usb.core.find(idVendor=0x10c4, idProduct=0x88a6)

if dev.is_kernel_driver_active(0):
    dev.detach_kernel_driver(0)

# Configure the device (do not know if necessary)
cfg = dev.get_active_configuration()

interface = cfg.interfaces()
# The out endpoint, which allows us to com w/ device
out = interface[0][1]

while True:
    # Write something periodically to wakeup the device
    out.write(bytes([0]))
    time.sleep(0.100) # every 100ms
Locked

Return to “Hardware Support”