Last modified by Mengting Qiu on 2025/03/08 11:33
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -50,9 +50,7 @@ 50 50 (% style="color:blue" %)**AT Commands:** 51 51 52 52 * (% style="color:#037691" %)**AT+PRO=2,0** (%%) ~/~/ Set to use UDP protocol to uplink ,Payload Type select Hex payload 53 - 54 54 * (% style="color:#037691" %)**AT+SERVADDR=120.24.4.116,5601** (%%) ~/~/ Set UDP server address and port 55 - 56 56 * (% style="color:#037691" %)**AT+CFM=1** (%%) ~/~/ If the server does not respond, this command is unnecessary 57 57 58 58 [[image:image-20230802112413-2.png]] ... ... @@ -64,38 +64,32 @@ 64 64 [[image:image-20230802112413-3.png]] 65 65 66 66 67 -= =3.2=65 += 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 .69 +Below are the commands 73 73 74 - (% style="color:blue" %)**AT Commands:**71 +AT Commands: 75 75 76 -* (% style="color:#037691" %)**AT+PRO=3,0** (%%) ~/~/ Set to use MQTT protocol to uplink, Payload Type select Hex payload. 73 +* AT+PRO=3,0 ~/~/ Set to use MQTT protocol to uplink, Payload Type select Hex payload. 74 +* AT+SERVADDR=120.24.4.116,1883 ~/~/ Set MQTT server address and port 75 +* AT+CLIENT=CLIENT ~/~/ Set up the CLIENT of MQTT 76 +* AT+UNAME=UNAME ~/~/ Set the username of MQTT 77 +* AT+PWD=PWD ~/~/ Set the password of MQTT 78 +* AT+PUBTOPIC=NSE01_PUB ~/~/ Set the sending topic of MQTT 79 +* 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.**85 +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 89 += 3. [[ThingSpeak>>url:https://thingspeak.com/]] (via MQTT) = 90 + 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.