PROPHET/OS
NAME
mqtt: carries telemetry to a broker over MQTT 3.1.1, on port 1883
SYNOPSIS
mqtt pub <address> <topic> <text> [qos]|sub <address> <topic> [count]|selbsttest
DESCRIPTION
Carries telemetry to a broker over MQTT 3.1.1, on port 1883.
pub sends one message and ends. With qos 1 it waits for the receipt and gives 1 when none comes; with qos 0, the default, it gives 0 as soon as the bytes are out, because a message nobody acknowledges has nothing to wait for. sub takes a subscription, writes one line per message, topic and text, and ends after the count, four by default, like ping does.
It is a client and no vigil. Whoever wants a value every minute puts the line into cronv; whoever wants a permanent reporter builds it as one.
The address is an address and no name: resolve says what a name is. What is served is QoS 0 and QoS 1. QoS 2 is four messages for exactly-once, and telemetry does not want it, because a reading that arrives twice is still that one reading.
The format itself lies in lib/os/mqtt.c, outside the kernel, and the area mqtt drives it against byte sequences of the specification written out by hand. mqtt selbsttest drives the conversation over it, in ring 3, against a broker in memory: this machine has no loopback, so there is no way to give a program of ours the other end of a connection. What that leaves open is a foreign broker on a real line, and it is open.
EXAMPLE
$ mqtt --help mqtt pub <address> <topic> <text> [qos]|sub <address> <topic> [count]|selbsttest carries telemetry to a broker over MQTT 3.1.1, port 1883 pub sends one message, qos 0 or 1, and 1 waits for its receipt sub takes a subscription and writes what comes, four messages by default