Version 442.2 by Xiaoling on 2022/11/23 11:02

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