2D Barcode Scanner Breakout Hookup Guide

Pages
Contributors: El Duderino, MAKIN-STUFF
Favorited Favorite 2

DE2120 Python Package

Note: This Python package and included examples assume you are using the latest version of Python 3. If this is your first time using Python or TTL UART hardware on a Raspberry Pi, these resources can help you get started:

The SparkFun DE2120 Python package helps streamline sending commands and receiving barcode data from the 2D Barcode Scanner Breakout. Install the sparkfun-de2120 Python package hosted by PyPi through a command interface or if you prefer to manually download and build the libraries from the GitHub Repository, click the button below to download the package:

(Please be aware of any package dependencies. You can also check out the repository documentation page, hosted on Read the Docs.)

Installation

Note: The Raspberry Pi OS should automatically install any necessary drivers for the 2D Barcode Scanner when it is connected and operating in USB-COM Mode. Find the USB-COM barcode on page 23 in the Scan Settings Manual (the DE2120 defaults to USB-Keyboard mode) or scan it below:

USB COM mode for the DE2120

PyPi Installation

The DE2120 Py repository is hosted on PyPi as the sparkfun-de2120 package. On systems that support PyPi, install the package via pip3 (use pip for Python 2) using the following commands:

For all users (The user must have sudo privileges):

language:bash
sudo pip3 install sparkfun-de2120

For the current user:

language:bash
pip3 install sparkfun-de2120

Local Installation

Make sure to install the setuptools package on the system.

Direct installation at the command line (use python for Python 2):

language:bash
python3 setup.py install

Use the following command to build a package for use with pip3:

language:bash
python3 steup.py sdist

A package file is built and placed in a subdirectory called dist. Install the package file using pip3.

language:bash
cd dist
pip3 install sparkfun_de2120-<version>.tar.gz

DE2120 Python Package Operation

For a full overview of how to use this package along with all the functions included with the DE2120 Py package, take a look at the source code and package documentation hosted on ReadtheDocs.

Upgrading the Python Package

If needed, the DE2120 Python package can be upgraded using the following commands:

For all users:

language:bash
sudo pip3 install --upgrade sparkfun-de2120

For the current user:

language:bash
pip3 install --upgrade sparkfun-de2120