tectom
Posts: 5
Joined: Tue Dec 23, 2014 9:23 pm

USB Barcode Scanner

Tue Dec 23, 2014 9:34 pm

Hi everyone,
i have got a big problem. My Raspberry Pi don´t know that the barcode scanner ( Tera USB Barcode@Amazon) is not a keyboard. So if i start my script with a Query (Shell read command), and i will scan a barcode not immediately show, nothing shows, but if i plug in my barcode scanner at my Netbook with Debian, in the next moment i start the same script, it works.


Important Information:
- The raspberry pi runs with Wheezy.
- The dmesg says " USB FOUND".
- The OS at the Notebook is Debian


Thank you for every help!
Soory for my bad english, probably i have to hang more around and improve my skills.

Peace
TT

User avatar
joan
Posts: 14589
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: USB Barcode Scanner

Tue Dec 23, 2014 11:07 pm

When you plug the scanner into the Pi what does
  • dmesg say about the scanner
  • lsusb -v report about the scanner

tectom
Posts: 5
Joined: Tue Dec 23, 2014 9:23 pm

Re: USB Barcode Scanner

Wed Dec 24, 2014 9:28 am

dmesg:

[ 23.518653] bcm2835-cpufreq: switching to governor ondemand
[ 23.518661] bcm2835-cpufreq: switching to governor ondemand
[ 26.566008] Adding 102396k swap on /var/swap. Priority:-1 extents:1 across:102396k SSFS
[ 27.258955] bcm2708_fb_pan_display(0,0) returns=0
[ 27.942438] bcm2708_fb_blank(1) returns=1 p[1]=0x80000000
[ 27.942904] bcm2708_fb_pan_display(0,0) returns=0
[ 29.143131] bcm2708_fb_blank(0) returns=0 p[1]=0x80000000
[ 32.046341] usb 1-1.2: new full-speed USB device number 5 using dwc_otg
[ 32.150231] usb 1-1.2: New USB device found, idVendor=13ba, idProduct=0018
[ 32.150266] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 32.150281] usb 1-1.2: Product: Barcode Reader
[ 32.162300] input: Barcode Rea

der as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/input/input0
[ 32.167628] hid-generic 0003:13BA:0018.0001: input,hidraw0: USB HID v1.10 Keyboard [Barcode Reader ] on usb-bcm2708_usb-1.2/input0



lsusb:

Bus 001 Device 005: ID 13ba:0018 Unknown
Couldn't open device, some information will be missing



I think this is the mistake

adih2001
Posts: 18
Joined: Sat Mar 01, 2014 9:06 am

Re: USB Barcode Scanner

Wed Dec 24, 2014 10:48 am

- Try typing in the console:

Code: Select all

sudo apt-get update

sudo apt-get upgrade

sudo rpi-update
- If it doesn't work try installing the last version or raspbian!

- And if still doesn't work try to get the drivers from somewhere

tectom
Posts: 5
Joined: Tue Dec 23, 2014 9:23 pm

Re: USB Barcode Scanner

Wed Dec 24, 2014 12:07 pm

Code: Select all

Bus 001 Device 006: ID 13ba:0018 Unknown
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x13ba Unknown
  idProduct          0x0018
  bcdDevice            0.01
  iManufacturer           0
  iProduct                1
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              400mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      1 Keyboard
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      62
         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     0x0008  1x 8 bytes
        bInterval               2

Bus 001 Device 005: ID 0bda:8172 Realtek Semiconductor Corp. RTL8191SU 802.11n WLAN Adapter
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x8172 RTL8191SU 802.11n WLAN Adapter
  bcdDevice            2.00
  iManufacturer           1
  iProduct                2
  iSerial                 3
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           46
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           4
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x0d  EP 13 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0

So now he find the scanner.
The dmesg says [quote] [ 886.508731] usb 1-1.2: Product: Barcode Reader
[/quote

But he do not read a code with the read command in shell#

If use windows and notepad, it works.

beta-tester
Posts: 1305
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: USB Barcode Scanner

Wed Dec 24, 2014 2:58 pm

Couldn't open device, some information will be missing
do it as sudoer should fix the error message

Code: Select all

sudo lsusb -v
your barcode scanner is recognized as Human Interface Device (HID) and is mapped as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/input/input0
so i think it should work.
maybe its power-consumption (listed with MaxPower: 400mA in lsusb) is too high for your RPi

is your barcodescanner listed there...
what do you get, if you type in

Code: Select all

ls -la /dev/input/by-id/

Code: Select all

ls -la /dev/input/by-path/
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

tectom
Posts: 5
Joined: Tue Dec 23, 2014 9:23 pm

Re: USB Barcode Scanner

Wed Dec 24, 2014 8:32 pm

lrwxrwxrwx 1 root root 9 Jan 1 1970 usb-13ba_Barcode_Reader-event-kbd -> ../event0

tomaszw
Posts: 1
Joined: Wed Dec 24, 2014 10:57 pm

Re: USB Barcode Scanner

Wed Dec 24, 2014 11:05 pm

I had the same problem with USB RFID reader which i bought from dx.com. I switch power source with something stronger and after that it works without any problems.

tectom
Posts: 5
Joined: Tue Dec 23, 2014 9:23 pm

Re: USB Barcode Scanner

Thu Dec 25, 2014 5:00 pm

ok and which source do you use?
But i only have got 2 USB Pots, one for the Wlan Stick and the other for the barcode.
If i plug in the scanner in the ethernet port, he don´t run. Now i am going to change the Wlan Stick to a Ethernet Port, if it runs i will tell you soon.


#Update

The Problem is not fixxed. I have changed to the Ethernet Port and i have a usb hub with an current, but it doesn´t run

#Update 2

Now i have used the normal set up of wifi and have reinstalled my pi. After that it works show show me the code. But immediately after did a reboot. It doesn´t run again Now i think i will test it only with ethernet. It´s a real mystik.

My Code is:
echo"Code"
read barcode
echo "$barcode"

Gimansist
Posts: 1
Joined: Wed Aug 05, 2015 9:24 am

Re: USB Barcode Scanner

Wed Aug 05, 2015 9:27 am

Just want to add, that powered USB hub(1.5Amp in my case) also solved the same problem for me!
My scanner is PCPlay Barcode PCP-BCG4209 (Vendor-ID 0x13ba, Product ID 0x18)

Return to “Troubleshooting”