Re: [Wlug] Seeking help with a USB barcode scanner
-----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?
At this point I'd start putting printk's and turning on DEBUGs in the kernel source. For starters, drivers/usb/input/hid-core.c:hid_input_report() drivers/usb/input/hid-input.c:hidinput_configure_usage() I typically do something like this, $ make $ make modules_install INSTALL_MOD_PATH=$(pwd)/tmp (don't go installing under /lib just yet) $ rmmod foo $ insmod ./tmp/..../foo.ko [ unplug, replug, dmesg, tail messages, rinse, repeat ] -Jamie
From: Jamie Guinan <guinan@bluebutton.com>
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?
At this point I'd start putting printk's and turning on DEBUGs in the kernel source. For starters,
If you get to the point of modifying the kernel source, can you be far from wanting an oscilloscope on the pins? -- Keith
This is what I would do. 1. Install "lsusb". It behaves much like lspci so you can what devices are on your system. When you do a "lsusb" it'll list what devices are hanging off of each USB bus. Do a before and after so you can see the major/minor numbers. 2. When you know the devices major and minor number you can write a program using libusb that'll look for the device, open the device if it exists, take posession of it and then read data to and from it, hopefully. http://libusb.sourceforge.net/doc/examples-code.html Looking at that example, I don't think it would be too hard to whip up a program to open the device and then loop until there's input and then dump it on the screen. Thanks, Tim. On 3/31/07, Keith Wright <kwright@keithdiane.us> wrote:
From: Jamie Guinan <guinan@bluebutton.com>
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?
At this point I'd start putting printk's and turning on DEBUGs in the kernel source. For starters,
If you get to the point of modifying the kernel source, can you be far from wanting an oscilloscope on the pins?
-- Keith _______________________________________________ Wlug mailing list Wlug@mail.wlug.org http://mail.wlug.org/mailman/listinfo/wlug
-- I am leary of the allegiances of any politician who refers to their constituents as "consumers".
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Tim Keller wrote:
This is what I would do.
1. Install "lsusb". It behaves much like lspci so you can what devices are on your system.
When you do a "lsusb" it'll list what devices are hanging off of each USB bus. Do a before and after so you can see the major/minor numbers.
2. When you know the devices major and minor number you can write a program using libusb that'll look for the device, open the device if it exists, take posession of it and then read data to and from it, hopefully. http://libusb.sourceforge.net/doc/examples-code.html
Looking at that example, I don't think it would be too hard to whip up a program to open the device and then loop until there's input and then dump it on the screen.
Thanks, Tim.
HI Tim, Thanks for the tip about libusb. I have lsusb installed, and I also have usbview. I'm surprised that I can't find the proper thing to "cat" to see output from the barcode reader. That would be the shell equivalent of what you propose. If I could find that, I'd be in business. I'm 99% certain that I'm looking in the right place. Now, I wonder if it is possible that the barcode reader is defective.......hummmmm. Once I find the right file to "cat", whipping up a program to grab the bytes and deal with them would be fairly trivial, I agree. 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 iD8DBQFGEX21Hl0iXDssISsRAhhCAJ9Y4iidL2WKRRyAqMFz06c1Nbd7yQCffu6p 2XTWxxQuiKaj27rVAGw9HxY= =Q0Ie -----END PGP SIGNATURE-----
participants (4)
-
Andy Stewart
-
Jamie Guinan
-
Keith Wright
-
Tim Keller