Unitech AS10-U keyboard like Barcode scanner - Raspberry Pi Forums


hi
have barcode scanner above. supposedly works keyboard. works magic in windows without having install drivers. trying work pi, having hard time.

vendor id 040b , product id 6543. pi can see after plug in @ /dev/usb/hiddev0, works wheni access /dev/input

od -x </dev/input/by-id/usb-040b-longnumber
command above displays lot of hex numbers don't seem consistent every time scan same bar code.

cat </dev/input/by-id/usb-040b-...
displays tons of ascii characters. not sure how extract actual bar code.

import sys

fp = open('/dev/input/by-id/usb-040b-longnumber', 'rb')
tstr = ''
while true:
buffer = fp.read(8)
c in buffer:
if ord(c) > 0:
tstr = tstr + c

print tstr + "\n"

these simple codes i've tried. guidance appreciated.
thanks



raspberrypi



Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support