This the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

factorycube-edge

sensorconnect

This tool automatically finds connected ifm gateways (e.g. the AL1350 or AL1352), extracts all relevant data and pushes the data to a MQTT broker. Technical information and usage can be found in the documentation for sensorconnect

cameraconnect

This tool automatically identifies connected cameras network-wide which support the GenICam standard and makes them utilizable. Each camera requires its own container. The camera acquisition can be triggered via MQTT. The resulting image data gets pushed to the MQTT broker. Technical information and usage can be found in the documentation for cameraconnect

barcodereader

This tool automatically detected connected USB barcode scanners and send the data to a MQTT broker. Technical information and usage can be found in the documentation for barcodereader

mqtt-bridge

This tool acts as an MQTT bridge to handle bad internet connections. Messages are stored in a persistent queue on disk. This allows using the factorycube-edge in remote environments with bad internet connections. It will even survive restarts (e.g. internet failure and then 1h later power failure). We developed it as we’ve tested multiple MQTT brokers and their bridge functionalities (date of testing: 2021-03-15) and could not find a proper solution:

nodered

This tool is used to connect PLC and to process data. See also Getting Started. Or take a look into the official documentation

emqx-edge

This tool is used as a central MQTT broker. See emqx-edge documentation for more information. The max mqtt message size is 104 MB.

1 - barcodereader

This is the documentation for the container barcodereader.

Getting started

Here is a quick tutorial on how to start up a basic configuration / a basic docker-compose stack, so that you can develop.

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 used environment variables.

DEBUG_ENABLED

Description: Deactivates MQTT and only prints the barcodes to stdout

Type: bool

Possible values: true, false

Example value: true

CUSTOM_USB_NAME

Description: If your barcodereader is not in the supported list of devices, you must specify the name of the USB device here

Type: string

Possible values: all

Example value: Datalogic ADC, Inc. Handheld Barcode Scanner

MQTT_CLIENT_ID

Description: The MQTT client id to connect with the MQTT broker

Type: string

Possible values: all

Example value: weaving_barcodereader

BROKER_URL

Description: The MQTT broker URL

Type: string

Possible values: IP, DNS name

Example value: ia_mosquitto

Example value 2: localhost

BROKER_PORT

Description: The MQTT broker port. Only unencrypted ports are allowed here (default: 1883)

Type: integer

Possible values: all

Example value: 1883

CUSTOMER_ID

Description: The customer ID, which is used for the topic structure

Type: string

Possible values: all

Example value: dccaachen

LOCATION

Description: The location, which is used for the topic structure

Type: string

Possible values: all

Example value: aachen

MACHINE_ID

Description: The machine ID, which is used for the topic structure

Type: string

Possible values: all

Example value: weaving_machine_2

2 - cameraconnect

This docker container automatically detects cameras in the network and makes them accessible via MQTT. The MQTT output is specified in the MQTT documentation

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

Getting started

Using the Helm chart

By default cameraconnect will be deactivated in factorycube-edge. First, you need to enable it in the factorycube-edge values. Then you need to create a folder on the node in /home/rancher/gentl_producer and move your genTL producer files (*.cti) and all required libaries into that folder. Then apply your settings to the Helm chart with helm upgrade.

Another idea for changing it: helm install ....... --set 'cameraconnect.enabled=true'

Or overwroite it in the development_values.yaml

Furthermore, you need to adjust the MQTT_HOST to the externally exposed MQTT IP (e.g., the IP of your node). Usually you can use the Kubernetes internal DNS. But cameraconnect needs to be in hostMode = true and hterefore you need to access from external.

Development setup

Here is a quick tutorial on how to start up a basic configuration / a basic docker-compose stack, so that you can develop.

  1. Specify the environment variables, e.g. in a .env file in the main folder or directly in the docker-compose
  2. execute sudo docker-compose -f ./deployment/cameraconnect/docker-compose.yaml up -d --build

Environment variables

This chapter explains all used environment variables.

CUBE_TRANSMITTERID

Description: The unique transmitter id. This will be used for the creation of the MQTT topic. ia/raw/TRANSMITTERID/…

Type: string

Possible values: all

Example value: 2021-0156

MQTT_HOST

