MQTT configuration

Maximo® Visual Inspection Edge uses an internal MQTT broker to handle internal messaging and deliver incoming trigger messages from external systems. You can send outgoing alert messages by using the internal broker, or you can encrypt them and send them by using an external broker.

Internal MQTT broker

Maximo Visual Inspection Edge includes an internal MQTT broker. This broker handles internal messaging, delivers incoming trigger messages, and can be used to send outgoing alert messages.

The broker runs inside the Maximo Visual Inspection Edge controller container. External clients can access the broker only on port 8883 by using transport layer security (TLS) encryption protocol version 1.3.

MQTT messaging in internal processes, triggers, and alerts

Internal Maximo Visual Inspection Edge processes use MQTT messages to perform the following tasks:

  • Trigger inspection pipelines that run in the CME Docker container in response to user actions.
  • Provide the health status of the CME container to the controller container.
  • Flag error conditions that occur in the CME container to the controller container.

Internal MQTT messages use topic names that begin with visionedge/. These topics cannot be accessed by external clients.

MQTT messages are also used to allow external systems to trigger input sources, such as cameras, to capture images. You specify a topic name in the Single-shot trigger field in an inspection. When an external system publishes a message in that topic, the input source captures an image.

Incoming trigger messages must be handled by the internal broker. If your workflow already uses an MQTT broker and systems publish trigger messages to that broker, you must configure MQTT bridging between your broker and the internal broker.

MQTT messages allow inspections to send alert messages to external recipients. In the Alert type->MQTT section of the Rule settings dialog, you specify a topic name and alert message. If the rule conditions are satisfied, the alert message is published to the topic, and any external recipients who subscribe to the topic receive the message.

Maximo Visual Inspection Edge uses the broker that is configured in the MQTT settings page to send alert messages. To use the internal broker, set the value of the Host field to vision-edge-controller and the value of the Port field to 1883. To use an external broker, enter the host, port, and authentication details of the external broker.

Integrating external systems with the internal broker

To allow an external system to publish trigger messages to and subscribe to alert messages from the internal broker, complete the following steps:

  1. Determine the host name of the Maximo Visual Inspection Edge server by running the following command:
    hostname -f
  2. Copy the <installation root>/vision-edge/volume/run/var/config/.ssl/visionedgeca.crt file, which is the certification authority (CA) certificate file, from the Maximo Visual Inspection Edge server to the external server.
  3. On the external server, use the MQTT client to subscribe to the topics where alerts in Maximo Visual Inspection Edge publish messages. For example, to use the mosquitto_sub client to subscribe to the alerts/bad_object topic, run the following command:
    mosquitto_sub -h <MVI Edge host name> -p 8883 --cafile ./visionedgeca.crt -t alerts/bad_object
  4. On the external server, use the MQTT client to publish trigger messages to the topics that are configured for input sources in inspections in Maximo Visual Inspection Edge. For example, to use the mosquitto_pub client to publish messages to the triggers/camera1 topic, run the following command:
    mosquitto_pub -h <MVI Edge host name> -p 8883 --cafile ./visionedgeca.crt -t triggers/camera1 -m '{"objectid":"152637"}'

Using TLS to encrypt outgoing alert messages

You might want Maximo Visual Inspection Edge to send alert messages by using an external broker. To encrypt the outgoing alert messages by using the TLS encryption protocol, complete the following steps:

  1. Copy the external broker’s CA certificate file to the <installation root>/vision-edge/volume/run/var/config directory on the Maximo Visual Inspection Edge server. This file usually has a .pem extension, for example ca.pem.
  2. In the <installation root>/vision-edge/volume/run/var/config/vision-edge.properties file, make the following updates to the mqtt_usetls and mqtt_pemfile configuration properties:
    mqtt_usetls=true
    mqtt_pemfile=<installation root>/vision-edge/volume/run/var/config/<CA certificate file name>
  3. Restart the Maximo Visual Inspection Edge containers by running the following command in the installation root directory:
    ./startedge.sh