This chapter provides recommendations and instructions for tools used to analyze, test, and debug the MQTT and OPC-UA interfaces of the APS.
- 9.1 MQTT Analysis Tools
- 9.2 OPC-UA Analysis Tools
- 9.3 Docker Architecture
- 9.4 Best Practices for Testing
MQTT Explorer is a comprehensive and easy-to-use MQTT client that provides a structured overview of your MQTT topics. It is highly recommended for visualizing the hierarchy of topics and debugging message flows.
- Website: http://mqtt-explorer.com/
- Purpose: Visualizing topic tree, monitoring live messages, publishing test messages.
- Connection:
- Host: IP address of your MQTT broker (e.g.,
localhostor the IP of the Raspberry Pi). - Port:
1883 - Username/Password:
default/default(standard development credentials).
- Host: IP address of your MQTT broker (e.g.,
- Visualization:
- Upon connection, you will see the topic tree on the left (e.g.,
f/i/state,u/i/state). - Expand the nodes to see individual devices and their messages.
- The "Value" column shows the latest payload.
- The "History" graph on the right shows value changes over time.
- Upon connection, you will see the topic tree on the left (e.g.,
- Publishing Test Messages:
- Use the "Publish" panel on the right.
- Topic: Enter the target topic (e.g.,
u/i/order). - Payload: Select
jsonand paste your test JSON. - Click "Publish".
The mosquitto package includes command-line tools that are excellent for scripting and quick checks.
- Documentation: https://mosquitto.org/documentation/
Use this tool to listen to topics in the terminal.
Example: Monitor all state messages
mosquitto_sub -h localhost -t "f/i/state/#" -vExample: Monitor a specific device
mosquitto_sub -h localhost -t "f/i/state/hbw" -vUse this tool to send messages from the terminal.
Example: Send a test order
mosquitto_pub -h localhost -t "u/i/order" -m '{"type":"order","ts":"...","orderId":"test-1"}'UaExpert is a full-featured OPC UA Client for testing and debugging OPC UA servers.
- Website: https://www.unified-automation.com/products/development-tools/uaexpert.html
- Purpose: Reading/writing raw PLC values, browsing the address space.
- Connection:
- Add a new server.
- Enter the endpoint URL of the PLC (e.g.,
opc.tcp://192.168.0.1:4840). - Connect anonymously or with credentials if configured.
- Browsing:
- Navigate the "Address Space" tree on the left.
- Locate the variables (e.g., under
PLC1->DataBlocks->Global).
- Monitoring:
- Drag variables to the "Data Access View" to see live values.
- Control:
- Double-click a value in the "Value" column to write a new value (e.g., setting
cmd__picktotruefor testing).
- Double-click a value in the "Value" column to write a new value (e.g., setting
Note: See OPC-UA Relationship for details on the variable structure. For a screenshot and further details, see the Factory Documentation on OPC-UA.
The Central Control Unit (CCU) and its supporting services are typically deployed using Docker.
A typical APS deployment consists of the following containers:
- MQTT Broker (
eclipse-mosquitto):- Handles all MQTT traffic.
- Exposes ports
1883(TCP) and9001(WebSocket).
- Central Control Unit (
aps-ccu):- The main Node.js application containing the orchestration logic.
- Connects to the MQTT broker container.
- Node-RED (
nodered/node-red):- Runs on the individual module controllers (TXT 4.0) or as a simulation bridge.
- Translates between MQTT and OPC-UA.
- Frontend (
aps-frontend):- Web-based user interface for monitoring and control.
- Connects to the MQTT broker via WebSockets (port 9001).
Reference: For detailed setup instructions and
docker-compose.ymlexamples, please refer to the README in the main repository.
- Monitor First: Before sending commands, always open MQTT Explorer or
mosquitto_subto observe the current traffic. - Check QoS: Ensure your test clients use the appropriate QoS level (usually QoS 0 or 1 for testing).
- Watch for Retained Messages: Be careful when publishing with the "Retain" flag, as this can persist invalid states.
- Isolate Tests: When testing a specific module, ensure the CCU is not trying to control it simultaneously to avoid race conditions.
- Continue to Scenario Examples for practical workflows
- See Appendices for additional resources