Dockerized environment for demoing MQTT using an Ignition Main and Edge Gateway and the Eclipse Mosquitto MQTT Broker.
This setup is for quick testing, development, and demonstration of Sparkplug B and general MQTT data between an Edge and a Central server using a third-party broker Mosquitto.
| File Name | Description |
|---|---|
docker-compose.yaml |
Defines the multi-container application, including the two Ignition instances and the Mosquitto broker. |
mosquitto.conf |
Configuration file for the Mosquitto broker, enabling anonymous connections for this demonstration. |
The docker-compose.yaml file sets up three containers:
- Image:
eclipse-mosquitto - Port: Exposed on host port 1883 (
1883:1883). - Configuration: Uses the provided
mosquitto.conf, which sets:This allows any client to connect to the broker on the default MQTT non-TLS port.listener 1883 allow_anonymous true
- Image:
inductiveautomation/ignition:8.1.45 - Port: Exposed on host port 9088 (
9088:8088). - Gateway Name:
Main - Edition:
standard - Admin Credentials: Username
admin, Passwordpassword(for development only).
- Image:
inductiveautomation/ignition:8.1.45 - Port: Exposed on host port 9099 (
9099:8088). - Gateway Name:
Edge - Edition:
edge - Admin Credentials: Username
admin, Passwordpassword(for development only).
Follow these steps to launch:
Run the following command from the same directory as the .yaml file:
docker compose up -dThis will pull the necessary images and start all three containers (main, edge, and mosquitto) in detached mode.
Wait for the Ignition Gateways to fully initialize. You can then access them via the browser:
- Ignition Main Gateway: http://localhost:9088
- Ignition Edge Gateway: http://localhost:9099
You will need to configure the MQTT Transmission and MQTT Engine modules within the Gateways.
-
On the
edgeGateway (https://www.google.com/search?q=http://localhost:9099):- Install the MQTT Transmission module.
- Configure the MQTT Transmitter to connect to the broker using the hostname
mosquitto(as defined indocker-compose.yaml). The port is1883.
-
On the
mainGateway (https://www.google.com/search?q=http://localhost:9088):- Install the MQTT Engine module.
- Configure the MQTT Engine to connect to the broker using the hostname
mosquitto. The port is1883.
Once configured, the Edge Gateway will publish Sparkplug B data to the Mosquitto broker, and the Main Gateway will subscribe to and process that data, making it available in the Cirrus Link managed Tag Provider.
To stop and remove the containers and networks:
docker compose downTo remove the persistent data volumes as well (which resets the Ignition Gateways to their default state):
docker compose down -v