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,7 +21,6 @@ 21 21 |1NCE| | | 22 22 |China Mobile| | | 23 23 24 - 25 25 == 2.1 1NCE SIM Card. == 26 26 27 27 ... ... @@ -73,15 +73,15 @@ 73 73 74 74 (% style="color:blue" %)**AT Commands:** 75 75 76 -* (% style="color:#037691" %)**AT+PRO=3,0** 75 +* (% style="color:#037691" %)**AT+PRO=3,0** (%%) ~/~/ Set to use MQTT protocol to uplink, Payload Type select Hex payload. 77 77 78 -* (% style="color:#037691" %)**AT+SERVADDR=120.24.4.116,1883** 77 +* (% style="color:#037691" %)**AT+SERVADDR=120.24.4.116,1883** (%%) ~/~/ Set MQTT server address and port 79 79 80 -* (% style="color:#037691" %)**AT+CLIENT=CLIENT** 79 +* (% style="color:#037691" %)**AT+CLIENT=CLIENT** (%%) ~/~/ Set up the CLIENT of MQTT 81 81 82 -* (% style="color:#037691" %)**AT+UNAME=UNAME** 81 +* (% style="color:#037691" %)**AT+UNAME=UNAME** (%%) ~/~/ Set the username of MQTT 83 83 84 -* (% style="color:#037691" %)**AT+PWD=PWD** 83 +* (% style="color:#037691" %)**AT+PWD=PWD** (%%) ~/~/ Set the password of MQTT 85 85 86 86 * (% style="color:#037691" %)**AT+PUBTOPIC=NSE01_PUB** (%%) ~/~/ Set the sending topic of MQTT 87 87 ... ... @@ -91,13 +91,14 @@ 91 91 92 92 [[image:image-20230802112413-5.png]] 93 93 94 -**Notice: MQTT 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.** 95 95 96 96 97 97 == 3.3 [[ThingSpeak>>url:https://thingspeak.com/]] (via MQTT) == 98 98 99 -== 1.1 Get MQTT Credentials ==98 +=== 3.3.1 Get MQTT Credentials === 100 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. 102 102 103 103 [[image:image-20230802112413-6.png]] ... ... @@ -105,22 +105,24 @@ 105 105 [[image:image-20230802112413-7.png]] 106 106 107 107 108 -== 1.2.108 +== 3.3.2 Simulate with MQTT.fx == 109 109 110 -=== 1.2.1 Establish MQTT Connection ===110 +=== 3.3.2.1 Establish MQTT Connection === 111 111 112 + 112 112 After we got MQTT Credentials, we can first simulate with PC tool MQTT.fx tool to see if the Credentials and settings are fine. 113 113 114 114 [[image:image-20230802112413-8.png]] 115 115 116 -* Broker Address: mqtt3.thingspeak.com 117 -* Broker Port: 1883 118 -* Client ID: <Your ThingSpeak MQTT ClientID> 119 -* User Name: <Your ThingSpeak MQTT User Name> 120 -* Password: <Your ThingSpeak MQTT Password> 117 +* (% style="color:#037691" %)**Broker Address:**(%%) mqtt3.thingspeak.com 121 121 122 -=== 1.2.2 Publish Data to ThingSpeak Channel === 119 +* (% style="color:#037691" %)**Broker Port:**(%%) 1883 120 +* (% style="color:#037691" %)**Client ID:**(%%) <Your ThingSpeak MQTT ClientID> 121 +* (% style="color:#037691" %)**User Name:**(%%) <Your ThingSpeak MQTT User Name> 122 +* (% style="color:#037691" %)**Password:**(%%) <Your ThingSpeak MQTT Password> 123 123 124 +=== 3.3.2.2 Publish Data to ThingSpeak Channel === 125 + 124 124 [[image:image-20230802112413-9.png]] 125 125 126 126 [[image:image-20230802112413-10.png]] ... ... @@ -145,10 +145,15 @@ 145 145 In the NB-IoT, we can run below commands so to publish the channels like MQTT.fx 146 146 147 147 * AT+PRO=3,1 ~/~/Set to use ThingSpeak Server and Related Payload 150 + 148 148 * AT+CLIENT=<Your ThingSpeak MQTT ClientID> 152 + 149 149 * AT+UNAME=<Your ThingSpeak MQTT User Name> 154 + 150 150 * AT+PWD=<Your ThingSpeak MQTT Password> 156 + 151 151 * AT+PUBTOPIC=<YOUR_CHANNEL_ID> 158 + 152 152 * AT+SUBTOPIC=<YOUR_CHANNEL_ID> 153 153 154 154 === 1.3.2 Uplink Examples ===