Description: The MQTT broker URL

Type: string

Possible values: IP, DNS name

Example value: ia_mosquitto

Example value 2: localhost

MQTT_PORT

Description: The MQTT broker port. Only unencrypted ports are allowed here (default: 1883)

Type: integer

Possible values: all

Example value: 1883

TRIGGER

Description: Defines the option of how the camera is triggered. Either via MQTT or via a continuous time trigger.
In production the camera should be triggered via MQTT. The continuous time trigger is just convenient for debugging.
If MQTT is selected, the camera will be triggered by any message which arrives via its subscribed MQTT topic.
However, if the arriving MQTT message contains a UNIX timestamp in milliseconds with the key “timestamp_ms”,
the camera will be triggered at that exact timestamp.

Type: string

Possible values: MQTT, Continuous

Example value: MQTT

ACQUISITION_DELAY

Description: Timeconstant in seconds which delays the image acquisition after the camera has been triggered.
This is mostly used, if the camera is triggered with a UNIX timestamp (see variable TRIGGER), to make sure, that the
camera is triggered, even if the UNIX timestamps lies in the past. This could be caused by network latencies.

Type: float

Possible values: all

Example value: 0.7

CYCLE_TIME

Description: Only relevant if the trigger is set to “Continuous”. Cycle time gives the time period which defines
the frequency in which the camera is triggered.
For example: a value of 0.5 would result in a trigger frequency of 2 images per second.

Type: float

Possible values: all

Example value: 1.5

CAMERA_INTERFACE

Description: Defines which camera interface is used. Currently only cameras of the GenICam standard are supported.
However, for development of testing you can also use the DummyCam, which simulates a camera and sends a static image via MQTT,
when triggered.

Type: String

Possible values: GenICam, DummyCam

Example value: GenICam

EXPOSURE_TIME

Description: Defines the exposure time for the selected camera. You should adjust this to your local environment to
achieve optimal images.

Type: int

Possible values: Depends on camera interface. Values between 1 and 80,000 are eligible for most cameras.

Example value: 1000

EXPOSURE_AUTO

Description: Determines if camera automatically adjusts the exposure time. Your settings will only be executed if
the camera supports this. You do not have to check if the camera supports this.

Type: String

Possible values:
“Off” - No automatic adjustment
“Once” - Adjusted once
“Continuous” - Continuous adjustment (not recommended, Attention: This could have a big impact on the frame rate of your camera)

Example value: Off

PIXEL_FORMAT

Description: Sets the pixel format which will be used for image acquisition. This module allows you to acquire
images in monochrome pixel formats(use: “Mono8”) and RGB/BRG color pixel formats (use:“RGB8Packed” or “BGR8Packed”)

Type: String

Possible values: Mono8, RGB8Packed, BGR8Packed

Example value: Mono8

IMAGE_WIDTH

Description: Defines the horizontal width of the images acquired. If the width values surpasses the maximum
capability of the camera the maximum value is set automatically.

Type: int

Possible values: all except 0

Example value: 1000

IMAGE_HEIGHT

Description: Defines the vertical height of the images acquired. If the height value surpasses the maximum
capability of the camera the maximum value is set automatically.

Type: int

Possible values: all except 0

Example value: 1000

IMAGE_CHANNELS

Description: Number of channels (bytes per pixel) that are used in the array (third dimension of the image data
array).You do not have to set this value. If None, the best number of channels for your set pixel format will be used.

Type: int

Possible values: 1 or 3

Example value: 1

MAC_ADDRESS

Description: Defines which camera is accessed by the container. One container can use only one camera.
The MAC address can be found on the backside of the camera.
The input is not case sensitive. Please follow the example format below.

Type: String

Possible values: all

Example value: 0030532B879C

LOGGING_LEVEL

Description: Defines which logging level is used. Mostly relevant for developers. Use WARNING or ERROR in production.

Type: String

Possible values: DEBUG, INFO, WARNING, ERROR, CRITICAL

Example value: DEBUG

Credits

Based on the Bachelor Thesis from Patrick Kunz.

3 - mqtt-bridge

This tool acts as an MQTT bridge to handle bad internet connections.

Getting started

