Last modified by Mengting Qiu on 2025/07/03 18:55
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,10 +8,3 @@ 1 -(% class="wikigeneratedid" %) 2 -**Table of Contents:** 3 - 4 -{{toc/}} 5 - 6 - 7 - 8 8 = 1. The use of this guideline = 9 9 10 10 ... ... @@ -16,86 +16,75 @@ 16 16 17 17 The -NB and -NS models support (% style="color:blue" %)**LTE Cat NB2**(%%), with below frequency band: multiple frequency bands of (% style="color:blue" %)**B1/B2/B3/B4/B5/B8/B12/B13/B14/B17/B18/B19/B20/B25/B28/B66/B70/B85**(%%) . Make sure you use a the NB-IoT SIM card. 18 18 19 -(% border="1" cellspacing="4" style="background-color:#f2f2f2; width:510px" %) 20 -|(% style="background-color:#4f81bd; color:white" %)**SIM Provider**|(% style="background-color:#4f81bd; color:white" %)**APN**|(% style="background-color:#4f81bd; color:white" %)**NB-IoT Coverage**|(% style="background-color:#4f81bd; color:white" %)**Comments** 21 -|1NCE| | | 22 -|China Mobile| | | 23 23 24 - 25 25 == 2.1 1NCE SIM Card. == 26 26 27 27 16 +(% border="1" cellspacing="4" style="width:510px;background-color:#F2F2F2" %) 17 +|(% style="background-color:#4F81BD;color:white" %)SIM Provider|(% style="background-color:#4F81BD;color:white" %)APN|(% style="background-color:#4F81BD;color:white" %)NB-IoT Coverage|(% style="background-color:#4F81BD;color:white" %)Comments 18 +|1NCE| | | 19 +|China Mobile| | | 28 28 21 + 29 29 = 3. Configure to connect to different servers = 30 30 31 -== 3.1 General UDP Connection == 32 32 25 += NB-IoT 服务器对接例子 = 33 33 27 += 1. General UDP Connection = 28 + 34 34 The NB-IoT Sensor can send packet to server use UDP protocol. 35 35 31 +== 1.1 Simulate UDP Connection by PC tool == 36 36 37 -=== 3.1.1 Simulate UDP Connection by PC tool === 38 - 39 - 40 40 We can use PC tool to simulate UDP connection to make sure server works ok. 41 41 42 42 [[image:image-20230802112413-1.png]] 43 43 37 +== 1.2 Configure NB-IoT Sensor == 44 44 45 -=== 3.1.2 Configure NB-IoT Sensor===39 +=== 1.2.1 AT Commands === 46 46 47 - ==== 3.1.2.1AT Commands====41 +AT Commands: 48 48 43 +* AT+PRO=2,0 ~/~/ Set to use UDP protocol to uplink , Payload Type select Hex payload 44 +* AT+SERVADDR=120.24.4.116,5601 ~/~/ Set UDP server address and port 45 +* AT+CFM=1 ~/~/ If the server does not respond, this command is unnecessary 49 49 50 -(% style="color:blue" %)**AT Commands:** 51 - 52 -* (% style="color:#037691" %)**AT+PRO=2,0** (%%) ~/~/ Set to use UDP protocol to uplink ,Payload Type select Hex payload 53 - 54 -* (% style="color:#037691" %)**AT+SERVADDR=120.24.4.116,5601** (%%) ~/~/ Set UDP server address and port 55 - 56 -* (% style="color:#037691" %)**AT+CFM=1** (%%) ~/~/ If the server does not respond, this command is unnecessary 57 - 58 58 [[image:image-20230802112413-2.png]] 59 59 49 +=== 1.2.2 Uplink Example === 60 60 61 -==== 3.1.2.2 Uplink Example ==== 62 62 63 - 64 64 [[image:image-20230802112413-3.png]] 65 65 66 66 67 -= =3.2=55 += 2. General MQTT Connection = 68 68 69 - 70 70 The NB-IoT Sensor can send packet to server use MQTT protocol. 71 71 72 -Below are the commands .59 +Below are the commands 73 73 74 - (% style="color:blue" %)**AT Commands:**61 +AT Commands: 75 75 76 -* (% style="color:#037691" %)**AT+PRO=3,0** (%%) ~/~/ Set to use MQTT protocol to uplink, Payload Type select Hex payload. 63 +* AT+PRO=3,0 ~/~/ Set to use MQTT protocol to uplink, Payload Type select Hex payload. 64 +* AT+SERVADDR=120.24.4.116,1883 ~/~/ Set MQTT server address and port 65 +* AT+CLIENT=CLIENT ~/~/ Set up the CLIENT of MQTT 66 +* AT+UNAME=UNAME ~/~/ Set the username of MQTT 67 +* AT+PWD=PWD ~/~/ Set the password of MQTT 68 +* AT+PUBTOPIC=NSE01_PUB ~/~/ Set the sending topic of MQTT 69 +* AT+SUBTOPIC=NSE01_SUB ~/~/ Set the subscription topic of MQTT 77 77 78 -* (% style="color:#037691" %)**AT+SERVADDR=120.24.4.116,1883** (%%) ~/~/ Set MQTT server address and port 79 - 80 -* (% style="color:#037691" %)**AT+CLIENT=CLIENT** (%%) ~/~/ Set up the CLIENT of MQTT 81 - 82 -* (% style="color:#037691" %)**AT+UNAME=UNAME** (%%) ~/~/ Set the username of MQTT 83 - 84 -* (% style="color:#037691" %)**AT+PWD=PWD** (%%) ~/~/ Set the password of MQTT 85 - 86 -* (% style="color:#037691" %)**AT+PUBTOPIC=NSE01_PUB** (%%) ~/~/ Set the sending topic of MQTT 87 - 88 -* (% style="color:#037691" %)**AT+SUBTOPIC=NSE01_SUB** (%%) ~/~/ Set the subscription topic of MQTT 89 - 90 90 [[image:image-20230802112413-4.png]] 91 91 92 92 [[image:image-20230802112413-5.png]] 93 93 94 - **Notice: MQTT protocol has a much higher power consumption compare with UDP / CoAP protocol. Please check the power analyze document and adjust the uplink period to a suitable interval.**75 +Notice: MQTT protocol has a much higher power consumption compare with UDP / CoAP protocol. Please check the power analyze document and adjust the uplink period to a suitable interval. 95 95 96 96 97 -== 3.3 [[ThingSpeak>>url:https://thingspeak.com/]] (via MQTT) == 98 98 79 += 3. [[ThingSpeak>>url:https://thingspeak.com/]] (via MQTT) = 80 + 99 99 == 1.1 Get MQTT Credentials == 100 100 101 101 [[ThingSpeak>>url:https://thingspeak.com/]] connection uses MQTT Connection. So we need to get MQTT Credentials first. You need to point MQTT Devices to ThingSpeak Channel as well. ... ... @@ -119,8 +119,9 @@ 119 119 * User Name: <Your ThingSpeak MQTT User Name> 120 120 * Password: <Your ThingSpeak MQTT Password> 121 121 122 -=== 1.2.2 Publish Data to ThingSpeak Channel === 123 123 105 +=== 1.2.2 Publish Data to ThingSpeak Channel === 106 + 124 124 [[image:image-20230802112413-9.png]] 125 125 126 126 [[image:image-20230802112413-10.png]] ... ... @@ -130,6 +130,7 @@ 130 130 * Topic: channels/YOUR_CHANNEL_ID/publish 131 131 * Payload: field1=63&field2=67&status=MQTTPUBLISH 132 132 116 + 133 133 Where 63 and 67 are the value to be published to field1 & field2. 134 134 135 135 ... ... @@ -151,6 +151,8 @@ 151 151 * AT+PUBTOPIC=<YOUR_CHANNEL_ID> 152 152 * AT+SUBTOPIC=<YOUR_CHANNEL_ID> 153 153 138 + 139 + 154 154 === 1.3.2 Uplink Examples === 155 155 156 156 For S31-NB ... ... @@ -286,6 +286,7 @@ 286 286 287 287 )))|(% colspan="1" rowspan="1" %)RSSI|(% colspan="1" rowspan="1" %)count|(% colspan="1" rowspan="1" %) |(% colspan="1" rowspan="1" %) |(% colspan="1" rowspan="1" %) |(% colspan="1" rowspan="1" %) |(% colspan="1" rowspan="1" %) |(% colspan="1" rowspan="1" %) 288 288 275 + 289 289 = 4. Datacake = 290 290 291 291 == 1.1 Define Product == ... ... @@ -408,7 +408,7 @@ 408 408 409 409 [[image:image-20230802112413-30.png]] 410 410 411 -== 1.2 Simulate Connection == 398 +== 1.2 Simulate Connection == 412 412 413 413 [[image:image-20230802112413-31.png]] 414 414 ... ... @@ -421,9 +421,10 @@ 421 421 * AT+PUBTOPIC=any value 422 422 * AT+SUBTOPIC=any value 423 423 411 + 424 424 = 6. ThingsBoard.Cloud (via MQTT) = 425 425 426 -== 1.1 Configure ThingsBoard == 414 +== 1.1 Configure ThingsBoard == 427 427 428 428 === 1.1.1 Create Device === 429 429 ... ... @@ -530,6 +530,7 @@ 530 530 * Broker Port: 1883 531 531 * Client ID: “Any value” 532 532 521 + 533 533 On the section User credentials, set the following information:(这边加一个截图) 534 534 535 535 * User Name: “Any value” Tago validates your user by the token only ... ... @@ -537,6 +537,7 @@ 537 537 * PUBTOPIC: “Any value” 538 538 * SUBTOPIC: “Any value” 539 539 529 + 540 540 == 5.2 Simulate with MQTT.fx == 541 541 542 542 [[image:image-20230802112413-47.png]] ... ... @@ -571,6 +571,7 @@ 571 571 * PUBTOPIC: “Any value” 572 572 * SUBTOPIC: “Any value” 573 573 564 + 574 574 [[image:image-20230802112413-52.png]] 575 575 576 576