1- # Native Nim MQTT client library
1+ # Native Nim MQTT client library and binaries
22
33This is a hybrid package including a native Nim MQTT library and
44binaries for a MQTT broker, publisher and subscriber.
@@ -39,6 +39,8 @@ The package provides 4 MQTT binaries:
3939## nmqtt
4040```
4141$ nmqtt --help
42+ nmqtt version 1.0.0
43+
4244nmqtt is a MQTT v3.1.1 broker
4345
4446USAGE
@@ -68,14 +70,17 @@ OPTIONS
6870 --client-kickold kick old client, if new client has same clientid. Defaults to false.
6971 --clientid-pass pass clientid in payload {clientid:payload}. Defaults to false.
7072 --password-file= absolute path to the password file
73+ --ssl activate ssl for the broker - requires --ssl-cert and --ssl-key.
74+ --ssl-cert= absolute path to the ssl certificate.
75+ --ssl-key= absolute path to the ssl key.
7176```
72- _ SSL is not supported_
7377
7478
7579## nmqtt_password
7680```
7781$ nmqtt_password --help
78- Add users and passwords to nmqtt's password file.
82+ nmqtt_password is a user and password manager for nmqtt
83+ nmqtt_password is based upon nmqtt version 1.0.0
7984
8085USAGE
8186 nmqtt_password -a {password_file.conf} {username}
@@ -89,76 +94,71 @@ OPTIONS
8994 -?, --help print this cligen-erated help
9095 -a, --adduser add a new user to the password file.
9196 -b, --batch run in batch mode to allow passing passwords on the command line.
92- -d, --deluser delete a user form the password file.
97+ -d, --deluser delete a user from the password file.
9398```
9499
95100
96101## nmqtt_pub
97102```
98103$ ./nmqtt_pub --help
99- Publish MQTT messages to a MQTT-broker.
104+ nmqtt_pub is a MQTT client for publishing messages to a MQTT-broker.
105+ nmqtt_pub is based upon nmqtt version 1.0.0
100106
101107Usage:
102108 nmqtt_pub [options] -t {topic} -m {message}
103109 nmqtt_pub [-h host -p port -u username -P password] -t {topic} -m {message}
104110
105111OPTIONS
106- -?, --help print this cligen-erated help
107- --help-syntax advanced: prepend,plurals,..
108- -h=, --host= IP-address of the broker.
109- -p=, --port= network port to connect too.
110- --ssl enable ssl. Auto-enabled on port 8883.
111- -c=, --clientid= your connection ID. Defaults to nmqtt_pub_ appended with processID.
112- -u=, --username= provide a username
113- -P=, --password= provide a password
114- -t=, --topic= mqtt topic to publish to.
115- -m=, --msg= message payload to send.
116- -q=, --qos= quality of service level to use for all messages.
117- -r, --retain retain messages on the broker.
118- --repeat= repeat the publish N times.
119- --repeatdelay= if using --repeat, wait N seconds between publish. Defaults to 0.
120- --removeretained clear any received retained messages
121- --willtopic= set the will's topic
122- --willmsg= set the will's message
123- --willqos= set the will's quality of service
124- --willretain set to retain the will message
125- -v, --verbose set verbose
112+ -?, --help print this cligen-erated help
113+ -h=, --host= IP-address of the broker.
114+ -p=, --port= network port to connect too.
115+ --ssl use ssl.
116+ -c=, --clientid= your connection ID. Defaults to nmqttpub- appended with processID.
117+ -u=, --username= provide a username
118+ -P=, --password= provide a password
119+ -t=, --topic= mqtt topic to publish to.
120+ -m=, --msg= message payload to send.
121+ -q=, --qos= quality of service level to use for all messages.
122+ -r, --retain retain messages on the broker.
123+ --repeat= repeat the publish N times.
124+ --repeatdelay= if using --repeat, wait N seconds between publish. Defaults to 0.
125+ --willtopic= set the will's topic
126+ --willmsg= set the will's message
127+ --willqos= set the will's quality of service
128+ --willretain set to retain the will message
129+ -v=, --verbosity= set the verbosity level from 0-2. Defaults to 0.
126130```
127131
128- _ ` -verbose ` not implemented yet_
129-
130132
131133## nmqtt_sub
132134```
133135$ ./nmqtt_sub --help
134- Subscribe to a topic on a MQTT-broker.
136+ nmqtt_sub is a MQTT client that will subscribe to a topic on a MQTT-broker.
137+ nmqtt_sub is based upon nmqtt version 1.0.0
135138
136139Usage:
137140 nmqtt_sub [options] -t {topic}
138141 nmqtt_sub [-h host -p port -u username -P password] -t {topic}
139142
140143OPTIONS
141144 -?, --help print this cligen-erated help
142- --help-syntax advanced: prepend,plurals,..
143145 -h=, --host= IP-address of the broker. Defaults to 127.0.0.1
144146 -p=, --port= network port to connect too. Defaults to 1883.
145- --ssl enable ssl. Auto-enabled on port 8883 .
146- -c=, --clientid= your connection ID. Defaults to nmqtt_pub_ appended with processID.
147+ --ssl use ssl.
148+ -c=, --clientid= your connection ID. Defaults to nmqttsub- appended with processID.
147149 -u=, --username= provide a username
148150 -P=, --password= provide a password
149- -t=, --topic= MQTT topic to publish to .
151+ -t=, --topic= MQTT topic to subscribe too. For multipe topics, separate them by comma .
150152 -q=, --qos= quality of service level to use for all messages. Defaults to 0.
151153 -k=, --keepalive= keep alive in seconds for this client. Defaults to 60.
152154 --removeretained clear any retained messages on the topic
153155 --willtopic= set the will's topic
154156 --willmsg= set the will's message
155157 --willqos= set the will's quality of service
156158 --willretain set to retain the will message
157- -v, --verbose set verbose
159+ -v= , --verbosity= set the verbosity level from 0-2. Defaults to 0.
158160```
159161
160- _ ` -verbose ` not implemented yet_
161-
162162
163163# Library
164164
250250### set_host*
251251
252252``` nim
253- proc set_host*(ctx: MqttCtx, host: string, port: int=1883, doSsl =false) =
253+ proc set_host*(ctx: MqttCtx, host: string, port: int=1883, sslOn =false) =
254254```
255255
256256Set the MQTT host
0 commit comments