USB Barcode Scanner (Raspberry Pi)

by piddlerintheroot in Circuits > Raspberry Pi

71905 Views, 31 Favorites, 0 Comments

USB Barcode Scanner (Raspberry Pi)

thumb.png

Basic tutorial of how to setup a USB barcode scanner with the Raspberry Pi.

Parts

vlcsnap-8415-04-28-05h38m51s284.png

Setup

vlcsnap-3847-02-03-12h33m22s716.png

1. Plug in USB Barcode Scanner to Raspberry Pi

2. Boot Pi and open terminal

Type "sudo raspi-config"

3. Go to interfacing options and enable "Serial"

4. Install dependencies

Type "pip install requests"

5. Navigate to https://upcdatabase.org/ and create a free account and take note of api key

6. Edit line 6 of barcode.py and enter your api key

7. Type "sudo python barcode.py" to run script (press ctrl+c to exit script)

Code

vlcsnap-0323-09-14-04h54m54s281.png

Dependencies:

"pip install requests"

run:

sudo python barcode.py

Downloads

Additional Info

vlcsnap-4240-06-21-08h51m51s648.png
USB Barcode Scanner (Raspberry Pi)