You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-20
Original file line number
Diff line number
Diff line change
@@ -189,26 +189,7 @@ This example enables the wolfMQTT client to connect to the IBM Watson Internet o
189
189
### MQTT-SN Example
190
190
The Sensor Network client implements the MQTT-SN protocol for low-bandwidth networks. There are several differences from MQTT, including the ability to use a two byte Topic ID instead the full topic during subscribe and publish. The SN client requires an MQTT-SN gateway. The gateway acts as an intermediary between the SN clients and the broker. This client was tested with the Eclipse Paho MQTT-SN Gateway, which connects by default to the public Eclipse broker, much like our wolfMQTT Client example. The address of the gateway must be configured as the host. The example is located in `/examples/sn-client/`.
191
191
192
-
A special feature of MQTT-SN is the ability to use QoS level -1 (negative one) to publish to a predefined topic without first connecting to the gateway. There is no feedback in the application if there was an error, so confirmation of the test would involve running the `sn-client` first and watching for the publish from the `sn-client_qos-1`. There is an example provided in `/examples/sn-client/sn-client_qos-1`. It requires some configuration changes of the gateway.
193
-
194
-
* Enable the the QoS-1 feature, predefined topics, and change the gateway name in `gateway.conf`:
195
-
196
-
```
197
-
QoS-1=YES
198
-
PredefinedTopic=YES
199
-
PredefinedTopicList=./predefinedTopic.conf
200
-
.
201
-
.
202
-
.
203
-
#GatewayName=PahoGateway-01
204
-
GatewayName=WolfGateway
205
-
```
206
-
207
-
* Comment out all entries and add a new topic in `predefinedTopic.conf`:
208
-
209
-
```
210
-
WolfGatewayQoS-1,wolfMQTT/example/testTopic, 1
211
-
```
192
+
More about MQTT-SN examples in [examples/sn-client/README.md](examples/sn-client/README.md)
212
193
213
194
### Multithread Example
214
195
This example exercises the multithreading capabilities of the client library. The client implements two tasks: one that publishes to the broker; and another that waits for messages from the broker. The publish thread is created `NUM_PUB_TASKS` times (10 by default) and sends unique messages to the broker. This feature is enabled using the `--enable-mt` configuration option. The example is located in `/examples/multithread/`.
The Sensor Network client implements the MQTT-SN protocol for low-bandwidth networks. There are several differences from MQTT, including the ability to use a two byte Topic ID instead the full topic during subscribe and publish. The SN client requires an MQTT-SN gateway. The gateway acts as an intermediary between the SN clients and the broker. This client was tested with the Eclipse Paho MQTT-SN Gateway, which connects by default to the public Eclipse broker, much like our wolfMQTT Client example. The address of the gateway must be configured as the host. The example is located in `/examples/sn-client/`.
3
+
4
+
To enable Sensor Network protocol support, configure wolfMQTT using:
5
+
`./configure --enable-sn`
6
+
7
+
## QoS-1
8
+
A special feature of MQTT-SN is the ability to use QoS level -1 (negative one) to publish to a predefined topic without first connecting to the gateway. There is no feedback in the application if there was an error, so confirmation of the test would involve running the `sn-client` first and watching for the publish from the `sn-client_qos-1`. There is an example provided in `/examples/sn-client/sn-client_qos-1`. It requires some configuration changes of the gateway.
9
+
10
+
* Enable the the QoS-1 feature, predefined topics, and change the gateway name in `gateway.conf`:
11
+
12
+
```
13
+
QoS-1=YES
14
+
PredefinedTopic=YES
15
+
PredefinedTopicList=./predefinedTopic.conf
16
+
.
17
+
.
18
+
.
19
+
#GatewayName=PahoGateway-01
20
+
GatewayName=WolfGateway
21
+
```
22
+
23
+
* Comment out all entries and add a new topic in `predefinedTopic.conf`:
24
+
25
+
```
26
+
WolfGatewayQoS-1,wolfMQTT/example/testTopic, 1
27
+
```
28
+
29
+
## MQTT-SN with DTLS
30
+
MQTT-SN can be secured using DTLS. This enables encryption of sensor data to the gateway. The Eclipse Paho MQTT-SN Gateway supports DTLS clients.
31
+
32
+
To build the Eclipse Paho MQTT-SN Gateway with DTLS:
33
+
`<gateway-folder>/MQTTSNGateway$ ./build.sh dtls`
34
+
35
+
To build wolfSSL with DTLS support:
36
+
`./configure --enable-dtls && make && sudo make install`
37
+
38
+
To run the wolfMQTT sn-client example with DTLS:
39
+
`./examples/sn-client/sn-client -t`
40
+
41
+
### Notes for Gateway configuration
42
+
* To use with local mosquitto broker, edit MQTTSNGateway/gateway.conf. Also set paths to DTLS cert / key.
0 commit comments