Re: [Wlug] Seeking help with a USB barcode scanner
On Fri, 30 Mar 2007, Andy Stewart wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
HI everybody,
Does anybody in the group have any experience using a USB barcode scanner with Linux? Its tough to google for "barcode scanner" since each term brings up its own set of things which aren't what I seek.
In particular, I have been loaned a USB barcode scanner which is made by PSC, Inc. with model number QS2500. When I plug it into my laptop, the USB vendor and device IDs are 04B4:0101. I looked this up on the Linux USB devices website and it has multiple references (mostly to USB keyboards).
I think this device is being handled as a USB HID device, but I'm not certain.
Hi Andy, See if "evdev" is loaded, then try reading the various /dev/input/event* nodes. I have a USB keyboard here. Oh neat, under 2.6.19, they even give you a path that matches the device ids, # od -x /dev/input/by-id/usb-1241_1203-event-kbd (tap tap tap...) 0000000 92a9 460e 0000 0000 36dc 000b 0000 0000 0000020 0001 001c 0000 0000 92a9 460e 0000 0000 0000040 36e0 000b 0000 0000 0000 0000 0000 0000 ... C code, #include <linux/input.h> int keyboardFd = open(kbdev, O_RDWR); struct input_event ev; int n = read(keyboardFd, &ev, sizeof(ev)); See the fields in ev, you'll get events for press/release, keycode, etc. Have fun! -Jamie
I'm wondering if Linux has any software that would read the value from a barcode scanner and do something with it. If I knew which device file was used, maybe I could "cat <devfile>" and see some output when I scanned a barcode.
Note that there are several examples of software for printing barcodes, but that's not what I need (at least not yet).
Any help would be appreciated.
Thanks!
Andy
- -- Andy Stewart, Founder Worcester Linux Users' Group (http://www.wlug.org) Chelmsford Linux Meetup Group (http://linux.meetup.com/393) Amateur Radio: KB1OIQ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iD8DBQFGDcRgHl0iXDssISsRAjF2AJ98hr6d4i2EMSQ5AvAWiiyfPLHdWACeLSm+ uCN6IcuTTYvDZbz44z+t4I4= =gdbi -----END PGP SIGNATURE----- _______________________________________________ Wlug mailing list Wlug@mail.wlug.org http://mail.wlug.org/mailman/listinfo/wlug
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Everybody, Jamie Guinan wrote:
See if "evdev" is loaded, then try reading the various /dev/input/event* nodes.
Yes, evdev is loaded and I see some /dev/input/event* nodes. The unique ones for this device (that show up when I plug in the device) are event3 and event4. Also, I see mouse1 and ts1.
I have a USB keyboard here. Oh neat, under 2.6.19, they even give you a path that matches the device ids,
# od -x /dev/input/by-id/usb-1241_1203-event-kbd (tap tap tap...) 0000000 92a9 460e 0000 0000 36dc 000b 0000 0000 0000020 0001 001c 0000 0000 92a9 460e 0000 0000 0000040 36e0 000b 0000 0000 0000 0000 0000 0000 ...
In /dev/input/by-id, I see: usb-Cypress_Cypress_PS.2_Keyboard-event-{kbd,mouse} usb-Cypress_Cypress_PS.2_Keyboard-mouse I tried your "od -x" trick on each of these to no avail. I pointed the barcode scanner at some arbitrary barcodes, and it beeped and turned off the red light, but nothing appeared on my screen as a result of the "od -x". Are there other possibilities to consider? Thanks! Andy - -- Andy Stewart, Founder Worcester Linux Users' Group (http://www.wlug.org) Chelmsford Linux Meetup Group (http://linux.meetup.com/393) Amateur Radio: KB1OIQ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFGDrAaHl0iXDssISsRAtKQAJ94QGALxKYyZCAe1O82lmX0oPbw6ACff6xq +3p23tpa7Eu+AaA2eRTS1To= =Yf7o -----END PGP SIGNATURE-----
participants (2)
-
Andy Stewart
-
Jamie Guinan