Last modified by Mengting Qiu on 2025/03/08 11:33
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -234,10 +234,10 @@ 234 234 == 3.4.1 Define Product == 235 235 236 236 237 -Firstly, we need to set the MQTT mode to datacake, and we need to run (% style="color:blue" %)** AT+PRO=3,2**(%%). This command is set to datacake. After running the command, the device automatically sets the server address, port.237 +Firstly, we need to set the MQTT mode to datacake, and we need to run** AT+PRO=3,2**. This command is set to datacake. After running the command, the device automatically sets the server address, port. 238 238 239 239 240 -By chosing to add the device under a (% style="color:blue" %)**"New Product"**(%%) you are required to give a name for this product. You can name it something like (% style="color:blue" %)**"My First MQTT Product"**.240 +By chosing to add the device under a (% style="color:blue" %)**"New Product"**(%%) you are required to give a name for this product. You can name it something like "My First MQTT Product". 241 241 242 242 [[image:image-20230802112413-14.png]] 243 243 ... ... @@ -249,7 +249,7 @@ 249 249 250 250 [[image:image-20230802112413-15.png]] 251 251 252 -Enter a name here (such as "My First MQTT Device") and complete the creation of the device by clicking on the (% style="color:blue" %)**"Next"**(%%)button.252 +Enter a name here (such as "My First MQTT Device") and complete the creation of the device by clicking on the "Next" button. 253 253 254 254 255 255 === 3.4.3 Create Database Fields === ... ... @@ -257,13 +257,13 @@ 257 257 258 258 After creating the device, it is listed in the table of the fleet view. Now open the device by clicking on the entry in the list. 259 259 260 -You will then see a device view with an empty dashboard. Now, the first thing we want to do is navigate to the Device configuration. To do this, use the tab bar and click on (% style="color:blue" %)**"Configuration"**.260 +You will then see a device view with an empty dashboard. Now, the first thing we want to do is navigate to the Device configuration. To do this, use the tab bar and click on "Configuration". 261 261 262 262 [[image:image-20230802112413-16.png]] 263 263 264 264 [[image:image-20230802112413-17.png]] 265 265 266 -To create a first database field, please click on the (% style="color:blue" %)**"Add Field"**(%%)button as marked in the screenshot above.266 +To create a first database field, please click on the "Add Field" button as marked in the screenshot above. 267 267 268 268 This will open another modal asking for some required input for your first field. 269 269 ... ... @@ -275,13 +275,13 @@ 275 275 === 3.4.4 Set up Broker === 276 276 277 277 278 -The broker is running on mqtt.datacake.co on ports (% style="color:blue" %)**1883 and 8883**(%%). Port 1883 is unsecured and should not be used in production environments. Port 8883 uses a CA signed server certificate.278 +The broker is running on mqtt.datacake.co on ports 1883 and 8883. Port 1883 is unsecured and should not be used in production environments. Port 8883 uses a CA signed server certificate. 279 279 280 280 You will need an access token to log into the Datacake MQTT Broker. You can use your own personal token or create a token explicitly for individual devices or groups of devices. 281 281 282 282 View your Personal Access Token 283 283 284 -You can view your own token via the User-Settings-Menu. You can reach this menu by clicking on (% style="color:blue" %)**"Edit Profile"**(%%)at the end of the list using the Workspace Selector:284 +You can view your own token via the User-Settings-Menu. You can reach this menu by clicking on "Edit Profile" at the end of the list using the Workspace Selector: 285 285 286 286 [[image:image-20230802112413-20.png]] 287 287 ... ... @@ -360,7 +360,6 @@ 360 360 361 361 [[image:image-20230802112413-30.png]] 362 362 363 - 364 364 === 3.5.2 Simulate Connection === 365 365 366 366 ... ... @@ -393,9 +393,8 @@ 393 393 394 394 [[image:image-20230802112413-32.png]] 395 395 395 +==== 3.6.2.2 Create Uplink & Downlink Converter ==== 396 396 397 -==== 3.6.1.2 Create Uplink & Downlink Converter ==== 398 - 399 399 (% style="color:blue" %)**Uplink Converter** 400 400 401 401 The purpose of the decoder function is to parse the incoming data and metadata to a format that ThingsBoard can consume. deviceName and deviceType are required, while attributes and telemetry are optional. Attributes and telemetry are flat key-value objects. Nested objects are not supported. ... ... @@ -414,11 +414,10 @@ 414 414 (% style="color:red" %)**Note:Our device payload is already human readable data. Therefore, users do not need to write decoders. Simply create by default.** 415 415 416 416 417 -=== =3.6.1.3 MQTT Integration Setup ====415 +=== 1.1.3 MQTT Integration Setup === 418 418 417 +Go to the Integrations center -> Integrations page and click “plus” icon to add a new integration. Name it “MQTT Integration”, select type MQTT; 419 419 420 -Go to the Integrations center -> Integrations page and click **“plus”** icon to add a new integration. Name it “MQTT Integration”, select type MQTT; 421 - 422 422 [[image:image-20230802112413-35.png]] 423 423 424 424 * The next steps is to add the recently created uplink and downlink converters; ... ... @@ -427,7 +427,7 @@ 427 427 428 428 [[image:image-20230802112413-37.png]] 429 429 430 - (% style="color:blue" %)**Add a topic filter:**427 +Add a topic filter: 431 431 432 432 433 433 tb/mqtt-integration-tutorial/sensors~/~/temperature ~-~-> Temperature 固定的? 对的。 ... ... @@ -436,32 +436,30 @@ 436 436 437 437 [[image:image-20230802112413-38.png]] 438 438 436 +== 1.2 Simulate with MQTT.fx == 439 439 440 -=== 3.6.2 Simulate with MQTT.fx === 441 - 442 442 [[image:image-20230802112413-39.png]] 443 443 444 444 [[image:image-20230802112413-40.png]] 445 445 442 +== 1.3 Configure NB-IoT Sensor == 446 446 447 - === 3.6.3Configure NB-IoT Sensor ===444 +AT Commands 448 448 449 - (%style="color:blue" %)**ATCommands**446 +AT+PRO=3,3 ~/~/ Use MQTT to connect to ThingsBoard. 450 450 451 - (% style="color:#037691" %)**AT+PRO=3,3(%%)~/~/UseMQTT to connectto ThingsBoard.448 +AT+SUBTOPIC=device name ~-~-> 只需要 Device Name 吗?对的 452 452 453 - (% style="color:#037691" %)**AT+SUBTOPIC=device name** (%%)~-~-> 只需要 Device Name 吗?对的450 +AT+PUBTOPIC=device name ~-~-> 只需要 Device Name 吗?对的 454 454 455 -(% style="color:#037691" %)**AT+PUBTOPIC=device name** (%%) ~-~-> 只需要 Device Name 吗?对的 456 456 457 - 458 458 Users do not need to fill in the client, username, and password. But the configuration information of the device requires setting the client, username, and password, which can be entered freely. (软件自动填充为 Device Name 吧).这边不用提示了,客户不需要输入。(大部分客户还是会自己去设置这个的,提高安全性) 459 459 460 - (% style="color:blue" %)**CLIENT :“Any value”**455 +CLIENT :“Any value” 461 461 462 - (% style="color:blue" %)**User Name:“Any value”**457 +User Name:“Any value” 463 463 464 - (% style="color:blue" %)**Password:“Any value”**459 +Password:“Any value” 465 465 466 466 467 467 Test Uplink by click the button for 1 second ... ... @@ -473,11 +473,10 @@ 473 473 [[image:image-20230802112413-43.png]] 474 474 475 475 476 -= =3.7 [[Tago.io>>url:https://admin.tago.io/]] (via MQTT) ==471 += 7. [[Tago.io>>url:https://admin.tago.io/]] (via MQTT) = 477 477 478 -== =3.7.1 Create device & Get Credentials ===473 +== 5.1 Create device & Get Credentials == 479 479 480 - 481 481 We use MQTT Connection to send data to [[Tago.io>>url:https://admin.tago.io/]]. We need to Create Device and Get MQTT Credentials first. 482 482 483 483 [[image:image-20230802112413-44.png]] ... ... @@ -484,6 +484,7 @@ 484 484 485 485 [[image:image-20230802112413-45.png]] 486 486 481 += = 487 487 488 488 Go to the Device section and create a device. Then, go to the section tokens and copy your device-token. 489 489 ... ... @@ -492,30 +492,20 @@ 492 492 493 493 On the Connection Profile window, set the following information: (这边加一个截图) 494 494 495 -* (% style="color:blue" %)**Profile Name: “Any name”** 490 +* Profile Name: “Any name” 491 +* Broker Address: mqtt.tago.io 492 +* Broker Port: 1883 493 +* Client ID: “Any value” 496 496 497 -* (% style="color:blue" %)**Broker Address: mqtt.tago.io** 498 - 499 -* (% style="color:blue" %)**Broker Port: 1883** 500 - 501 -* (% style="color:blue" %)**Client ID: “Any value”** 502 - 503 503 On the section User credentials, set the following information:(这边加一个截图) 504 504 505 -* **User Name: “Any value”** (%%) Tago validates your user by the token only 497 +* User Name: “Any value” Tago validates your user by the token only 498 +* Password: “Your device token” 499 +* PUBTOPIC: “Any value” 500 +* SUBTOPIC: “Any value” 506 506 507 - ***Password:“Your devicetoken”**502 +== 5.2 Simulate with MQTT.fx == 508 508 509 -* **PUBTOPIC: “Any value”** 510 - 511 -* **SUBTOPIC: “Any value”** 512 - 513 - 514 - 515 - 516 -=== 3.7.2 Simulate with MQTT.fx === 517 - 518 - 519 519 [[image:image-20230802112413-47.png]] 520 520 521 521 [[image:image-20230802112413-48.png]] ... ... @@ -524,40 +524,30 @@ 524 524 525 525 [[image:image-20230802112413-49.png]] 526 526 512 +== 1.4. tago data == 527 527 528 -=== 3.7.3 tago data === 529 529 530 - 531 531 [[image:image-20230802112413-50.png]] 532 532 533 533 [[image:image-20230802112413-51.png]] 534 534 519 +== 1.4. TLS mode == 535 535 536 - === 3.7.4TLS mode===521 +Users can choose to use SSL/TLS mode. 537 537 523 +On the SSL/TLS section, check the option Enable SSL/TLS, and click OK. 538 538 539 - Userscanchoose touse(% style="color:blue" %)**SSL/TLS**(%%)mode.525 +The device needs to enable the TLS mode and set the AT+TLSMOD=1,0 command. 540 540 541 -On the SSL/TLS section, check the option **Enable SSL/TLS**, and click OK. 527 +* Profile Name: “Any name” 528 +* Broker Address: mqtt.tago.io 529 +* Broker Port: 8883 530 +* Client ID: “Any value” 531 +* User Name: “Any value” Tago validates your user by the token only 532 +* Password: “Your device token” 533 +* PUBTOPIC: “Any value” 534 +* SUBTOPIC: “Any value” 542 542 543 -The device needs to enable the TLS mode and set the (% style="color:blue" %)**AT+TLSMOD=1,0**(%%) command. 544 - 545 -* (% style="color:blue" %)**Profile Name: “Any name”** 546 - 547 -* (% style="color:blue" %)**Broker Address: mqtt.tago.io** 548 - 549 -* (% style="color:blue" %)**Broker Port: 8883** 550 - 551 -* (% style="color:blue" %)**Client ID: “Any value”** 552 - 553 -* (% style="color:blue" %)**User Name: “Any value”** (%%) Tago validates your user by the token only 554 - 555 -* (% style="color:blue" %)**Password: “Your device token”** 556 - 557 -* (% style="color:blue" %)**PUBTOPIC: “Any value”** 558 - 559 -* (% style="color:blue" %)**SUBTOPIC: “Any value”** 560 - 561 561 [[image:image-20230802112413-52.png]] 562 562 563 563