logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

paho_c_pub - send (publish) data to an MQTT server

Description

paho_c_pub sends data to an MQTT server using the Eclipse Paho C client asynchronous library (MQTTAsync).
       MQTT  is  a  protocol, operating over TCP/IP, which allows programs to easily communicate with each other
       through a server.  Messages are published to topics and delivered to any  subscribers  to  those  topics.
       The corresponding subscriber program paho_c_sub allows the receipt of MQTT messages.

       The default mode of operation is to read input from stdin, sending a separate message for each line read.
       Options  exist  to  change this mode to send a one-off message, of 0 length (-n), a given string (-m), or
       the contents of a file (-f).

Name

       paho_c_pub - send (publish) data to an MQTT server

Options

-t--topic
              The MQTT topic to publish the data to.

       -c--connection
              The MQTT URI to connect to, a combination of transport prefix,  host,  port  and  for  websockets,
              topic.   To  connect  using TCP use the tcp prefix, for example: tcp://localhost:1883.  An example
              using    SSL/TLS:    ssl://localhost:1883.     An    example     for     websockets,     insecure:
              ws://localhost:1883/topic, and secure: wss://localhost:80/topic.

       -h--host The  TCP/IP  host  name  of  the MQTT server to connect to. Along with the --port option, an older
              alternative to using --connection.

       -p--port The TCP/IP port number of the MQTT server to connect to. Along with the --host  option,  an  older
              alternative to using --connection.

       -q--qos  The MQTT QoS on which to publish the message. The alternatives are 0, 1 or 2.

       -V--MQTTversion
              The  version of the MQTT protocol to use.  Valid options are 31 (or mqttv31), 311 (mqttv311) and 5
              (or mqttv5).  If MQTT version 5  is  used,  then  some  additional  options  are  valid,  such  as
              --message-expiry and --user-property.

       --quiet
              Do not print error messages.

       --trace
              Print library internal trace.  Valid levels are min, max, error and protocol.

       -r--retained
              Publish messages with the MQTT retained flag set.

       -n--null-message
              Publish a 0-length message.

       -m--message
              Publish a one off message with the payload supplied.

       -f--filename
              Publish a one off message with the contents of the file whose name is given.

       --message-expiry
              [MQTT version 5 only] Sets the expiry interval property of messages in seconds.

       --user-property
              [MQTT version 5 only] Sets a user property of sent messages.  A pair of strings, name and value.

       --will-topic
              Sets  the  MQTT  will message topic to publish to. If the application ends without sending an MQTT
              disconnect, the will message will be published to this topic.

       --will-payload
              Only used if will-topic is set. Sets the MQTT will message to be published.

       --will-qos
              Only used if will-topic is set. Sets the MQTT QoS at which the  will  message  is  published.  The
              alternatives are 0, 1 or 2.

       --will-retain
              Only used if will-topic is set. Sets the MQTT retained flag on the will message.

       --cafile
              Only used with a TLS connection. The name of a file for the OpenSSL trust store.

       --capath
              Only used with a TLS connection. The name of a directory holding OpenSSL trusted certificates.

       --cert Only  used  with  a  TLS  connection.  The name of a file for the TLS keystore containing a client
              certificate to be presented.

       --key  Only used with a TLS connection. The name of a file containing the client private key.

       --keypass
              Only used with a TLS connection. The password for the client private key file, if needed.

       --ciphers
              Only used with a TLS connection. A list of cipher suites that  the  client  will  present  to  the
              server during the TLS handshake.

       --insecure
              Only  used  with a TLS connection. Don't check that the server certificate common name matches the
              hostname.

http://eclipse.org/paho                       31 July 2018 (v1.3.0)                               PAHO_C_PUB(1L)

Synopsis

paho_c_pub  [topic]  [-t|--topictopic]  [-c|--connectionconnection]  [-h|--hosthostname] [-p|--portportnumber] [-i|--clientidclientid] [-u|--usernameusername]  [-P|--passwordpassword]  [-k|--keepalivekeepalive-timeout] [-V|--MQTT-version31|311|5]
       [-q|--qos0|1|2]  [-r|--retained]  [-n|--null-message]  [-m|--messagemessage] [-f|--filenamefilename]
       [--delimiterdelimiter] [--maxdatalenmaxdatalen]
       [--message-expiryexpiry-interval] [--user-propertynamevalue]
       [--quiet] [--verbose] [--tracemin|max|error|protocol]
       [--will-topicwill-topic] [--will-payloadwill-payload] [--will-retain] [--will-qos0|1|2]
       [--cafilecafile] [--capathcapath] [--certcertfile] [--keykeyfile]  [--keypasspassword]  [--cipherscipher-string] [--insecure]

See Also