I've been thinking (on and off) for over a year of a way to improve how I store and more importantly, how I find my electronic components. Like a lot of people I have (plastic and metal) storage cabinets that comprise of rows of drawers (in which I place all the various items I have acquired and purchased over the years). At the moment I have thin cardboard labels that I place inside each drawer. For components I use regularly I can remember... "oh that's in the third drawer (from the left) on the second row" (unless of course the drawer gets put back in the wrong place).
When I saw this advert on AE I couldn't resist pressing the "Buy Now" button especially as I had some credit from refunds/returns and some tokens - that lowered the price even more.
The scanner arrived this week and after a few failed attempts at getting the Bluetooth to work I tried plugging the 2.4GHz Wireless Dongle into one of my Raspberry Pi 4Bs that act as my home server running Node-RED and Mosquitto.
The dongle appears as an HID Keyboard Device so I created a simple Python script to trap the "key presses" until an "KEY_ENTER" is detected - which causes the bar code to be sent via MQTT to Node-RED.
Next step was to create a simple NR flow to send a query to my MySQL dB.
Part of my simple dB...
This gives a result that indicates if the bar code is in the database or not. The 'switch' node (in the above flow) is used to trigger a message that is sent to a Telegram account on my phone and also to one of my Alexa devices.
As a quick test I cut a label off of a couple of packet of biscuits and inserted one code in the dB.
If anyone is interested, here's the Python file (rename it to... 'bar_code_scanner.py')
bar_code_scanner.txt (3.6 KB)