Since from version 7.6.x, Dynamsoft Barcode Reader started to support ARM64 (Previously, ARM32 only). It is good news for developers who aim to build barcode reader app on embedded computing boards like Raspberry Pi and Nvidia Jetson Nano. In this article, I will guide you through the process of building Python and C/C++ barcode reader apps on Nvidia Jetson Nano.
The AAch64 Python Barcode SDK
The operating system running on Jetson Nano is Ubuntu 18.04 Aarch64. You can find the Aarch64 edition of Dynamsoft Barcode SDK on https://pypi.org/project/dbr/#files.
The supported Python versions include 3.6, 3.7 and 3.8.
To install the ARM64 barcode SDK on the Aarch64 operating system, you just need to run the command:
pip3 install dbr
Once the installation is done, you can test the package in Python3:
Using Python Barcode SDK on Jetson Nano
To get started quickly with the Python barcode APIs, you can pull the sample code from GitHub: https://github.com/Dynamsoft/python-barcode.
A valid license is required for running all samples. Everyone has a chance to apply for a free 30-day trial license from the Dynamsoft customer portal.
As you get a license key, substitute the key string in the Python code:
license_key = "Input your own license"
Here is a sample (test_DecodeVideoByCamera.py) of decoding barcodes from the webcam video stream in real-time.
Note: To open a USB webcam, you have to build and install OpenCV beforehand.
Using C++ Barcode SDK on Jetson Nano
If you regard performance, you may prefer coding in C++.
Currently, only ARM32 edition is available for download online. You can download the package and extract documentation, header files and libraries to local disk.
It is no doubt that you will fail to build a C++ project with an ARM32 library on the ARM64 platform. You will see the incompatible error message if you do so.
The tricky thing is where the Aarch64 library is? If you have installed the Python barcode SDK, you can get it from the Python package folder.
cp /usr/local/lib/python3.6/dist-packages/dbr/libDynamsoftBarcodeReader.so ~/Dynamsoft/BarcodeReader/lib/
So far, this is the only way to get the ARM64 barcode library for C/C++. The official ARM64 C/C++ SDK will be available in the next release.
Now you can successfully build and run the C/C++ barcode reader project:
make ./ReadBarcode ../../../images/AllSupportedBarcodeTypes.tif
- Jetson Nano Developer Kit: the tutorial showing how to set up Jetson Nano and boot operating system.
- Linaro Toolchain: the cross-toolchain used to compile Dynamsoft Barcode Reader.