PAHO_CS_PUB_STATIC(1L)
π PAHO_CS_PUB_STATIC π
okay bestie, welcome to the manual page for paho_cs_pub_static from the 1L manual β this is the one that sends stuff. it's giving main character energy for sure π
β¨ NAME β¨
paho_cs_pub_static β send (publish) data to an MQTT server π¦
β¨ SYNOPSIS β¨
paho_cs_pub_static [topic] [-t|--topic topic] [-c|--connection
connection] [-h|--host hostname] [-p|--port portnumber] [-i|--clientid
clientid] [-u|--username username] [-P|--password password]
[-k|--keepalive keepalive-timeout] [-V|--MQTT-version 31|311|5]
[-q|--qos 0|1|2] [-r|--retained] [-n|--null-message] [-m|--message
message] [-f|--filename filename] [--delimiter delimiter] [--maxdatalen
maxdatalen]
[--message-expiry expiry-interval] [--user-property name value]
[--quiet] [--verbose] [--trace min|max|error|protocol]
[--will-topic will-topic] [--will-payload will-payload] [--will-retain]
[--will-qos 0|1|2]
[--cafile cafile] [--capath capath] [--cert certfile] [--key keyfile]
[--keypass password] [--ciphers cipher-string] [--insecure]
πΈ DESCRIPTION πΈ
so paho_cs_pub_static sends data to an MQTT server, and it does it using the Eclipse Paho C client synchronous library (MQTTClient). no cap. π«Ά
MQTT is a protocol β it runs over TCP/IP β and it lets programs talk to each other so easily, like they're all in the same group chat, but the chat is a server. messages get published to topics, and then they get delivered to literally anyone subscribed to those topics. the matching subscriber program, paho_cs_sub, is the one that receives all those MQTT messages. iconic duo fr fr π
the default mode of operation is to read input from stdin, sending a separate message for every single line it reads. but bestie, there are options to switch the whole vibe up: you can send a one-off message instead β one of 0 length (-n), or a given string (-m), or the contents of a file (-f). pick your fighter π
π OPTIONS π
-t,--topicβ the MQTT topic you're publishing the data to. this is where the message goes, periodt.-c,--connectionβ the MQTT URI to connect to: a combo of transport prefix, host, port and (for websockets) topic. wanna connect using TCP? use thetcpprefix, liketcp://localhost:1883. SSL/TLS example:ssl://localhost:1883. websockets, insecure:ws://localhost:1883/topic, and secure:wss://localhost:80/topic. so many slays π-h,--hostβ the TCP/IP host name of the MQTT server to connect to. along with the--portoption, this is an older alternative to using--connection.-p,--portβ the TCP/IP port number of the MQTT server to connect to. along with the--hostoption, this is an older alternative to using--connection.-q,--qosβ the MQTT QoS on which to publish the message. the alternatives are0,1or2.-V,--MQTTversionβ the version of the MQTT protocol to use. valid options are31(ormqttv31),311(mqttv311) and5(ormqttv5). and if you go with MQTT version 5, then some extra options become valid, like--message-expiryand--user-property. glow up β¨--quietβ do not print error messages. shhh π€«--traceβ print library internal trace. valid levels aremin,max,errorandprotocol.-r,--retainedβ publish messages with the MQTT retained flag set.-n,--null-messageβ publish a0-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. dramatic exit, honestly π--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 are0,1or2.--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.
bestie, that --insecure one is literally named that for a reason β it turns off the hostname/common-name check on the server certificate. it's not a cute lil toggle, it's a real security decision. use it on purpose, not by accident π¨
π¦ SEE ALSO π¦
paho_c_pub(1)paho_c_pub_static(1)paho_c_sub(1)paho_c_sub_static(1)paho_cs_pub(1)paho_cs_sub(1)paho_cs_sub_static(1)
and that's the whole page, bestie π₯Ή go be the main character of your own message broker. this little love letter to paho_cs_pub_static(1L) came from the fine folks at http://eclipse.org/paho, dated 31 December 2020, version (v1.3.8). mwah π
π¦ where this page comes from
- debian trixie: paho.mqtt.c-examples 1.3.14-2 Β· EPL-2.0
- ubuntu noble: paho.mqtt.c-examples 1.3.13-1build2 Β· EPL-2.0
- ubuntu questing: paho.mqtt.c-examples 1.3.14-2
- ubuntu resolute: paho.mqtt.c-examples 1.3.15-1 Β· EPL-2.0
- ubuntu stonking: paho.mqtt.c-examples 1.3.16+ds-1build1 Β· EPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms