HiveMQ
Use Case: Manufacturing ..
Use Case - SCADA
Nowadays, plants use a wide selection of industrial sensors, each with a unique design, and application to collect and analyze data.
These Supervisory Control and Data Acquisition (SCADA) systems consist of both software and hardware components which enable remote and on-site gathering of data from the industrial equipment.
Pentaho Data Integration enables you to collect data from any source in real-time, augment data streams in a single interface and transform raw data into actionable manufacturing insights.


Remember to stop the mosquitto container.
Ensure the Mosquitto Broker has been stopped.
Copy over the required files.
Docker Network
HiveMQ Container
Run HiveMQ Docker container.
--ulimit
imits system resource amounts that individual users can consume
nofile
the maximum number of Open Files/File Descriptors this user can have at one time
--name
name of container
-p 9090
mapped container port. Exposes HiveMQ container Control Center on port 8080 to external 9090
-p 9000
mapped container port. Exposes HiveMQ container Websocket on port 9000
-p 1883
mapped container port. Exposes HiveMQ container TCP Listener on port 1883.
--net
name of isolated Docker network: hivemq
hivemq/hivemq4
Docker Hub image
Log into HiveMQ Control Center.
User
admin
Password
hivemq

Start the HiveMQ Broker.
Take a look at:
~/Streaming/HiveMQ4/scripts/sensor.py
Execute sensor.py
Release 2.0.0 of the Paho Python MQTT includes breaking changes (11th Feb 2024)
Execute sensor.py script.
Check that the sensor data is being successfully published to HiveMQ.

Execute subscribe.py
Take a look at:
~/Streaming/HiveMQ4/scripts/subscribe.py
Execute sensor.py script.
Take a look at the stats.

➡️ Next: Consume the data stream in PDI
Pentaho Data Integration
Start Pentaho Data Integration:
Execute sensor.py script.
Log into HiveMQ Control Center.
User
admin
Password
admin
Check the inbound connections and traffic.

You can also view the stream in MQTT Explorer.

Open the following transformation:
~/Streaming/HiveMQ4/tr_hive_consumer.ktr
Double click on the MQTT Consumer step.
For further details on the settings: MQTT Consumer

Transformation
➡️ Next: Process the sensor records
Open the following transformation:
~/Streaming/HiveMQ4/tr_process_sensor_data.ktr

Double-click on the JSON Input step and configure with the following settings.

Open the following file:
~/Streaming/HiveMQ4/HiveMQ4/output/robot_sensor.txt

Last updated
Was this helpful?

