# USB Bar Code Scanner how to use?



## dmtr (Nov 28, 2012)

Hi ALL!

I want to use a barcode scanner on FreeBSD. I have USB Honeywell MS9520.

After attach in log:

```
ugen0.4: <Honeywell Scanning and Mobility> at usbus0
ukbd1: <Honeywell Scanning and Mobility Honeywell Scanning and Mobility Scanner, class 0/0, rev 1.10/58.81, addr 4> on usbus0
kbd3 at ukbd1
ugen0.4: <Honeywell Scanning and Mobility> at usbus0 (disconnected)
ukbd1: at uhub0, port 6, addr 4 (disconnected)
ugen0.4: <Honeywell Scanning and Mobility> at usbus0
```
The first question is: why is first defined as a keyboard, and then ugen? The second question: the device is, how to get information from it?

I understand that this device can be seen as a reference system keyboard, but just do not know how to get information from him.

Finished programs not in the ports tree.


----------



## dmtr (Nov 28, 2012)

System FreeBSD 8.3-p4


----------



## jem (Nov 28, 2012)

Have you tried scanning a barcode?  You might find it just inputs characters as if you had typed them at a keyboard.


----------



## wblock@ (Nov 28, 2012)

That's the way most scanners work.  They just type the characters the same as if the user had entered them.  That's also the reason there is usually a human-readable version of the barcode information below it: so it can be manually entered if the barcode is damaged.


----------



## dmtr (Nov 29, 2012)

I understand how a bar code scanner work.
But both see and touch and save the result of his work?

See the dump, log, etc. 

How to see the results? How?


----------



## wblock@ (Nov 29, 2012)

That is a function of the application that accepts the input.


----------



## dmtr (Nov 29, 2012)

Ok.
What to see this INPUT?

Need a sniffer to see this input information.
usbdump fit?
Or are there other applications of this type?


----------



## Beastie (Nov 29, 2012)

Can't you just open a text editor, scan a barcode and see if the code text gets "pasted" to the editor? Am I missing something obvious here?


----------



## kpa (Nov 29, 2012)

Any USB barcode scanner should be just another USB keyboard to FreeBSD (and other operating systems). Can you post the outputs of

`# usbconfig`

And 
`# dmesg | grep ukbd`


----------



## mix_room (Nov 29, 2012)

Try something like `xev` to see what is being output.


----------



## dmtr (Nov 30, 2012)

Hi all!

I start my post with log message:


```
1. Nov 30 11:04:03 irc-ws17 kernel: ugen0.4: <Honeywell Scanning and Mobility> at usbus0
2. Nov 30 11:04:03 irc-ws17 kernel: ukbd1: <Honeywell Scanning and Mobility Honeywell Scanning and Mobility Scanner, class 0/0, rev 1.10/58.81, addr 4> on usbus0
3. Nov 30 11:04:03 irc-ws17 kernel: kbd3 at ukbd1
4. Nov 30 11:04:03 irc-ws17 kernel: ugen0.4: <Honeywell Scanning and Mobility> at usbus0 (disconnected)
5. Nov 30 11:04:03 irc-ws17 kernel: ukbd1: at uhub0, port 6, addr 4 (disconnected)
6. Nov 30 11:04:08 irc-ws17 root: Unknown USB device: vendor 0x0c2e product 0x0720 bus uhub0
7. Nov 30 11:04:08 irc-ws17 kernel: ugen0.4: <Honeywell Scanning and Mobility> at usbus0
```

From this came the questions:
Why is first defined as a keyboard, and then ugen?

The Trace log:

```
Point 1: Insert Scanner
Point 2: Detect Scanner As Keyboard
Point 3: Apply Driver ukbd
Point 4, 5: disconnected - (WHY?)
Point 6: Unknown USB device
Point 7: Scanner Now ugen
```

That is, the scanner was an unknown device and *not* the keyboard.
As it is now possible to handle events like keyboard scanner?

Therefore, usbdump and xev shows nothing.

What is there in Notepad text processing?


----------



## dmtr (Nov 30, 2012)

Little understood.
I work with USB keyboard: console and X
USB Scanner is TWO USB keyboard.

My Device NOT work as keyboard.
An attempt to append the device through kbdmuh produced an error by kbdcontrol:

kbdcontrol: unable to obtain keyboard information: Inappropriate ioctl for device


----------



## wblock@ (Nov 30, 2012)

Appears to be a problem with the USB device.  Please post to the freebsd-usb mailing list.


----------