Here is a quick tutorial on how to start up a basic configuration / a basic docker-compose stack, so that you can develop.

Here is a quick tutorial on how to start up a basic configuration / a basic docker-compose stack, so that you can develop.

  1. Specify the environment variables, e.g. in a .env file in the main folder or directly in the docker-compose
  2. execute sudo docker-compose -f ./deployment/mqtt-bridge/docker-compose.yaml up -d --build

Environment variables

This chapter explains all used environment variables.

REMOTE_CERTIFICATE_NAME

Description: the certificate name / client id

Type: string

Possible values: all

Example value: 2021-0156

REMOTE_BROKER_URL

Description: the URL to the broker. Can be prepended either with ssl:// or mqtt:// or needs to specify the port afterwards with :1883

Type: string

Possible values: all

Example value: ssl://mqtt.app.industrial-analytics.net

REMOTE_SUB_TOPIC

Description: the remote topic that should be subscribed. The bridge will automatically append a /# to the string mentioned here

Type: string

Possible values: all

Example value: ia/ia

REMOTE_PUB_TOPIC

Description: the remote topic prefix where messages from the remote broker should be send to.

Type: string

Possible values: all

Example value: ia/ia

REMOTE_BROKER_SSL_ENABLED

Description: should SSL be enabled and certificates be used for connection?

Type: bool

Possible values: true or false

Example value: true

LOCAL_CERTIFICATE_NAME

Description: the certificate name / client id

Type: string

Possible values: all

Example value: 2021-0156

LOCAL_BROKER_URL

Description: the URL to the broker. Can be prepended either with ssl:// or mqtt:// or needs to specify the port afterwards with :1883

Type: string

Possible values: all

Example value: ssl://mqtt.app.industrial-analytics.net

LOCAL_SUB_TOPIC

Description: the remote topic that should be subscribed. The bridge will automatically append a /# to the string mentioned here

Type: string

Possible values: all

Example value: ia/ia

LOCAL_PUB_TOPIC

Description: the remote topic prefix where messages from the remote broker should be send to.

Type: string

Possible values: all

Example value: ia/ia

LOCAL_BROKER_SSL_ENABLED

Description: should SSL be enabled and certificates be used for connection?

Type: bool

Possible values: true or false

Example value: true

BRIDGE_ONE_WAY

Description: DO NOT SET TO FALSE OR THIS MIGHT CAUSE AN ENDLESS LOOP! NEEDS TO BE FIXED BY SWITCHING TO MQTTV5 AND USING NO_LOCAL OPTION WHILE SUBSCRIBING. If true it sends the messages only from local broker to remote broker (not the other way around)

Type: bool

Possible values: true or false

Example value: true

Important note regarding topics

The bridge will append /# to LOCAL_SUB_TOPIC and subscribe to it. All messages will then be send to the remote broker. The topic on the remote broker is defined by:

  1. First stripping LOCAL_SUB_TOPIC from the topic
  2. and then replacing it with REMOTE_PUB_TOPIC

4 - sensorconnect

This docker container automatically detects ifm gateways in the specified network and reads their sensor values in the highest possible data frequency. The MQTT output is specified in the MQTT documentation

Getting started

Here is a quick tutorial on how to start up a basic configuration / a basic docker-compose stack, so that you can develop.

  1. Specify the environment variables, e.g. in a .env file in the main folder or directly in the docker-compose
  2. execute sudo docker-compose -f ./deployment/sensorconnect/docker-compose.yaml up -d --build

Environment variables

This chapter explains all used environment variables.

TRANSMITTERID

Description: The unique transmitter id. This will be used for the creation of the MQTT topic. ia/raw/TRANSMITTERID/…

Type: string

Possible values: all

Example value: 2021-0156

BROKER_URL

Description: The MQTT broker URL

Type: string

Possible values: IP, DNS name

Example value: ia_mosquitto

Example value 2: localhost

BROKER_PORT

Description: The MQTT broker port. Only unencrypted ports are allowed here (default: 1883)

Type: integer

Possible values: all

Example value: 1883

IP_RANGE

Description: The IP range to search for ifm gateways

Type: string

Possible values: All subnets in CIDR notation

Example value: 172.16.0.0/24