The colorOS operating system can exchange computer-to-computer messages with other colorOS nodes on the same network, or even non-colorOS network nodes that are properly configured. This is accomplished through an MQTT Message Broker.
Nodes which share the same MQTT Message Broker can communicate with each other. While colorOS does not currently support acting as a message broker itself, it can communicate with a broker running on another operating system (Linux, macOS, Windows) on the same network, as long as it supports the version 3.1.1 protocol.
Using an MQTT Message Broker is required to use colorOS Clustering.
Note that the following broker features are currently NOT supported by colorOS:
- MQTT Authentication
- MQTT Encryption
It is assumed that colorOS nodes running adjacent to each other can be considered friendly, and are running behind a firewall, and/or not directly accessible from the public Internet (e.g., in your home, or in an office, or on a boat or other mobile platform, etc.). That said, colorOS Messaging should not be used on a publicly accessible MQTT Message Broker if there are any concerns about data privacy.
Enabling Messaging with a Default Message Broker
Enable MQTT messaging by defining these macros in coloros.h and rebuilding the kernel:
#define MQTT_CLIENT - Enable MQTT Message Broker messaging
#define MQTT_BROKER "mqtt.color-os.com" - Define the default MQTT Message Broker
Overriding the Default Message Broker
While the default MQTT Message Broker is defined in coloros.h and built into the kernel, it can be overridden by setting the system property MQTT_SERVER without rebuilding the kernel.
For example, if your MQTT server is located at messaging.acme.com, when logged into a System account (or if logins are not enabled), to set and print the override MQTT Message Broker server:
OK, set mqtt-server messaging.acme.com
OK, print property mqtt-server
messaging.acme.com