python3 implementation for handheld barcode scanner using COM port/ serial. tested on ubuntu 18.04 / linux mint tina
most linux distribution. But, it should be working fine with mac or windows.
Any generic, cheap chinese single directional laser barcode scanner (they're usually the same) with COM or serial communication over USB. It is identified by a very "direct" user manual such as this:
This code is using pyserial module, so install it first before using it. It is recommended using virtual environment.
-
Enter in terminal:
git clone https://github.com/ijash/handheld_barcode_scanner.git cd handheld_barcode_scanner pip3 install pyserial
note:pip3 command is interchangeable with pipenv if installed
-
Then, connect the USB to computer and make sure the barcode scanner is using serial communication (COM).
-
Run it in terminal
python3 barcode.py
feel free to create a pull request.