Version 441.2 by Xiaoling on 2022/11/23 10:49

Show last authors
1 (% style="display:none" %) (%%) ​​​(% style="display:none" %) [[image:image-20221123104832-1.jpeg||height="810" width="810"]]
2
3
4 (% style="display:none" %) (%%)
5
6
7
8
9
10
11
12 **Table of Contents:**
13
14 (% _mstaria-label="285168" aria-label="macro:toc widget" contenteditable="false" role="region" tabindex="-1" %)
15 (((
16 (% 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"]]
17 )))
18
19 {{toc/}}
20
21
22
23
24
25
26
27
28
29
30 = 1.  Introduction =
31
32
33 == 1.1 ​ What is LSN50 LoRa Sensor Node ==
34
35
36 (((
37 (((
38 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.
39 )))
40
41 (((
42 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.
43 )))
44
45 (((
46 (% style="color:#4472c4" %)**LSN50**(%%) uses STM32l0x chip from ST, STML0x is the (% style="color:#4472c4" %)**ultra-low-power**(%%) STM32L072xxxx 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.
47 )))
48
49 (((
50 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.
51 )))
52 )))
53
54
55 [[image:1656294562709-486.png]]
56
57
58
59 == 1.2  Specifications ==
60
61
62 (% style="color:#037691" %)**Micro Controller:**
63
64 * STM32L072xxxx MCU
65 * MCU: STM32L072CZT6
66 * Flash: 128KB
67 * RAM: 20KB
68 * EEPROM: 6KB
69 * Clock Speed: 32Mhz
70
71 (% style="color:#037691" %)**Common DC Characteristics:**
72
73 * Supply Voltage: 2.1v ~~ 3.6v
74 * Operating Temperature: -40 ~~ 85°C
75 * I/O pins: Refer to [[STM32L072 datasheet>>https://www.st.com/resource/en/datasheet/stm32l072cz.pdf]]
76
77 (% style="color:#037691" %)**LoRa Spec:**
78
79 * Frequency Range,
80 ** Band 1 (HF): 862 ~~ 1020 Mhz
81 * or
82 ** Band 2 (LF): 410 ~~ 528 Mhz
83 * 168 dB maximum link budget.
84 * +20 dBm - 100 mW constant RF output vs.
85 * +14 dBm high efficiency PA.
86 * Programmable bit rate up to 300 kbps.
87 * High sensitivity: down to -148 dBm.
88 * Bullet-proof front end: IIP3 = -12.5 dBm.
89 * Excellent blocking immunity.
90 * Low RX current of 10.3 mA, 200 nA register retention.
91 * Fully integrated synthesizer with a resolution of 61 Hz .
92 * FSK, GFSK, MSK, GMSK, LoRaTM and OOK modulation.
93 * Built-in bit synchronizer for clock recovery.
94 * Preamble detection.
95 * 127 dB Dynamic Range RSSI.
96 * Automatic RF Sense and CAD with ultra-fast AFC.
97 * Packet engine up to 256 bytes with CRC.
98 * LoRaWAN 1.0.2 Specification
99
100 (% style="color:#037691" %)**Battery:**
101
102 * Li/SOCI2 un-chargeable battery
103 * Capacity: 4000mAh
104 * Self Discharge: <1% / Year @ 25°C
105 * Max continuously current: 130mA
106 * Max boost current: 2A, 1 second
107
108 (% style="color:#037691" %)**Power Consumption**
109
110 * STOP Mode: 2.7uA @ 3.3v
111 * LoRa Transmit Mode: 125mA @ 20dBm 44mA @ 14dBm
112
113
114 == ​1.3  Features ==
115
116
117 * LoRaWAN 1.0.3 Class A, Class C
118 * STM32L072xxxx MCU
119 * SX1276/78 Wireless Chip
120 * Pre-load bootloader on USART1/USART2
121 * MDK-ARM Version 5.24a IDE
122 * I2C, LPUSART1, USB, SPI2
123 * 3x12bit ADC, 1x12bit DAC
124 * 20xDigital I/Os
125 * LoRa™ Modem
126 * Preamble detection
127 * Baud rate configurable
128 * CN470/EU433/KR920/US915/IN865
129 * EU868/AS923/AU915/MA869
130 * Open-source hardware / software
131 * Available Band:433/868/915/920 Mhz
132 * IP66 Waterproof Enclosure
133 * Ultra-Low Power consumption
134 * AT Commands to change parameters
135 * 4000mAh or 8500mAh Battery for long term use。
136
137
138 == 1.4 ​ Applications ==
139
140
141 * Smart Cities
142 * Smart Factory
143 * Smart Metering
144 * Smart Agriculture
145 * Smart Buildings & Home Automation
146 * Logistics and Supply Chain Management
147
148
149 == 1.5  Pin Definitions and Switch ==
150
151
152 (% class="wikigeneratedid" %)
153 [[image:1656295532863-613.png||height="371" width="721"]]
154
155
156 (% class="wikigeneratedid" %)
157 [[image:image-20220627101527-1.png]]
158
159
160
161 === 1.5.1 Jumper JP2 ===
162
163
164 Power on Device when put this jumper.
165
166
167
168 === 1.5.2 BOOT MODE / SW1 ===
169
170
171 (((
172 ~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.
173 )))
174
175 (((
176 2. Flash:  work mode, device starts to work and send out console output for further debug
177 )))
178
179
180
181 === 1.5.3 Reset Button ===
182
183
184 Press to reboot the device.
185
186
187
188 === 1.5.4 LED ===
189
190
191 It will flash:
192
193 ~1. When boot the device in flash mode
194
195 2. Send an uplink packet
196
197
198
199 === 1.6  Hardware Change log ===
200
201
202 (% style="color:red" %)**Note: Hardware version is marked in the PCB.**
203
204
205 (% style="color:#4472c4" %)**LSN50 v2.1:**
206
207 1. Change R14 to 1M ohm
208 1. Change R3, R4 to 4.7Kohm. So no need to modify them for 3 DS18B20 connection.
209 1. Add ESD to each I/O
210
211 (% style="color:#4472c4" %)**LSN50 v2.0:**
212
213 * Change to a new enclosure. Improve with external antenna, IP68, ear hook.
214
215
216
217 = 2.  Use LSN50 with LoRaWAN firmware =
218
219
220 == 2.1  How it works ==
221
222
223 (((
224 (((
225 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.
226 )))
227
228 (((
229
230 )))
231
232 (((
233 The diagram below shows the working flow in default firmware (ver 1.8.0): 
234
235
236 )))
237
238 (((
239 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.
240 )))
241 )))
242
243
244
245 == 2.2  ​Quick guide to connect to LoRaWAN server (OTAA) ==
246
247
248 (((
249 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. 
250
251
252 (% 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]]
253
254
255 )))
256
257 (% _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" %)​(%%)​
258
259 (((
260
261
262 (% style="color:blue" %)**Step 1**(%%): Create a device in TTN with the OTAA keys from LSN50.
263
264 Each LSN50 is shipped with a sticker with the default device EUI as below:
265 )))
266
267 (((
268
269 )))
270
271 (% _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" %)​(%%)​
272
273
274 (((
275 (((
276 You can enter this key in the LoRaWAN Server portal. Below is TTN screen shot:
277 )))
278
279 (((
280 **Register the device:**
281 )))
282 )))
283
284 (% _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" %)​​
285
286 (% _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" %)​
287
288
289 **Add APP EUI and DEV EUI:**
290
291
292 (% _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" %)​
293
294
295
296 **Add APP EUI in the application:**
297
298
299 (% _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" %)​
300
301
302 **Add APP KEY**
303
304 (% _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" %)​
305
306 (% _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" %)​
307
308 (% _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" %)​(%%)​
309
310 (% style="color:blue" %)**Step 2**(%%)**:** Power on LSN50
311
312
313 Put a Jumper on JP2 to power on the device.(% style="display:none" %)
314
315 (% style="display:none" %)
316
317 **For LSn50v2:**
318
319 [[image:1656313034748-905.png]](% style="display:none" %)
320
321
322 (% _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" %)​(%%)​
323
324 (((
325 (((
326 (% 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.
327
328
329 )))
330 )))
331
332 (% _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"]]
333
334 ​(% _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" %)​​
335
336
337 == 2.3  ​Working Mode & Uplink Payload ==
338
339
340 === 2.3.1  MOD~=1 (Default Mode) ===
341
342
343 (((
344 In this mode, uplink payload includes in total 11 bytes. Uplink packets use FPORT=2.
345
346
347 [[image:image-20220627171207-27.png]]
348
349
350 [[image:image-20220627150949-6.png]]
351
352
353 )))
354
355
356 === 2.3.2  ​Decode payload in The Things Network ===
357
358
359 While using TTN V3 network, you can add the payload format to decode the payload.
360
361
362 [[image:1656378466788-734.png]]
363
364
365 (((
366 The payload decoder function for TTN V3 are here:
367 )))
368
369 (((
370 LSN50 TTN V3 Payload Decoder:  [[https:~~/~~/github.com/dragino/dragino-end-node-decoder>>https://github.com/dragino/dragino-end-node-decoder]]
371 )))
372
373
374
375 == 2.4 Payload Explanation and Sensor Interface ==
376
377
378 === 2.4.1 Battery Info ===
379
380
381 (((
382 Check the battery voltage for LSN50.
383 )))
384
385 (((
386 Ex1: 0x0B45 = 2885mV
387 )))
388
389 (((
390 Ex2: 0x0B49 = 2889mV
391 )))
392
393
394
395
396 === 2.4.3 Digital Input ===
397
398
399 The digital input for pin PA12,
400
401 * When PA12 is high, the bit 1 of payload byte 6 is 1.
402 * When PA12 is low, the bit 1 of payload byte 6 is 0.
403
404
405
406
407 === 2.4.5 Digital Interrupt ===
408
409
410 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.
411
412
413 (((
414 (% style="color:#4472c4" %)** Interrupt connection method:**
415 )))
416
417 [[image:1656379178634-321.png]]
418
419
420
421
422
423
424 === 2.4.7 ​Distance Reading ===
425
426
427 Refer [[Ultrasonic Sensor section>>||anchor="H2.4.8UltrasonicSensor"]].
428
429
430
431 === 2.4.9  Battery Output - VDD pin ===
432
433
434 The VDD pin of LSN50v2 is connected to the Battery directly. If users want to use VDD pin to power an external sensor. User need to make sure the external sensor is of low power consumption. Because the VDD pin is always open. If the external sensor is of high power consumption. the battery of LSN50v2 will run out very soon.
435
436
437
438 === 2.4.10  +5V Output ===
439
440
441 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. 
442
443
444 (((
445 Since firmware (% style="color:red" %)**v1.6.3**(%%), The 5V output time can be controlled by AT Command.
446 )))
447
448 (((
449 (% style="color:#4472c4" %)**AT+5VT=1000**
450 )))
451
452 (((
453 Means set 5V valid time to have 1000ms. So the real 5V output will actually have 1000ms + sampling time for other sensors.
454 )))
455
456
457 (((
458 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.
459 )))
460
461
462
463
464
465 == 2.5 Configure LSN50 via AT or Downlink ==
466
467
468 (((
469 User can configure LSN50 via [[AT Commands >>||anchor="H3.A0UsingtheATCommands"]]or LoRaWAN Downlink Commands
470 )))
471
472 (((
473 There are two kinds of Commands:
474 )))
475
476 * (% _mstmutation="1" style="color:blue" %)**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"]]
477
478 * (% style="color:blue" %)**Sensor Related Commands**(%%): These commands are special designed for LSN50.  User can see these commands below:
479
480
481 === 2.5.1 Common Commands: ===
482
483
484 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]]
485
486
487
488 (((
489
490
491
492
493 == 2.7 ​Firmware Change Log ==
494
495
496 (((
497 **Firmware download: ** [[https:~~/~~/www.dropbox.com/sh/9k0a6sn8a94dc03/AAD54woDmnmAMUMY2WfKfjxoa?dl=0>>https://www.dropbox.com/sh/9k0a6sn8a94dc03/AAD54woDmnmAMUMY2WfKfjxoa?dl=0]]
498 )))
499
500 (((
501 **Firmware Change Log: **[[https:~~/~~/www.dropbox.com/sh/9k0a6sn8a94dc03/AAD54woDmnmAMUMY2WfKfjxoa?dl=0>>https://www.dropbox.com/sh/9k0a6sn8a94dc03/AAD54woDmnmAMUMY2WfKfjxoa?dl=0]]
502
503
504
505 )))
506
507 == 2.8 Use VDD or +5V to Power External Sensor ==
508
509
510 (((
511 User can use VDD or +5V to power external sensor.
512 )))
513
514 (((
515 (% style="color:red" %)**Note:**
516 )))
517
518 1. (((
519 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.
520 )))
521 1. (((
522 +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"]].
523 )))
524
525 (((
526 (% style="color:red" %)**Note: Always test the actually current pass by the JP2 jumper when connect to a new type of sensor.**
527 )))
528
529
530
531 == 2.9  Battery Analysis ==
532
533
534 === 2.9.1  Battery Type ===
535
536
537 (((
538 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.
539 )))
540
541 (((
542 The battery is designed to last for more than 5 years for the LSN50.
543 )))
544
545
546 (((
547 The battery related documents as below:
548 )))
549
550 * [[Battery Dimension>>https://www.dragino.com/downloads/index.php?dir=datasheet/Battery/]],
551 * [[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"]]
552 * [[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/]]
553
554 [[image:image-20220627175349-30.png]]
555
556
557
558
559
560 === 2.9.3 ​Battery Note ===
561
562
563 (((
564 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.
565 )))
566
567
568
569 === 2.9.4 Replace the battery ===
570
571
572 (((
573 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.
574 )))
575
576 (((
577 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).
578 )))
579
580
581
582 = 3.  Using the AT Commands =
583
584
585 == 3.1  Access AT Commands ==
586
587
588 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.
589
590
591
592
593
594 (% style="color:#4472c4" %)**LSN50 v2 UART connection photo**
595
596 [[image:image-20220627165424-25.png||height="437" width="894"]]
597
598
599
600 (((
601 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:
602 )))
603
604
605 [[image:image-20220627165531-26.png||height="624" width="893"]](% style="display:none" %)
606
607
608
609 == 3.2  Common AT Command Sequence ==
610
611
612 === 3.2.1  Multi-channel ABP mode (Use with SX1301/LG308) ===
613
614
615 (((
616 (% style="color:#037691" %)**If device has not joined network via OTAA:**
617 )))
618
619 (((
620 (% style="background-color:#dcdcdc" %)**AT+FDR**
621 )))
622
623 (((
624 (% style="background-color:#dcdcdc" %)**AT+NJM=0**
625 )))
626
627 (((
628 (% style="background-color:#dcdcdc" %)**ATZ**
629 )))
630
631
632 (((
633 (% style="color:#037691" %)**If device already joined network:**
634 )))
635
636 (((
637 (% style="background-color:#dcdcdc" %)**AT+NJM=0**
638 )))
639
640 (((
641 (% style="background-color:#dcdcdc" %)**ATZ**
642 )))
643
644
645
646 === 3.2.2  Single-channel ABP mode (Use with LG01/LG02) ===
647
648
649 See [[Sect 6.7>>||anchor="H6.7A0HowtoconfiguretheEUIkeysinLSN503F"]]
650
651
652
653 = 4.  Upload Firmware =
654
655
656 (% style="color:red" %)**Notes**:
657
658 * 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.
659 * Always run AT+FDR to reset parameters to factory default after an update image.
660 If the update is from image >= v1.3 to another image version >=v1.3, then the keys will be kept after running AT+FDR.
661 Otherwise (e.g. from v1.2 to v1.3), AT+FDR may erase the keys.
662
663
664 == 4.1  Upload Firmware via Serial Port ==
665
666
667 The LSN50's AT Command port can be used for firmware upgrade. The hardware connection for upgrade firmware is as below:
668
669
670
671 (% 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]].
672
673
674 (% style="color:blue" %)**Step2**(%%)**:** Download the [[LSN50 Image files>>url:https://www.dropbox.com/sh/g99v0fxcltn9r1y/AADnMzn1IN0LssOQNHlvooTta/LSN50%20%26%20LSN50-v2/Firmware/LSN50.hex?dl=0&subfolder_nav_tracking=1]].
675
676
677 (% style="color:blue" %)**Step3**(%%)**: **Open flashloader; choose the correct COM port to update
678
679
680 [[image:image-20220627163821-19.png]]
681
682
683 [[image:image-20220627163930-20.png||height="450" width="751"]]
684
685
686 [[image:image-20220627164030-21.png||height="459" width="750"]]
687
688
689 (((
690 (% style="color:blue" %)**Step4**(%%)**: **Switch SW1 back to flash state and push the RESET button.
691 )))
692
693 (((
694 The LSN50 will then run the new firmware.
695 )))
696
697
698
699 == 4.2  Upload Firmware via ST-Link V2 ==
700
701
702 You can use ST-LINK to upgrade firmware into LSN50. The hardware connection for upgrade firmware is as below:
703
704
705 (% style="color:blue" %)**Connection:**
706
707 * (% style="background-color:yellow" %)**ST-LINK v2 GND  <~-~-> LSN50v2 GND**
708 * (% style="background-color:yellow" %)**ST-LINK v2 SWCLK <~-~-> LSN50 PA14**
709 * (% style="background-color:yellow" %)**ST-LINK v2 SWDIO <~-~-> LSN50 PA13**
710 * (% style="background-color:yellow" %)**ST-LINK v2 RST  <~-~->  LSN50 NRST**
711
712 (% 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]]
713
714
715 (% style="color:blue" %)**Step2**(%%): Download the [[LSN50 Image files>>url:https://github.com/dragino/LoRa_STM32/tree/master/LSN50.hex]].
716
717
718 (% style="color:blue" %)**Step3:**(%%)** **Open ST-LINK utility, (% style="color:blue" %)**file ~-~-> open file**(%%) to select the image to be upgraded.
719
720
721 (% style="color:blue" %)**Step4:**(%%)** **Click the “(% style="color:blue" %)**Program Verify**”(%%) button on ST-LINK.
722
723
724 [[image:image-20220627164303-22.png]]
725
726
727 (((
728 (% 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.
729 )))
730
731 (((
732 (% 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.**
733 )))
734
735
736
737 [[image:image-20220627164303-23.png]]
738
739
740
741 = 5.  Developer Guide =
742
743
744 * (((
745 Software Source Code Download : [[https:~~/~~/github.com/dragino/LoRa_STM32/tree/master/STM32CubeExpansion_LRWAN>>https://github.com/dragino/LoRa_STM32/tree/master/STM32CubeExpansion_LRWAN]]
746 )))
747 * (((
748 Hardware Source Code Download: [[https:~~/~~/github.com/dragino/Lora/tree/master/LSN50>>https://github.com/dragino/Lora/tree/master/LSN50]]
749 )))
750
751 (((
752 LSN50 is an open source project, developer can use compile their firmware for customized applications. User can get the source code from:
753 )))
754
755 * (((
756 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"]]
757 )))
758 * (((
759 Hardware Design files:  [[https:~~/~~/github.com/dragino/Lora/tree/master/LSN50>>url:https://github.com/dragino/Lora/tree/master/LSN50]]
760 )))
761 * (((
762 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/]]
763 )))
764
765 (((
766 Use Keil to open project file:
767 )))
768
769 (((
770 STM32CubeExpansion_LRWAN/Projects/Multi/Applications/LoRa/DRAGINO-LRWAN(AT)/MDK-ARM/STM32L072CZ-Nucleo/Lora.uvprojx
771 )))
772
773 (((
774
775 )))
776
777 (((
778 In Keil, you can see what frequency band the code support.
779 )))
780
781 [[image:image-20220627162417-15.png]]
782
783
784 **~1. If you want to change frequency, modify the Preprocessor Symbols.**
785
786
787 For example, change EU868 to US915
788
789 [[image:1656318662202-530.png]]
790
791
792 **2. Compile and build**
793
794 [[image:image-20220627163212-17.png]]
795
796
797
798 = 6.  FAQ =
799
800
801 == 6.1  Why there is 433/868/915 version? ==
802
803
804 (((
805 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.
806 )))
807
808
809
810 == 6.2 What is the frequency range of LT LoRa part? ==
811
812
813 Different LT version supports different frequency range, below is the table for the working frequency and recommend bands for each model:
814
815 [[image:image-20220627155456-9.png]]
816
817
818
819 == 6.3  How to change the LoRa Frequency Bands/Region? ==
820
821
822 You can follow the instructions for [[how to upgrade image>>||anchor="H2.7200BFirmwareChangeLog"]].
823 When downloading the images, choose the required image file for download.
824
825
826
827 == 6.4  Can I use Private LoRa protocol? ==
828
829
830 (((
831 (((
832 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.
833 )))
834
835 (((
836 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.
837 )))
838
839
840 )))
841
842 (% style="color:#4472c4" %)**LoRa Shield + UNO**:
843
844 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.
845
846
847 Refs:  [[https:~~/~~/www.dropbox.com/sh/u9s41qdx5yujwcb/AAAT5r4QkMaeOogWrzJt7Wn4a?dl=0>>https://www.dropbox.com/sh/u9s41qdx5yujwcb/AAAT5r4QkMaeOogWrzJt7Wn4a?dl=0]]
848
849
850 Open the serial monitor to Arduino. The device acts as a LoRa Receiver and listen on the frequency 868.3Mhz by default.
851
852
853 (% style="color:#4472c4" %)**LSN50**:
854
855 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
856
857 Compile it and Upload it to LSN50, the LSN50 will transfer on the frequency 868.3Mhz.
858
859 In the Arduino Console, it will see the received packets as below.
860
861
862 [[image:image-20220627160116-10.png]]
863
864
865
866 == 6.5  How to set up LSN50 to work in 8 channel mode ==
867
868
869 (((
870 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.
871 )))
872
873 (((
874 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.
875 )))
876
877 (((
878
879 )))
880
881 (((
882 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.
883 )))
884
885 [[image:image-20220627160940-13.png]]
886
887
888 (((
889 When you use the TTN V3 network, the US915 frequency bands use are:
890 )))
891
892 * (((
893 903.9 - SF7BW125 to SF10BW125
894 )))
895 * (((
896 904.1 - SF7BW125 to SF10BW125
897 )))
898 * (((
899 904.3 - SF7BW125 to SF10BW125
900 )))
901 * (((
902 904.5 - SF7BW125 to SF10BW125
903 )))
904 * (((
905 904.7 - SF7BW125 to SF10BW125
906 )))
907 * (((
908 904.9 - SF7BW125 to SF10BW125
909 )))
910 * (((
911 905.1 - SF7BW125 to SF10BW125
912 )))
913 * (((
914 905.3 - SF7BW125 to SF10BW125
915 )))
916 * (((
917 904.6 - SF8BW500
918 )))
919
920 (((
921 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:
922 )))
923
924 (((
925 (% style="color:blue" %)**AT+CHE=2**
926 )))
927
928 (((
929 (% style="color:blue" %)**ATZ**
930 )))
931
932
933 (((
934 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.
935 )))
936
937 (((
938 The (% style="color:blue" %)**AU915**(%%) band is similar. Below are the AU915 Uplink Channels.
939 )))
940
941 [[image:image-20220627161124-14.png]]
942
943
944
945 == 6.6  How to set up LSN50 to work with Single Channel Gateway such as LG01/LG02? ==
946
947
948 (((
949 In this case, users need to set LSN50 to work in ABP mode and transmit in only one frequency.
950 )))
951
952 (((
953 Assume we have a LG02 working in the frequency 868400000 now, below is the steps.
954 )))
955
956
957 (((
958 (% 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.
959 )))
960
961
962 [[image:image-20220627160542-11.png]]
963
964
965 (((
966 (% 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.**
967 )))
968
969
970 (((
971 (% 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]].**
972 )))
973
974
975
976 (((
977 (% style="color:blue" %)**Step2:  **(%%)Run AT commands to make the LSN50 work in Single frequency and ABP mode. Below are the AT commands:
978 )))
979
980
981 (((
982 (% style="background-color:#dcdcdc" %)AT+FDR(%%)  :  Reset Parameters to Factory Default, Keys Reserve
983 )))
984
985 (((
986 (% style="background-color:#dcdcdc" %)AT+NJM=0(%%) : Set to ABP mode
987 )))
988
989 (((
990 (% style="background-color:#dcdcdc" %)AT+ADR=0(%%) : Set the Adaptive Data Rate Off
991 )))
992
993 (((
994 (% style="background-color:#dcdcdc" %)AT+DR=5(%%)  : Set Data Rate (Set AT+DR=3 for 915 band)
995 )))
996
997 (((
998 (% style="background-color:#dcdcdc" %)AT+TDC=300000(%%)  :  Set transmit interval to 5 minutes
999 )))
1000
1001 (((
1002 (% style="background-color:#dcdcdc" %)AT+CHS=868400000(%%) : Set transmit frequency to 868.4Mhz
1003 )))
1004
1005 (((
1006 (% style="background-color:#dcdcdc" %)AT+DADDR=26 01 1A F1(%%)  :Set Device Address to 26 01 1A F1
1007 )))
1008
1009 (((
1010 (% style="background-color:#dcdcdc" %)ATZ(%%)  :  Reset MCU
1011 )))
1012
1013
1014 (((
1015 As shown  below:
1016 )))
1017
1018 [[image:image-20220627160542-12.png]]
1019
1020
1021
1022 == 6.7  How to configure the EUI keys in LSN50? ==
1023
1024
1025 (((
1026 The early version of LSN50 firmware doesn't have pre-configured keys.
1027 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.
1028 )))
1029
1030 (((
1031 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]].
1032 )))
1033
1034
1035
1036 = 7.  Trouble Shooting =
1037
1038
1039 == 7.1  Connection problem when uploading firmware. ==
1040
1041
1042 (((
1043 (% 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.
1044 )))
1045
1046 (((
1047
1048 )))
1049
1050 (((
1051 (% style="color:green" %)**Checklist**:
1052 )))
1053
1054 (((
1055 ~1. Double check if follow up exactly the steps as manual.
1056 )))
1057
1058 (((
1059 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.
1060 )))
1061
1062 (((
1063 3. If you use Windows10 system. Please change the flash loader to run in Windows7 compatibility mode.
1064 )))
1065
1066
1067 [[image:image-20220627153421-8.png]]
1068
1069
1070 (((
1071 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.
1072 )))
1073
1074
1075
1076 == 7.2  Why I can't join TTN V3 in US915 / AU915 bands? ==
1077
1078
1079 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.
1080
1081
1082
1083 == 7.3  AT Command input doesn't work ==
1084
1085
1086 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.
1087
1088
1089
1090 = 8.  Order Info =
1091
1092
1093 Part Number: ** (% style="color:blue" %)LSN50-v2-XX-YY-ZZ(%%)**
1094
1095 (% style="color:blue" %)**XX**(%%): The default frequency band
1096
1097 * (% style="color:red" %)**AS923 **(%%)**:** LoRaWAN AS923 band
1098 * (% style="color:red" %)**AU915 **(%%)**:** LoRaWAN AU915 band
1099 * (% style="color:red" %)**EU433 **(%%)**:** LoRaWAN EU433 band
1100 * (% style="color:red" %)**EU868 **(%%)**:** LoRaWAN EU868 band
1101 * (% style="color:red" %)**KR920 **(%%)**:** LoRaWAN KR920 band
1102 * (% style="color:red" %)**US915 **(%%)**:** LoRaWAN US915 band
1103 * (% style="color:red" %)**IN865 **(%%)**:**  LoRaWAN IN865 band
1104 * (% style="color:red" %)**CN470 **(%%)**:** LoRaWAN CN470 band
1105
1106 (% style="color:blue" %)**YY**(%%)**: **Hole Option
1107
1108 * (% style="color:red" %)**12**(%%): With M12 waterproof cable hole
1109 * (% style="color:red" %)**16**(%%): With M16 waterproof cable hole
1110 * (% style="color:red" %)**20**(%%): With M20 waterproof cable hole (LSN50 v2 doesn't have this version)
1111 * (% style="color:red" %)**NH**(%%): No Hole
1112
1113 (% style="color:blue" %)**ZZ**(%%)**: **Battery Option ( Only valid for v2 model)
1114
1115 * (% style="color:red" %)**4**(%%): with 4000mAh battery
1116 * (% style="color:red" %)**8**(%%): with 8500mAg battery
1117
1118
1119 = 9. ​ Packing Info =
1120
1121
1122
1123 (% style="color:blue" %)**For LSN50 v2**(%%)**:**
1124
1125 **Package Includes**:
1126
1127 * LSN50 v2 LoRa Sensor Node x 1
1128 * External antenna x 1
1129 * Spring Antenna (evaluate purpose)
1130
1131 **Dimension and weight**:
1132
1133 * Device Size: 9.7 x 6.5 x 4.7 cm
1134 * Device Weight: 150g
1135 * Package Size / pcs : 14.0 x 8x 5 cm
1136 * Weight / pcs : 180g
1137
1138
1139 = 10.  ​Support =
1140
1141
1142 * 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.
1143 * 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]].
1144
1145
1146 = 11.  References =
1147
1148
1149 * [[Product Page>>url:http://www.dragino.com/products/lora/item/128-lsn50.html]]
1150 * [[Data Sheet, Document Base>>https://www.dropbox.com/sh/djkxs7mr17y94mi/AABVlWbM9uzK9OA3mXyAT10Za?dl=0]]
1151 * [[Image Download>>url:https://github.com/dragino/LoRa_STM32/tree/master/LSN50.hex]]
1152
1153
1154 )))