Version 427.1 by Bei Jinggeng on 2022/08/24 09:33

Show last authors
1 (% style="display:none" %) (%%) ​​​(% style="display:none" %)
2
3 (% style="text-align:center" %)
4 [[image:image-20220627094803-5.png||height="366" width="804"]]
5
6
7 (% style="display:none" %) (%%)
8
9
10
11
12
13
14
15 **Table of Contents:**
16
17 (% _mstaria-label="285168" aria-label="macro:toc widget" contenteditable="false" role="region" tabindex="-1" %)
18 (((
19 (% style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||height="15" role="presentation" title="Click and drag to move" width="15"]]
20 )))
21
22 {{toc/}}
23
24
25
26
27
28
29
30
31
32
33 = 1.  Introduction =
34
35
36 == 1.1 ​ What is LSN50 LoRa Sensor Node ==
37
38
39 (((
40 (((
41 LSN50 is a Long Range LoRaWAN Sensor Node. It is designed for (% style="color:#4472c4" %)**outdoor data logging **(%%)and powered by (% style="color:#4472c4" %)**Li/SOCl2 battery**(%%) for long term use and secure data transmission. It is designed to facilitate developers to quickly deploy industrial level LoRa and IoT solutions. It helps users to turn the idea into a practical application and make the Internet of Things a reality. It is easy to program, create and connect your things everywhere.
42 )))
43
44 (((
45 It is based on SX1276/SX1278 allows the user to send data and reach extremely long ranges at low data-rates. It provides ultra-long range spread spectrum communication and high interference immunity whilst minimizing current consumption. It targets professional wireless sensor network applications such as irrigation systems, smart metering, smart cities, smartphone detection, building automation, and so on.
46 )))
47
48 (((
49 (% style="color:#4472c4" %)**LSN50**(%%) uses STM32l0x chip from ST, STML0x is the (% style="color:#4472c4" %)**ultra-low-power**(%%) STM32L072xx microcontrollers incorporate the connectivity power of the universal serial bus (USB 2.0 crystal-less) with the high-performance ARM® Cortex®-M0+ 32-bit RISC core operating at a 32 MHz frequency, a memory protection unit (MPU), high-speed embedded memories (192 Kbytes of Flash program memory, 6 Kbytes of data EEPROM and 20 Kbytes of RAM) plus an extensive range of enhanced I/Os and peripherals.
50 )))
51
52 (((
53 LSN50 is an (% style="color:#4472c4" %)**open source product**(%%), it is based on the STM32Cube HAL drivers and lots of libraries can be found in ST site for rapid development.
54 )))
55 )))
56
57
58 [[image:1656294562709-486.png]]
59
60
61
62 == 1.2  Specifications ==
63
64
65 (% style="color:#037691" %)**Micro Controller:**
66
67 * STM32L072CZT6 MCU
68 * MCU: STM32L072CZT6
69 * Flash: 192KB
70 * RAM: 20KB
71 * EEPROM: 6KB
72 * Clock Speed: 32Mhz
73
74 (% style="color:#037691" %)**Common DC Characteristics:**
75
76 * Supply Voltage: 2.1v ~~ 3.6v
77 * Operating Temperature: -40 ~~ 85°C
78 * I/O pins: Refer to STM32L072 datasheet
79
80 (% style="color:#037691" %)**LoRa Spec:**
81
82 * Frequency Range,
83 ** Band 1 (HF): 862 ~~ 1020 Mhz
84
85 or
86
87 *
88 ** Band 2 (LF): 410 ~~ 528 Mhz
89 * 168 dB maximum link budget.
90 * +20 dBm - 100 mW constant RF output vs.
91 * +14 dBm high efficiency PA.
92 * Programmable bit rate up to 300 kbps.
93 * High sensitivity: down to -148 dBm.
94 * Bullet-proof front end: IIP3 = -12.5 dBm.
95 * Excellent blocking immunity.
96 * Low RX current of 10.3 mA, 200 nA register retention.
97 * Fully integrated synthesizer with a resolution of 61 Hz .
98 * FSK, GFSK, MSK, GMSK, LoRaTM and OOK modulation.
99 * Built-in bit synchronizer for clock recovery.
100 * Preamble detection.
101 * 127 dB Dynamic Range RSSI.
102 * Automatic RF Sense and CAD with ultra-fast AFC.
103 * Packet engine up to 256 bytes with CRC.
104 * LoRaWAN 1.0.2 Specification
105
106 (% style="color:#037691" %)**Battery:**
107
108 * Li/SOCI2 un-chargeable battery
109 * Capacity: 4000mAh
110 * Self Discharge: <1% / Year @ 25°C
111 * Max continuously current: 130mA
112 * Max boost current: 2A, 1 second
113
114 (% style="color:#037691" %)**Power Consumption**
115
116 * STOP Mode: 2.7uA @ 3.3v
117 * LoRa Transmit Mode: 125mA @ 20dBm 44mA @ 14dBm
118
119
120 == ​1.3  Features ==
121
122
123 * LoRaWAN 1.0.3 Class A, Class C
124 * STM32L072CZT6 MCU
125 * SX1276/78 Wireless Chip
126 * Pre-load bootloader on USART1/USART2
127 * MDK-ARM Version 5.24a IDE
128 * I2C, LPUSART1, USB, SPI2
129 * 3x12bit ADC, 1x12bit DAC
130 * 20xDigital I/Os
131 * LoRa™ Modem
132 * Preamble detection
133 * Baud rate configurable
134 * CN470/EU433/KR920/US915/IN865
135 * EU868/AS923/AU915
136 * Open-source hardware / software
137 * Available Band:433/868/915/920 Mhz
138 * IP66 Waterproof Enclosure
139 * Ultra-Low Power consumption
140 * AT Commands to change parameters
141 * 4000mAh or 8500mAh Battery for long term use。
142
143
144 == 1.4 ​ Applications ==
145
146
147 * Smart Buildings & Home Automation
148 * Logistics and Supply Chain Management
149 * Smart Metering
150 * Smart Agriculture
151 * Smart Cities
152 * Smart Factory
153
154
155 == 1.5  Pin Definitions and Switch ==
156
157
158 (% class="wikigeneratedid" %)
159 [[image:1656295519542-152.png||height="413" width="728"]]
160
161
162 (% class="wikigeneratedid" %)
163 [[image:1656295532863-613.png||height="371" width="721"]]
164
165
166 (% class="wikigeneratedid" %)
167 [[image:image-20220627101527-1.png]]
168
169
170
171 === 1.5.1 Jumper JP2 ===
172
173
174 Power on Device when put this jumper.
175
176
177
178 === 1.5.2 BOOT MODE / SW1 ===
179
180
181 (((
182 ~1. ISP:  upgrade mode, device won't have any signal in this mode. but ready for upgrade firmware. LED won't work. Firmware won't run.
183 )))
184
185 (((
186 2. Flash:  work mode, device starts to work and send out console output for further debug
187 )))
188
189
190
191 === 1.5.3 Reset Button ===
192
193
194 Press to reboot the device.
195
196
197
198 === 1.5.4 LED ===
199
200
201 It will flash:
202
203 1. When boot the device in flash mode
204 1. Send an uplink packet
205
206
207 === 1.6  Hardware Change log ===
208
209
210 (% style="color:red" %)**Note: Hardware version is marked in the PCB.**
211
212
213 (% style="color:#4472c4" %)**LSN50 v2.1:**
214
215 1. Change R14 to 1M ohm
216 1. Change R3, R4 to 4.7Kohm. So no need to modify them for 3 DS18B20 connection.
217 1. Add ESD to each I/O
218
219 (% style="color:#4472c4" %)**LSN50 v2.0:**
220
221 * Change to a new enclosure. Improve with external antenna, IP68, ear hook.
222
223 (% style="color:#4472c4" %)**LSN50 v1.3**:
224
225 * Add P-MOS to control 5V output
226
227 (% style="color:#4472c4" %)**LSN50 v1.2**:
228
229 * Add LED. Turn on for every LoRa transmit
230 * Add pin PA4, PB13, NRST
231 * Add 5V Output, on/off control by PB5(Low to Enable, High to Disable)
232
233
234 == 1.7  Hole Option ==
235
236
237 The LSN50 provides different hole size options for different size sensor cable. The options provided are M12, M16 and M20. The definition is as below:
238
239 [[image:image-20220627104757-1.png]]
240
241
242 [[image:1656298089706-973.png]]
243
244
245
246 = 2.  Use LSN50 with LoRaWAN firmware =
247
248
249 == 2.1  How it works ==
250
251
252 (((
253 (((
254 The LSN50 is pre-loaded with a firmware and is configured as LoRaWAN OTAA Class A mode by default. It has OTAA keys to join LoRaWAN network. To connect a local LoRaWAN network, you just need to input the OTAA keys in the LoRaWAN IoT server and power on the LSN50. It will automatically join the network via OTAA.
255 )))
256
257 (((
258
259 )))
260
261 (((
262 The diagram below shows the working flow in default firmware (ver 1.8.0): 
263 )))
264
265 [[image:image-20220823174408-9.png||height="890" width="657"]]
266
267
268
269 (((
270 In case you can't set the OTAA keys in the LoRaWAN OTAA server, and you have to use the keys from the server, you can [[use AT Commands>>||anchor="H3.A0UsingtheATCommands"]] to set the keys in the LSN50.
271 )))
272 )))
273
274
275
276 == 2.2  ​Quick guide to connect to LoRaWAN server (OTAA) ==
277
278
279 (((
280 Following is an example for how to join the [[TTN V3 LoRaWAN Network>>url:http://www.thethingsnetwork.org/]]. Below is the network structure; we use the [[LG308>>url:http://www.dragino.com/products/lora/item/140-lg308.html]] as a LoRaWAN gateway in this example. 
281
282
283 (% style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]][[image:1655891470063-521.png]](% title="Click and drag to resize" %)​[[image:1656298385089-555.png]]
284
285
286 )))
287
288 (% _mstmutation="1" title="Click and drag to resize" %)​(%%)The LG308 is already set to connected to [[TTN V3 network >>url:https://www.thethingsnetwork.org/||_mstmutation="1"]], so what we need to now is configure the TTN V3 server.(% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]][[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% title="Click and drag to resize" %)​(% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)​(%%)​
289
290 (((
291
292
293 (% style="color:blue" %)**Step 1**(%%): Create a device in TTN with the OTAA keys from LSN50.
294
295 Each LSN50is shipped with a sticker with the default device EUI as below:
296 )))
297
298 (((
299
300 )))
301
302 (% _mstaria-label="1059162" aria-label="image-20220607170145-1.jpeg image widget" contenteditable="false" role="region" tabindex="-1" %)[[image:image-20220607170145-1.jpeg||data-widget="image"]](% style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% title="Click and drag to resize" %)​(% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" title="Click and drag to resize" %)​(% title="Click and drag to resize" %)​(% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" title="Click and drag to resize" %)​(% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]][[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% title="Click and drag to resize" %)​(% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)​(%%)​
303
304
305 (((
306 (((
307 You can enter this key in the LoRaWAN Server portal. Below is TTN screen shot:
308 )))
309
310 (((
311 **Register the device:**
312 )))
313 )))
314
315 (% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" title="Click and drag to resize" %)​(% title="Click and drag to resize" %)​(% _mstaria-label="795587" aria-label="1654935135620-998.png image widget" contenteditable="false" role="region" tabindex="-1" %)[[image:1654935135620-998.png||data-widget="image"]](% style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](%%)​(% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" title="Click and drag to resize" %)​(% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" title="Click and drag to resize" %)​(% title="Click and drag to resize" %)​​
316
317 (% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" title="Click and drag to resize" %)​(% title="Click and drag to resize" %)​
318
319
320 **Add APP EUI and DEV EUI:**
321
322
323 (% _mstaria-label="1002404" aria-label="image-20220611161308-4.png image widget" contenteditable="false" role="region" tabindex="-1" %)[[image:image-20220611161308-4.png||data-widget="image" height="551" width="753"]](% style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% title="Click and drag to resize" %)​
324
325
326
327 **Add APP EUI in the application:**
328
329
330 (% _mstaria-label="1002768" aria-label="image-20220611161308-5.png image widget" contenteditable="false" role="region" tabindex="-1" %)[[image:image-20220611161308-5.png||data-widget="image" height="601" width="742"]](% style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% title="Click and drag to resize" %)​
331
332
333 **Add APP KEY**
334
335 (% _mstaria-label="1003132" aria-label="image-20220611161308-6.png image widget" contenteditable="false" role="region" tabindex="-1" %)[[image:image-20220611161308-6.png||data-widget="image" height="485" width="744"]](% style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% title="Click and drag to resize" %)​
336
337 (% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" title="Click and drag to resize" %)​(% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" title="Click and drag to resize" %)​
338
339 (% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" title="Click and drag to resize" %)​(% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]][[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% title="Click and drag to resize" %)​(% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)​(%%)​
340
341 (% style="color:blue" %)**Step 2**(%%)**:** Power on LSN50
342
343 Put a Jumper on JP2 to power on the device.(% style="display:none" %)
344
345 [[image:image-20220627145643-5.png]](% style="display:none" %)
346
347 (% style="display:none" %)
348
349
350 (% style="display:none" %) (%%)
351
352 **For LSn50v2:**
353
354 [[image:1656313034748-905.png]](% style="display:none" %)
355
356
357 (% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" title="Click and drag to resize" %)​(%%)​(% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" title="Click and drag to resize" %)​(% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]][[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% title="Click and drag to resize" %)​(% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)​(%%)​
358
359 (((
360 (((
361 (% style="color:blue" %)**Step 3**(%%)**:**  The LSN50 will auto join to the TTN V3 network. After join success, it will start to upload messages to TTN V3 and you can see the messages in the panel.
362 )))
363 )))
364
365 (% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" title="Click and drag to resize" %)​(% title="Click and drag to resize" %)​[[image:1656312908855-552.png]](% style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]]
366
367 ​(% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" title="Click and drag to resize" %)​(% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||data-widget="image" draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220, 220, 220, 0.5); display:none" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Click and drag to move" width="15"]](% _mstaria-label="548795" aria-label="Data URI image image widget" contenteditable="false" role="region" style="background-image:url(http://wiki1.dragino.com/xwiki/webjars/wiki%3Axwiki/application-ckeditor-webjar/1.61/plugins/widget/images/handle.png); background:rgba(220,220,220,0.5); display:none" tabindex="-1" title="Click and drag to resize" %)​(% title="Click and drag to resize" %)​​
368
369
370 == 2.3  ​Working Mode & Uplink Payload ==
371
372
373 (((
374 LSN50 has different working mode for the connections of different type of sensors. This section describes these modes. Use can use the AT Command AT+MOD to set LSN50 to different working modes.
375 )))
376
377 (((
378 For example:
379 )))
380
381 (((
382 (% _mstmutation="1" style="color:red" %)**AT+MOD=2**(%%) ~/~/ will set the LSN50 to work in MOD=2 distance mode which target to measure distance via Ultrasonic Sensor.
383 )))
384
385 (((
386
387 )))
388
389 (((
390 (% style="color:red" %)**NOTE:**
391 )))
392
393 (((
394 1. Some working modes has payload more than 12 bytes, The US915/AU915/AS923 frequency bands’ definition has maximum 11 bytes in **DR0**. Server sides will see NULL payload while LSn50 transmit in DR0 with 12 bytes payload.
395 1. All modes share the same Payload Explanation from HERE.
396 1. By default, the device will send an uplink message every 5 minutes.
397 )))
398
399
400
401
402
403 === 2.3.1  MOD~=1 (Default Mode) ===
404
405
406 (((
407 In this mode, uplink payload includes in total 11 bytes. Uplink packets use FPORT=2.
408 [[image:image-20220627171207-27.png]]
409
410 [[image:image-20220627150949-6.png]]
411
412
413 )))
414
415
416 === 2.3.2 MOD~=2 (Distance Mode) ===
417
418
419 This mode is target to measure the distance. The payload of this mode is totally 11 bytes. The 8^^th^^ and 9^^th^^ bytes is for the distance.
420
421 [[image:image-20220627180835-31.png]]
422
423
424 [[image:1656324539647-568.png]]
425
426
427
428 (% style="color:red" %)**Connection of LIDAR-Lite V3HP:**
429
430 [[image:1656324581381-162.png]]
431
432
433
434 (% style="color:red" %)**Connection to Ultrasonic Sensor:**
435
436 [[image:1656324598488-204.png]]
437
438
439
440 For the connection to TF-Mini or TF-Luna , MOD2 payload is as below:
441
442 [[image:image-20220628083801-1.png]]
443
444 [[image:1656376779088-686.png]]
445
446
447
448 (% style="color:red" %)**Connection to [[TF-Mini plus>>url:http://en.benewake.com/product/detail/5c345cd0e5b3a844c472329b.html]] LiDAR(UART version):**
449
450 Need to remove R3 and R4 resistors to get low power. Since firmware v1.7.0
451
452 [[image:1656376795715-436.png]]
453
454
455
456 (% style="color:red" %)**Connection to [[TF-Luna>>url:http://en.benewake.com/product/detail/5e1c1fd04d839408076b6255.html]] LiDAR (UART version):**
457
458 Need to remove R3 and R4 resistors to get low power. Since firmware v1.7.0
459
460 [[image:1656376865561-355.png]]
461
462
463 (((
464 Please use firmware version > 1.6.5 when use MOD=2, in this firmware version, user can use LSn50 v1 to power the ultrasonic sensor directly and with low power consumption.
465 )))
466
467
468
469 === 2.3.3 MOD~=3 (3 ADC + I2C) ===
470
471
472 This mode has total 12 bytes. Include 3 x ADC + 1x I2C
473
474 [[image:image-20220628085009-2.png]]
475
476 [[image:1656377431497-975.png]]
477
478
479
480 === 2.3.4 MOD~=4 (3 x DS18B20) ===
481
482
483 This mode is supported in firmware version since v1.6.1. Software set to AT+MOD=4
484
485 Hardware connection is as below,
486
487 (% style="color:red" %)**( Note:**
488
489 * In hardware version v1.x and v2.0 , R3 & R4 should change from 10k to 4.7k ohm to support the other 2 x DS18B20 probes.
490 * In hardware version v2.1 no need to change R3 , R4, by default, they are 4.7k ohm already.
491
492 See [[here>>||anchor="H1.6A0HardwareChangelog" _mstmutation="1"]] for hardware changelog. (% style="color:red" %)**) **
493
494 [[image:1656377461619-156.png]]
495
496
497 This mode has total 11 bytes. As shown below:
498
499 [[image:image-20220628085248-3.png]]
500
501 [[image:1656377606181-607.png]]
502
503
504
505 === 2.3.5 MOD~=5(Weight Measurement by HX711) ===
506
507
508 (((
509 This mode is supported in firmware version since v1.6.2. Please use v1.6.5 firmware version so user no need to use extra LDO for connection.
510 )))
511
512 [[image:1656378224664-860.png]]
513
514
515 Each HX711 need to be calibrated before used. User need to do below two steps:
516
517 1. Zero calibration. Don't put anything on load cell and run **AT+WEIGRE** to calibrate to Zero gram.
518 1. Adjust calibration factor (default value 400): Put a known weight thing on load cell and run **AT+WEIGAP** to adjust the Calibration Factor.
519
520 For example:
521
522 (% style="color:#4472c4" %)**AT+WEIGAP =403.0**
523
524 Response:  Weight is 401 g
525
526
527 Check the response of this command and adjust the value to match the real value for thing.
528
529
530 (% border="1" cellspacing="10" style="background-color:#ffffcc; color:green; width:510px" %)
531 |=(% style="width: 70px;" %)**Size(bytes)**|=(% style="width: 44px;" %)**2**|=(% style="width: 110px;" %)**2**|=(% style="width: 51px;" %)**2**|=(% style="width: 110px;" %)**1**|=(% style="width: 50px;" %)**2**|=(% style="width: 60px;" %)**2**
532 |(% style="width:97px" %)**Value**|(% style="width:44px" %)[[BAT>>||anchor="H2.4.1BatteryInfo"]]|(% style="width:172px" %)(((
533 [[Temperature(DS18B20)>>||anchor="H2.4.2Temperature28DS18B2029"]]
534 )))|(% style="width:51px" %)[[ADC>>||anchor="H2.4.4AnalogueDigitalConverter28ADC29"]]|(% style="width:206px" %)[[Digital in & Digital Interrupt>>||anchor="H2.4.3DigitalInput"]]|(% style="width:72px" %)Weight|(% style="width:81px" %)Reserved
535
536 [[image:image-20220820120036-2.png||height="469" width="1003"]]
537
538
539
540 === 2.3.6 MOD~=6(Counting Mode, Since firmware v1.6.5) ===
541
542
543 (((
544 (((
545 In this mode, the device will work in counting mode. It counts the interrupt on the interrupt pins and sends the count on TDC time.
546 )))
547 )))
548
549 (((
550 (((
551 Connection is as below. The PIR sensor is a count sensor, it will generate interrupt when people come close or go away. User can replace the PIR sensor with other counting sensors.
552 )))
553 )))
554
555
556 [[image:1656378351863-572.png]]
557
558
559 (((
560 (% style="color:red" %)**Note:**(%%) LoRaWAN wireless transmission will infect the PIR sensor. Which cause the counting value increase +1 for every uplink. User can change PIR sensor or put sensor away of the LSN50 to avoid this happen.
561 )))
562
563 (((
564
565 )))
566
567 (% border="1" cellspacing="10" style="background-color:#ffffcc; color:green; width:410px" %)
568 |=(% style="width: 60px;" %)**Size(bytes)**|=(% style="width: 44px;" %)**2**|=(% style="width: 110px;" %)**2**|=(% style="width: 51px;" %)**2**|=(% style="width: 70px;" %)**1**|=(% style="width: 50px;" %)**4**
569 |(% style="width:80px" %)**Value**|(% style="width:44px" %)[[BAT>>||anchor="H2.4.1BatteryInfo"]]|(% style="width:172px" %)(((
570 [[Temperature(DS18B20)>>||anchor="H2.4.2Temperature28DS18B2029"]]
571 )))|(% style="width:51px" %)[[ADC>>||anchor="H2.4.4AnalogueDigitalConverter28ADC29"]]|(% style="width:206px" %)[[Digital in>>||anchor="H2.4.3DigitalInput"]]|(% style="width:72px" %)Count
572
573 [[image:1656378441509-171.png]]
574
575
576
577 === 2.3.7 MOD~=7 Three interrupt contracting modes (the hardware version needs to support three interrupt versions, Since firmware v1.8.0) ===
578
579
580 [[image:image-20220820140109-3.png]]
581
582 (% border="1" cellspacing="10" style="background-color:#ffffcc; color:green; width:410px" %)
583 |(((
584 **Size(bytes)**
585 )))|2|2|2|1|1|1|2
586 |(((
587 **Value**
588 )))|(((
589 BAT
590 )))|(((
591 Temperature
592
593 (DS18B20)
594 )))|(((
595 ADC
596 )))|(((
597 Digital in&Digital Interrupt1(PB14)
598 )))|(((
599 Digital Interrupt2(PB15)
600 )))|(((
601 Digital Interrupt3(PA4)
602 )))|(((
603 Reserved
604 )))
605
606 === 2.3.8 MOD~=8 (3ADC+1DS18B20, Since firmware v1.8.0) ===
607
608 (% border="1" cellspacing="10" style="background-color:#ffffcc; color:green; width:410px" %)
609 |(((
610 **Size(bytes)**
611 )))|2|2|2|(% style="width:26px" %)1|(% style="width:28px" %)2|2
612 |(((
613 **Value**
614 )))|(((
615 BAT
616 )))|(((
617 Temperature
618
619 (DS18B20)
620 )))|(((
621 ADC1
622
623 (PA0)
624 )))|(% style="width:26px" %)(((
625 Digital in&Digital Interrupt(PB14)
626 )))|(% style="width:28px" %)(((
627 ADC2
628
629 (PA1)
630 )))|(((
631 ADC3
632
633 (PA4)
634 )))
635
636 [[image:image-20220823164903-2.png]]
637
638
639 === 2.3.9 MOD~=9 3DS18B20+ two Interrupt count mode (the hardware version needs to support 3 interrupt versions, Since firmware v1.8.0) ===
640
641 (% border="1" cellspacing="10" style="background-color:#ffffcc; color:green; width:410px" %)
642 |(((
643 **Size(bytes)**
644 )))|2|2|2|1|2|4|4
645 |(((
646 **Value**
647 )))|(((
648 BAT
649 )))|(((
650 Temperature1
651
652 (PB3)
653 )))|(((
654 Temperature2
655
656 (PA9)
657 )))|(((
658 Digital in&Digital Interrupt(PA4)
659 )))|(((
660 Temperature3
661
662 (PA10)
663 )))|(((
664 Count1
665
666 (PB14)
667 )))|(((
668 Count1
669
670 (PB15)
671 )))
672
673 === [[image:image-20220823165322-3.png]] ===
674
675 The newly added AT command is issued correspondingly:
676
677 AT+INTMOD1 PB14 pin:  Corresponding downlink:06 00 00 xx
678
679 AT+INTMOD2 PB15pin:  Corresponding downlink:06 00 01 xx
680
681 AT+INTMOD3 PA4 pin:  Corresponding downlink:06 00 02 xx
682
683
684 AT+SETCNT=aa,bb 
685
686 When AA is 1, set the count of PB14 pin to BB Corresponding downlink:09 01 bb bb bb bb
687
688 When AA is 2, set the count of PB15 pin to BB Corresponding downlink:09 02 bb bb bb bb
689
690
691 === 2.3.10  ​Decode payload in The Things Network ===
692
693
694 While using TTN V3 network, you can add the payload format to decode the payload.
695
696
697 [[image:1656378466788-734.png]]
698
699
700 (((
701 The payload decoder function for TTN V3 are here:
702 )))
703
704 (((
705 LSN50 TTN V3 Payload Decoder:  [[https:~~/~~/www.dropbox.com/sh/dtkj65broivz2gy/AAAjL1ONAm9-TrVvl4HUtdwQa?dl=0>>https://www.dropbox.com/sh/dtkj65broivz2gy/AAAjL1ONAm9-TrVvl4HUtdwQa?dl=0||_mstmutation="1"]]
706 )))
707
708
709
710 == 2.4 Payload Explanation and Sensor Interface ==
711
712
713 === 2.4.1 Battery Info ===
714
715
716 (((
717 Check the battery voltage for LSN50.
718 )))
719
720 (((
721 Ex1: 0x0B45 = 2885mV
722 )))
723
724 (((
725 Ex2: 0x0B49 = 2889mV
726 )))
727
728
729
730 === 2.4.2 Temperature (DS18B20) ===
731
732
733 If there is a DS18B20 connected to PB3 pin. The temperature will be uploaded in the payload.
734
735 More DS18B20 can check the [[3 DS18B20 mode>>||anchor="2.3.4MOD3D4283xDS18B2029"]]
736
737
738 (% style="color:#4472c4" %)**Connection:**
739
740 [[image:1656378573379-646.png]]
741
742
743 (% style="color:#4472c4" %)**Example**:
744
745 If payload is: 0105H:  (0105 & FC00 == 0), temp = 0105H /10 = 26.1 degree
746
747 If payload is: FF3FH :  (FF3F & FC00 == 1) , temp = (FF3FH - 65536)/10 = -19.3 degrees.
748
749
750
751 === 2.4.3 Digital Input ===
752
753
754 The digital input for pin PA12,
755
756 * When PA12 is high, the bit 1 of payload byte 6 is 1.
757 * When PA12 is low, the bit 1 of payload byte 6 is 0.
758
759 === 2.4.4 Analogue Digital Converter (ADC) ===
760
761
762 (((
763 The ADC pins in LSN50 can measure range from 0~~3.3v, it use reference voltage from STM32. If user need to measure a voltage >3.3v, please use resistors to divide this voltage to lower than 3.3v, otherwise, it may destroy the ADC pin.
764 )))
765
766
767 (((
768 The ADC monitors the voltage on the PA0 line, in mV.
769 )))
770
771 (((
772 Ex: 0x021F = 543mv,
773 )))
774
775
776 (((
777 (% style="color:#4472c4" %)** Example1:** (%%) Reading an Oil Sensor (Read a resistance value):
778 )))
779
780 [[image:image-20220627172409-28.png]]
781
782
783 In the LSN50, we can use PB4 and PA0 pin to calculate the resistance for the oil sensor.
784
785
786 (% style="color:blue" %)**Steps:**
787
788 1. Solder a 10K resistor between PA0 and VCC.
789 1. Screw oil sensor's two pins to PA0 and PB4.
790
791 The equipment circuit is as below:
792
793
794 [[image:image-20220627172500-29.png]]
795
796
797 According to above diagram:
798
799 [[image:image-20220628091043-4.png]]
800
801 So
802
803 [[image:image-20220628091344-6.png]]
804
805
806 [[image:image-20220628091621-8.png]] is the reading of ADC. So if ADC=0x05DC=0.9 v and VCC (BAT) is 2.9v
807
808
809 The [[image:image-20220628091702-9.png]] 4.5K ohm
810
811 Since the Bouy is linear resistance from 10 ~~ 70cm.
812
813
814 The position of Bouy is [[image:image-20220628091824-10.png]] , from the bottom of Bouy.
815
816
817
818 === 2.4.5 Digital Interrupt ===
819
820
821 Digital Interrupt refers to pin PB14, and there are different trigger methods. When there is a trigger, the LSN50 will send a packet to the server.
822
823
824 (((
825 (% style="color:#4472c4" %)** Interrupt connection method:**
826 )))
827
828 [[image:1656379178634-321.png]]
829
830
831 (((
832 (% style="color:#4472c4" %)**Example to use with door sensor :**(%%)
833 (% style="color:#4472c4" %)(Requires firmware > 1.5.1)
834 )))
835
836
837 (((
838 The door sensor is shown at right. It is a two wire magnetic contact switch used for detecting the open/close status of doors or windows.
839 )))
840
841 [[image:1656379210849-860.png]]
842
843
844 (((
845 When the two pieces are close to each other, the 2 wire output will be short or open (depending on the type), while if the two pieces are away from each other, the 2 wire output will be the opposite status. So we can use LSN50 interrupt interface to detect the status for the door or window.
846 )))
847
848
849 (((
850 (% style="color:#4472c4" %)** Below is the installation example:**
851 )))
852
853 (((
854 Fix one piece of the magnetic sensor to the door and connect the two pins to LSN50 as follows:
855 )))
856
857 * (((
858 One pin to LSN50's PB14 pin
859 )))
860 * (((
861 The other pin to LSN50's VCC pin
862 )))
863
864 (((
865 Install the other piece to the door. Find a place where the two pieces will be close to each other when the door is closed. For this particular magnetic sensor, when the door is closed, the output will be short, and PB14 will be at the VCC voltage.
866 )))
867
868
869 (((
870 Door sensors have two types: ** (% style="color:#4472c4" %)NC (Normal close)(%%)** and (% style="color:#4472c4" %)**NO (normal open)**(%%). The connection for both type sensors are the same. But the decoding for payload are reverse, user need to modify this in the IoT Server decoder.
871 )))
872
873 (((
874 When door sensor is shorted, there will extra power consumption in the circuit, the extra current is 3v3/R14 = 3v2/1Mohm = 0.3uA which can be ignored.
875 )))
876
877
878 [[image:1656379283019-229.png]]
879
880
881 (((
882 The above photos shows the two parts of the magnetic switch fitted to a door.
883 )))
884
885
886 (((
887 (((
888 The software by default uses the falling edge on the signal line as an interrupt. We need to modify it to accept both the rising edge (0v ~-~-> VCC , door close) and the falling edge (VCC ~-~-> 0v , door open) as the interrupt.
889 )))
890 )))
891
892
893 (((
894 The command is:
895 )))
896
897 (((
898 (% _mstmutation="1" style="color:blue" %)**AT+INTMOD=1 **(% _mstmutation="1" %)** **(%%)~/~/(more info about INMOD please refer(% _mstmutation="1" %)** **(%%)[[**AT Command Manual**>>url:http://www.dragino.com/downloads/index.php?dir=LSN50-LoRaST/&file=DRAGINO_LSN50_AT_Commands_v1.5.1.pdf||_mstmutation="1"]](% _mstmutation="1" %)**. **(%%))
899 )))
900
901
902 (((
903 Below shows some screen captures in TTN V3:
904 )))
905
906
907 [[image:1656379339508-835.png]]
908
909
910 In MOD=1, user can use byte 6 to see the status for door open or close. TTN V3 decoder is as below:
911
912 (% style="background-color:#dcdcdc" %)door= (bytes[6] & 0x80)? "CLOSE":"OPEN";
913
914
915 (% style="color:red" %)**Notice for hardware version LSN50 v1 < v1.3**(%%) (produced before 2018-Nov).
916
917 In this hardware version, there is no R14 resistance solder. When use the latest firmware, it should set AT+INTMOD=0 to close the interrupt. If user need to use Interrupt in this hardware version, user need to solder R14 with 10M resistor and C1 (0.1uF) on board.
918
919 [[image:1656379563303-771.png]]
920
921
922
923 === 2.4.6 I2C Interface (SHT20) ===
924
925
926 (((
927 The PB6(SDA) and PB7(SCK) are I2C interface lines. You can use these to connect to an I2C device and get the sensor data.
928 )))
929
930 (((
931 We have made an example to show how to use the I2C interface to connect to the SHT20 Temperature and Humidity Sensor. This is supported in the stock firmware since v1.5 with (% style="color:#4472c4" %)**AT+MOD=1 (default value).**
932 )))
933
934 (((
935 Below is the connection to SHT20.
936 )))
937
938
939 [[image:1656379593307-549.png]]
940
941
942 The device will be able to get the I2C sensor data now and upload to IoT Server.
943
944
945 [[image:1656379664142-345.png]]
946
947 Convert the read byte to decimal and divide it by ten.
948
949
950 (% style="color:blue" %)**Example:**
951
952 Temperature:  Read:0116(H) = 278(D)  Value:  278 /10=27.8℃;
953
954 Humidity:    Read:0248(H)=584(D)  Value:  584 / 10=58.4, So 58.4%
955
956
957 If you want to use other I2C device, please refer the SHT20 part source code as reference.
958
959
960
961 === 2.4.7 ​Distance Reading ===
962
963
964 Refer [[Ultrasonic Sensor section>>||anchor="H2.4.8UltrasonicSensor"]].
965
966
967
968 === 2.4.8 Ultrasonic Sensor ===
969
970
971 (((
972 The LSN50 v1.5 firmware supports ultrasonic sensor (with AT+MOD=2) such as SEN0208 from DF-Robot. This Fundamental Principles of this sensor can be found at this link: [[https:~~/~~/wiki.dfrobot.com/Weather_-_proof_Ultrasonic_Sensor_with_Separate_Probe_SKU~~_~~__SEN0208>>url:https://wiki.dfrobot.com/Weather_-_proof_Ultrasonic_Sensor_with_Separate_Probe_SKU___SEN0208]]
973 )))
974
975
976 (((
977 The LSN50 detects the pulse width of the sensor and converts it to mm output. The accuracy will be within 1 centimeter. The usable range (the distance between the ultrasonic probe and the measured object) is between 24cm and 600cm.
978 )))
979
980
981 (((
982 The picture below shows the connection:
983 )))
984
985 [[image:1656380061365-178.png]]
986
987
988
989 Connect to the LSN50 and run (% style="color:blue" %)**AT+MOD=2**(%%) to switch to ultrasonic mode (ULT).
990
991 The ultrasonic sensor uses the 8^^th^^ and 9^^th^^ byte for the measurement value.
992
993
994 (% style="color:blue" %)**Example:**
995
996 Distance:  Read:0C2D(Hex) = 3117(D)  Value:  3117 mm=311.7 cm
997
998
999 [[image:1656384895430-327.png]]
1000
1001
1002 [[image:1656384913616-455.png]]
1003
1004
1005 You can see the serial output in ULT mode as below:
1006
1007 [[image:1656384939855-223.png]]
1008
1009
1010 In TTN V3 server:
1011
1012
1013 [[image:1656384961830-307.png]]
1014
1015
1016 [[image:1656384973646-598.png]]
1017
1018
1019
1020 === 2.4.9 +5V Output ===
1021
1022
1023 Since v1.2 hardware version, a +5v output is added in the hardware. The +5V output will be valid for every sampling.  LSN50 will enable +5V output before all sampling and disable the +5v after all sampling. 
1024
1025
1026 (((
1027 Since firmware (% style="color:red" %)**v1.6.3**(%%), The 5V output time can be controlled by AT Command.
1028 )))
1029
1030 (((
1031 (% style="color:#4472c4" %)**AT+5VT=1000**
1032 )))
1033
1034 (((
1035 Means set 5V valid time to have 1000ms. So the real 5V output will actually have 1000ms + sampling time for other sensors.
1036 )))
1037
1038
1039 (((
1040 By default the AT+5VT=500. If the external sensor which require 5v and require more time to get stable state, user can use this command to increase the power ON duration for this sensor.
1041 )))
1042
1043
1044
1045 === 2.4.10 Weigh Sensor HX711 ===
1046
1047
1048 Since v1.6.2 firmware, LSN50 support Weigh Sensor HX711.
1049
1050
1051
1052 === 2.4.11  BH1750 Illumination Sensor ===
1053
1054
1055 Since v1.7.0 firmware, MOD=1 support this sensor. The sensor value is in the 8^^th^^ and 9^^th^^ bytes.
1056
1057
1058 [[image:image-20220628110012-11.jpeg]]
1059
1060
1061 [[image:image-20220628110012-12.png]]
1062
1063
1064
1065 === 2.4.12 Working MOD ===
1066
1067
1068 (((
1069 The working MOD info is contained in the Digital in & Digital Interrupt byte (7^^th^^ Byte).
1070 )))
1071
1072 (((
1073 User can use the 3^^rd^^ ~~ 7^^th^^  bit of this byte to see the working mod:
1074 )))
1075
1076 (((
1077 Case 7^^th^^ Byte >> 2 & 0x1f:
1078 )))
1079
1080 * 0: MOD1
1081 * 1: MOD2
1082 * 2: MOD3
1083 * 3: MOD4
1084 * 4:MOD5
1085 * 5:MOD6
1086
1087 == 2.5 Configure LSN50 via AT or Downlink ==
1088
1089
1090 (((
1091 User can configure LSN50 via [[AT Commands >>||anchor="H3.A0UsingtheATCommands"]]or LoRaWAN Downlink Commands
1092 )))
1093
1094 (((
1095 There are two kinds of Commands:
1096 )))
1097
1098 * (% _mstmutation="1" style="color:#4472c4" %)**Common Commands**(%%): They should be available for each sensor, such as: change uplink interval, reset device. For firmware v1.7.0, user can find what common commands it supports:  [[End Device AT Commands>>doc:Main.End Device AT Commands and Downlink Command.WebHome||_mstmutation="1"]]
1099
1100 * (% style="color:#4472c4" %)**Sensor Related Commands**(%%): These commands are special designed for LSN50.  User can see these commands below:
1101
1102 === 2.5.1 Common Commands: ===
1103
1104
1105 They should be available for each of Dragino Sensors, such as: change uplink interval, reset device. For firmware v1.7.0, user can find what common commands it supports: [[End Device AT Commands>>doc:Main.End Device AT Commands and Downlink Command.WebHome]]
1106
1107
1108
1109 === 2.5.2 Sensor related commands: ===
1110
1111
1112 (% style="color:#4472c4" %)**Set work mode:**
1113
1114 * (% style="color:#037691" %)**AT Command:**
1115
1116 (((
1117 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+MOD=2 **(%%) ~/~/ Set work MOD =2. (1:IIC mode,2:Distance mode,3:3ADC mode, 4:3DS18B20 mode,5:weight mode)
1118 )))
1119
1120 (((
1121 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+MOD=?** (%%) ~/~/  Get current work MOD
1122 )))
1123
1124
1125 * (% style="color:#037691" %)**Downlink Payload:**
1126
1127 (% style="background-color:#dcdcdc" %)**0x0A aa** (%%) ~/~/ Same as AT+MOD=aa
1128
1129
1130
1131 (% style="color:#4472c4" %)**Set the trigger interrupt mode:**
1132
1133 * (% style="color:#037691" %)**AT Command:**
1134
1135 (((
1136 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+INTMOD=2**  (%%) ~/~/ Set INTMOD =2. (0:Disable,1:falling or rising,2:falling,3:rising)
1137 )))
1138
1139 (((
1140 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+INTMOD=?**  (%%) ~/~/  Get current INTMOD
1141 )))
1142
1143
1144 * (% style="color:#037691" %)**Downlink Payload:**
1145
1146 (% style="background-color:#dcdcdc" %)**0x06 000003**      (%%) ~/~/ Set AT+INTMOD=3
1147
1148
1149
1150 (% style="color:#4472c4" %)**Set the 5V power open time during sampling:**
1151
1152 * (% style="color:#037691" %)**AT Command:**
1153
1154 (((
1155 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+5VT=1000** (%%) ~/~/ Set 5v open time to 1000ms
1156 )))
1157
1158 (((
1159 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+5VT=?**    (%%) ~/~/  Check current 5v open duration
1160 )))
1161
1162
1163 * (% style="color:#037691" %)**Downlink Payload:**
1164
1165 (% style="background-color:#dcdcdc" %)**0x07 aa bb**    (%%) ~/~/ Equal AT+5VT=0x(aa bb)
1166
1167
1168
1169 (% style="color:#4472c4" %)**Set the weight to 0g (Zero Calibration)**
1170
1171 * (% style="color:#037691" %)**AT Command:**
1172
1173 (% style="background-color:#dcdcdc" %)**AT+WEIGRE** ** **(%%)** **~/~/ Set the weight to 0g
1174
1175
1176 * (% style="color:#037691" %)**Downlink Payload:**
1177
1178 (% style="background-color:#dcdcdc" %)**0x08 01** (%%) ~/~/ Set the weight to 0g
1179
1180
1181
1182 (% style="color:#4472c4" %)**Get or Set the GAP Value (calibrate factor) of measurement**
1183
1184 * (% style="color:#037691" %)**AT Command:**
1185
1186 (((
1187 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+WEIGAP=403.0**  (%%) ~/~/ Set GAP Value =403.0 (response: Weight: xx g)
1188 )))
1189
1190 (((
1191 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+WEIGAP=?**  (%%) ~/~/  Get current GAP Value
1192 )))
1193
1194
1195 * (% style="color:#037691" %)**Downlink Payload:**
1196
1197 (% style="background-color:#dcdcdc" %)**0x08 02 aa bb** (%%) ~/~/ Equal to AT+WEIGAP=0x(aa bb)/10
1198
1199
1200 (% style="color:#4472c4" %)**Encrypt upload**
1201
1202 * (% style="color:#037691" %)**AT Command:**
1203
1204 (((
1205 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+DECRYPT=1**  (%%) ~/~/ The payload is uploaded without encryption
1206 )))
1207
1208 (((
1209 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+DECRYPT=0**  (%%) ~/~/  Encrypt when uploading payload (default)
1210 )))
1211
1212
1213 (% style="color:#4472c4" %)**Get data**
1214
1215 * (% style="color:#037691" %)**AT Command:**
1216
1217 (((
1218 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+GETSENSORVALUE=0** (%%) ~/~/ The serial port gets the reading of the current sensor
1219 )))
1220
1221 (((
1222 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+GETSENSORVALUE=1** (%%) ~/~/  The serial port gets the current sensor reading and uploads it.
1223
1224
1225 (% style="color:#4472c4" %)**Resets the downlink packet count**
1226
1227 * (% style="color:#037691" %)**AT Command:**
1228
1229 (((
1230 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+DISFCNTCHECK=0**(% _mstmutation="1" %)**     **(%%) ~/~/(% _mstmutation="1" %)** **(%%)When the downlink packet count sent by the server is less than the node downlink packet count or exceeds 16384, the node will no longer receive downlink packets (default)
1231 )))
1232
1233 (((
1234 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+DISFCNTCHECK=1** (%%) ~/~/  When the downlink packet count sent by the server is less than the node downlink packet count or exceeds 16384, the node resets the downlink packet count and keeps it consistent with the server downlink packet count
1235 )))
1236
1237
1238 (% style="color:#4472c4" %)**When the limit bytes are exceeded, upload in batches**
1239
1240 * (% style="color:#037691" %)**AT Command:**
1241
1242 (((
1243 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+DISMACANS=0**(%%)  ~/~/ When the MACANS of the reply server plus the payload exceeds the maximum number of bytes of 11 bytes (DR0 of US915, DR2 of AS923, DR2 of AU195), the node will send a packet with a payload of 00 and a port of 4. (default)
1244 )))
1245
1246 (((
1247 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+DISMACANS=1** (%%) ~/~/ When the MACANS of the reply server plus the payload exceeds the maximum number of bytes of the DR, the node will ignore the MACANS and not reply, and only upload the payload part.
1248 )))
1249
1250 * (% style="color:#037691" %)**Downlink Payload:**
1251
1252 (% class="wikigeneratedid" %)
1253 (% style="background-color:#dcdcdc" %)**0x21 00 01 ** (%%) ~/~/ Set  the DISMACANS=1
1254
1255
1256 (% style="color:#4472c4" %)**Copy downlink to uplink**
1257
1258 * (% style="color:#037691" %)**AT Command:**
1259
1260 (((
1261 (% _mstmutation="1" style="background-color:#dcdcdc" %)**AT+RPL=5**(%%)  ~/~/ After receiving the package from the server, it will immediately upload the content of the package to the server, the port number is 100.
1262 )))
1263
1264 (% class="wikigeneratedid" %)
1265 Example:(% style="background-color:#dcdcdc" %)**aa xx xx xx xx** (%%) ~/~/ aa indicates whether the configuration has changed, 00 is yes, 01 is no; xx xx xx xx are the bytes sent.
1266
1267 (% class="wikigeneratedid" %)
1268 [[image:image-20220823173747-6.png||height="165" width="1124"]]
1269
1270 For example, sending 11 22 33 44 55 66 77 will return invalid configuration 00 11 22 33 44 55 66 77.
1271
1272 [[image:image-20220823173833-7.png||height="149" width="1124"]]
1273
1274 For example, if 01 00 02 58 is issued, a valid configuration of 01 01 00 02 58 will be returned.
1275
1276
1277 (% style="color:#4472c4" %)**Query version number and frequency band 、TDC**
1278
1279 * (((
1280 (% style="color:#037691" %)**Downlink: 26 01  **(%%) ~/~/ Downlink 26 01 can query device upload frequency, frequency band, software version number, TDC time.
1281 )))
1282
1283 Example:
1284
1285 [[image:image-20220823173929-8.png||height="76" width="1205"]]
1286
1287
1288 == 2.6 Show Data in Datacake IoT Server ==
1289
1290
1291 (((
1292 Datacake provides a human friendly interface to show the sensor data, once we have data in TTN V3, we can use Datacake to connect to TTN V3 and see the data in Datacake. Below are the steps:
1293 )))
1294
1295 (((
1296
1297 )))
1298
1299 (((
1300 (% style="color:blue" %)**Step 1**(%%)**:** Be sure that your device is programmed and properly connected to the network at this time.
1301 )))
1302
1303 (((
1304 (% style="color:blue" %)**Step 2**(%%)**:** To configure the Application to forward data to Datacake you will need to add integration. To add the Datacake integration, perform the following steps:
1305 )))
1306
1307
1308 [[image:1656385623971-339.png]]
1309
1310
1311 [[image:1656385646347-395.png]]
1312
1313
1314 [[image:1656385662459-942.png]]
1315
1316
1317 (% style="color:blue" %)**Step 3**(%%)**: **Create an account or log in Datacake.
1318
1319 (% style="color:blue" %)**Step 4**(%%)**:** Search the LSN50 and add DevEUI.
1320
1321 [[image:1656385688973-317.png]]
1322
1323
1324
1325 == 2.7 ​Firmware Change Log ==
1326
1327
1328 (((
1329 **Firmware download: ** [[https:~~/~~/www.dropbox.com/sh/9k0a6sn8a94dc03/AAD54woDmnmAMUMY2WfKfjxoa?dl=0>>https://www.dropbox.com/sh/9k0a6sn8a94dc03/AAD54woDmnmAMUMY2WfKfjxoa?dl=0]]
1330 )))
1331
1332 (((
1333 **Firmware Change Log: **[[https:~~/~~/www.dropbox.com/sh/9k0a6sn8a94dc03/AAD54woDmnmAMUMY2WfKfjxoa?dl=0>>https://www.dropbox.com/sh/9k0a6sn8a94dc03/AAD54woDmnmAMUMY2WfKfjxoa?dl=0]]
1334
1335
1336
1337 )))
1338
1339 == 2.8 Use VDD or +5V to Power External Sensor ==
1340
1341
1342 (((
1343 User can use VDD or +5V to power external sensor.
1344 )))
1345
1346 (((
1347 (% style="color:red" %)**Note:**
1348 )))
1349
1350 1. (((
1351 VDD is 2.5~~3.3v from the battery + diode, the VDD is always on, so when use VDD to power external sensor, make sure the sensor has a low power consumption in sleep mode ( less 50 uA) to get a long battery life.
1352 )))
1353 1. (((
1354 +5V output is only ON when sampling. And MCU will turn off it after sampling. So if sensor can support 5v, +5V out is the best choice. [[See here for more info>>||anchor="H2.4.92B5VOutput"]].
1355 )))
1356
1357 (((
1358 (% style="color:red" %)**Note: Always test the actually current pass by the JP2 jumper when connect to a new type of sensor.**
1359 )))
1360
1361
1362
1363 == 2.9  Battery Analysis ==
1364
1365
1366 === 2.9.1  Battery Type ===
1367
1368
1369 (((
1370 The LSN50 battery is a combination of a 4000mAh or 8500mAh Li/SOCI2 Battery and a Super Capacitor. The battery is non-rechargeable battery type with a low discharge rate (<2% per year). This type of battery is commonly used in IoT devices such as water meter.
1371 )))
1372
1373 (((
1374 The battery is designed to last for more than 5 years for the LSN50.
1375 )))
1376
1377
1378 (((
1379 The battery related documents as below:
1380 )))
1381
1382 * [[Battery Dimension>>https://www.dragino.com/downloads/index.php?dir=datasheet/Battery/]],
1383 * [[Lithium-Thionyl Chloride Battery datasheet>>https://www.dragino.com/downloads/index.php?dir=datasheet/Battery/||_mstmutation="1"]], [[Tech Spec>>https://www.dragino.com/downloads/index.php?dir=datasheet/Battery/||_mstmutation="1"]]
1384 * [[Lithium-ion Battery-Capacitor datasheet>>https://www.dragino.com/downloads/index.php?dir=datasheet/Battery/]], [[Tech Spec>>https://www.dragino.com/downloads/index.php?dir=datasheet/Battery/]]
1385
1386 [[image:image-20220627175349-30.png]]
1387
1388
1389
1390 === 2.9.2 ​Power consumption Analyze ===
1391
1392
1393 When connect to different sensors, it is good to test the power consumption with the sensor working. User can remove the ON/OFF Jumper of LSN50, and connect a multimeter between the two pins of this header and measure the current to know the whole system power consumption. Because the sleep mode will have as low as 10uA, at least 4.5 digit multimeter is required to measure this level of current.
1394
1395 (((
1396 A victor VC86E is recommended.
1397 )))
1398
1399 [[image:1656323400306-359.png]]
1400
1401
1402 (((
1403 In a minimum system with DS18B20 and Oil Sensor and default firmware, the power consumption includes:
1404 )))
1405
1406 (((
1407
1408 )))
1409
1410 (((
1411 ~1. Deep Sleep (Stop mode) for STM32. ~~ 5uA
1412 )))
1413
1414 (((
1415 2. Sampling current while reading DS18B20 and Oil Sensor
1416 )))
1417
1418 * (((
1419 Oil Sensor sampling time: 200us, current: 0.3mA
1420 )))
1421 * (((
1422 DS18B20 sampling time: 750ms, current: 0.64mA
1423 )))
1424 * (((
1425 Above power should add 8mA CPU power in working mode.
1426 )))
1427
1428 (((
1429 3. LoRaWAN transmit and receive time consumption. The LoRa TX / RX time and power can be found in the [[LoRa calculator tool>>url:https://www.semtech.com/uploads/documents/SX1272LoRaCalculatorSetup1_1.zip]].
1430 )))
1431
1432
1433 (((
1434 In a typical LoRaWAN data transmit. The energy profile is as below:
1435 )))
1436
1437
1438 [[image:1656323450362-299.png]]
1439
1440
1441 (((
1442 In the LoRaWAN protocol, the device will transfer in different LoRa Radio, and have different energy profile in LoRa part. We can calculate the battery life in two cases:
1443 )))
1444
1445 1. Lower power LoRa radio. Device has a good signal to gateway
1446 1. Higher power LoRa radio. Device has a poor signal to gateway
1447
1448 (% style="color:blue" %)**Low Power Case**:
1449
1450 * Radio Parameter: SF7, 125kHz, 20dbm
1451 * Transmit interval: 15 minutes.
1452 * Payload: 8 Bytes.
1453
1454 (% style="color:blue" %)**High Power Case**:
1455
1456 * Radio Parameter: SF10, 125kHz, 20dbm
1457 * Transmit interval: 15 minutes.
1458 * Payload: 8 Bytes.
1459
1460 To simplify the calculation, we can:
1461
1462 * Combine oil sensor and DS18B20 sampling energy together to (% style="color:#4472c4" %)**751ms@8.64ma**
1463
1464 * Combine the two RX windows together.
1465
1466 There is a [[power consumption tool>>url:http://www.dragino.com/downloads/index.php?dir=LSN50-LoRaST/&file=Battery_Calculator_v1.0.xlsx]] for easy analysis. Below is the analysis result.
1467
1468
1469 [[image:1656323531520-949.png]]
1470
1471 [[image:1656323549994-233.png]]
1472
1473
1474 (% style="color:red" %)**Note: Ignore the 18 year result, because the battery has a max 2% discharge per year.**
1475
1476
1477
1478 === 2.9.3 ​Battery Note ===
1479
1480
1481 (((
1482 The Li-SICO battery is designed for small current / long period application. It is not good to use a high current, short period transmit method. The recommended minimum period for use of this battery is 5 minutes. If you use a shorter period time to transmit LoRa, then the battery life may be decreased.
1483 )))
1484
1485
1486
1487 === 2.9.4 Replace the battery ===
1488
1489
1490 (((
1491 You can change the battery in the LSN50.The type of battery is not limited as long as the output is between 3v to 3.6v. On the main board, there is a diode (D1) between the battery and the main circuit. If you need to use a battery with less than 3.3v, please remove the D1 and shortcut the two pads of it so there won’t be voltage drop between battery and main board.
1492 )))
1493
1494 (((
1495 The default battery pack of LSN50 includes a ER18505 plus super capacitor. If user can't find this pack locally, they can find ER18505 or equivalence, which will also work in most case. The SPC can enlarge the battery life for high frequency use (update period below 5 minutes).
1496 )))
1497
1498
1499
1500 = 3.  Using the AT Commands =
1501
1502
1503 == 3.1  Access AT Commands ==
1504
1505
1506 LSN50 supports AT Command set in the stock firmware. You can use a USB to TTL adapter to connect to LSN50 for using AT command, as below.
1507
1508
1509 (% style="color:#4472c4" %)**LSN50 v1 UART connection photo**
1510
1511 [[image:image-20220627165424-24.png||height="495" width="486"]]
1512
1513
1514
1515 (% style="color:#4472c4" %)**LSN50 v2 UART connection photo**
1516
1517 [[image:image-20220627165424-25.png||height="437" width="894"]]
1518
1519
1520 (((
1521 In the PC, you need to set the serial baud rate to (% style="color:green" %)**9600**(%%) to access the serial console for LSN50. LSN50 will output system info once power on as below:
1522 )))
1523
1524
1525 [[image:image-20220627165531-26.png||height="624" width="893"]](% style="display:none" %)
1526
1527
1528
1529 == 3.2  Common AT Command Sequence ==
1530
1531
1532 === 3.2.1  Multi-channel ABP mode (Use with SX1301/LG308) ===
1533
1534
1535 (((
1536 (% style="color:#037691" %)**If device has not joined network via OTAA:**
1537 )))
1538
1539 (((
1540 (% style="background-color:#dcdcdc" %)AT+FDR
1541 )))
1542
1543 (((
1544 (% style="background-color:#dcdcdc" %)AT+NJM=0
1545 )))
1546
1547 (((
1548 (% style="background-color:#dcdcdc" %)ATZ
1549 )))
1550
1551
1552 (((
1553 (% style="color:#037691" %)**If device already joined network:**
1554 )))
1555
1556 (((
1557 (% style="background-color:#dcdcdc" %)AT+NJM=0
1558 )))
1559
1560 (((
1561 (% style="background-color:#dcdcdc" %)ATZ
1562 )))
1563
1564
1565
1566 === 3.2.2  Single-channel ABP mode (Use with LG01/LG02) ===
1567
1568
1569 See [[Sect 6.7>>||anchor="H6.7A0HowtoconfiguretheEUIkeysinLSN503F"]]
1570
1571
1572
1573 = 4.  Upload Firmware =
1574
1575
1576 (% style="color:red" %)**Notes**:
1577
1578 * Since image v1.3, the firmware will show version info during boot. If your device doesn't show version info, you may have a very old image version.
1579 * Always run AT+FDR to reset parameters to factory default after an update image.
1580 If the update is from image >= v1.3 to another image version >=v1.3, then the keys will be kept after running AT+FDR.
1581 Otherwise (e.g. from v1.2 to v1.3), AT+FDR may erase the keys.
1582
1583 == 4.1  Upload Firmware via Serial Port ==
1584
1585
1586 The LSN50's AT Command port can be used for firmware upgrade. The hardware connection for upgrade firmware is as below:
1587
1588
1589 [[image:image-20220627163506-18.png||height="426" width="418"]]
1590
1591
1592 (% style="color:blue" %)**Step1**(%%)**:** Download [[flash loader>>url:https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/flasher-stm32.html]].
1593
1594 (% style="color:blue" %)**Step2**(%%)**:** Download the [[LSN50 Image files>>url:https://github.com/dragino/LoRa_STM32/tree/master/LSN50.hex]].
1595
1596 (% style="color:blue" %)**Step3**(%%)**: **Open flashloader; choose the correct COM port to update
1597
1598 [[image:image-20220627163821-19.png]]
1599
1600
1601 [[image:image-20220627163930-20.png||height="450" width="751"]]
1602
1603
1604 [[image:image-20220627164030-21.png||height="459" width="750"]]
1605
1606
1607 (((
1608 (% style="color:blue" %)**Step4**(%%)**: **Switch SW1 back to flash state and push the RESET button.
1609 )))
1610
1611 (((
1612 The LSN50 will then run the new firmware.
1613 )))
1614
1615
1616
1617 == 4.2  Upload Firmware via ST-Link V2 ==
1618
1619
1620 You can use ST-LINK to upgrade firmware into LSN50. The hardware connection for upgrade firmware is as below:
1621
1622
1623 [[image:1656319349131-664.png]]
1624
1625
1626 (% style="color:blue" %)**Connection:**
1627
1628 * (% style="background-color:yellow" %)**ST-LINK v2 GND  <~-~-> LSN50 GND**
1629 * (% style="background-color:yellow" %)**ST-LINK v2 SWCLK <~-~-> LSN50 PA14**
1630 * (% style="background-color:yellow" %)**ST-LINK v2 SWDIO <~-~-> LSN50 PA13**
1631 * (% style="background-color:yellow" %)**ST-LINK v2 RST  <~-~->  LSN50 NRST**
1632
1633 (% style="color:blue" %)**Step1:**(%%) Install [[ST-LINK driver>>url:https://www.stmicroelectronics.com.cn/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-utilities/stsw-link009.html]] first and then install [[ST-LINK Utility>>url:https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/stsw-link004.html]]
1634
1635 (% style="color:blue" %)**Step2**(%%): Download the [[LSN50 Image files>>url:https://github.com/dragino/LoRa_STM32/tree/master/LSN50.hex]].
1636
1637 (% style="color:blue" %)**Step3:**(%%)** **Open ST-LINK utility, (% style="color:blue" %)**file ~-~-> open file**(%%) to select the image to be upgraded.
1638
1639 (% style="color:blue" %)**Step4:**(%%)** **Click the “(% style="color:blue" %)**Program Verify**”(%%) button on ST-LINK.
1640
1641
1642 [[image:image-20220627164303-22.png]]
1643
1644
1645 (((
1646 (% style="color:blue" %)**Step5:**(%%)** **The led on the ST-LINK adapter will now blinking, and the ST-Link utility will pop up a download window. Click the start button to download the image to LSN50.
1647 )))
1648
1649 (((
1650 (% style="color:red" %)**NOTE: If this step fails, ST-LINK can't establish connection to LSN50, please try to swap SWDIO & SWCLK pin. Some ST-LINK v2 devices are incorrectly marked.**
1651 )))
1652
1653
1654
1655 [[image:image-20220627164303-23.png]]
1656
1657
1658
1659 = 5.  Developer Guide =
1660
1661
1662 * (((
1663 Software Source Code Download : [[https:~~/~~/github.com/dragino/LoRa_STM32/tree/master/STM32CubeExpansion_LRWAN>>https://github.com/dragino/LoRa_STM32/tree/master/STM32CubeExpansion_LRWAN]]
1664 )))
1665 * (((
1666 Hardware Source Code Download: [[https:~~/~~/github.com/dragino/Lora/tree/master/LSN50>>https://github.com/dragino/Lora/tree/master/LSN50]]
1667 )))
1668
1669 (((
1670 LSN50 is an open source project, developer can use compile their firmware for customized applications. User can get the source code from:
1671 )))
1672
1673 * (((
1674 Software Source Code: [[https:~~/~~/github.com/dragino/LoRa_STM32/tree/master/STM32CubeExpansion_LRWAN>>url:https://github.com/dragino/LoRa_STM32/tree/master/STM32CubeExpansion_LRWAN||_mstmutation="1"]]
1675 )))
1676 * (((
1677 Hardware Design files:  [[https:~~/~~/github.com/dragino/Lora/tree/master/LSN50>>url:https://github.com/dragino/Lora/tree/master/LSN50]]
1678 )))
1679 * (((
1680 Compile instruction:  [[http:~~/~~/wiki.dragino.com/xwiki/bin/view/Main/Firmware%20Compile%20Instruction%20~~-~~-%20STM32/>>http://wiki.dragino.com/xwiki/bin/view/Main/Firmware%20Compile%20Instruction%20--%20STM32/]]
1681 )))
1682
1683 (((
1684 Use Keil to open project file:
1685 )))
1686
1687 (((
1688 STM32CubeExpansion_LRWAN/Projects/Multi/Applications/LoRa/DRAGINO-LRWAN(AT)/MDK-ARM/STM32L072CZ-Nucleo/Lora.uvprojx
1689 )))
1690
1691 (((
1692
1693 )))
1694
1695 (((
1696 In Keil, you can see what frequency band the code support.
1697 )))
1698
1699 [[image:image-20220627162417-15.png]]
1700
1701
1702 **~1. If you want to change frequency, modify the Preprocessor Symbols.**
1703
1704
1705 For example, change EU868 to US915
1706
1707 [[image:1656318662202-530.png]]
1708
1709
1710 **2. Compile and build**
1711
1712 [[image:image-20220627163212-17.png]]
1713
1714
1715
1716 = 6.  FAQ =
1717
1718
1719 == 6.1  Why there is 433/868/915 version? ==
1720
1721
1722 (((
1723 Different countries have different rules for the ISM band for LoRa. Although the LoRa chip can support a wide range of Frequencies, we provide different versions of the hardware for best tune of the LoRa hardware part.
1724 )))
1725
1726
1727
1728 == 6.2 What is the frequency range of LT LoRa part? ==
1729
1730
1731 Different LT version supports different frequency range, below is the table for the working frequency and recommend bands for each model:
1732
1733 [[image:image-20220627155456-9.png]]
1734
1735
1736
1737 == 6.3  How to change the LoRa Frequency Bands/Region? ==
1738
1739
1740 You can follow the instructions for [[how to upgrade image>>||anchor="H2.7200BFirmwareChangeLog"]].
1741 When downloading the images, choose the required image file for download.
1742
1743
1744
1745 == 6.4  Can I use Private LoRa protocol? ==
1746
1747
1748 (((
1749 (((
1750 The stock firmware is based on LoRaWAN protocol. You can use a private LoRa protocol in LSN50. This section describes an example for base LoRa transfer. It is a reference/demo and we do not provide further software development support on this topic.
1751 )))
1752
1753 (((
1754 In this demo, we will show the communication between LoRa Shield and LSN50, both of them using the basic LoRa library. LSN50 will send a message to a LoRa Shield and the LoRa Shield will print it to the console.
1755 )))
1756
1757
1758 )))
1759
1760 (% style="color:#4472c4" %)**LoRa Shield + UNO**:
1761
1762 Use the [[LoRa Library>>url:http://www.dragino.com/downloads/index.php?dir=LSN50-LoRaST/LoRa_Raw_Example/Arduino/&file=LoRa.zip]] and upload the [[LoRa Receive>>http://www.dragino.com/downloads/downloads/LSN50-LoRaST/LoRa_Raw_Example/Arduino/LoRaReceiver.ino]] Sketch to Arduino.
1763
1764
1765 Refs:
1766
1767 [[https:~~/~~/www.dropbox.com/sh/u9s41qdx5yujwcb/AAAT5r4QkMaeOogWrzJt7Wn4a?dl=0>>https://www.dropbox.com/sh/u9s41qdx5yujwcb/AAAT5r4QkMaeOogWrzJt7Wn4a?dl=0]]
1768
1769
1770 Open the serial monitor to Arduino. The device acts as a LoRa Receiver and listen on the frequency 868.3Mhz by default.
1771
1772
1773 (% style="color:#4472c4" %)**LSN50**:
1774
1775 Use the <[[LoRa RAW code>>url:http://www.dragino.com/downloads/index.php?dir=LSN50-LoRaST/LoRa_Raw_Example/LSN50/&file=lora_send.zip]]> . The project file is in: MDK-ARM\STM32L072CZ-Nucleo\ Lora.uvprojx
1776
1777 Compile it and Upload it to LSN50, the LSN50 will transfer on the frequency 868.3Mhz.
1778
1779 In the Arduino Console, it will see the received packets as below.
1780
1781
1782 [[image:image-20220627160116-10.png]]
1783
1784
1785
1786 == 6.5  How to set up LSN50 to work in 8 channel mode ==
1787
1788
1789 (((
1790 By default, the frequency bands US915, AU915, CN470 work in 72 frequencies. Many gateways are 8 channel gateways, and in this case, the OTAA join time and uplink schedule is long and unpredictable while the end node is hopping in 72 frequencies.
1791 )))
1792
1793 (((
1794 You can configure the end node to work in 8 channel mode by using the AT+CHE command. The 500kHz channels are always included for OTAA.
1795 )))
1796
1797 (((
1798
1799 )))
1800
1801 (((
1802 For example, in (% style="color:blue" %)**US915**(%%) band, the frequency table is as below. By default, the end node will use all channels (0~~71) for OTAA Join process. After the OTAA Join, the end node will use these all channels (0~~71) to send uplink packets.
1803 )))
1804
1805 [[image:image-20220627160940-13.png]]
1806
1807
1808 (((
1809 When you use the TTN V3 network, the US915 frequency bands use are:
1810 )))
1811
1812 * (((
1813 903.9 - SF7BW125 to SF10BW125
1814 )))
1815 * (((
1816 904.1 - SF7BW125 to SF10BW125
1817 )))
1818 * (((
1819 904.3 - SF7BW125 to SF10BW125
1820 )))
1821 * (((
1822 904.5 - SF7BW125 to SF10BW125
1823 )))
1824 * (((
1825 904.7 - SF7BW125 to SF10BW125
1826 )))
1827 * (((
1828 904.9 - SF7BW125 to SF10BW125
1829 )))
1830 * (((
1831 905.1 - SF7BW125 to SF10BW125
1832 )))
1833 * (((
1834 905.3 - SF7BW125 to SF10BW125
1835 )))
1836 * (((
1837 904.6 - SF8BW500
1838 )))
1839
1840 (((
1841 Because the end node is now hopping in 72 frequency, it makes it difficult for the devices to Join the TTN V3 network and uplink data. To solve this issue, you can access the device via the AT commands and run:
1842 )))
1843
1844 (((
1845 (% style="color:blue" %)**AT+CHE=2**
1846 )))
1847
1848 (((
1849 (% style="color:blue" %)**ATZ**
1850 )))
1851
1852
1853 (((
1854 to set the end node to work in 8 channel mode. The device will work in Channel 8-15 & 64-71 for OTAA, and channel 8-15 for Uplink.
1855 )))
1856
1857 (((
1858 The (% style="color:blue" %)**AU915**(%%) band is similar. Below are the AU915 Uplink Channels.
1859 )))
1860
1861 [[image:image-20220627161124-14.png]]
1862
1863
1864
1865 == 6.6  How to set up LSN50 to work with Single Channel Gateway such as LG01/LG02? ==
1866
1867
1868 (((
1869 In this case, users need to set LSN50 to work in ABP mode and transmit in only one frequency.
1870 )))
1871
1872 (((
1873 Assume we have a LG02 working in the frequency 868400000 now, below is the steps.
1874 )))
1875
1876
1877 (((
1878 (% style="color:blue" %)**Step1: **(%%)Log in TTN V3, Create an ABP device in the application and input the network session key (NETSKEY), app session key (APPSKEY) from the device.
1879 )))
1880
1881
1882 [[image:image-20220627160542-11.png]]
1883
1884
1885 (((
1886 (% style="color:red" %)**Note: You need to make sure the above three keys match in the device and in TTN V3. You can change them either in TTN V3 or in the Device to make them match. In TTN V3, NETSKEY and APPSKEY can be configured in the setting page, but the Device Addr is generated by TTN V3.**
1887 )))
1888
1889
1890 (((
1891 (% style="color:red" %)**You can also change the Device ADDR in TTN V3 by using the [[The Things Network CLI>>url:https://www.thethingsnetwork.org/docs/network/cli/quick-start.html]].**
1892 )))
1893
1894
1895
1896 (((
1897 (% style="color:blue" %)**Step2:  **(%%)Run AT commands to make the LSN50 work in Single frequency and ABP mode. Below are the AT commands:
1898 )))
1899
1900
1901 (((
1902 (% style="background-color:#dcdcdc" %)AT+FDR(%%)  Reset Parameters to Factory Default, Keys Reserve
1903 )))
1904
1905 (((
1906 (% style="background-color:#dcdcdc" %)AT+NJM=0(%%)  Set to ABP mode
1907 )))
1908
1909 (((
1910 (% style="background-color:#dcdcdc" %)AT+ADR=0(%%)  Set the Adaptive Data Rate Off
1911 )))
1912
1913 (((
1914 (% style="background-color:#dcdcdc" %)AT+DR=5(%%)  Set Data Rate (Set AT+DR=3 for 915 band)
1915 )))
1916
1917 (((
1918 (% style="background-color:#dcdcdc" %)AT+TDC=300000(%%)  Set transmit interval to 5 minutes
1919 )))
1920
1921 (((
1922 (% style="background-color:#dcdcdc" %)AT+CHS=868400000(%%)  Set transmit frequency to 868.4Mhz
1923 )))
1924
1925 (((
1926 (% style="background-color:#dcdcdc" %)AT+DADDR=26 01 1A F1(%%)  Set Device Address to 26 01 1A F1
1927 )))
1928
1929 (((
1930 (% style="background-color:#dcdcdc" %)ATZ(%%)  Reset MCU
1931 )))
1932
1933
1934 (((
1935 As shown  below:
1936 )))
1937
1938 [[image:image-20220627160542-12.png]]
1939
1940
1941
1942 == 6.7  How to configure the EUI keys in LSN50? ==
1943
1944
1945 (((
1946 The early version of LSN50 firmware doesn't have pre-configured keys.
1947 It is recommended that you update the image to the latest version before configure the keys. Refer [[upgrade_image>>||anchor="H2.7200BFirmwareChangeLog"]] to update the firmware to the latest version.
1948 )))
1949
1950 (((
1951 Run AT commands to set the keys to desired keys; refer [[AT Command manual>>https://www.dragino.com/downloads/downloads/LSN50-LoRaST/DRAGINO_LSN50_AT_Commands_v1.6.3.pdf]].
1952 )))
1953
1954
1955
1956 = 7.  Trouble Shooting =
1957
1958
1959 == 7.1  Connection problem when uploading firmware. ==
1960
1961
1962 (((
1963 (% style="color:red" %)**Issue**(%%): While using USB to TTL to upload firmware via UART interface. It works for several times but most of times it fails.
1964 )))
1965
1966 (((
1967
1968 )))
1969
1970 (((
1971 (% style="color:green" %)**Checklist**:
1972 )))
1973
1974 (((
1975 ~1. Double check if follow up exactly the steps as manual.
1976 )))
1977
1978 (((
1979 2. Check if hardware works fine: a) check if AT command works, b) check if ISP / flash switch works: PA12 will have different output level while set the ISP/Flash Switch in different position. c) check if reset button works.
1980 )))
1981
1982 (((
1983 3. If you use Windows10 system. Please change the flash loader to run in Windows7 compatibility mode.
1984 )))
1985
1986
1987 [[image:image-20220627153421-8.png]]
1988
1989
1990 (((
1991 4. We have seen cases where the FT232 USB TTL adapter has a reliability issue with the PC USB chipset (Intel). In this case, even though points 1 and 2 above work, it still has a reliability issue for uploading. If this happens, change to a different PC or change the USB to TTL adapter to solve the issue.
1992 )))
1993
1994
1995
1996 == 7.2  Why I can't join TTN V3 in US915 / AU915 bands? ==
1997
1998
1999 It is due to channel mapping. Please see the [[Eight Channel Mode>>doc:Main.End Device AT Commands and Downlink Command.WebHome||anchor="H7.19EightChannelMode"]] section above for details.
2000
2001
2002
2003 == 7.3  AT Command input doesn't work ==
2004
2005
2006 In the case if user can see the console output but can't type input to the device. Please check if you already include the (% style="color:red" %)**ENTER**(%%) while sending out the command. Some serial tool doesn't send (% style="color:red" %)**ENTER**(%%) while press the send key, user need to add ENTER in their string.
2007
2008
2009
2010 = 8.  Order Info =
2011
2012
2013 Part Number: (% style="color:blue" %)**LSN50-XX-YY  **(%%)**or  (% style="color:blue" %)LSN50-v2-XX-YY-ZZ(%%)**
2014
2015 (% style="color:blue" %)**XX**(%%): The default frequency band
2016
2017 * (% style="color:red" %)**AS923 **(%%)**:** LoRaWAN AS923 band
2018 * (% style="color:red" %)**AU915 **(%%)**:** LoRaWAN AU915 band
2019 * (% style="color:red" %)**EU433 **(%%)**:** LoRaWAN EU433 band
2020 * (% style="color:red" %)**EU868 **(%%)**:** LoRaWAN EU868 band
2021 * (% style="color:red" %)**KR920 **(%%)**:** LoRaWAN KR920 band
2022 * (% style="color:red" %)**US915 **(%%)**:** LoRaWAN US915 band
2023 * (% style="color:red" %)**IN865 **(%%)**:**  LoRaWAN IN865 band
2024 * (% style="color:red" %)**CN470 **(%%)**:** LoRaWAN CN470 band
2025
2026 (% style="color:blue" %)**YY**(%%)**: **Hole Option
2027
2028 * (% style="color:red" %)**12**(%%): With M12 waterproof cable hole
2029 * (% style="color:red" %)**16**(%%): With M16 waterproof cable hole
2030 * (% style="color:red" %)**20**(%%): With M20 waterproof cable hole (LSN50 v2 doesn't have this version)
2031 * (% style="color:red" %)**NH**(%%): No Hole
2032
2033 (% style="color:blue" %)**ZZ**(%%)**: **Battery Option ( Only valid for v2 model)
2034
2035 * (% style="color:red" %)**4**(%%): with 4000mAh battery
2036 * (% style="color:red" %)**8**(%%): with 8500mAg battery
2037
2038 = 9. ​ Packing Info =
2039
2040
2041 (% style="color:blue" %)**For LSN50**(%%)**:**
2042
2043 **Package Includes**:
2044
2045 * LSN50 LoRa Sensor Node x 1
2046
2047 **Dimension and weight**:
2048
2049 * Device Size: 8 x 6.5 x 5 cm
2050 * Device Weight: 137g
2051 * Package Size / pcs : 9 x 7 x 6cm
2052 * Weight / pcs : 160g
2053
2054 (% style="color:blue" %)**For LSN50 v2**(%%)**:**
2055
2056 **Package Includes**:
2057
2058 * LSN50 v2 LoRa Sensor Node x 1
2059 * External antenna x 1
2060 * Spring Antenna (evaluate purpose)
2061
2062 **Dimension and weight**:
2063
2064 * Device Size: 9.7 x 6.5 x 4.7 cm
2065 * Device Weight: 150g
2066 * Package Size / pcs : 14.0 x 8x 5 cm
2067 * Weight / pcs : 180g
2068
2069 = 10.  ​Support =
2070
2071
2072 * Support is provided Monday to Friday, from 09:00 to 18:00 GMT+8. Due to different timezones we cannot offer live support. However, your questions will be answered as soon as possible in the before-mentioned schedule.
2073 * Provide as much information as possible regarding your enquiry (product models, accurately describe your problem and steps to replicate it etc) and send a mail to [[support@dragino.com>>url:http://../../../../../../D:%5C%E5%B8%82%E5%9C%BA%E8%B5%84%E6%96%99%5C%E8%AF%B4%E6%98%8E%E4%B9%A6%5CLoRa%5CLT%E7%B3%BB%E5%88%97%5Csupport@dragino.com]].
2074
2075 = 11.  References =
2076
2077
2078 * [[Product Page>>url:http://www.dragino.com/products/lora/item/128-lsn50.html]]
2079 * [[Data Sheet, Document Base>>https://www.dropbox.com/sh/djkxs7mr17y94mi/AABVlWbM9uzK9OA3mXyAT10Za?dl=0]]
2080 * [[Image Download>>url:https://github.com/dragino/LoRa_STM32/tree/master/LSN50.hex]]
2081
2082
2083 )))