net-mqtt-sub - Perl script for subscribing to an MQTT topic
net-mqtt-sub [options] topic1 [topic2] [topic3] ...
This script subscribes to one or more MQTT topics and prints any messages that
it receives to stdout.
- -help
- Print a brief help message.
- -man
- Print the manual page.
- -host
- The host running the MQTT service. The default is
127.0.0.1.
- -port
- The port of the running MQTT service. The default is 1883.
- -client-id
- The client id to use in the connect message. The default is 'NetMQTTpm'
followed by the process id of the process.
- -verbose
- Include more verbose output. Without this option the script only outputs
errors and received messages one per line in the form:
topic message
With one -verbose options, publish messages are printed
in a form of a summary of the header fields and the payload in hex dump
and text form.
With two -verbose options, summaries are printed for
all messages sent and received.
With three -verbose options, a hex dump of all data
transmitted and received is printed.
- -keepalive NNN
- The keep alive timer value. Defaults to 120 seconds. For simplicity, it is
also currently used as the connection/subscription timeout.
- -count NNN
- Read the specificed number of MQTT messages and then exit. Default is 0 -
read forever.
- -one or -1
- Short for -count 1. Read one message and exit.
This is not official IBM code. I work for IBM but I'm writing this in my
spare time (with permission) for fun.
Mark Hindess <soft-cpan@temporalanomaly.com>
This software is copyright (c) 2014 by Mark Hindess.
This is free software; you can redistribute it and/or modify it
under the same terms as the Perl 5 programming language system itself.