三木社区

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

mosquitto_pub帮助信息

[复制链接]

1657

主题

1684

帖子

5684

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
5684
跳转到指定楼层
楼主
发表于 2017-6-21 10:39:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
  1. mosquitto_pub is a simple mqtt client that will publish a message on a single topic and exit.
  2. mosquitto_pub version 1.4.8 running on libmosquitto 1.4.8.

  3. Usage: mosquitto_pub [-h host] [-k keepalive] [-p port] [-q qos] [-r] {-f file | -l | -n | -m message} -t topic
  4.                      [-A bind_address] [-S]
  5.                      [-i id] [-I id_prefix]
  6.                      [-d] [--quiet]
  7.                      [-M max_inflight]
  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_pub --help

  15. -A : bind the outgoing socket to this host/ip address. Use to control which interface
  16.       the client communicates over.
  17. -d : enable debug messages.
  18. -f : send the contents of a file as the message.
  19. -h : mqtt host to connect to. Defaults to localhost.
  20. -i : id to use for this client. Defaults to mosquitto_pub_ appended with the process id.
  21. -I : define the client id as id_prefix appended with the process id. Useful for when the
  22.       broker is using the clientid_prefixes option.
  23. -k : keep alive in seconds for this client. Defaults to 60.
  24. -l : read messages from stdin, sending a separate message for each line.
  25. -m : message payload to send.
  26. -M : the maximum inflight messages for QoS 1/2..
  27. -n : send a null (zero length) message.
  28. -p : network port to connect to. Defaults to 1883.
  29. -P : provide a password (requires MQTT 3.1 broker)
  30. -q : quality of service level to use for all messages. Defaults to 0.
  31. -r : message should be retained.
  32. -s : read message from stdin, sending the entire input as a message.
  33. -S : use SRV lookups to determine which host to connect to.
  34. -t : mqtt topic to publish to.
  35. -u : provide a username (requires MQTT 3.1 broker)
  36. -V : specify the version of the MQTT protocol to use when connecting.
  37.       Can be mqttv31 or mqttv311. Defaults to mqttv31.
  38. --help : display this message.
  39. --quiet : don't print error messages.
  40. --will-payload : payload for the client Will, which is sent by the broker in case of
  41.                   unexpected disconnection. If not given and will-topic is set, a zero
  42.                   length message will be sent.
  43. --will-qos : QoS level for the client Will.
  44. --will-retain : if given, make the client Will retained.
  45. --will-topic : the topic on which to publish the client Will.
  46. --cafile : path to a file containing trusted CA certificates to enable encrypted
  47.             communication.
  48. --capath : path to a directory containing trusted CA certificates to enable encrypted
  49.             communication.
  50. --cert : client certificate for authentication, if required by server.
  51. --key : client private key for authentication, if required by server.
  52. --ciphers : openssl compatible list of TLS ciphers to support.
  53. --tls-version : TLS protocol version, can be one of tlsv1.2 tlsv1.1 or tlsv1.
  54.                  Defaults to tlsv1.2 if available.
  55. --insecure : do not check that the server certificate hostname matches the remote
  56.               hostname. Using this option means that you cannot be sure that the
  57.               remote host is the server you wish to connect to and so is insecure.
  58.               Do not use this option in a production environment.
  59. --psk : pre-shared-key in hexadecimal (no leading 0x) to enable TLS-PSK mode.
  60. --psk-identity : client identity string for TLS-PSK mode.
  61. --proxy : SOCKS5 proxy URL of the form:
  62.            socks5h://[username[:password]@]hostname[:port]
  63.            Only "none" and "username" authentication is supported.

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


回复

使用道具 举报

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

辽公网安备 21021702000620号

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

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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