Version 23.6 by Xiaoling on 2024/05/29 09:44

Hide last authors
Xiaoling 1.1 1 {{toc/}}
2
3
Xiaoling 23.6 4 = 1. Log in to the platform and find IoT core =
Xiaoling 1.1 5
Xiaoling 23.2 6
Xiaoling 23.6 7 = 2. Create your own test policy =
Xiaoling 1.1 8
Xiaoling 23.6 9 == 2.1 First click the policy on the left, enter the page and click Create policy ==
Xiaoling 1.1 10
Xiaoling 23.3 11 [[image:image-20240528172927-2.png||height="377" width="931"]]
Xiaoling 1.1 12
13
Xiaoling 23.6 14 == 2.2 After filling in a policy name for testing, the policy will be displayed on the page ==
Xiaoling 23.2 15
16
Xiaoling 1.2 17 a. Fill in any name
Xiaoling 1.1 18
Xiaoling 1.2 19 b. Configure the policy you created
Xiaoling 1.1 20
Bei Jinggeng 22.1 21 [[image:image-20240528173144-3.png||height="572" width="931"]]
Xiaoling 1.1 22
Bei Jinggeng 22.1 23
Xiaoling 1.2 24 c. After clicking to enter the policy configuration page, follow the clicking sequence below to go to the json configuration interface, and then fill in the following fields in the "statement" keyword:
Xiaoling 1.1 25
Bei Jinggeng 22.1 26 (% data-sider-select-id="7bc0f6db-481d-435a-ad0c-92cf0ede3ea4" %)
27 (% data-sider-select-id="8026a4d9-df91-4895-b9c5-3d6ac9b46012" %)**{**
Xiaoling 1.1 28
Bei Jinggeng 22.1 29 **~ "Version": "2012-10-17",**
Xiaoling 1.1 30
Bei Jinggeng 22.1 31 **~ "Statement": [**
Xiaoling 1.1 32
Bei Jinggeng 22.1 33 **~ {**
Xiaoling 1.2 34
Bei Jinggeng 22.1 35 **~ "Effect": "Allow",**
Xiaoling 1.2 36
Bei Jinggeng 22.1 37 **~ "Action": "",**
Xiaoling 1.2 38
Bei Jinggeng 22.1 39 **~ "Resource": ""**
Xiaoling 1.2 40
Bei Jinggeng 22.1 41 **~ }**
Xiaoling 1.2 42
Bei Jinggeng 22.1 43 **~ ]**
Xiaoling 1.2 44
Bei Jinggeng 22.1 45 **}**
Xiaoling 1.2 46
47
Bei Jinggeng 22.1 48 [[image:image-20240528173203-4.png||height="517" width="942"]]
Xiaoling 1.2 49
Bei Jinggeng 22.1 50
Xiaoling 1.2 51 d. Create this policy
52
53
Bei Jinggeng 22.1 54 (% data-sider-select-id="21f75c89-756f-4f95-919d-30cc5cf86298" %)
55 = 3. Create a Things =
Xiaoling 1.2 56
Bei Jinggeng 22.1 57 (% data-sider-select-id="1a295982-a5d4-4787-896b-ac87e2385b09" %)
58 == 3.1 Create a single Things ==
Xiaoling 1.2 59
Xiaoling 23.2 60
Bei Jinggeng 22.1 61 (% data-sider-select-id="b6a1852f-c446-4c98-a017-595ac62adc60" %)
62 ~1. Select Create Things
Xiaoling 1.2 63
Bei Jinggeng 22.1 64 [[image:image-20240528173244-5.png||height="329" width="932"]]
Xiaoling 1.2 65
Bei Jinggeng 22.1 66 [[image:image-20240528173500-6.png||height="484" width="928"]]
Xiaoling 1.2 67
68
Bei Jinggeng 22.1 69 (% data-sider-select-id="de8a3324-fa57-46eb-a85c-49eeea34baa5" %)
70 2. Fill in the name of the control item you want to create in the thing name column.
Xiaoling 1.2 71
72 Use the default for other parameters
73
74 Then click Next.
75
Bei Jinggeng 22.1 76 [[image:image-20240528173754-7.png||height="712" width="781"]]
Xiaoling 1.2 77
78
Bei Jinggeng 22.1 79 (% data-sider-select-id="fc59dc2d-1ed3-41f5-8482-8534342857a7" %)
80 3. Choose to automatically generate a new certificate
81
Xiaoling 1.2 82 Then click Next
83
Bei Jinggeng 22.1 84 [[image:image-20240528173829-8.png||height="547" width="782"]]
Xiaoling 1.2 85
86
Bei Jinggeng 22.1 87 (% data-sider-select-id="d2fd3708-ecaf-4479-b1eb-b5db28e1adb9" %)
88 4.  The next step is to choose a strategy
89
Xiaoling 1.2 90 Here you can choose a policy we created in the first step
91
Bei Jinggeng 22.1 92 [[image:image-20240528173851-9.png||height="580" width="785"]]
Xiaoling 1.2 93
94
Bei Jinggeng 22.1 95 (% data-sider-select-id="2f8892b2-d89c-416e-a5e6-6f58bd557860" %)
96 5. When you click to create things, the certificate download page will pop up.
97
Bei Jinggeng 23.1 98 (% data-sider-select-id="398c8d35-75ff-4077-85bb-9e0377efa186" %)
99 (% data-sider-select-id="087aa6c7-c542-4afc-9ce6-291538c31764" %)**This certificate is very important.**(%%) After creating the device, you must download the certificate of the device so that our NB device can connect normally.
Xiaoling 1.2 100
101 Please download all the following certificates and put them in a folder.
102
Bei Jinggeng 22.1 103 [[image:image-20240528173926-10.png]]
Xiaoling 1.2 104
105
Bei Jinggeng 22.1 106 6. You can see the things you just created in the things
Xiaoling 1.2 107
Bei Jinggeng 22.1 108 [[image:image-20240528173951-11.png||height="381" width="1089"]]
Xiaoling 1.2 109
110
Bei Jinggeng 22.1 111 (% data-sider-select-id="3ba36b16-0696-40e7-88b5-2c533f73589a" %)
Bei Jinggeng 23.1 112 = (% data-sider-select-id="fc07fe98-6fd9-4d61-a991-8524b6097b3a" %)4. Connect to AWS using Dragino-NB device(%%) =
Xiaoling 1.2 113
Bei Jinggeng 22.1 114 (% data-sider-select-id="582a7e84-a00a-4129-b71d-347a29aa5142" %)
115 == 4.1 Upgrade the firmware to configure TTS firmware to set the certificate ==
Xiaoling 1.2 116
Xiaoling 23.2 117
Bei Jinggeng 23.1 118 User can change device firmware to::
Xiaoling 1.2 119
Bei Jinggeng 23.1 120 * Update with new features.
Bei Jinggeng 22.1 121
Bei Jinggeng 23.1 122 * Fix bugs.
Bei Jinggeng 22.1 123
Bei Jinggeng 23.1 124 Firmware and changelog can be downloaded from : **[[Set up TLS certificate - Dropbox>>url:https://www.dropbox.com/sh/sxrgszkac4ips0q/AAA7xVIHen982Nc0edNPaB-Wa/NB-IoT/Set%20up%20TLS%20certificate?dl=0&subfolder_nav_tracking=1||data-sider-select-id="830d1b64-cb24-48b3-91e4-49da5c3f0783"]]**
125
126 Methods to Update Firmware:
127
128 * (Recommended way) OTA firmware update via BLE: [[**Instruction**>>url:http://wiki.dragino.com/xwiki/bin/view/Main/BLE_Firmware_Update_NB_Sensors_BC660K-GL/]].
129
130 * Update through UART TTL interface : **[[Instruction>>url:http://wiki.dragino.com/xwiki/bin/view/Main/UART_Access_for_NB_ST_BC660K-GL/#H4.2UpdateFirmware28Assumethedevicealreadyhaveabootloader29]]**.
131
132
Xiaoling 23.2 133
Bei Jinggeng 22.1 134 (% data-sider-select-id="954c6787-a52d-4862-805c-4afa47abd128" %)
135 == 4.2 Configure certificate ==
136
Xiaoling 23.2 137
Xiaoling 1.2 138 After upgrade the firmware, the serial port displays as follows:
139
Bei Jinggeng 22.1 140 (% data-sider-select-id="8b6a9e23-dec0-476c-acd4-098aa19fe1f3" %)
141 [[image:image-20240528174330-13.png||height="286" width="568"]]
Xiaoling 1.2 142
Xiaoling 23.2 143
Bei Jinggeng 22.1 144 (% data-sider-select-id="8b6a9e23-dec0-476c-acd4-098aa19fe1f3" %)
Xiaoling 23.2 145 === 4.2.1 Configure CA certificate ===
Xiaoling 1.2 146
Xiaoling 23.2 147
Xiaoling 1.2 148 Please input the certificate in PEM format for the user.
149
150 Use the AT command AT+CACERT as follows:
151
152 AT+CACERT=~-~-~-~--BEGIN CERTIFICATE~-~-~-~--
153
154 MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF
155
156 ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6
157
158 b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL
159
160 MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv
161
162 b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj
163
164 ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM
165
166 9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw
167
168 IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6
169
170 VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L
171
172 93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm
173
174 jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC
175
176 AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA
177
178 A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI
179
180 U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs
181
182 N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv
183
184 o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU
185
186 5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy
187
188 rqXRfboQnoZsG4q5WTP468SQvvG5
189
190 ~-~-~-~--END CERTIFICATE~-~-~-~--}
191
Xiaoling 23.4 192 (% style="color:red" %)**Note: Be sure to add a terminator "}" at the end of the command. Otherwise, the command will not execute successfully.**
Xiaoling 1.2 193
Bei Jinggeng 22.1 194 [[image:image-20240528174408-14.png]]
Xiaoling 1.2 195
196
197 After successful execution, as shown in the following figure.
198
Bei Jinggeng 22.1 199 [[image:image-20240528174502-15.png]]
Xiaoling 1.2 200
Xiaoling 23.4 201 Display (% style="color:blue" %)**"Successfully configured CA certificate."**(%%) If the configuration is successful, otherwise it is considered configuration failure.
Xiaoling 1.2 202
Xiaoling 23.2 203
204 === 4.2.2 Configure client certificate ===
Xiaoling 1.2 205
Xiaoling 23.2 206
Xiaoling 1.2 207 Use the AT command AT+CLICERT as follows:
208
209 AT+CLICERT=~-~-~-~--BEGIN CERTIFICATE~-~-~-~--
210
211 MIIDWTCCAkGgAwIBAgIUYSpJUzfb4NTa76JJxd2th0fZA8swDQYJKoZIhvcNAQEL
212
213 BQAwTTFLMEkGA1UECwxCQW1hem9uIFdlYiBTZXJ2aWNlcyBPPUFtYXpvbi5jb20g
214
215 SW5jLiBMPVNlYXR0bGUgU1Q9V2FzaGluZ3RvbiBDPVVTMB4XDTI0MDUyNDA4MDI0
216
217 NVoXDTQ5MTIzMTIzNTk1OVowHjEcMBoGA1UEAwwTQVdTIElvVCBDZXJ0aWZpY2F0
218
219 ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMTdc1GQLVBohAeCJD6n
220
221 6WTFAFrygTch90a5wUr2bhlVuDxvEhEKNcmu5vOCo5agmfLWb2VCxgezgvQOBYQ8
222
223 1oTqXJNdl4tS0DICfqb/ogVHWGHRao67XyhbPNBS0j/nCPTIIk6+/NBeYPOjaG+p
224
225 utfXE7SGIEcc3RevkYkUJx6y+WH7MLjj1mufuXBVWIL1RrfrIRPw6auVk7dhS5rU
226
227 NvYcJa7Qd6gpAh1DzPj7ZECrv7fEIIBDEsSYOy6ToWtzqGIVcIAHBDfORB0Hcm+N
228
229 7wG3KDf61P4aWkLlkP5pRUaUIQdVblxginmx2K3n8t/WP7QcfITa191rjEVVBXmk
230
231 ROsCAwEAAaNgMF4wHwYDVR0jBBgwFoAUs8Caohh1ZGP8kjSn3rtxJiJJ9IswHQYD
232
233 VR0OBBYEFCjwGwqD7FG9UCNm3wjFQX4HixzfMAwGA1UdEwEB/wQCMAAwDgYDVR0P
234
235 AQH/BAQDAgeAMA0GCSqGSIb3DQEBCwUAA4IBAQBgqI49a4PBQZYrFM63TX3EHgdd
236
237 N6Pj7AytjO+SrKNMCSo/OtIvhDTxOocr1vKrux1Tw5qmrllrIXLtlGtbmln5DS6a
238
239 DTCLrjwcIFIabLxpx5DPY1WSMYvL04SW7d4Y+3SxOFNRotDSiomr8eIIac0d3HE2
240
241 B5b0SnWZgWbrhjNUgvwo8l8tA9DOGIr2MeQ5kPjudOOiYSR3HC0v+jviBMV6VX8M
242
243 LHVH3CRshHDKBGpV1NZ1RAm9EY/oRGtSiMsyjRh6hegC0vehwVxaC4w9qG0ASkzz
244
245 42OOGfNqhYnYDiKTEIkazaoAFpTKDejWBaL7W5VpthUkQOl67IyX+ohuUKTo
246
247 ~-~-~-~--END CERTIFICATE~-~-~-~--}
248
Xiaoling 23.4 249 (% style="color:red" %)**Note: Be sure to add a terminator "}" at the end of the command. Otherwise, the command will not execute successfully.**
Xiaoling 1.2 250
Bei Jinggeng 22.1 251 [[image:image-20240528174630-16.png||height="553" width="747"]]
Xiaoling 1.2 252
Xiaoling 23.4 253 Display (% style="color:blue" %)**"Successfully configured client certificate."**(%%) Configuration successful, otherwise configuration failed.
Xiaoling 1.2 254
Xiaoling 23.2 255
256 === 4.2.3 Configure client private key ===
Xiaoling 1.2 257
Xiaoling 23.2 258
Xiaoling 1.2 259 Use the AT command AT+CLIKEY, as shown below
260
261 AT+CLIKEY=~-~-~-~--BEGIN RSA PRIVATE KEY~-~-~-~--
262
263 MIIEpAIBAAKCAQEAxN1zUZAtUGiEB4IkPqfpZMUAWvKBNyH3RrnBSvZuGVW4PG8S
264
265 EQo1ya7m84KjlqCZ8tZvZULGB7OC9A4FhDzWhOpck12Xi1LQMgJ+pv+iBUdYYdFq
266
267 jrtfKFs80FLSP+cI9MgiTr780F5g86Nob6m619cTtIYgRxzdF6+RiRQnHrL5Yfsw
268
269 uOPWa5+5cFVYgvVGt+shE/Dpq5WTt2FLmtQ29hwlrtB3qCkCHUPM+PtkQKu/t8Qg
270
271 gEMSxJg7LpOha3OoYhVwgAcEN85EHQdyb43vAbcoN/rU/hpaQuWQ/mlFRpQhB1Vu
272
273 XGCKebHYrefy39Y/tBx8hNrX3WuMRVUFeaRE6wIDAQABAoIBAFhAOcjvjBDGuaEw
274
275 CxV3al49HfqnSZuwg0xWSztSm2qKDcwxsnSnEhO2b1vsTW9h0YGV9Vv8gg/Dvkmv
276
277 23M7XqM4+IUraJsRZbl1etdcM4KQSCOZoF4Zyv+pXuq4pf31kQNCkHaikWzLUkUG
278
279 FPQxr0vA49mCYwfd/ZL3ppM/0IWmxRwloV1Gb9q8iDBUcJGSDokZnT7diUxzzOcd
280
281 +UJ6xUhFq1v46Y7vO+73XROLv34JEBC0bIw2ErL6+AbzhHwb2mkuSccG9Ks37g3Z
282
283 dyyjjj8hm1wvHWepuWqEssaiS3HD5zAsI0v85xS8RwNj3zLfd8o1WC666n3CO+ij
284
285 VdRmR4kCgYEA+/sEFxpfaRomqcLwJebZcZH06U1RfJFfnbH2/Q6fANf8zNxwWs9A
286
287 O+jyk/CLhHYRIk6VIOMQmWwEYgJ2eAHfw2Diwj4/0eqkGu+yZOS6KTCewxSV73vc
288
289 SvACramJy4y6yEgDN5onwR1XqfVMfA0LzTcSupHR/xvrpf/gCsNFPxUCgYEAyAFd
290
291 nMUhJFSq3pOogxA43aJSkA8YuDS3jpBkKQ6vx81APpIMabQauOxFDt488TZGP3Yy
292
293 lhpa/lfFIgu2K7CgV4dUp+JtJJoZ/F+ExxUUzdqB4zxzWywAcc3RebfwP6qASwFT
294
295 G3mXYci4tgNWR+k5CSsuLXDk/OT5uo5GeGAEc/8CgYEAk6V8uxDP8STKnNRFpN/E
296
297 b6CHciDE64m/DgbWY2cq0fK9BUjxaLRhvfj8EqVzCrWnyoNjLHcAJfW+B7PLuPvY
298
299 IoJlvE1/Vb/4UnQ7ApVnY3VCwaoRRNc9uIcz+pAJ1sRqOarAf9cLDkPkNwktvM5k
300
301 KOXpSnrhIms4w/bPT18l9xUCgYBsAMDKbXEuK0JyGw5+Z/4tQQCQpnZU0rLkm3ha
302
303 64FkxaORplBprEZZ4cyQ8NW78/EPSAadI/JLMp5TejuPcDvFyGCgoBcMEuNBc1tC
304
305 HlIzr3FAgl5Qt3wt+FTMA9YKq0nINxjn10s2FKwaLccj4f9YwiaXh0VAg22PnlDT
306
307 pBYDhQKBgQCMwyKXJ4zYiDRdvLvgKzeuKaU4KNQItHE4KORPfkecjPoENt4bKxDw
308
309 2EdNFQLIoqBHL1s+/8+SzhCI31V7pkTs1AqCxDExJS7+8Z5NQFQIo/jooUo0N80E
310
311 y3ZZS6OLOXXscEqhMogf1grfbabXM9OkgTIq43cPQHtMGQiFAtIJkg==
312
313 ~-~-~-~--END RSA PRIVATE KEY~-~-~-~--}
314
Xiaoling 23.4 315 (% style="color:red" %)**Note: Be sure to add a terminator "}" at the end of the command. Otherwise, the command will not execute successfully.**
Xiaoling 1.2 316
Bei Jinggeng 22.1 317 [[image:image-20240528174702-17.png]]
Xiaoling 1.2 318
Xiaoling 23.4 319 Display(% style="color:blue" %)** "Successfully configured client private key."**(%%) If the configuration is successful, otherwise it is considered configuration failure.
Xiaoling 1.2 320
Xiaoling 23.2 321
Bei Jinggeng 22.1 322 === 4.3.3 Re-upgrade the firmware ===
Xiaoling 1.2 323
324
Xiaoling 23.2 325 After the certificate configuration is completed, Re-upgrade to the firmware you originally used.
326
327
Bei Jinggeng 22.1 328 = 5. Configure draginoNB-device =
Xiaoling 1.2 329
Bei Jinggeng 22.1 330 == 5.1 Configure the data format sent by the device ==
331
Xiaoling 23.2 332
Xiaoling 1.2 333 AT+PRO=3,5(Data is in Json format of MQTT)
334
335
Bei Jinggeng 22.1 336 == 5.2 Set server address ==
Xiaoling 1.2 337
Xiaoling 23.2 338
Xiaoling 1.2 339 AT+SERVADDR=an5tk94sdgjat-ats.iot.us-east-1.amazonaws.com,8883
340
341
Xiaoling 23.2 342 == 5.3 Set up private and public topics ==
Xiaoling 1.2 343
Xiaoling 23.2 344
Xiaoling 1.2 345 AWS does not limit topics, so you can set any topic
346
347 AT+SUBTOPIC=Any
348
349 AT+PUBTOPIC=Any
350
351
Bei Jinggeng 22.1 352 == 5.4 Set the TLS mode ==
Xiaoling 1.2 353
Xiaoling 23.2 354
Xiaoling 1.2 355 AT+TLSMOD=1,2
356
357 To use the TLS mode certificate function, users need to configure the AT+TLSMOD command
358
359 AT+TLSMOD=1,0  No authentication
360
361 AT+TLSMOD=1,1  Perform server authentication
362
363 AT+TLSMOD=1,2  Perform server and client authentication if requested by the remote server.(In AWS we recommend using this mode)
364
365
Bei Jinggeng 22.1 366 Restart the device
Xiaoling 1.2 367
Xiaoling 23.2 368
Bei Jinggeng 22.1 369 = 6. View data on AWS =
Xiaoling 1.2 370
Xiaoling 23.2 371 == 6.1 Find MQTT test client in test ==
Xiaoling 1.2 372
Xiaoling 23.2 373
Xiaoling 1.2 374 In the fourth step, fill in the topics you subscribed to before
375
376 AT+PUBTOPIC=XXXX
377
378 If you forget your previous topic, you can fill in #,subscribe to all topics
379
Bei Jinggeng 22.1 380 [[image:image-20240528175111-18.png||height="409" width="1014"]]
Xiaoling 1.2 381
382
Xiaoling 23.5 383 == 6.2 The data published information in Subscriptions ==
Xiaoling 1.2 384
Bei Jinggeng 22.1 385
386 [[image:image-20240528175133-19.png||height="563" width="1022"]]
387
388 [[image:image-20240528175154-20.png||height="752" width="1042"]]
389
390