Skip to main content

Publishing

The same group paths are used for publishing and subscribing. The topic you publish to will depend on your access permissions and the data you want to send.

The Devices and Processes groups allow write (publish) operations, provided you have the correct permissions.

tip

If you have any issues with permissions and/or topics, please refer to MQTT Permissions.

Compression

All messages received by Centrix resources should be compressed using gzip. gzip is a widely available lossless compression method with implementations in most languages and frameworks.

danger

All code examples on this page are for demonstration purposes and support will not be provided.

async function compress(payload) {
const blob = new Blob([payload]);
const compressedStream = blob.stream().pipeThrough(new CompressionStream("gzip"));
const reader = compressedStream.getReader();

let read;
let buffer = [];
while ((read = await reader.read())) {
if (read.done) break;
if (read.value) buffer = buffer.concat(...read.value);
}

return new Uint8Array(buffer);
}

Devices & Hubs

The devices topic is used to publish data to devices and hubs. This could be used to set a value of devices such as traffic lights, terminals, and weighbridges/scales. read permissions are also available for the device topic.

We recommend contacting your authorized reseller about publishing data, as each application may have different requirements and/or rules.

The topic structure for devices can be found in the Topic Structure article.

Processes

note

This documentation is still under construction and is not yet fully supported for publishing.

Documents

note

The documents topic does not allow publishing. To create, update, and delete documents, please use the API.