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

Summary

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 -(% style="color:red" %)**Note : Before add the gateway, the user needs to complete the preceding three steps.**
60 +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 -(% style="color:red" %)**Note : The Gateway EUI and server addresses must match the ChirpStack configuration.**
68 +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,13 +109,11 @@
109 109  
110 110  Below is examples:
111 111  
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
112 +{{{Connect to your server via MQTT:
113 +MQTT Client ID: Any
114 +Protocol:mqtt/tcp Server IP:loraserver_ip:1883
117 117  User name: User name Password: password
118 -)))
116 +}}}
119 119  
120 120  [[image:https://wiki.dragino.com/images/thumb/0/06/ChirpStack_Down_1.png/600px-ChirpStack_Down_1.png||height="578" width="600"]]
121 121  
... ... @@ -123,29 +123,23 @@
123 123  
124 124  After connect
125 125  
126 -(% class="box" %)
127 -(((
128 -Subscribe : Format:application/ID/device/ Device EUI/rx
124 +{{{Subscribe : Format:application/ID/device/ Device EUI/rx
129 129  Example: application/7/device/00aedb3da649cb23/rx
130 -)))
131 131  
132 -(% class="box" %)
133 -(((
134 -Publish:
127 +Publish:
135 135  Format: Top: application/ID/device/ Device EUI/tx
136 136  Payload: {"confirmed":true or false,"fPort":XX,"data":"xxxx"}
137 137  Example: Top: application/7/device/00aedb3da649cb23/tx
138 138  Payload: {"confirmed":true,"fPort":2,"data":"AwEB"}
139 -)))
132 +}}}
140 140  
141 141  [[image:https://wiki.dragino.com/images/thumb/c/c8/ChirpStack_Down_2.png/600px-ChirpStack_Down_2.png||height="342" width="600"]]
142 142  
143 143  MQTT Connect to ChirpStack
144 144  
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 -)))
148 148  
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 +
149 149  [[image:https://wiki.dragino.com/images/thumb/f/f8/ChirpStack_Down_3.png/600px-ChirpStack_Down_3.png||height="309" width="600"]]
150 150  
151 151  Choose to Use Hex for Encode
... ... @@ -156,9 +156,7 @@
156 156  
157 157  Downlink payload encode javescript code: 可以在网站上运行以下Javsscript代码:
158 158  
159 -(% class="box" %)
160 -(((
161 -function sha1_to_base64(sha1)
151 +{{{function sha1_to_base64(sha1)
162 162  {
163 163   var digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
164 164   var base64_rep = "";
... ... @@ -165,7 +165,7 @@
165 165   var cnt = 0;
166 166   var bit_arr = 0;
167 167   var bit_num = 0;
168 -
158 + 
169 169   for(var n = 0; n < sha1.length; ++n)
170 170   {
171 171   if(sha1[n] >= 'A' && sha1[n] <= 'Z')
... ... @@ -180,25 +180,25 @@
180 180   {
181 181   ascv = sha1.charCodeAt(n) - 48;
182 182   }
183 -
173 + 
184 184   bit_arr = (bit_arr << 4) | ascv;
185 185   bit_num += 4;
186 186   if(bit_num >= 6)
187 187   {
188 - bit_num -= 6;        
178 + bit_num -= 6;
189 189   base64_rep += digits[bit_arr >>> bit_num];
190 - bit_arr &= ~~(-1 << bit_num);
180 + bit_arr &= ~(-1 << bit_num);
191 191   }
192 192   }
193 -
183 + 
194 194   if(bit_num > 0)
195 195   {
196 196   bit_arr <<= 6 - bit_num;
197 197   base64_rep += digits[bit_arr];
198 198   }
199 -
200 - var padding = base64_rep.length % 4;   
201 -
189 + 
190 + var padding = base64_rep.length % 4;
191 + 
202 202   if(padding > 0)
203 203   {
204 204   for(var n = 0; n < 4 - padding; ++n)
... ... @@ -208,18 +208,17 @@
208 208   }
209 209   return base64_rep;
210 210  }
211 -
201 + 
212 212  console.log(sha1_to_base64("data"));
213 -
203 + 
214 214  data is downlink payload required by end node.
215 -e.g console.log(sha1_to_base64("030101"));
216 - ​result: AwEB     
205 + e.g console.log(sha1_to_base64("030101"));
206 + ​result: AwEB
217 217   AwEB is the 0x030101'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 -)))
208
209 + ​e.g console.log(sha1_to_base64("030000"));
210 + ​result: AwAA
211 + AwAA is 0x030000's base 64 Encode.}}}
223 223  
224 224  == 4.3 Add the decode function in Chirpstack for the payload ==
225 225  
... ... @@ -235,13 +235,10 @@
235 235  
236 236  = 5. Multiply Uplink in ChirpStack =
237 237  
238 -(((
239 239  nbtrans field is the value to determine the re-transmission time for unconfirmed uplink data.
240 -)))
241 241  
242 -(((
229 +
243 243  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 -)))
245 245  
246 246  [[image:https://wiki.dragino.com/images/thumb/6/63/Nbtrans_1.png/600px-Nbtrans_1.png||alt="Nbtrans 1.png" height="103" width="600"]]
247 247  
... ... @@ -249,13 +249,10 @@
249 249  
250 250  [[image:https://wiki.dragino.com/images/thumb/1/17/Nbtrans_2.png/300px-Nbtrans_2.png||alt="Nbtrans 2.png" height="462" width="300"]]
251 251  
252 -(((
238 +
253 253  Above behaviour will cause the platform shows below two cases of error:
254 -)))
255 255  
256 -(((
257 257  Error of duplicate Frame Counter
258 -)))
259 259  
260 260  [[image:https://wiki.dragino.com/images/7/7e/Nbtrans_3.png||alt="Nbtrans 3.png" height="677" width="600"]]
261 261  
... ... @@ -331,21 +331,13 @@
331 331  
332 332  [[image:https://wiki.dragino.com/images/8/82/Chirpstacksolution-9.png||alt="Chirpstacksolution-9.png" height="73" width="554"]]
333 333  
334 -(((
335 335  For example: adr_plugins=[“adr-setting”]
336 -)))
337 337  
338 -* (((
339 -Adding a single plugin format is adr_plugins=["filename"]
340 -)))
319 +* Adding a single plugin format is adr_plugins=["filename"]
341 341  
342 -* (((
343 -Adding multiple plugins The format is adr_plugins=["file name 1", "file name 2",...]
344 -)))
321 +* Adding multiple plugins The format is adr_plugins=["file name 1", "file name 2",...]
345 345  
346 -(((
347 347  Finally, re-run chirpstack-network-server.exe, and then select the plugin you just compiled in Device-profiles,
348 -)))
349 349  
350 350  [[image:https://wiki.dragino.com/images/3/39/Chirpstacksolution-10.png||alt="Chirpstacksolution-10.png" height="275" width="554"]]
351 351  
... ... @@ -355,10 +355,6 @@
355 355  
356 356  == 6.1 MIC Mismatch or MIC Failed ==
357 357  
358 -(((
359 359  When the device is registered or the device is working normally, the problem of MIC mismatch and MIC failed occurs.
360 -)))
361 361  
362 -(((
363 363  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