The IOT2050 application was developed to read barcodes and QR-codes by using an external USB scanner, decode the codes and transmit them using MQTT. The following example uses Docker and Node-Red to do so.
The following hardware components are required for the application:
- SIMATIC IOT2050
- Datalogic Scanning Inc. GD4430-BK Scanner
Follow SIMATIC_IOT2050_Setting_up.md for the following steps:
- Installing the SD-Card Example Image (in this example the image V1.1.1 was used)
- First commissioning of the SIMATIC IOT2050: Remote access with Putty SSH Connection (login as root)
- Working internet connection on the IOT2050
In addition, the barcode scanner must now be connected to the IOT2050 via USB. The following command can be used to check if the scanner is connected:
lsusb
An update must be performed for the system and git must be installed. The following commands are executed for this:
apt-get update
apt-get install git
Use the following commands:
curl -fsSL https://get.docker.com -o get-docker.sh
sh ./get-docker.sh
Verify the successful installation:
docker run hello-world
If the installation was successful, the output should contain the following:
For more information on installing Docker click here.
Add Docker-Compose:
sudo curl -L --fail https://github.com/AppTower/docker-compose/releases/download/latest/run.sh -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
To clone the latest version of the application from Github use the following commands:
cd /home
git clone https://github.com/SIMATICmeetsLinux/IOT2050-QR-Code-Scanner-Docker [This repository]
The repository with the application files can now be opened by the following command:
cd qr-code-scanner/src/
The following command in the application-repository can be used to build the docker-file:
docker-compose build
On the Example Image version 1.1.1 (used in this manual) Node-Red is already preinstalled and autostart is enabled. To access it, open a browser on your PC connected to the IOT2050 and open the URL http://<IP of the IOT2050>:1880/
.
Download the ready-made JSON-File: qr-code-flow.json
Import the flow and press the "deploy-button":
Menu -> Import -> Select a file to import -> Press the Import-Button
If all configurations are set correctly, the flow will look like the following.
To start the docker-application go to the application-directory (qr-code-scanner/src/) and use the following command:
docker-compose up
The application is ready when it is successfully launched:
Barcodes and QR-Codes can now be read using the scanner. These are then displayed in the terminal and transferred to Node-Red via the mqtt node.
The following examples can be used for testing:
Examples | Input/Output |
---|---|
Barcode | |
QR-Code | |
Barcode output (terminal) | |
Barcode output (node-red) |
Topic | |
---|---|
1 | SIMATIC IOT2050 forum: https://support.industry.siemens.com/tf/ww/en/threads/309 |
2 | SIMATIC IOT2050 Getting Started: https://support.industry.siemens.com/tf/ww/en/posts/238945/ |
3 | Operating Instructions: https://support.industry.siemens.com/cs/ww/en/view/109779016 |
Thank you for your interest in contributing. Anybody is free to report bugs, unclear documentation, and other problems regarding this repository in the Issues section. Additionally everybody is free to propose any changes to this repository using Pull Requests.
If you haven't previously signed the Siemens Contributor License Agreement (CLA), the system will automatically prompt you to do so when you submit your Pull Request. This can be conveniently done through the CLA Assistant's online platform. Once the CLA is signed, your Pull Request will automatically be cleared and made ready for merging if all other test stages succeed.
Please read the Legal information.