<
From version < 1.2 >
edited by Xiaoling
on 2022/05/16 11:21
To version < 1.4 >
edited by Xiaoling
on 2022/05/16 11:44
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -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 -}}}
34 +(% class="box" %)
35 +(((
36 + Windows       ~-~->Network-server server * : localhost:8000
37 + Linux         ~-~->Network-server server * : chirpstack-network-server:8000
38 +)))
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.
60 +(% 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,7 @@
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.
68 +(% style="color:red" %)**Note : The Gateway EUI and server addresses must match the ChirpStack configuration.**
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  
... ... @@ -107,11 +107,13 @@
107 107  
108 108  Below is examples:
109 109  
110 -{{{Connect to your server via MQTT:
111 -MQTT Client ID: Any
112 -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
113 113  User name: User name Password: password
114 -}}}
118 +)))
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  
... ... @@ -119,23 +119,29 @@
119 119  
120 120  After connect
121 121  
122 -{{{Subscribe : Format:application/ID/device/ Device EUI/rx
126 +(% class="box" %)
127 +(((
128 +Subscribe : Format:application/ID/device/ Device EUI/rx
123 123  Example: application/7/device/00aedb3da649cb23/rx
130 +)))
124 124  
125 -Publish:
132 +(% class="box" %)
133 +(((
134 +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 -}}}
139 +)))
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  
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 +)))
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
... ... @@ -146,7 +146,9 @@
146 146  
147 147  Downlink payload encode javescript code: 可以在网站上运行以下Javsscript代码:
148 148  
149 -{{{function sha1_to_base64(sha1)
159 +(% class="box" %)
160 +(((
161 +function sha1_to_base64(sha1)
150 150  {
151 151   var digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
152 152   var base64_rep = "";
... ... @@ -153,7 +153,7 @@
153 153   var cnt = 0;
154 154   var bit_arr = 0;
155 155   var bit_num = 0;
156 - 
168 +
157 157   for(var n = 0; n < sha1.length; ++n)
158 158   {
159 159   if(sha1[n] >= 'A' && sha1[n] <= 'Z')
... ... @@ -168,25 +168,25 @@
168 168   {
169 169   ascv = sha1.charCodeAt(n) - 48;
170 170   }
171 - 
183 +
172 172   bit_arr = (bit_arr << 4) | ascv;
173 173   bit_num += 4;
174 174   if(bit_num >= 6)
175 175   {
176 - bit_num -= 6;
188 + bit_num -= 6;        
177 177   base64_rep += digits[bit_arr >>> bit_num];
178 - bit_arr &= ~(-1 << bit_num);
190 + bit_arr &= ~~(-1 << bit_num);
179 179   }
180 180   }
181 - 
193 +
182 182   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 - 
199 +
200 + var padding = base64_rep.length % 4;   
201 +
190 190   if(padding > 0)
191 191   {
192 192   for(var n = 0; n < 4 - padding; ++n)
... ... @@ -196,17 +196,18 @@
196 196   }
197 197   return base64_rep;
198 198  }
199 - 
211 +
200 200  console.log(sha1_to_base64("data"));
201 - 
213 +
202 202  data is downlink payload required by end node.
203 - e.g console.log(sha1_to_base64("030101"));
204 - ​result: AwEB
215 +e.g console.log(sha1_to_base64("030101"));
216 + ​result: AwEB     
205 205   AwEB is the 0x030101's base 64 Encode.
206
207 - ​e.g console.log(sha1_to_base64("030000"));
208 - ​result: AwAA
209 - 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 +)))
210 210  
211 211  == 4.3 Add the decode function in Chirpstack for the payload ==
212 212  
... ... @@ -222,10 +222,13 @@
222 222  
223 223  = 5. Multiply Uplink in ChirpStack =
224 224  
238 +(((
225 225  nbtrans field is the value to determine the re-transmission time for unconfirmed uplink data.
240 +)))
226 226  
227 -
242 +(((
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]]
244 +)))
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  
... ... @@ -233,10 +233,13 @@
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 -
252 +(((
237 237  Above behaviour will cause the platform shows below two cases of error:
254 +)))
238 238  
256 +(((
239 239  Error of duplicate Frame Counter
258 +)))
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  
... ... @@ -312,13 +312,21 @@
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  
334 +(((
315 315  For example: adr_plugins=[“adr-setting”]
336 +)))
316 316  
317 -* Adding a single plugin format is adr_plugins=["filename"]
338 +* (((
339 +Adding a single plugin format is adr_plugins=["filename"]
340 +)))
318 318  
319 -* 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 +)))
320 320  
346 +(((
321 321  Finally, re-run chirpstack-network-server.exe, and then select the plugin you just compiled in Device-profiles,
348 +)))
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  
358 +(((
331 331  When the device is registered or the device is working normally, the problem of MIC mismatch and MIC failed occurs.
360 +)))
332 332  
362 +(((
333 333  Under normal circumstances, users need to change the APPKEY to solve this problem.
364 +)))
Copyright ©2010-2022 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0