The technical documentation for the microservice barcodereader, which reads out barcodes and sends the data to the MQTT broker.

This microservice is still in development and is not considered stable for production use.

Getting started

Here is a quick tutorial on how to start up a basic configuration or, respectively, a basic docker-compose stack, for development purposes.

Go to the root folder of the project and execute the following command:

sudo docker build -f deployment/barcodereader/DockerFile -t barcodereader:latest .
sudo docker run --privileged -e "DEBUG_ENABLED=True" -v '/dev:/dev' barcodereader:latest

All connected devices will be shown, the used device is marked with “Found xyz”. After every scan the MQTT message will be printed.

Environment variables

This chapter explains all environment variables used in barcodereader.

Variable nameDescriptionTypePossible valuesExample Values
LOGGING_LEVELDefines which logging level is used, mostly relevant for developers. If logging level is not DEVELOPMENT, default logging will be usedstringDEVELOPMENTDEVELOPMENT
KAFKA_BOOTSTRAP_SERVERURL of the Kafka broker used, port is requiredstringalllocalhost:9092
CUSTOMER_IDThe customer ID, which is used for the topic structurestringalldccaachen
LOCATIONThe location, which is used for the topic structurestringallaachen
ASSET_IDThe asset ID, which is used for the topic structurestringallweaving_machine_2
SERIAL_NUMBERSerial number of the clusterstringalldevelopment
SCAN_ONLYPrevent message broadcasting if enabled (default: false)booltrue, falsefalse
INPUT_DEVICE_PATHLinux path of the input device usedstringall/dev/input/event0
INPUT_DEVICE_IDThe name of the input devicestringallDatalogic ADC, Inc. Handheld Barcode Scanner
Last modified November 23, 2022: Feat/linkfixes (#176) (120bad7)