DocsArrow - Elements Webflow Library - BRIX Templates
Connect Unity to MQTT Broker

Connect Unity to MQTT Broker

Adding ParallaxProcessor Prefab

The ParallaxProcessor prefab enables MQTT message handling between the UI project and the Control System.

This guide assumes the Automated UI generation tool is NOT being used to build the scene. When using the Automated UI Generation tool, the ParallaxProcessor prefab will be added to the scene already.

Adding ParallaxProcessor prefab to the scene

The ParallaxProcessor prefab contain the fields:

Broker Address: IP Address of the MQTT server.

Broker Port: Port of the MQTT server. Use port 1883 for programmatic access.

Username: as set in your Node-RED MQTT broker node.

Password: as set in your Node-RED MQTT broker node.

MQTT topics to subscribe to: In this field, you need to specify the topics that correspond to the message types your system will handle: Digital, Analog, and Serial. This field contains an expandable list where you can add or define these topics. Ensure that the topics specified here precisely match the topics defined in your MQTT output node, which sends feedback states to the touch-panel UI. Essentially, by subscribing to these topics, you enable the system to listen and react to feedback coming from the MQTT output node, reflecting the current state of each type (Digital, Analog, Serial) in the user interface.

Test connection

Ensure the MQTT broker is configured:

Aedes MQTT broker node

In the Unity editor, press the play button, check the Console to see the connection status. The Unity debug console log shows if the connection has been established:

View the debug log in Node-RED:

Message received in Node-RED debug log

Expand the log to view details:

The “id” field shows the Parallax-Touchpanel, along with its unique identifier

Access MQTT Server Web Page on the device:

The MQTT Node Red server comes pre-installed on the processor. The web page is accessible by the processors IP Address, at port 1880.

User: admin

Password: <serialNumber>

Default Programmatic Access Port: 1883

Default Web Page Port: 1880

Login to the Node Red web page to begin your logic programming.

Note: you may also spin up a node red server on your local machine for pre-programming and testing.