Skip to main content
Version: 1.7.1

The tedge mqtt command

tedge mqtt
Publish a message on a topic and subscribe a topic

Usage: tedge mqtt [OPTIONS] <COMMAND>

Commands:
pub Publish a MQTT message on a topic
sub Subscribe a MQTT topic
help Print this message or the help of the given subcommand(s)

Options:
--config-dir <CONFIG_DIR>
[env: TEDGE_CONFIG_DIR, default: /etc/tedge]

--debug
Turn-on the DEBUG log level.

If off only reports ERROR, WARN, and INFO, if on also reports DEBUG

--log-level <LOG_LEVEL>
Configures the logging level.

One of error/warn/info/debug/trace. Logs with verbosity lower or equal to the selected level will be printed, i.e. warn prints ERROR and WARN logs and trace prints logs of all levels.

Overrides `--debug`

-h, --help
Print help (see a summary with '-h')

Pub​

tedge mqtt pub
Publish a MQTT message on a topic

Usage: tedge mqtt pub [OPTIONS] <TOPIC> <MESSAGE>

Arguments:
<TOPIC>
Topic to publish

<MESSAGE>
Message to publish

Options:
--config-dir <CONFIG_DIR>
[env: TEDGE_CONFIG_DIR, default: /etc/tedge]

-q, --qos <QOS>
QoS level (0, 1, 2)

[default: 0]

--debug
Turn-on the DEBUG log level.

If off only reports ERROR, WARN, and INFO, if on also reports DEBUG

-r, --retain
Retain flag

--base64
Decode the payload before publishing

--log-level <LOG_LEVEL>
Configures the logging level.

One of error/warn/info/debug/trace. Logs with verbosity lower or equal to the selected level will be printed, i.e. warn prints ERROR and WARN logs and trace prints logs of all levels.

Overrides `--debug`

--repeat <REPEAT>
Repeat the message

--sleep <SLEEP>
Pause between repeated messages (e.g., 60s, 1h)

[default: 1s]

-h, --help
Print help (see a summary with '-h')

Sub​

tedge mqtt sub
Subscribe a MQTT topic

Usage: tedge mqtt sub [OPTIONS] <TOPIC>

Arguments:
<TOPIC>
Topic to subscribe to

Options:
--config-dir <CONFIG_DIR>
[env: TEDGE_CONFIG_DIR, default: /etc/tedge]

-q, --qos <QOS>
QoS level (0, 1, 2)

[default: 0]

--debug
Turn-on the DEBUG log level.

If off only reports ERROR, WARN, and INFO, if on also reports DEBUG

--no-topic
Avoid printing the message topics on the console

--base64
Encode the received payloads

--log-level <LOG_LEVEL>
Configures the logging level.

One of error/warn/info/debug/trace. Logs with verbosity lower or equal to the selected level will be printed, i.e. warn prints ERROR and WARN logs and trace prints logs of all levels.

Overrides `--debug`

-W, --duration <DURATION>
Disconnect and exit after the specified timeout (e.g., 60s, 1h)

-C, --count <COUNT>
Disconnect and exit after receiving the specified number of messages

--retained-only
Only show retained messages and disconnect and exit after receiving the first non-retained message

-h, --help
Print help (see a summary with '-h')