-
Notifications
You must be signed in to change notification settings - Fork 0
Module Documentation
In the following, the major modules will be described. Primarily, the Publisher and Subscriber modules!
As stated background section of the home page of this wiki, DTStacks is built partially on top of the raw integration of the eclipse-paho m2mqtt project for which gpvigano published his raw integration into unity (M2MqttUnity. However, to accommodate a simplified workflow, modifications have been made, primarily to enable less experienced developers to get started without headaches. Or at least less of them. However, it is of course still possible for anyone to further modify these!
All publishers by default (even when created using the publisher generation tool), have a standardized inspector section to configure and establish a connection to a broker. To get hints/clues to each individual field, simply hover the cursor above the name and a tooltip will give a brief description of the field in question.
The meaning and function of all individual fields and options will be described below:
Here all parameters which concern contacting the broker are entered.
The IP address (if within a local network) or the URL where the Broker is listing at. If a URL is used, use raw URLs without the prefix. Hence, test.mosquitto.org instead of https://test.mosquitto.org or mqtt://test.mosquitto.org. This will be handled internally for you.
The port at which the Broker is listening. Many Brokers by default listen at port 1883 non-encrypted and 8883 for encrypted
If enabled, the client will try to establish an TSL/SSL secured connection. For this a certificate is necessary. Using this, the message is significantly more secure than an open connection if sensitive data will be transferred. More information on how to create these certificates can be obtained here
Specify the delay between activating the component in unity (e.g. at the start of the program) and the establishment of the Mqtt connection
The period after which the connection will be terminated if no reply from a broker is received.
Instructs the client whether to establish a connection once activated automatically. If this is not enabled, this has to be triggered from another script (e.g. a button on a GUI) to initiate the connecting process. (If nothing seems to be happening, this is a common issue)
The user name login to access the Broker, if no login is required, simply leave this blank.
The corresponding login-password to access the Broker, if no login is required, simply leave this blank.
The topic to which the client listens or publishes to. More information can be found in a post on Steves-Internet-Guide. Please be aware that wildcards are supported but generally not recommended to use in this case.
If enabled, the client will automatically send a test message to the specified topic once a connection is established. This is meant as a unit-test for a single client to test the broker connection. Since this is a simple string, it may lead to issues for any subscribed client.
For publishing clients, also the mode of publishing can be configured. (for subscribing clients, this is not necessary.)
If enabled, the publisher will automatically keep publishing the information he has at specified intervals. If this is disabled, the publisher will operate in One-Shot-Mode, meaning the publishing process has to be triggered externally! (E.g. from script or a button on a GUI)
The interval at which the client will publish a new message to the broker. Counted as "after every Frames".
The publisher module is designed to solemnly send the specified information to an MQTT broker. It is NOT intended to be used for processing anything or directly interacting with game objects in Unity. The only interaction it is supposed to have within a unity scene is requesting the relevant information from a dedicated handler.
DTStacks, the Digital-Twinning-Stacks, published and maintained by fate4gle.
Please find the description of the framework within this wiki. Over time, this wiki will be further expanded and more conclusive. If anything crucial is missing, please raise an issue and it will be covered as soon as possible.