@@ -10,9 +10,9 @@ date: 2022-06-28
10
10
11
11
12
12
13
- ## WIZ5xxSR-RP MQTT Connection Overview
13
+ ## MQTT Connection Overview
14
14
15
- ** WIZ5xxSR-RP ** supports ** MQTT client** and ** MQTTS client** mode.
15
+ ** W232N ** supports ** MQTT client** and ** MQTTS client** mode.
16
16
17
17
18
18
@@ -27,7 +27,7 @@ date: 2022-06-28
27
27
### Hardware
28
28
29
29
30
- - WIZ5xxSR-RP Evaluation Board (WIZ510SR-RP can be used without WIZ5xxSR-RP Evaluation Board.)
30
+ - W232N
31
31
- 5V Power adapter
32
32
- Cables (Ethernet / Serial)
33
33
@@ -50,15 +50,15 @@ date: 2022-06-28
50
50
51
51
## How to Connect to MQTT Broker through Mosquitto
52
52
53
- WIZ5xxSR-RP supports MQTT client and MQTTS client mode, but this section guides how to connect to MQTT broker through Mosquitto based on MQTT client mode.
53
+ W232N supports MQTT client and MQTTS client mode, but this section guides how to connect to MQTT broker through Mosquitto based on MQTT client mode.
54
54
55
55
> ** Note** : MQTTS client mode requires additional security-related settings, unlike MQTT client mode.
56
56
57
57
58
58
59
- ### Step 1: Setup Environment to Use WIZ5xxSR-RP
59
+ ### Step 1: Run Config-tool
60
60
61
- The process of setup environment to use the WIZ5xxSR-RP each product is available at the ** 'Getting Started '** document below.
61
+ Run installed ** 'Config-tool '**
62
62
63
63
64
64
@@ -91,7 +91,7 @@ mosquitto -c mosquitto.conf -p 1883 -v
91
91
92
92
93
93
94
- ### Step 4: Setup WIZ5xxSR-RP through WIZnet S2E Configuration Tool for MQTT Broker Connection
94
+ ### Step 4: Setup Device through WIZnet S2E Configuration Tool for MQTT Broker Connection
95
95
96
96
1 . Select ** MQTT client** mode in the ** Operation mode** setting section
97
97
@@ -130,7 +130,7 @@ mosquitto -c mosquitto.conf -p 1883 -v
130
130
131
131
### Step 5: Done
132
132
133
- WIZ5xxSR-RP is successfully connected to the MQTT broker!
133
+ Device is successfully connected to the MQTT broker!
134
134
135
135
| |
136
136
| :------------------------------------------------------------------------: |
@@ -145,3 +145,261 @@ WIZ5xxSR-RP is successfully connected to the MQTT broker!
145
145
146
146
147
147
-----
148
+
149
+
150
+ ## How to connect to AWS using MQTT
151
+
152
+ ### Step 1: Create a Thing and Policy in AWS and Download a Certificate
153
+
154
+ 1 . To use AWS services, you must first sign in. Click the link below to go to the sign in page.
155
+
156
+ ** [ AWS login page] ( https://aws.amazon.com/console/ ) **
157
+
158
+ <br />
159
+ <br />
160
+
161
+
162
+ 2 . Once logged in, search for “IoT Console” in the search bar and click on it.
163
+
164
+ | |
165
+ | :-----------------------------------------------------------------------------------------: |
166
+ | <img src =" /img/products/w232n/aws_execute/1_aws_iot_core.png " width =" 600 " /> |
167
+ | Figure: ** Search “IoT Console"** |
168
+
169
+ <br />
170
+ <br />
171
+
172
+ 2 . Click the “Things” tab on the left, then hit the orange “Create things” button.
173
+
174
+ | |
175
+ | :-----------------------------------------------------------------------------------------: |
176
+ | <img src =" /img/products/w232n/aws_execute/2_aws_creating_thing.png " width =" 600 " /> |
177
+ | Figure: ** click "Create Things"** |
178
+
179
+ <br />
180
+ <br />
181
+
182
+
183
+ 3 . Select “Create single thing” and press the Next button.
184
+
185
+ | |
186
+ | :-----------------------------------------------------------------------------------------: |
187
+ | <img src =" /img/products/w232n/aws_execute/3_aws_creating_thing.png " width =" 600 " /> |
188
+ | Figure: ** Select "Create things"** |
189
+
190
+ <br />
191
+ <br />
192
+
193
+
194
+ 4 . Enter “Thing name” and hit the Next button.
195
+
196
+ | |
197
+ | :-----------------------------------------------------------------------------------------: |
198
+ | <img src =" /img/products/w232n/aws_execute/4_aws_creating_thing.png " width =" 600 " /> |
199
+ | Figure: ** Enter "Thing name"** |
200
+
201
+ <br />
202
+ <br />
203
+
204
+
205
+ 5 . Select “Auto-generate a new certificate (recommended)” and press the Next button.
206
+
207
+ | |
208
+ | :-----------------------------------------------------------------------------------------: |
209
+ | <img src =" /img/products/w232n/aws_execute/5_aws_creating_thing.png " width =" 600 " /> |
210
+ | Figure: ** Select "Auto-generate a new certificate" and click "Next"** |
211
+
212
+ <br />
213
+ <br />
214
+
215
+
216
+ 6 . Next, you need to create a policy for securing your Thing. Click “Create policy”.
217
+
218
+ | |
219
+ | :-----------------------------------------------------------------------------------------: |
220
+ | <img src =" /img/products/w232n/aws_execute/6_aws_creating_policy.png " width =" 600 " /> |
221
+ | Figure: ** Click "Create policy"** |
222
+
223
+ <br />
224
+ <br />
225
+
226
+
227
+ 7 . Set a name for the policy, configure the Policy Document as shown, and hit the Create button.
228
+
229
+ | |
230
+ | :-----------------------------------------------------------------------------------------: |
231
+ | <img src =" /img/products/w232n/aws_execute/7_aws_creating_policy.png " width =" 600 " /> |
232
+ | Figure: ** Setting policy information** |
233
+
234
+ <br />
235
+ <br />
236
+
237
+
238
+ 8 . Go back to the “Create single thing” page you opened earlier and press the “Create thing” button.
239
+
240
+ | |
241
+ | :-----------------------------------------------------------------------------------------: |
242
+ | <img src =" /img/products/w232n/aws_execute/8_aws_combine_policy.png " width =" 600 " /> |
243
+ | Figure: ** Click "Create thing"** |
244
+
245
+ <br />
246
+ <br />
247
+
248
+
249
+ 9 . Download all keys and certificates.
250
+
251
+ | |
252
+ | :-----------------------------------------------------------------------------------------: |
253
+ | <img src =" /img/products/w232n/aws_execute/9_aws_downloading_cert_key.png " width =" 600 " /> |
254
+ | Figure: ** Download all keys and certificates** |
255
+
256
+ <br />
257
+ <br />
258
+ <br />
259
+ <br />
260
+
261
+ ### Step 2: Enter the certificate on the device
262
+
263
+ 1 . In AWS, enter the MQTT Test Client tab and copy the endpoint.
264
+
265
+ | |
266
+ | :-----------------------------------------------------------------------------------------: |
267
+ | <img src =" /img/products/w232n/aws_execute/10_aws_copy_endpoint.png " width =" 600 " /> |
268
+ | Figure: ** Copy Endpoint** |
269
+
270
+ <br />
271
+ <br />
272
+
273
+ 2 . Turn on the configuration tool to detect your device and set the “Basic settings” tab as follows
274
+
275
+ | |
276
+ | :-----------------------------------------------------------------------------------------: |
277
+ | <img src =" /img/products/w232n/aws_execute/1_device_search.png " width =" 600 " /> |
278
+ | Figure: ** Set the “Basic settings” tab in the configuration tool** |
279
+
280
+ <br />
281
+ <br />
282
+
283
+ 3 . Set up the “MQTT options” tab like this
284
+
285
+ - MQTT Topics Section
286
+ - ** Publish Topic:** $aws/things/my_w232n_thing/shadow/update
287
+ - ** Subscribe Topic:** $aws/things/my_w232n_thing/shadow/update/accepted
288
+
289
+ - MQTT Options
290
+ - ** Client ID:** my_w232n_thing
291
+ - ** Keep-Alive:** 60
292
+ - ** QoS:** QoS 0
293
+
294
+ - Remote Host / Port
295
+ - ** Remote Host:** Paste the copied endpoint
296
+ - ** Remote Port:** 8883
297
+
298
+ | |
299
+ | :-----------------------------------------------------------------------------------------: |
300
+ | <img src =" /img/products/w232n/aws_execute/2_MQTT_option.png " width =" 600 " /> |
301
+ | Figure: ** Set “MQTT options”** |
302
+
303
+ <br />
304
+ <br />
305
+
306
+
307
+ 4 . Go to the Certificate Manager tab and adjust the Root CA section as shown below.
308
+
309
+ | |
310
+ | :-----------------------------------------------------------------------------------------: |
311
+ | <img src =" /img/products/w232n/aws_execute/3_MQTT_cert_key.png " width =" 600 " /> |
312
+ | Figure: ** Adjust the Root CA section** |
313
+
314
+ <br />
315
+ <br />
316
+
317
+ 5 . Tap “Load file” to load the following certificate and key files
318
+
319
+ - ** Root CA** : AmazonRootCA1.pem
320
+ - ** Client Certificate** : xxxxx-certificate.pem.crt
321
+ - ** Private Key** : xxxxx-private.pem.key
322
+
323
+ | |
324
+ | :-----------------------------------------------------------------------------------------: |
325
+ | <img src =" /img/products/w232n/aws_execute/4_MQTT_cert_key.png " width =" 600 " /> |
326
+ | Figure: ** Load certificate and key files** |
327
+
328
+ <br />
329
+ <br />
330
+
331
+ 6 . Press each of the “Save to device” buttons.
332
+
333
+ | |
334
+ | :-----------------------------------------------------------------------------------------: |
335
+ | <img src =" /img/products/w232n/aws_execute/5_MQTT_cert_key.png " width =" 600 " /> |
336
+ | Figure: ** Save certificate and key files** |
337
+
338
+ <br />
339
+ <br />
340
+
341
+ 7 . click “Apply settings”.
342
+
343
+ | |
344
+ | :-----------------------------------------------------------------------------------------: |
345
+ | <img src =" /img/products/w232n/aws_execute/6_MQTT_cert_key.png " width =" 600 " /> |
346
+ | Figure: ** click “Apply settings”** |
347
+
348
+ <br />
349
+ <br />
350
+ <br />
351
+ <br />
352
+
353
+
354
+ ### Step 3: Run (Subscribe)
355
+
356
+ 1 . Go back to the AWS IoT Console page and click “MQTT test client” under the “Test” section to enter it. Then, in the MQTT Topics Section of the configuration tool, enter the Publish Topic ** $aws/things/my_w232n_thing/shadow/update** in the “Topic filter” and hit the Subscribe button.
357
+
358
+ | |
359
+ | :-----------------------------------------------------------------------------------------: |
360
+ | <img src =" /img/products/w232n/aws_execute/1_aws_sub_topic.png " width =" 600 " /> |
361
+ | Figure: ** Subscrive topic** |
362
+
363
+ <br />
364
+ <br />
365
+
366
+ 2 . Open your device's serial port using a terminal tool to transfer data.
367
+
368
+ | |
369
+ | :-----------------------------------------------------------------------------------------: |
370
+ | <img src =" /img/products/w232n/aws_execute/2_aws_sub_topic.png " width =" 600 " /> |
371
+ | Figure: ** Transfer data** |
372
+
373
+ <br />
374
+ <br />
375
+
376
+ 3 . This will ensure that your MQTT communication with AWS is working correctly.
377
+
378
+ | |
379
+ | :-----------------------------------------------------------------------------------------: |
380
+ | <img src =" /img/products/w232n/aws_execute/3_aws_sub_topic.png " width =" 600 " /> |
381
+ | Figure: ** Successful MQTT communication with AWS** |
382
+
383
+ <br />
384
+ <br />
385
+ <br />
386
+ <br />
387
+
388
+ ### Step 4: Run (Publish)
389
+
390
+ 1 . Return to the AWS IoT Console page and click “MQTT test client” under the “Test” section. Then in the MQTT Topics Section of the configuration tool, enter the Subscribe Topic $aws/things/my_w232n_thing/shadow/update/accepted in the “Topic name” and hit the Publish button.
391
+
392
+ | |
393
+ | :-----------------------------------------------------------------------------------------: |
394
+ | <img src =" /img/products/w232n/aws_execute/4_aws_pub_topic.png " width =" 600 " /> |
395
+ | Figure: ** Publish topic** |
396
+
397
+ <br />
398
+ <br />
399
+
400
+ 2 . In the Serials window, you can see the data sent by AWS.
401
+
402
+ | |
403
+ | :-----------------------------------------------------------------------------------------: |
404
+ | <img src =" /img/products/w232n/aws_execute/5_aws_pub_topic.png " width =" 600 " /> |
405
+ | Figure: ** Successful MQTT communication with AWS** |
0 commit comments