三木社区

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 577|回复: 0
打印 上一主题 下一主题

mosquitto_sub帮助信息

[复制链接]

1657

主题

1684

帖子

5684

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
5684
跳转到指定楼层
楼主
发表于 2017-6-21 10:40:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
  1. mosquitto_sub is a simple mqtt client that will subscribe to a single topic and print all messages it receives.
  2. mosquitto_sub version 1.4.8 running on libmosquitto 1.4.8.

  3. Usage: mosquitto_sub [-c] [-h host] [-k keepalive] [-p port] [-q qos] [-R] -t topic ...
  4.                      [-C msg_count] [-T filter_out]
  5.                      [-A bind_address] [-S]
  6.                      [-i id] [-I id_prefix]
  7.                      [-d] [-N] [--quiet] [-v]
  8.                      [-u username [-P password]]
  9.                      [--will-topic [--will-payload payload] [--will-qos qos] [--will-retain]]
  10.                      [{--cafile file | --capath dir} [--cert file] [--key file]
  11.                       [--ciphers ciphers] [--insecure]]
  12.                      [--psk hex-key --psk-identity identity [--ciphers ciphers]]
  13.                      [--proxy socks-url]
  14.        mosquitto_sub --help

  15. -A : bind the outgoing socket to this host/ip address. Use to control which interface
  16.       the client communicates over.
  17. -c : disable 'clean session' (store subscription and pending messages when client disconnects).
  18. -C : disconnect and exit after receiving the 'msg_count' messages.
  19. -d : enable debug messages.
  20. -h : mqtt host to connect to. Defaults to localhost.
  21. -i : id to use for this client. Defaults to mosquitto_sub_ appended with the process id.
  22. -I : define the client id as id_prefix appended with the process id. Useful for when the
  23.       broker is using the clientid_prefixes option.
  24. -k : keep alive in seconds for this client. Defaults to 60.
  25. -N : do not add an end of line character when printing the payload.
  26. -p : network port to connect to. Defaults to 1883.
  27. -P : provide a password (requires MQTT 3.1 broker)
  28. -q : quality of service level to use for the subscription. Defaults to 0.
  29. -R : do not print stale messages (those with retain set).
  30. -S : use SRV lookups to determine which host to connect to.
  31. -t : mqtt topic to subscribe to. May be repeated multiple times.
  32. -T : topic string to filter out of results. May be repeated.
  33. -u : provide a username (requires MQTT 3.1 broker)
  34. -v : print published messages verbosely.
  35. -V : specify the version of the MQTT protocol to use when connecting.
  36.       Can be mqttv31 or mqttv311. Defaults to mqttv31.
  37. --help : display this message.
  38. --quiet : don't print error messages.
  39. --will-payload : payload for the client Will, which is sent by the broker in case of
  40.                   unexpected disconnection. If not given and will-topic is set, a zero
  41.                   length message will be sent.
  42. --will-qos : QoS level for the client Will.
  43. --will-retain : if given, make the client Will retained.
  44. --will-topic : the topic on which to publish the client Will.
  45. --cafile : path to a file containing trusted CA certificates to enable encrypted
  46.             certificate based communication.
  47. --capath : path to a directory containing trusted CA certificates to enable encrypted
  48.             communication.
  49. --cert : client certificate for authentication, if required by server.
  50. --key : client private key for authentication, if required by server.
  51. --ciphers : openssl compatible list of TLS ciphers to support.
  52. --tls-version : TLS protocol version, can be one of tlsv1.2 tlsv1.1 or tlsv1.
  53.                  Defaults to tlsv1.2 if available.
  54. --insecure : do not check that the server certificate hostname matches the remote
  55.               hostname. Using this option means that you cannot be sure that the
  56.               remote host is the server you wish to connect to and so is insecure.
  57.               Do not use this option in a production environment.
  58. --psk : pre-shared-key in hexadecimal (no leading 0x) to enable TLS-PSK mode.
  59. --psk-identity : client identity string for TLS-PSK mode.
  60. --proxy : SOCKS5 proxy URL of the form:
  61.            socks5h://[username[:password]@]hostname[:port]
  62.            Only "none" and "username" authentication is supported.

  63. See http://mosquitto.org/ for more information.
复制代码


回复

使用道具 举报

Archiver|手机版|小黑屋|三木电子社区 ( 辽ICP备11000133号-4 )

辽公网安备 21021702000620号

GMT+8, 2025-12-25 00:13 , Processed in 0.054431 second(s), 22 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表