Pogo unit as headless barcode scanner
Now that I have a couple of Pogo devices up and running with at least a basic Linux OS, I’m starting to think about getting one of them running as a headless USB barcode scanner. I installed usbutils on the Pogo (‘sudo apt-get install usbutils’) and am able to view its details with a ‘lsusb’, especially followed by a ‘lsusb -v -s <busnum>:<devnum>’. I’d like to set up a (probably Perl, though I really do need to at least tinker with Ruby at some point) script to “listen” to the scanner and receive any input from it (i.e., barcode data it has scanned). The script would then determine what to do with that data based upon a database lookup. Scanning of grocery items, for example, might add them to an inventory for updating, while scanning of the serial number barcodes on my Black & Decker Matrix 20V Lithium batteries could trigger an entry that a particular battery serial number was charged on a particular date (so I can make sure they are charged periodically as per the user guide).
Some references from my initial research this evening:
- Use an EVIOCGRAB to lock the scanner input to a script
- Use udev scripts to consistently assign the scanner to a particular device ID (noted that repeatedly issuing a ‘lsusb -v -s <busnum>:<devnum>’ causes the “devnum” to change).
- Perhaps just configure syslog on the device and send the logs to a more powerful or dedicated device for processing. Some information on configuring the syslog daemon in the Busybox host OS.
Leave a Reply