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
-
... ... @@ -6,7 +6,9 @@ 6 6 7 7 The ChirpStack open-source LoRaWAN Network Server stack provides open-source components for LoRaWAN networks And the Chirpstack supports the users in building a private LoRaWAN Server. For more info please refer to this [[link>>url:https://www.chirpstack.io/]] 8 8 9 +((( 9 9 The dragino gateway can connect the ChirpStack server via Semtech UDP or Semtech Basic Station. 11 +))) 10 10 11 11 **Prerequisite** 12 12 ... ... @@ -20,10 +20,12 @@ 20 20 21 21 (% class="box" %) 22 22 ((( 25 +((( 23 23 Semtech UDP : **All Model** 24 24 Basic Station : , , 25 25 **Note** : the firmware needs > if use the Bais station 26 26 ))) 30 +))) 27 27 28 28 = 2. Semtech UDP = 29 29 ... ... @@ -31,9 +31,11 @@ 31 31 32 32 The network-Servers address varies depending on the ChirpStack server setup environment 33 33 34 -{{{ Windows -->Network-server server * : localhost:8000 35 - Linux -->Network-server server * : chirpstack-network-server:8000 36 -}}} 38 +(% class="box" %) 39 +((( 40 + Windows ~-~->Network-server server * : localhost:8000 41 + Linux ~-~->Network-server server * : chirpstack-network-server:8000 42 +))) 37 37 38 38 If the user cannot add network-Servers, re-check the ChirpStack code or the server building process. 39 39 ... ... @@ -55,7 +55,7 @@ 55 55 56 56 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. 57 57 58 -Note : Before add the gateway, the user needs to complete the preceding three steps. 64 +(% style="color:red" %)**Note : Before add the gateway, the user needs to complete the preceding three steps.** 59 59 60 60 If the user has completed the preceding steps, proceed to the next step. 61 61 ... ... @@ -63,7 +63,9 @@ 63 63 64 64 The example gateway id is: a840411e96744150 65 65 66 -Note : The Gateway EUI and server addresses must match the ChirpStack configuration. 72 +((( 73 +(% style="color:red" %)**Note : The Gateway EUI and server addresses must match the ChirpStack configuration.** 74 +))) 67 67 68 68 [[image:https://wiki.dragino.com/images/thumb/c/c6/Add_the_gateway.png/600px-Add_the_gateway.png||height="363" width="600"]] 69 69 ... ... @@ -105,37 +105,51 @@ 105 105 106 106 User can use MQTT to send downlink payload to ChirpStack to perform downstream to LoRaWAN End 107 107 116 +((( 108 108 Below is examples: 118 +))) 109 109 110 -{{{Connect to your server via MQTT: 111 -MQTT Client ID: Any 112 -Protocol:mqtt/tcp Server IP:loraserver_ip:1883 120 +(% class="box" %) 121 +((( 122 +Connect to your server via MQTT: 123 +MQTT Client ID: Any 124 +Protocol:mqtt/tcp Server IP:loraserver_ip:1883 113 113 User name: User name Password: password 114 - }}}126 +))) 115 115 116 116 [[image:https://wiki.dragino.com/images/thumb/0/06/ChirpStack_Down_1.png/600px-ChirpStack_Down_1.png||height="578" width="600"]] 117 117 130 +((( 118 118 MQTT Connect to ChirpStack 132 +))) 119 119 134 +((( 120 120 After connect 136 +))) 121 121 122 -{{{Subscribe : Format:application/ID/device/ Device EUI/rx 138 +(% class="box" %) 139 +((( 140 +Subscribe : Format:application/ID/device/ Device EUI/rx 123 123 Example: application/7/device/00aedb3da649cb23/rx 142 +))) 124 124 125 -Publish: 144 +(% class="box" %) 145 +((( 146 +Publish: 126 126 Format: Top: application/ID/device/ Device EUI/tx 127 127 Payload: {"confirmed":true or false,"fPort":XX,"data":"xxxx"} 128 128 Example: Top: application/7/device/00aedb3da649cb23/tx 129 129 Payload: {"confirmed":true,"fPort":2,"data":"AwEB"} 130 - }}}151 +))) 131 131 132 132 [[image:https://wiki.dragino.com/images/thumb/c/c8/ChirpStack_Down_2.png/600px-ChirpStack_Down_2.png||height="342" width="600"]] 133 133 134 134 MQTT Connect to ChirpStack 135 135 157 +((( 158 +(% 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/]] 159 +))) 136 136 137 -Note: Chirpstack use base64 to downlink, so need to convert the downlink payload from HEX to base64 [[https:~~/~~/base64.us/>>url:https://base64.us/]] 138 - 139 139 [[image:https://wiki.dragino.com/images/thumb/f/f8/ChirpStack_Down_3.png/600px-ChirpStack_Down_3.png||height="309" width="600"]] 140 140 141 141 Choose to Use Hex for Encode ... ... @@ -144,9 +144,13 @@ 144 144 145 145 [[image:https://wiki.dragino.com/images/thumb/d/d2/ChirpStack_Down_4.png/600px-ChirpStack_Down_4.png||alt="ChirpStack Down 4.png" height="344" width="600"]] 146 146 169 +((( 147 147 Downlink payload encode javescript code: 可以在网站上运行以下Javsscript代码: 171 +))) 148 148 149 -{{{function sha1_to_base64(sha1) 173 +(% class="box" %) 174 +((( 175 +function sha1_to_base64(sha1) 150 150 { 151 151 var digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 152 152 var base64_rep = ""; ... ... @@ -153,8 +153,7 @@ 153 153 var cnt = 0; 154 154 var bit_arr = 0; 155 155 var bit_num = 0; 156 - 157 - for(var n = 0; n < sha1.length; ++n) 182 +\\ for(var n = 0; n < sha1.length; ++n) 158 158 { 159 159 if(sha1[n] >= 'A' && sha1[n] <= 'Z') 160 160 { ... ... @@ -168,26 +168,22 @@ 168 168 { 169 169 ascv = sha1.charCodeAt(n) - 48; 170 170 } 171 - 172 - bit_arr = (bit_arr << 4) | ascv; 196 +\\ bit_arr = (bit_arr << 4) | ascv; 173 173 bit_num += 4; 174 174 if(bit_num >= 6) 175 175 { 176 - bit_num -= 6; 200 + bit_num -= 6; 177 177 base64_rep += digits[bit_arr >>> bit_num]; 178 - bit_arr &= ~(-1 << bit_num); 202 + bit_arr &= ~~(-1 << bit_num); 179 179 } 180 180 } 181 - 182 - if(bit_num > 0) 205 +\\ if(bit_num > 0) 183 183 { 184 184 bit_arr <<= 6 - bit_num; 185 185 base64_rep += digits[bit_arr]; 186 186 } 187 - 188 - var padding = base64_rep.length % 4; 189 - 190 - if(padding > 0) 210 +\\ var padding = base64_rep.length % 4; 211 +\\ if(padding > 0) 191 191 { 192 192 for(var n = 0; n < 4 - padding; ++n) 193 193 { ... ... @@ -196,17 +196,15 @@ 196 196 } 197 197 return base64_rep; 198 198 } 199 - 200 -console.log(sha1_to_base64("data")); 201 - 202 -data is downlink payload required by end node. 203 - e.g console.log(sha1_to_base64("030101")); 204 - result: AwEB 220 +\\console.log(sha1_to_base64("data")); 221 +\\data is downlink payload required by end node. 222 +e.g console.log(sha1_to_base64("030101")); 223 + result: AwEB 205 205 AwEB is the 0x030101's base 64 Encode. 206 - 207 - e .g console.log(sha1_to_base64("030000"));208 - result:AwAA209 - AwAA is 0x030000's base 64 Encode.}}}225 +\\e.g console.log(sha1_to_base64("030000")); 226 + result: AwAA 227 + AwAA is 0x030000's base 64 Encode. 228 +))) 210 210 211 211 == 4.3 Add the decode function in Chirpstack for the payload == 212 212 ... ... @@ -222,21 +222,29 @@ 222 222 223 223 = 5. Multiply Uplink in ChirpStack = 224 224 244 +((( 225 225 nbtrans field is the value to determine the re-transmission time for unconfirmed uplink data. 246 +))) 226 226 227 - 248 +((( 228 228 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]] 250 +))) 229 229 230 230 [[image:https://wiki.dragino.com/images/thumb/6/63/Nbtrans_1.png/600px-Nbtrans_1.png||alt="Nbtrans 1.png" height="103" width="600"]] 231 231 254 +((( 232 232 nbtrans is a field of ADR message, in unconfirm mode, it tells end node how many time it needs to transmit for every frame. 256 +))) 233 233 234 234 [[image:https://wiki.dragino.com/images/thumb/1/17/Nbtrans_2.png/300px-Nbtrans_2.png||alt="Nbtrans 2.png" height="462" width="300"]] 235 235 236 - 260 +((( 237 237 Above behaviour will cause the platform shows below two cases of error: 262 +))) 238 238 264 +((( 239 239 Error of duplicate Frame Counter 266 +))) 240 240 241 241 [[image:https://wiki.dragino.com/images/7/7e/Nbtrans_3.png||alt="Nbtrans 3.png" height="677" width="600"]] 242 242 ... ... @@ -248,7 +248,9 @@ 248 248 249 249 This example uses the Windows version as a template, other versions can refer to this. Similiar reference: [[https:~~/~~/confluence.alitecs.de/plugins/servlet/mobile?contentId=79790102#content/view/79790102>>url:https://confluence.alitecs.de/plugins/servlet/mobile?contentId=79790102#content/view/79790102]] 250 250 278 +((( 251 251 ~1. Install the GO compilation environment: Download the corresponding version of the Go compiler at [[https:~~/~~/go.dev/dl/>>url:https://go.dev/dl/]] and install it. 280 +))) 252 252 253 253 [[image:https://wiki.dragino.com/images/3/37/Chirpstacksolution-1.png||alt="Chirpstacksolution-1.png" height="199" width="554"]] 254 254 ... ... @@ -256,11 +256,17 @@ 256 256 257 257 [[image:https://wiki.dragino.com/images/c/ca/Chirpstacksolution-2.png||alt="Chirpstacksolution-2.png" height="283" width="361"]] 258 258 288 +((( 259 259 2. Environment variable settings:. 290 +))) 260 260 292 +((( 261 261 1) Open Computer -> Properties -> Advanced System Settings -> Environment Variables and add a "new" system variable: 294 +))) 262 262 296 +((( 263 263 2)Set the variable name GOROOT and the variable value C:\Go\ (installation directory) 298 +))) 264 264 265 265 [[image:https://wiki.dragino.com/images/f/f9/Chirpstacksolution-3.png||alt="Chirpstacksolution-3.png" height="152" width="554"]] 266 266 ... ... @@ -308,17 +308,35 @@ 308 308 309 309 5. Add the plugin and run the plugin. 310 310 346 +((( 311 311 The exe file generated in the previous step is placed in the same root directory as chirpstack-network-server.toml, and the ADR plugin is added to the toml file. The location of the addition is as follows: 348 +))) 312 312 313 313 [[image:https://wiki.dragino.com/images/8/82/Chirpstacksolution-9.png||alt="Chirpstacksolution-9.png" height="73" width="554"]] 314 314 352 +((( 353 +((( 315 315 For example: adr_plugins=[“adr-setting”] 355 +))) 356 +))) 316 316 317 -* Adding a single plugin format is adr_plugins=["filename"] 358 +* ((( 359 +((( 360 +Adding a single plugin format is adr_plugins=["filename"] 361 +))) 362 +))) 318 318 319 -* Adding multiple plugins The format is adr_plugins=["file name 1", "file name 2",...] 364 +* ((( 365 +((( 366 +Adding multiple plugins The format is adr_plugins=["file name 1", "file name 2",...] 367 +))) 368 +))) 320 320 370 +((( 371 +((( 321 321 Finally, re-run chirpstack-network-server.exe, and then select the plugin you just compiled in Device-profiles, 373 +))) 374 +))) 322 322 323 323 [[image:https://wiki.dragino.com/images/3/39/Chirpstacksolution-10.png||alt="Chirpstacksolution-10.png" height="275" width="554"]] 324 324 ... ... @@ -328,6 +328,10 @@ 328 328 329 329 == 6.1 MIC Mismatch or MIC Failed == 330 330 384 +((( 331 331 When the device is registered or the device is working normally, the problem of MIC mismatch and MIC failed occurs. 386 +))) 332 332 388 +((( 333 333 Under normal circumstances, users need to change the APPKEY to solve this problem. 390 +)))