Changes for page Notes for ChirpStack
Last modified by Edwin Chen on 2025/01/30 09:53
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -57,7 +57,7 @@ 57 57 58 58 In Step 3. Create Service-profiles, the above parameters can be set. If necessary, you can set them by yourself. This is only an example. 59 59 60 -Note : Before add the gateway, the user needs to complete the preceding three steps. 60 +(% style="color:red" %)**Note : Before add the gateway, the user needs to complete the preceding three steps.** 61 61 62 62 If the user has completed the preceding steps, proceed to the next step. 63 63 ... ... @@ -65,7 +65,7 @@ 65 65 66 66 The example gateway id is: a840411e96744150 67 67 68 -Note : The Gateway EUI and server addresses must match the ChirpStack configuration. 68 +(% style="color:red" %)**Note : The Gateway EUI and server addresses must match the ChirpStack configuration.** 69 69 70 70 [[image:https://wiki.dragino.com/images/thumb/c/c6/Add_the_gateway.png/600px-Add_the_gateway.png||height="363" width="600"]] 71 71 ... ... @@ -109,11 +109,13 @@ 109 109 110 110 Below is examples: 111 111 112 -{{{Connect to your server via MQTT: 113 -MQTT Client ID: Any 114 -Protocol:mqtt/tcp Server IP:loraserver_ip:1883 112 +(% class="box" %) 113 +((( 114 +Connect to your server via MQTT: 115 +MQTT Client ID: Any 116 +Protocol:mqtt/tcp Server IP:loraserver_ip:1883 115 115 User name: User name Password: password 116 - }}}118 +))) 117 117 118 118 [[image:https://wiki.dragino.com/images/thumb/0/06/ChirpStack_Down_1.png/600px-ChirpStack_Down_1.png||height="578" width="600"]] 119 119 ... ... @@ -121,23 +121,29 @@ 121 121 122 122 After connect 123 123 124 -{{{Subscribe : Format:application/ID/device/ Device EUI/rx 126 +(% class="box" %) 127 +((( 128 +Subscribe : Format:application/ID/device/ Device EUI/rx 125 125 Example: application/7/device/00aedb3da649cb23/rx 130 +))) 126 126 127 -Publish: 132 +(% class="box" %) 133 +((( 134 +Publish: 128 128 Format: Top: application/ID/device/ Device EUI/tx 129 129 Payload: {"confirmed":true or false,"fPort":XX,"data":"xxxx"} 130 130 Example: Top: application/7/device/00aedb3da649cb23/tx 131 131 Payload: {"confirmed":true,"fPort":2,"data":"AwEB"} 132 - }}}139 +))) 133 133 134 134 [[image:https://wiki.dragino.com/images/thumb/c/c8/ChirpStack_Down_2.png/600px-ChirpStack_Down_2.png||height="342" width="600"]] 135 135 136 136 MQTT Connect to ChirpStack 137 137 145 +((( 146 +(% style="color:red" %)Note: Chirpstack use base64 to downlink, so need to convert the downlink payload from HEX to base64 [[https:~~/~~/base64.us/>>url:https://base64.us/]] 147 +))) 138 138 139 -Note: Chirpstack use base64 to downlink, so need to convert the downlink payload from HEX to base64 [[https:~~/~~/base64.us/>>url:https://base64.us/]] 140 - 141 141 [[image:https://wiki.dragino.com/images/thumb/f/f8/ChirpStack_Down_3.png/600px-ChirpStack_Down_3.png||height="309" width="600"]] 142 142 143 143 Choose to Use Hex for Encode ... ... @@ -148,7 +148,9 @@ 148 148 149 149 Downlink payload encode javescript code: 可以在网站上运行以下Javsscript代码: 150 150 151 -{{{function sha1_to_base64(sha1) 159 +(% class="box" %) 160 +((( 161 +function sha1_to_base64(sha1) 152 152 { 153 153 var digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 154 154 var base64_rep = ""; ... ... @@ -155,7 +155,7 @@ 155 155 var cnt = 0; 156 156 var bit_arr = 0; 157 157 var bit_num = 0; 158 - 168 + 159 159 for(var n = 0; n < sha1.length; ++n) 160 160 { 161 161 if(sha1[n] >= 'A' && sha1[n] <= 'Z') ... ... @@ -170,25 +170,25 @@ 170 170 { 171 171 ascv = sha1.charCodeAt(n) - 48; 172 172 } 173 - 183 + 174 174 bit_arr = (bit_arr << 4) | ascv; 175 175 bit_num += 4; 176 176 if(bit_num >= 6) 177 177 { 178 - bit_num -= 6; 188 + bit_num -= 6; 179 179 base64_rep += digits[bit_arr >>> bit_num]; 180 - bit_arr &= ~(-1 << bit_num); 190 + bit_arr &= ~~(-1 << bit_num); 181 181 } 182 182 } 183 - 193 + 184 184 if(bit_num > 0) 185 185 { 186 186 bit_arr <<= 6 - bit_num; 187 187 base64_rep += digits[bit_arr]; 188 188 } 189 - 190 - var padding = base64_rep.length % 4; 191 - 199 + 200 + var padding = base64_rep.length % 4; 201 + 192 192 if(padding > 0) 193 193 { 194 194 for(var n = 0; n < 4 - padding; ++n) ... ... @@ -198,17 +198,18 @@ 198 198 } 199 199 return base64_rep; 200 200 } 201 - 211 + 202 202 console.log(sha1_to_base64("data")); 203 - 213 + 204 204 data is downlink payload required by end node. 205 - 206 - result: AwEB 215 +e.g console.log(sha1_to_base64("030101")); 216 + result: AwEB 207 207 AwEB is the 0x030101's base 64 Encode. 208 - 209 - e.g console.log(sha1_to_base64("030000")); 210 - result: AwAA 211 - AwAA is 0x030000's base 64 Encode.}}} 218 + 219 +e.g console.log(sha1_to_base64("030000")); 220 + result: AwAA 221 + AwAA is 0x030000's base 64 Encode. 222 +))) 212 212 213 213 == 4.3 Add the decode function in Chirpstack for the payload == 214 214 ... ... @@ -224,10 +224,13 @@ 224 224 225 225 = 5. Multiply Uplink in ChirpStack = 226 226 238 +((( 227 227 nbtrans field is the value to determine the re-transmission time for unconfirmed uplink data. 240 +))) 228 228 229 - 242 +((( 230 230 ChirpStack will auto adjust nbtrans according to uplink rssi. [[link to source>>url:https://github.com/brocaar/chirpstack-network-server/blob/master/internal/adr/adr.go]] 244 +))) 231 231 232 232 [[image:https://wiki.dragino.com/images/thumb/6/63/Nbtrans_1.png/600px-Nbtrans_1.png||alt="Nbtrans 1.png" height="103" width="600"]] 233 233 ... ... @@ -235,10 +235,13 @@ 235 235 236 236 [[image:https://wiki.dragino.com/images/thumb/1/17/Nbtrans_2.png/300px-Nbtrans_2.png||alt="Nbtrans 2.png" height="462" width="300"]] 237 237 238 - 252 +((( 239 239 Above behaviour will cause the platform shows below two cases of error: 254 +))) 240 240 256 +((( 241 241 Error of duplicate Frame Counter 258 +))) 242 242 243 243 [[image:https://wiki.dragino.com/images/7/7e/Nbtrans_3.png||alt="Nbtrans 3.png" height="677" width="600"]] 244 244 ... ... @@ -314,13 +314,21 @@ 314 314 315 315 [[image:https://wiki.dragino.com/images/8/82/Chirpstacksolution-9.png||alt="Chirpstacksolution-9.png" height="73" width="554"]] 316 316 334 +((( 317 317 For example: adr_plugins=[“adr-setting”] 336 +))) 318 318 319 -* Adding a single plugin format is adr_plugins=["filename"] 338 +* ((( 339 +Adding a single plugin format is adr_plugins=["filename"] 340 +))) 320 320 321 -* Adding multiple plugins The format is adr_plugins=["file name 1", "file name 2",...] 342 +* ((( 343 +Adding multiple plugins The format is adr_plugins=["file name 1", "file name 2",...] 344 +))) 322 322 346 +((( 323 323 Finally, re-run chirpstack-network-server.exe, and then select the plugin you just compiled in Device-profiles, 348 +))) 324 324 325 325 [[image:https://wiki.dragino.com/images/3/39/Chirpstacksolution-10.png||alt="Chirpstacksolution-10.png" height="275" width="554"]] 326 326 ... ... @@ -330,6 +330,10 @@ 330 330 331 331 == 6.1 MIC Mismatch or MIC Failed == 332 332 358 +((( 333 333 When the device is registered or the device is working normally, the problem of MIC mismatch and MIC failed occurs. 360 +))) 334 334 362 +((( 335 335 Under normal circumstances, users need to change the APPKEY to solve this problem. 364 +)))