-
Notifications
You must be signed in to change notification settings - Fork 43
mqtt_unsubscribe
Unsubscribes the currently active context client from a list of topics and is therefore only available in Shell mode.
clientId@host:port > unsubscribe
Alias: client@host:port > unsub
Option | Long Version | Explanation |
---|---|---|
-t | --topic | The topics to publish to |
Connect a client which is identified by test mosquitto client1
and subscribe it to two topics afterward. Then unsubscribe from one of the two topics:
Welcome to Toolkit v0.7.0
Press Ctrl+C or `exit` to exit the REPL
used: ?”´ unused: ?Ÿ¢
?Ÿ¢ 0: test mosquitto [email protected]:1883
?Ÿ¢ 1: test mosquitto [email protected]:1883
new > add a new config settings
Please select your mqtt configs: > 0
you typed:0
clientId:toolkit_mqtt_foRbI6r1 connect broker test.mosquitto.org:1883???
Usage: > { pub | sub | unsub | dis | list | exit }
In context mode all MQTT commands relate to the currently active client.
commands:
help Displays help information about the specified command
pub, publish Publish a message to a list of topics
sub, subscribe Subscribe this MQTT client to a list of topics
unsub, unsubscribe Unsubscribe this MQTT client from a list of topics
dis, disconnect Disconnects this MQTT client
ls, list List connected client info and subscribed topics
exit Exit the current context
test mosquitto [email protected]:1883 > sub -t topic1
test mosquitto [email protected]:1883 > sub -t topic2
test mosquitto [email protected]:1883 > list
ClientId:
Name: test mosquitto [email protected]:1883
Client Id: toolkit_mqtt_foRbI6r1
Username:
Password:
Keep Alive : 10(s)
Clean Session : Y
Subscribed Topics:
topic: topic1 qos: AT_MOST_ONCE
topic: topic2 qos: AT_MOST_ONCE
test mosquitto [email protected]:1883 > unsub -t topic1
test mosquitto [email protected]:1883 >
This article is part of the IoT Toolkit, click on Directory View all chapters.
If you feel that the article is helpful to you, please click on Star 🌟 or Fork 🍴 in the top right corner.
-
toolkit mqtt desc
: introduction and description of MQTT protocol;
-
toolkit mqtt set
: mqtt settings information management;
-
toolkit mqtt shell
: mqtt shell mode;
Synopsis:
-
toolkit coap desc
: introduction and description of CoAP protocol; -
toolkit coap mt
: List supported MIME types; -
toolkit coap disc
: list available resources; -
toolkit coap get
: Request data from CoAP Resource; -
toolkit coap post
: Create/Update data in CoAP Resource; -
toolkit coap put
: Update data in CoAP Resource; -
toolkit coap del
: Delete CoAP Resource;