paho_cs_pub.1 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. .TH PAHO_CS_PUB 1L "31 July 2018 (v1.3.0)" http://eclipse.org/paho
  2. .SH NAME
  3. paho_cs_pub \- send (publish) data to an MQTT server
  4. .SH SYNOPSIS
  5. .B paho_cs_pub
  6. [\fItopic\fR]
  7. [\fB\-t\fR|\fB\-\-topic\fR \fItopic\fR]
  8. [\fB\-c\fR|\fB\-\-connection\fR \fIconnection\fR]
  9. [\fB\-h\fR|\fB\-\-host\fR \fIhostname\fR]
  10. [\fB\-p\fR|\fB\-\-port\fR \fIportnumber\fR]
  11. [\fB\-i\fR|\fB\-\-clientid\fR \fIclientid\fR]
  12. [\fB\-u\fR|\fB\-\-username\fR \fIusername\fR]
  13. [\fB\-P\fR|\fB\-\-password\fR \fIpassword\fR]
  14. [\fB\-k\fR|\fB\-\-keepalive\fR \fIkeepalive-timeout\fR]
  15. [\fB\-V\fR|\fB\-\-MQTT-version\fR \fB31\fR|\fB311\fR|\fB5\fR]
  16. .br
  17. [\fB\-q\fR|\fB\-\-qos\fR \fB0\fR|\fB1\fR|\fB2\fR]
  18. [\fB\-r\fR|\fB\-\-retained\fR]
  19. [\fB\-n\fR|\fB\-\-null-message\fR]
  20. [\fB\-m\fR|\fB\-\-message\fR \fImessage\fR]
  21. [\fB\-f\fR|\fB\-\-filename\fR \fIfilename\fR]
  22. [\fB\-\-delimiter\fR \fIdelimiter\fR]
  23. [\fB\-\-maxdatalen\fR \fImaxdatalen\fR]
  24. .br
  25. [\fB\-\-message-expiry\fR \fIexpiry-interval\fR]
  26. [\fB\-\-user-property\fR \fIname\fR \fIvalue\fR]
  27. .br
  28. [\fB\-\-quiet\fR]
  29. [\fB\-\-verbose\fR]
  30. [\fB\-\-trace\fR \fBmin\fR|\fBmax\fR|\fBerror\fR|\fBprotocol\fR]
  31. .br
  32. [\fB\-\-will-topic\fR \fIwill-topic\fR]
  33. [\fB\-\-will-payload\fR \fIwill-payload\fR]
  34. [\fB\-\-will-retain\fR]
  35. [\fB\-\-will-qos\fR \fB0\fR|\fB1\fR|\fB2\fR]
  36. .br
  37. [\fB\-\-cafile\fR \fIcafile\fR]
  38. [\fB\-\-capath\fR \fIcapath\fR]
  39. [\fB\-\-cert\fR \fIcertfile\fR]
  40. [\fB\-\-key\fR \fIkeyfile\fR]
  41. [\fB\-\-keypass\fR \fIpassword\fR]
  42. [\fB\-\-ciphers\fR \fIcipher-string\fR]
  43. [\fB\-\-insecure\fR]
  44. .SH DESCRIPTION
  45. .B paho_cs_pub
  46. sends data to an MQTT server using the Eclipse Paho C client synchronous library (MQTTClient).
  47. MQTT is a protocol, operating over TCP/IP, which allows programs to easily communicate
  48. with each other through a server. Messages are published to topics and delivered to any subscribers to those topics.
  49. The corresponding subscriber program \fBpaho_cs_sub\fR allows the receipt of MQTT messages.
  50. .PP
  51. The default mode of operation is to read input from stdin, sending a separate message for each line read. Options exist
  52. to change this mode to send a one-off message, of 0 length (\fB-n\fR), a given string (\fB-m\fR), or the contents of a file (\fB-f\fR).
  53. .SH "OPTIONS"
  54. .TP
  55. .PD 0
  56. .BI \-t
  57. .TP
  58. .PD
  59. .B \-\-topic
  60. The MQTT topic to publish the data to.
  61. .TP
  62. .PD 0
  63. .BI \-c
  64. .TP
  65. .PD
  66. .B \-\-connection
  67. The MQTT URI to connect to, a combination of transport prefix, host, port and for websockets, topic.
  68. To connect using TCP use the tcp prefix, for example: \fBtcp://\fR\fIlocalhost\fR\fB:\fR\fI1883\fR.
  69. An example using SSL/TLS: \fBssl://\fR\fIlocalhost\fR\fB:\fR\fI1883\fR.
  70. An example for websockets, insecure: \fBws://\fR\fIlocalhost\fR\fB:\fR\fI1883\fR\fB/\fR\fItopic\fR, and
  71. secure: \fBwss://\fR\fIlocalhost\fR\fB:\fR\fI80\fR\fB/\fR\fItopic\fR.
  72. .TP
  73. .PD 0
  74. .BI \-h
  75. .TP
  76. .PD
  77. .B \-\-host
  78. The TCP/IP host name of the MQTT server to connect to. Along with the \fB--port\fR option, an older alternative to using \fB--connection\fR.
  79. .TP
  80. .PD 0
  81. .BI \-p
  82. .TP
  83. .PD
  84. .B \-\-port
  85. The TCP/IP port number of the MQTT server to connect to. Along with the \fB--host\fR option, an older alternative to using \fB--connection\fR.
  86. .TP
  87. .PD 0
  88. .BI \-q
  89. .TP
  90. .PD
  91. .B \-\-qos
  92. The MQTT QoS on which to publish the message. The alternatives are \fB0\fR, \fB1\fR or \fB2\fR.
  93. .TP
  94. .PD 0
  95. .BI \-V
  96. .TP
  97. .PD
  98. .B \-\-MQTTversion
  99. The version of the MQTT protocol to use. Valid options are \fB31\fR (or \fBmqttv31\fR), \fB311\fR (\fBmqttv311\fR) and \fB5\fR (or \fBmqttv5\fR).
  100. If MQTT version 5 is used, then some additional options are valid, such as \fB--message-expiry\fR and \fB--user-property\fR.
  101. .TP
  102. .PD
  103. .B \-\-quiet
  104. Do not print error messages.
  105. .TP
  106. .PD
  107. .B \-\-trace
  108. Print library internal trace. Valid levels are \fBmin\fR, \fBmax\fR, \fBerror\fR and \fprotocol\fR.
  109. .TP
  110. .PD 0
  111. .BI \-r
  112. .TP
  113. .PD
  114. .B \-\-retained
  115. Publish messages with the MQTT retained flag set.
  116. .TP
  117. .PD 0
  118. .BI \-n
  119. .TP
  120. .PD
  121. .B \-\-null-message
  122. Publish a 0-length message.
  123. .TP
  124. .PD 0
  125. .BI \-m
  126. .TP
  127. .PD
  128. .B \-\-message
  129. Publish a one off message with the payload supplied.
  130. .TP
  131. .PD 0
  132. .BI \-f
  133. .TP
  134. .PD
  135. .B \-\-filename
  136. Publish a one off message with the contents of the file whose name is given.
  137. .TP
  138. .PD
  139. .B \-\-message-expiry
  140. [MQTT version 5 only] Sets the expiry interval property of messages in seconds.
  141. .TP
  142. .PD
  143. .B \-\-user-property
  144. [MQTT version 5 only] Sets a user property of sent messages. A pair of strings, name and value.
  145. .TP
  146. .PD
  147. .B \-\-will-topic
  148. Sets the MQTT will message topic to publish to. If the application ends without sending an MQTT disconnect, the
  149. will message will be published to this topic.
  150. .TP
  151. .PD
  152. .B \-\-will-payload
  153. Only used if \fBwill-topic\fR is set. Sets the MQTT will message to be published.
  154. .TP
  155. .PD
  156. .B \-\-will-qos
  157. Only used if \fBwill-topic\fR is set. Sets the MQTT QoS at which the will message is published. The alternatives are \fB0\fR, \fB1\fR or \fB2\fR.
  158. .TP
  159. .PD
  160. .B \-\-will-retain
  161. Only used if \fBwill-topic\fR is set. Sets the MQTT retained flag on the will message.
  162. .TP
  163. .PD
  164. .B \-\-cafile
  165. Only used with a TLS connection. The name of a file for the OpenSSL trust store.
  166. .TP
  167. .PD
  168. .B \-\-capath
  169. Only used with a TLS connection. The name of a directory holding OpenSSL trusted certificates.
  170. .TP
  171. .PD
  172. .B \-\-cert
  173. Only used with a TLS connection. The name of a file for the TLS keystore containing a client certificate to be presented.
  174. .TP
  175. .PD
  176. .B \-\-key
  177. Only used with a TLS connection. The name of a file containing the client private key.
  178. .TP
  179. .PD
  180. .B \-\-keypass
  181. Only used with a TLS connection. The password for the client private key file, if needed.
  182. .TP
  183. .PD
  184. .B \-\-ciphers
  185. Only used with a TLS connection. A list of cipher suites that the client will present to the server during the TLS handshake.
  186. .TP
  187. .PD
  188. .B \-\-insecure
  189. Only used with a TLS connection. Don't check that the server certificate common name matches the hostname.