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