Last modified by Mengting Qiu on 2025/03/08 11:33
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -21,6 +21,7 @@ 21 21 |1NCE| | | 22 22 |China Mobile| | | 23 23 24 + 24 24 == 2.1 1NCE SIM Card. == 25 25 26 26 ... ... @@ -49,9 +49,7 @@ 49 49 (% style="color:blue" %)**AT Commands:** 50 50 51 51 * (% style="color:#037691" %)**AT+PRO=2,0** (%%) ~/~/ Set to use UDP protocol to uplink ,Payload Type select Hex payload 52 - 53 53 * (% style="color:#037691" %)**AT+SERVADDR=120.24.4.116,5601** (%%) ~/~/ Set UDP server address and port 54 - 55 55 * (% style="color:#037691" %)**AT+CFM=1** (%%) ~/~/ If the server does not respond, this command is unnecessary 56 56 57 57 [[image:image-20230802112413-2.png]] ... ... @@ -70,34 +70,27 @@ 70 70 71 71 Below are the commands. 72 72 73 - (% style="color:blue" %)**AT Commands:**72 +**AT Commands:** 74 74 75 -* (% style="color:#037691" %)**AT+PRO=3,0** (%%) ~/~/ Set to use MQTT protocol to uplink, Payload Type select Hex payload. 74 +* **AT+PRO=3,0** ~/~/ Set to use MQTT protocol to uplink, Payload Type select Hex payload. 75 +* **AT+SERVADDR=120.24.4.116,1883** ~/~/ Set MQTT server address and port 76 +* **AT+CLIENT=CLIENT** ~/~/ Set up the CLIENT of MQTT 77 +* **AT+UNAME=UNAME** ~/~/ Set the username of MQTT 78 +* **AT+PWD=PWD** ~/~/ Set the password of MQTT 79 +* **AT+PUBTOPIC=NSE01_PUB** ~/~/ Set the sending topic of MQTT 80 +* **AT+SUBTOPIC=NSE01_SUB** ~/~/ Set the subscription topic of MQTT 76 76 77 -* (% style="color:#037691" %)**AT+SERVADDR=120.24.4.116,1883** (%%) ~/~/ Set MQTT server address and port 78 - 79 -* (% style="color:#037691" %)**AT+CLIENT=CLIENT** (%%) ~/~/ Set up the CLIENT of MQTT 80 - 81 -* (% style="color:#037691" %)**AT+UNAME=UNAME** (%%) ~/~/ Set the username of MQTT 82 - 83 -* (% style="color:#037691" %)**AT+PWD=PWD** (%%) ~/~/ Set the password of MQTT 84 - 85 -* (% style="color:#037691" %)**AT+PUBTOPIC=NSE01_PUB** (%%) ~/~/ Set the sending topic of MQTT 86 - 87 -* (% style="color:#037691" %)**AT+SUBTOPIC=NSE01_SUB** (%%) ~/~/ Set the subscription topic of MQTT 88 - 89 89 [[image:image-20230802112413-4.png]] 90 90 91 91 [[image:image-20230802112413-5.png]] 92 92 93 - (% style="color:red" %)**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.**86 +**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.** 94 94 95 95 96 96 == 3.3 [[ThingSpeak>>url:https://thingspeak.com/]] (via MQTT) == 97 97 98 -== =3.3.1 Get MQTT Credentials ===91 +== 1.1 Get MQTT Credentials == 99 99 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. 102 102 103 103 [[image:image-20230802112413-6.png]] ... ... @@ -105,71 +105,54 @@ 105 105 [[image:image-20230802112413-7.png]] 106 106 107 107 108 -== 3.3.2100 +== 1.2. Simulate with MQTT.fx == 109 109 110 -=== 3.3.2.1 Establish MQTT Connection ===102 +=== 1.2.1 Establish MQTT Connection === 111 111 112 - 113 113 After we got MQTT Credentials, we can first simulate with PC tool MQTT.fx tool to see if the Credentials and settings are fine. 114 114 115 115 [[image:image-20230802112413-8.png]] 116 116 117 -* (% style="color:#037691" %)**Broker Address:**(%%) mqtt3.thingspeak.com 108 +* Broker Address: mqtt3.thingspeak.com 109 +* Broker Port: 1883 110 +* Client ID: <Your ThingSpeak MQTT ClientID> 111 +* User Name: <Your ThingSpeak MQTT User Name> 112 +* Password: <Your ThingSpeak MQTT Password> 118 118 119 - * (% style="color:#037691"%)**BrokerPort:**(%%)1883114 +=== 1.2.2 Publish Data to ThingSpeak Channel === 120 120 121 -* (% style="color:#037691" %)**Client ID:**(%%) <Your ThingSpeak MQTT ClientID> 122 - 123 -* (% style="color:#037691" %)**User Name:**(%%) <Your ThingSpeak MQTT User Name> 124 - 125 -* (% style="color:#037691" %)**Password:**(%%) <Your ThingSpeak MQTT Password> 126 - 127 - 128 - 129 -=== 3.3.2.2 Publish Data to ThingSpeak Channel === 130 - 131 131 [[image:image-20230802112413-9.png]] 132 132 133 133 [[image:image-20230802112413-10.png]] 134 134 135 - (% style="color:blue" %)**In MQTT.fx, we can publish below info:**120 +In MQTT.fx, we can publish below info: 136 136 137 -* (% style="color:#037691" %)**Topic:**(%%) channels/YOUR_CHANNEL_ID/publish 122 +* Topic: channels/YOUR_CHANNEL_ID/publish 123 +* Payload: field1=63&field2=67&status=MQTTPUBLISH 138 138 139 -* (% style="color:#037691" %)**Payload:**(%%) field1=63&field2=67&status=MQTTPUBLISH 140 - 141 141 Where 63 and 67 are the value to be published to field1 & field2. 142 142 143 143 144 - (% style="color:blue" %)**Result:**128 +Result: 145 145 146 146 [[image:image-20230802112413-11.png]] 147 147 148 148 149 -== 3.3 Configure NB-IoT Sensor for connection ==133 +== 1.3 Configure NB-IoT Sensor for connection == 150 150 151 -=== 3.3.1 AT Commands: ===135 +=== 1.3.1 AT Commands: === 152 152 153 - 154 154 In the NB-IoT, we can run below commands so to publish the channels like MQTT.fx 155 155 156 -* **AT+PRO=3,1** ~/~/ Set to use ThingSpeak Server and Related Payload 139 +* AT+PRO=3,1 ~/~/Set to use ThingSpeak Server and Related Payload 140 +* AT+CLIENT=<Your ThingSpeak MQTT ClientID> 141 +* AT+UNAME=<Your ThingSpeak MQTT User Name> 142 +* AT+PWD=<Your ThingSpeak MQTT Password> 143 +* AT+PUBTOPIC=<YOUR_CHANNEL_ID> 144 +* AT+SUBTOPIC=<YOUR_CHANNEL_ID> 157 157 158 - * **AT+CLIENT=<YourThingSpeakMQTT ClientID>**146 +=== 1.3.2 Uplink Examples === 159 159 160 -* **AT+UNAME=<Your ThingSpeak MQTT User Name>** 161 - 162 -* **AT+PWD=<Your ThingSpeak MQTT Password>** 163 - 164 -* **AT+PUBTOPIC=<YOUR_CHANNEL_ID>** 165 - 166 -* **AT+SUBTOPIC=<YOUR_CHANNEL_ID>** 167 - 168 - 169 - 170 -=== 3.3.2 Uplink Examples === 171 - 172 - 173 173 For S31-NB 174 174 175 175 For SE01-NB ... ... @@ -195,9 +195,8 @@ 195 195 For SN50V3-NB 196 196 197 197 198 -=== 3.3.3Map fields to sensor value ===173 +=== 1.3.2 Map fields to sensor value === 199 199 200 - 201 201 When NB-IoT sensor upload to ThingSpeak. The payload already specify which fileds related to which sensor value. Use need to create fileds in Channels Settings. with name so to see the value correctly. 202 202 203 203