Version 232.1 by Bei Jinggeng on 2023/03/21 09:41

Show last authors
1 (% style="text-align:center" %)
2 [[image:image-20220613162008-1.png||_mstalt="428142" height="510" width="334"]]
3
4
5
6
7
8 **Table of Contents:**
9
10 {{toc/}}
11
12
13
14
15
16 = 1. Introduction =
17
18 == 1.1 What is LHT65N Temperature & Humidity Sensor ==
19
20
21 (((
22 The Dragino LHT65N Temperature & Humidity sensor is a Long Range LoRaWAN Sensor. It includes a (% style="color:#4f81bd" %)**built-in Temperature & Humidity sensor**(%%) and has an external sensor connector to connect to an external (% style="color:#4f81bd" %)**Temperature Sensor.**
23 )))
24
25 (((
26 The LHT65N allows users to send data and reach extremely long ranges. 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, building automation, and so on.
27 )))
28
29 (((
30 LHT65N has a built-in 2400mAh non-chargeable battery which can be used for up to 10 years*.
31 )))
32
33 (((
34 LHT65N is full compatible with LoRaWAN v1.0.3 Class A protocol, it can work with a standard LoRaWAN gateway.
35 )))
36
37 (((
38 LHT65N supports (% style="color:#4f81bd" %)**Datalog Feature**(%%). It will record the data when there is no network coverage and users can retrieve the sensor value later to ensure no miss for every sensor reading.
39 )))
40
41 (((
42 *The actual battery life depends on how often to send data, please see the battery analyzer chapter.
43 )))
44
45
46 == 1.2 Features ==
47
48
49 * LoRaWAN v1.0.3 Class A protocol
50 * Frequency Bands: CN470/EU433/KR920/US915/EU868/AS923/AU915
51 * AT Commands to change parameters
52 * Remote configure parameters via LoRaWAN Downlink
53 * Firmware upgradeable via program port
54 * Built-in 2400mAh battery for up to 10 years of use.
55 * Built-in Temperature & Humidity sensor
56 * Optional External Sensors
57 * Tri-color LED to indicate working status
58 * Datalog feature (Max 3328 records)
59
60
61 == 1.3 Specification ==
62
63
64 (% style="color:#037691" %)**Built-in Temperature Sensor:**
65
66 * Resolution: 0.01 °C
67 * Accuracy Tolerance : Typ ±0.3 °C
68 * Long Term Drift: < 0.02 °C/yr
69 * Operating Range: -40 ~~ 85 °C
70
71 (% style="color:#037691" %)**Built-in Humidity Sensor:**
72
73 * Resolution: 0.04 %RH
74 * Accuracy Tolerance : Typ ±3 %RH
75 * Long Term Drift: < 0.02 °C/yr
76 * Operating Range: 0 ~~ 96 %RH
77
78 (% style="color:#037691" %)**External Temperature Sensor:**
79
80 * Resolution: 0.0625 °C
81 * ±0.5°C accuracy from -10°C to +85°C
82 * ±2°C accuracy from -55°C to +125°C
83 * Operating Range: -55 °C ~~ 125 °C
84
85
86 = 2. Connect LHT65N to IoT Server =
87
88 == 2.1 How does LHT65N work? ==
89
90
91 (((
92 LHT65N is configured as LoRaWAN OTAA Class A mode by default. Each LHT65N is shipped with a worldwide unique set of OTAA keys. To use LHT65N in a LoRaWAN network, first, we need to put the OTAA keys in LoRaWAN Network Server and then activate LHT65N.
93 )))
94
95 (((
96 If LHT65N is under the coverage of this LoRaWAN network. LHT65N can join the LoRaWAN network automatically. After successfully joining, LHT65N will start to measure environment temperature and humidity, and start to transmit sensor data to the LoRaWAN server. The default period for each uplink is 20 minutes.
97 )))
98
99
100 == 2.2 How to Activate LHT65N? ==
101
102
103 (((
104 The LHT65N has two working modes:
105 )))
106
107 * (((
108 (% style="color:blue" %)**Deep Sleep Mode**(%%): LHT65N doesn't have any LoRaWAN activation. This mode is used for storage and shipping to save battery life.
109 )))
110 * (((
111 (% style="color:blue" %)**Working Mode**(%%):  In this mode, LHT65N works as LoRaWAN Sensor mode to Join LoRaWAN network and send out the sensor data to the server. Between each sampling/tx/rx periodically, LHT65N will be in STOP mode (IDLE mode), in STOP mode, LHT65N has the same power consumption as Deep Sleep mode. 
112 )))
113
114 (((
115 The LHT65N is set in deep sleep mode by default; The ACT button on the front is to switch to different modes:
116 )))
117
118
119 [[image:image-20220515123819-1.png||_mstalt="430742" height="379" width="317"]]
120
121 [[image:image-20220525110604-2.png||_mstalt="427531"]]
122
123
124 == 2.3 Example to join LoRaWAN network ==
125
126
127 (% class="wikigeneratedid" %)
128 This section shows an example of how to join the TTN V3 LoRaWAN IoT server. Use with other LoRaWAN IoT servers is of a similar procedure.
129
130
131 (% class="wikigeneratedid" %)
132 [[image:image-20220522232442-1.png||_mstalt="427830" height="387" width="648"]]
133
134
135 (((
136 Assume the LPS8N is already set to connect to [[TTN V3 network>>url:https://eu1.cloud.thethings.network||_mstvisible="2"]], So it provides network coverage for LHT65N. Next we need to add the LHT65N device in TTN V3:
137 )))
138
139
140 === 2.3.1 Step 1: Create Device n TTN ===
141
142
143 (((
144 Create a device in TTN V3 with the OTAA keys from LHT65N.
145 )))
146
147 (((
148 Each LHT65N is shipped with a sticker with its device EUI, APP Key and APP EUI as below:
149 )))
150
151 [[image:image-20220617150003-1.jpeg||_mstalt="5426434"]]
152
153 User can enter these keys in the LoRaWAN Server portal. Below is TTN V3 screenshot:
154
155 Add APP EUI in the application.
156
157
158 [[image:image-20220522232916-3.png||_mstalt="430495"]]
159
160
161 [[image:image-20220522232932-4.png||_mstalt="430157"]]
162
163
164 [[image:image-20220522232954-5.png||_mstalt="431847"]]
165
166
167
168 (% style="color:red" %)**Note: LHT65N use same payload as LHT65.**
169
170
171 [[image:image-20220522233026-6.png||_mstalt="429403"]]
172
173
174 Input APP EUI,  APP KEY and DEV EUI:
175
176
177 [[image:image-20220522233118-7.png||_mstalt="430430"]]
178
179
180 === 2.3.2 Step 2: Activate LHT65N by pressing the ACT button for more than 5 seconds. ===
181
182
183 (((
184 Use ACT button to activate LHT65N and it will auto-join to the TTN V3 network. After join success, it will start to upload sensor data to TTN V3 and user can see in the panel.
185 )))
186
187 [[image:image-20220522233300-8.png||_mstalt="428389" height="219" width="722"]]
188
189
190 == 2.4 Uplink Payload   ( Fport~=2) ==
191
192
193 (((
194 The uplink payload includes totally 11 bytes. Uplink packets use FPORT=2 and (% style="color:#4f81bd" %)**every 20 minutes**(%%) send one uplink by default.
195 )))
196
197 (((
198 After each uplink, the (% style="color:blue" %)**BLUE LED**(%%) will blink once.
199 )))
200
201 (% border="1" cellspacing="4" style="background-color:#ffffcc; color:green; width:390px" %)
202 |=(% style="width: 60px;" %)(((
203 **Size(bytes)**
204 )))|=(% style="width: 30px;" %)(((
205 **2**
206 )))|=(% style="width: 100px;" %)(((
207 **2**
208 )))|=(% style="width: 100px;" %)(((
209 **2**
210 )))|=(% style="width: 50px;" %)(((
211 **1**
212 )))|=(% style="width: 50px;" %)(((
213 **4**
214 )))
215 |(% style="width:97px" %)(((
216 **Value**
217 )))|(% style="width:39px" %)(((
218 [[BAT>>||anchor="H2.4.2BAT-BatteryInfo"]]
219 )))|(% style="width:100px" %)(((
220 (((
221 [[Built-In Temperature>>||anchor="H2.4.3Built-inTemperature"]]
222 )))
223 )))|(% style="width:77px" %)(((
224 (((
225 [[Built-in Humidity>>||anchor="H2.4.4Built-inHumidity"]]
226 )))
227 )))|(% style="width:47px" %)(((
228 [[Ext>>||anchor="H2.4.5Ext23"]] #
229 )))|(% style="width:51px" %)(((
230 [[Ext value>>||anchor="H2.4.6Extvalue"]]
231 )))
232
233 * The First 6 bytes: has fix meanings for every LHT65N.
234 * The 7th byte (EXT #): defines the external sensor model.
235 * The 8^^th^^ ~~ 11^^th^^ byte: the value for external sensor value. The definition is based on external sensor type. (If EXT=0, there won't be these four bytes.)
236
237
238 === 2.4.1 Decoder in TTN V3 ===
239
240
241 When the uplink payload arrives TTNv3, it shows HEX format and not friendly to read. We can add LHT65N decoder in TTNv3 for friendly reading.
242
243 Below is the position to put the decoder and LHT65N decoder can be download from here: [[https:~~/~~/github.com/dragino/dragino-end-node-decoder>>https://github.com/dragino/dragino-end-node-decoder]]
244
245
246 [[image:image-20220522234118-10.png||_mstalt="451464" height="353" width="729"]]
247
248
249 === 2.4.2 BAT-Battery Info ===
250
251
252 These two bytes of BAT include the battery state and the actually voltage
253
254 [[image:image-20220523152839-18.png||_mstalt="457613"]]
255
256 (b)stands for binary
257
258 [[image:image-20220522235639-1.png||_mstalt="431392" height="139" width="727"]]
259
260
261 Check the battery voltage for LHT65N.
262
263 * BAT status=(0Xcba4>>14)&0xFF=11 (BIN) ,very good
264 * Battery Voltage =0xCBA4&0x3FFF=0x0BA4=2980mV
265
266
267 === 2.4.3 Built-in Temperature ===
268
269
270 [[image:image-20220522235639-2.png||_mstalt="431756" height="138" width="722"]]
271
272 * Temperature:  0x0ABB/100=27.47℃
273
274 [[image:image-20220522235639-3.png||_mstalt="432120"]]
275
276 * Temperature:  (0xF5C6-65536)/100=-26.18℃
277
278
279 === 2.4.4 Built-in Humidity ===
280
281
282 [[image:image-20220522235639-4.png||_mstalt="432484" height="138" width="722"]]
283
284 * Humidity:    0x025C/10=60.4%
285
286
287 === 2.4.5 Ext # ===
288
289
290 Bytes for External Sensor:
291
292 [[image:image-20220523152822-17.png||_mstalt="454545"]]
293
294
295 === 2.4.6 Ext value ===
296
297 ==== 2.4.6.1 Ext~=1, E3 Temperature Sensor ====
298
299
300 [[image:image-20220522235639-5.png||_mstalt="432848"]]
301
302
303 * DS18B20 temp=0x0ADD/100=27.81℃
304
305 The last 2 bytes of data are meaningless
306
307
308
309 [[image:image-20220522235639-6.png||_mstalt="433212"]]
310
311
312 * External temperature= (0xF54F-65536)/100=-27.37℃
313
314 F54F :  (F54F & 8000 == 1) , temp = (F54F - 65536)/100 = 27.37℃
315
316 (0105 & 8000:Judge whether the highest bit is 1, when the highest bit is 1, it is negative)
317
318 The last 2 bytes of data are meaningless
319
320 If the external sensor is 0x01, and there is no external temperature connected. The temperature will be set to 7FFF which is 327.67℃
321
322
323
324 ==== 2.4.6.2 Ext~=9, E3 sensor with Unix Timestamp ====
325
326
327 (((
328 Timestamp mode is designed for LHT65N with E3 probe, it will send the uplink payload with Unix timestamp. With the limitation of 11 bytes (max distance of AU915/US915/AS923 band), the time stamp mode will be lack of BAT voltage field, instead, it shows the battery status. The payload is as below:
329 )))
330
331 (((
332
333 )))
334
335 (% border="1" cellspacing="4" style="background-color:#ffffcc; color:green; width:480px" %)
336 |=(% style="width: 50px;" %)(((
337 **Size(bytes)**
338 )))|=(% style="width: 70px;" %)(((
339 **2**
340 )))|=(% style="width: 120px;" %)(((
341 **2**
342 )))|=(% style="width: 120px;" %)(((
343 **2**
344 )))|=(% style="width: 50px;" %)(((
345 **1**
346 )))|=(% style="width: 70px;" %)(((
347 **4**
348 )))
349 |(% style="width:110px" %)(((
350 **Value**
351 )))|(% style="width:71px" %)(((
352 [[External temperature>>||anchor="H4.2SetExternalSensorMode"]]
353 )))|(% style="width:99px" %)(((
354 [[Built-In Temperature>>||anchor="H2.4.3Built-inTemperature"]]
355 )))|(% style="width:132px" %)(((
356 BAT Status & [[Built-in Humidity>>||anchor="H2.4.4Built-inHumidity"]]
357 )))|(% style="width:54px" %)(((
358 Status & Ext
359 )))|(% style="width:64px" %)(((
360 [[Unix Time Stamp>>||anchor="H2.6.2UnixTimeStamp"]]
361 )))
362
363 * **Battery status & Built-in Humidity**
364
365 (% border="1" cellspacing="4" style="background-color:#ffffcc; color:green; width:461px" %)
366 |=(% style="width: 67px;" %)Bit(bit)|=(% style="width: 256px;" %)[15:14]|=(% style="width: 132px;" %)[11:0]
367 |(% style="width:67px" %)Value|(% style="width:256px" %)(((
368 BAT Status
369 00(b): Ultra Low ( BAT <= 2.50v)
370 01(b): Low  (2.50v <=BAT <= 2.55v)
371 10(b): OK   (2.55v <= BAT <=2.65v)
372 11(b): Good   (BAT >= 2.65v)
373 )))|(% style="width:132px" %)(((
374 [[Built-in Humidity>>||anchor="H2.4.4Built-inHumidity"]]
375 )))
376
377 * **Status & Ext Byte**
378
379 (% border="1" cellspacing="4" style="background-color:#ffffcc; color:green; width:500px" %)
380 |=(% scope="row" style="width: 60px;" %)**Bits**|(% style="width:90px" %)**7**|(% style="width:100px" %)**6**|(% style="width:90px" %)**5**|(% style="width:100px" %)**4**|(% style="width:60px" %)**[3:0]**
381 |=(% style="width: 96px;" %)**Status&Ext**|(% style="width:124px" %)None-ACK Flag|(% style="width:146px" %)Poll Message FLAG|(% style="width:109px" %)Sync time OK|(% style="width:143px" %)Unix Time Request|(% style="width:106px" %)Ext: 0b(1001)
382
383 * (% style="color:blue" %)**Poll Message Flag**:(%%)  1: This message is a poll message reply, 0: means this is a normal uplink.
384 * (% style="color:blue" %)**Sync time OK**: (%%) 1: Set time ok,0: N/A. After time SYNC request is sent, LHT65N will set this bit to 0 until got the time stamp from the application server.
385 * (% style="color:blue" %)**Unix Time Request**:(%%)  1: Request server downlink Unix time, 0 : N/A. In this mode, LHT65N will set this bit to 1 every 10 days to request a time SYNC. (AT+SYNCMOD to set this)
386
387
388 ==== 2.4.6.3 Ext~=6, ADC Sensor (use with E2 Cable) ====
389
390
391 In this mode, user can connect external ADC sensor to check ADC value. The 3V3_OUT can
392
393 be used to power the external ADC sensor; user can control the power on time for this
394
395 (% style="color:blue" %)**sensor by setting:**
396
397 **AT+EXT=6,timeout**  (% style="color:red" %)**Time to power this sensor, from 0 ~~ 65535ms**
398
399 **For example:**
400
401 AT+EXT=6,1000 will power this sensor for 1000ms before sampling the ADC value.
402
403
404 Or use **downlink command A2** to set the same.
405
406 The measuring range of the node is only about 0.1V to 1.1V The voltage resolution is about 0.24mv.
407
408 When the measured output voltage of the sensor is not within the range of 0.1V and 1.1V, the output voltage terminal of the sensor shall be divided The example in the following figure is to reduce the output voltage of the sensor by three times If it is necessary to reduce more times, calculate according to the formula in the figure and connect the corresponding resistance in series.
409
410 [[image:image-20220628150112-1.png||_mstalt="427414" height="241" width="285"]]
411
412
413 When ADC_IN1 pin is connected to GND or suspended, ADC value is 0
414
415 [[image:image-20220628150714-4.png||_mstalt="431054"]]
416
417
418 When the voltage collected by ADC_IN1 is less than the minimum range, the minimum range will be used as the output; Similarly, when the collected voltage is greater than the maximum range, the maximum range will be used as the output.
419
420
421 1) The minimum range is about 0.1V. Each chip has internal calibration, so this value is close to 0.1V
422
423 [[image:image-20220628151005-5.png||_mstalt="429546"]]
424
425
426 2) The maximum range is about 1.1V. Each chip has internal calibration, so this value is close to 1.1v
427
428 [[image:image-20220628151056-6.png||_mstalt="431873"]]
429
430
431 3) Within range
432
433 [[image:image-20220628151143-7.png||_mstalt="431210"]]
434
435
436
437 ==== 2.4.6.4 Ext~=2 TMP117 Sensor (Since Firmware v1.3) ====
438
439
440 [[image:image-20220927095645-1.png||_mstalt="433771" height="534" width="460"]]
441
442
443 (% style="color:blue" %)**Ext=2,Temperature Sensor(TMP117):**
444
445 [[image:image-20220906102307-7.png||_mstalt="430443"]]
446
447
448 (% style="color:blue" %)**Interrupt Mode and Counting Mode:**
449
450 The external cable NE2 can be use for MOD4 and MOD8
451
452
453
454 ==== 2.4.6.5 Ext~=4 Interrupt Mode (Since Firmware v1.3) ====
455
456
457 (% style="color:red" %)**Note: In this mode, 3.3v output will be always ON. LHT65N will send an uplink when there is a trigger.**
458
459
460 (% style="color:blue" %)**Interrupt Mode can be used to connect to external interrupt sensors such as:**
461
462 (% style="color:#037691" %)**Case 1: Door Sensor.** (%%)3.3v Out for such sensor is just to detect Open/Close.
463
464 In Open State, the power consumption is the same as if there is no probe
465
466 In Close state, the power consumption will be 3uA higher than normal.
467
468 [[image:image-20220906100852-1.png||_mstalt="429156" height="205" width="377"]]
469
470
471 Ext=4,Interrupt Sensor:
472
473 (% border="1.5" cellpadding="4" cellspacing="4" style="background-color:#ffffcc; color:green; height:6px; width:478px" %)
474 |(% style="width:101px" %)(((
475 AT+EXT=4,1
476 )))|(% style="width:373px" %)(((
477 Sent uplink packet in both rising and falling interrupt
478 )))
479 |(% style="width:101px" %)(((
480 AT+EXT=4,2
481 )))|(% style="width:373px" %)(((
482 Sent uplink packet only in falling interrupt
483 )))
484 |(% style="width:101px" %)(((
485 AT+EXT=4,3
486 )))|(% style="width:373px" %)(((
487 Sent uplink packet only in rising interrupt
488 )))
489
490 Trigger by falling edge:
491
492 [[image:image-20220906101145-2.png||_mstalt="428324"]]
493
494
495 Trigger by raising edge:
496
497 [[image:image-20220906101145-3.png||_mstalt="428688"]]
498
499
500
501 ==== 2.4.6.6 Ext~=8 Counting Mode(Since Firmware v1.3) ====
502
503
504 (% style="color:red" %)**Note: In this mode, 3.3v output will be always ON. LHT65N will count for every interrupt and uplink periodically.**
505
506
507 (% style="color:blue" %)**Case 1**(%%):  Low power consumption Flow Sensor, such flow sensor has pulse output and the power consumption in uA level and can be powered by LHT65N.
508
509 [[image:image-20220906101320-4.png||_mstalt="427336" height="366" width="698"]]
510
511
512 (% style="color:blue" %)**Case 2**(%%):  Normal Flow Sensor: Such flow sensor has higher power consumption and is not suitable to be powered by LHT65N. It is powered by external power and output <3.3v pulse
513
514 [[image:image-20220906101320-5.png||_mstalt="427700" height="353" width="696"]]
515
516
517 Ext=8, Counting Sensor ( 4 bytes):
518
519 (% border="2" cellpadding="4" cellspacing="4" style="background-color:#ffffcc; color:green; height:6px; width:381px" %)
520 |(% style="width:138px" %)(((
521 AT+EXT=8,0
522 )))|(% style="width:240px" %)(((
523 Count at falling interrupt
524 )))
525 |(% style="width:138px" %)(((
526 AT+EXT=8,1
527 )))|(% style="width:240px" %)(((
528 Count at rising interrupt
529 )))
530 |(% style="width:138px" %)(((
531 AT+SETCNT=60
532 )))|(% style="width:240px" %)(((
533 Sent current count to 60
534 )))
535
536 [[image:image-20220906101320-6.png||_mstalt="428064"]]
537
538
539 (% style="color:blue" %)**A2 downlink Command:**
540
541 A2 02:  Same as AT+EXT=2 (AT+EXT= second byte)
542
543 A2 06 01 F4:  Same as AT+EXT=6,500 (AT+EXT= second byte, third and fourth bytes)
544
545 A2 04 02:  Same as AT+EXT=4,2 (AT+EXT= second byte, third byte)
546
547 A2 08 01 00:  Same as AT+EXT=8,0 (AT+EXT= second byte, fourth byte)
548
549 A2 08 02 00 00 00 3C:  Same as AT+ SETCNT=60  (AT+ SETCNT = 4th byte and 5th byte and 6th byte and 7th byte)
550
551
552 == 2.5 Show data on Datacake ==
553
554
555 (((
556 Datacake IoT platform provides a human-friendly interface to show the sensor data, once we have sensor data in TTN V3, we can use Datacake to connect to TTN V3 and see the data in Datacake. Below are the steps:
557 )))
558
559 (((
560
561 )))
562
563 (((
564 (% style="color:blue" %)**Step 1**(%%): Be sure that your device is programmed and properly connected to the LoRaWAN network.
565 )))
566
567 (((
568 (% style="color:blue" %)**Step 2**(%%): Configure your Application to forward data to Datacake you will need to add integration. Go to TTN V3 Console ~-~-> Applications ~-~-> Integrations ~-~-> Add Integrations.
569 )))
570
571 (((
572
573 )))
574
575 (((
576 Add Datacake:
577 )))
578
579
580 [[image:image-20220523000825-7.png||_mstalt="429884" height="262" width="583"]]
581
582
583
584 Select default key as Access Key:
585
586
587 [[image:image-20220523000825-8.png||_mstalt="430248" height="453" width="406"]]
588
589
590 In Datacake console ([[https:~~/~~/datacake.co/>>url:https://datacake.co/]]) , add LHT65 device.
591
592
593 [[image:image-20220523000825-9.png||_mstalt="430612" height="366" width="392"]]
594
595
596 [[image:image-20220523000825-10.png||_mstalt="450619" height="413" width="728"]]
597
598
599 == 2.6 Datalog Feature ==
600
601
602 (((
603 Datalog Feature is to ensure IoT Server can get all sampling data from Sensor even if the LoRaWAN network is down. For each sampling, LHT65N will store the reading for future retrieving purposes. There are two ways for IoT servers to get datalog from LHT65N.
604 )))
605
606
607 === 2.6.1 Ways to get datalog via LoRaWAN ===
608
609
610 There are two methods:
611
612 (% style="color:blue" %)**Method 1:** (%%)IoT Server sends a downlink LoRaWAN command to [[poll the value>>||anchor="H2.6.4Pollsensorvalue"]] for specified time range.
613
614
615 (% style="color:blue" %)**Method 2: **(%%)Set [[PNACKMD=1>>||anchor="H4.13AutoSendNone-ACKmessages"]], LHT65N will wait for ACK for every uplink, when there is no LoRaWAN network, LHT65N will mark these records with non-ack messages and store the sensor data, and it will send all messages (10s interval) after the network recovery.
616
617
618 (% style="color:red" %)**Note for method 2:**
619
620 * a) LHT65N will do an ACK check for data records sending to make sure every data arrive server.
621 * b) LHT65N will send data in **CONFIRMED Mode** when PNACKMD=1, but LHT65N won't re-transmit the packet if it doesn't get ACK, it will just mark it as a NONE-ACK message. In a future uplink if LHT65N gets a ACK, LHT65N will consider there is a network connection and resend all NONE-ACK Message.
622
623 Below is the typical case for the auto-update datalog feature (Set PNACKMD=1)
624
625
626 [[image:image-20220703111700-2.png||_mstalt="426244" height="381" width="1119"]]
627
628
629 === 2.6.2 Unix TimeStamp ===
630
631
632 LHT65N uses Unix TimeStamp format based on
633
634
635 [[image:image-20220523001219-11.png||_mstalt="450450" height="97" width="627"]]
636
637
638
639 User can get this time from link:  [[https:~~/~~/www.epochconverter.com/>>url:https://www.epochconverter.com/]] :
640
641 Below is the converter example
642
643 [[image:image-20220523001219-12.png||_mstalt="450827" height="298" width="720"]]
644
645
646 So, we can use AT+TIMESTAMP=1611889405 or downlink 3060137afd00 to set the current time 2021 – Jan ~-~- 29 Friday 03:03:25
647
648
649 === 2.6.3 Set Device Time ===
650
651
652 (((
653 (% style="color:blue" %)**There are two ways to set device's time:**
654 )))
655
656 (((
657 **1.  Through LoRaWAN MAC Command (Default settings)**
658 )))
659
660 (((
661 User need to set SYNCMOD=1 to enable sync time via MAC command.
662 )))
663
664 (((
665 Once LHT65N Joined LoRaWAN network, it will send the MAC command (DeviceTimeReq) and the server will reply with (DeviceTimeAns) to send the current time to LHT65N. If LHT65N fails to get the time from the server, LHT65N will use the internal time and wait for next time request (AT+SYNCTDC to set the time request period, default is 10 days).
666 )))
667
668 (((
669 (% style="color:red" %)**Note: LoRaWAN Server need to support LoRaWAN v1.0.3(MAC v1.0.3) or higher to support this MAC command feature, Chirpstack,TTN V3 v3 and loriot support but TTN V3 v2 doesn't support. If server doesn't support this command, it will through away uplink packet with this command, so user will lose the packet with time request for TTN V3 v2 if SYNCMOD=1.**
670 )))
671
672
673 (((
674 **2. Manually Set Time**
675 )))
676
677 (((
678 User needs to set SYNCMOD=0 to manual time, otherwise, the user set time will be overwritten by the time set by the server.
679 )))
680
681
682 === 2.6.4 Poll sensor value ===
683
684
685 User can poll sensor value based on timestamps from the server. Below is the downlink command.
686
687 [[image:image-20220523152302-15.png||_mstalt="451581"]]
688
689
690 Timestamp start and Timestamp end use Unix TimeStamp format as mentioned above. Devices will reply with all data log during this time period, use the uplink interval.
691
692 For example, downlink command (% _mstmutation="1" %)**31 5FC5F350 5FC6 0160 05**(%%)
693
694 Is to check 2020/12/1 07:40:00 to 2020/12/1 08:40:00's data
695
696 Uplink Internal =5s,means LHT65N will send one packet every 5s. range 5~~255s.
697
698
699 === 2.6.5 Datalog Uplink payload ===
700
701
702 The Datalog poll reply uplink will use below payload format.
703
704 **Retrieval data payload:**
705
706 (% border="1" cellspacing="4" style="background-color:#ffffcc; color:green; width:480px" %)
707 |=(% style="width: 60px;" %)(((
708 **Size(bytes)**
709 )))|=(% style="width: 90px;" %)**2**|=(% style="width: 90px;" %)**2**|=(% style="width: 70px;" %)**2**|=(% style="width: 100px;" %)**1**|=(% style="width: 70px;" %)**4**
710 |(% style="width:97px" %)**Value**|(% style="width:123px" %)[[External sensor data>>||anchor="H2.4.6Extvalue"]]|(% style="width:108px" %)[[Built In Temperature>>||anchor="H2.4.3Built-inTemperature"]]|(% style="width:133px" %)[[Built-in Humidity>>||anchor="H2.4.4Built-inHumidity"]]|(% style="width:159px" %)Poll message flag & Ext|(% style="width:80px" %)[[Unix Time Stamp>>||anchor="H2.6.2UnixTimeStamp"]]
711
712 **Poll message flag & Ext:**
713
714 [[image:image-20221006192726-1.png||_mstalt="430508" height="112" width="754"]]
715
716 (% style="color:blue" %)**No ACK Message**(%%):  1: This message means this payload is fromn Uplink Message which doesn't get ACK from the server before ( for [[PNACKMD=1>>||anchor="H4.13AutoSendNone-ACKmessages"]] feature)
717
718 (% style="color:blue" %)**Poll Message Flag**(%%): 1: This message is a poll message reply.
719
720 * Poll Message Flag is set to 1.
721
722 * Each data entry is 11 bytes, to save airtime and battery, devices will send max bytes according to the current DR and Frequency bands.
723
724 For example, in US915 band, the max payload for different DR is:
725
726 (% style="color:blue" %)**a) DR0:** (%%)max is 11 bytes so one entry of data
727
728 (% style="color:blue" %)**b) DR1:**(%%) max is 53 bytes so devices will upload 4 entries of data (total 44 bytes)
729
730 (% style="color:blue" %)**c) DR2:**(%%) total payload includes 11 entries of data
731
732 (% style="color:blue" %)**d) DR3: **(%%)total payload includes 22 entries of data.
733
734 If devise doesn't have any data in the polling time. Device will uplink 11 bytes of 0   
735
736
737 **Example:**
738
739 If LHT65N has below data inside Flash:
740
741 [[image:image-20220523144455-1.png||_mstalt="430040" height="335" width="735"]]
742
743
744 If user sends below downlink command: (% style="background-color:yellow" %)3160065F9760066DA705
745
746 Where : Start time: 60065F97 = time 21/1/19 04:27:03
747
748 Stop time: 60066DA7= time 21/1/19 05:27:03
749
750
751 **LHT65N will uplink this payload.**
752
753 [[image:image-20220523001219-13.png||_mstalt="451204" height="421" style="text-align:left" width="727"]]
754
755
756 __**7FFF089801464160065F97**__ **__7FFF__ __088E__ __014B__ __41__ __60066009__** 7FFF0885014E41600660667FFF0875015141600662BE7FFF086B015541600665167FFF08660155416006676E7FFF085F015A41600669C67FFF0857015D4160066C1E
757
758 Where the first 11 bytes is for the first entry:
759
760 7FFF089801464160065F97
761
762 Ext sensor data=0x7FFF/100=327.67
763
764 Temp=0x088E/100=22.00
765
766 Hum=0x014B/10=32.6
767
768 poll message flag & Ext=0x41,means reply data,Ext=1
769
770 Unix time is 0x60066009=1611030423s=21/1/19 04:27:03
771
772
773 == 2.7 Alarm Mode & Feature "Multi sampling, one uplink" ==
774
775
776 (((
777 when the device is in alarm mode, it checks the built-in sensor temperature for a short time. if the temperature exceeds the preconfigured range, it sends an uplink immediately.
778 )))
779
780 (((
781 (% style="color:red" %)**Note: alarm mode adds a little power consumption, and we recommend extending the normal read time when this feature is enabled.**
782
783
784 === 2.7.1 ALARM MODE ( Since v1.3.1 firmware) ===
785
786
787 **Internal GXHT30 temperature alarm(Acquisition time: fixed at one minute)**
788
789 (((
790 (% class="box infomessage" %)
791 (((
792 **AT+WMOD=3**:  Enable/disable alarm mode. (0: Disabled, 1: Enabled Temperature Alarm for onboard temperature sensor)
793
794 **AT+CITEMP=1**:  The interval between checking the alarm temperature. (In minutes)
795
796 **AT+ARTEMP**:  Gets or sets the alarm range of the internal temperature sensor
797
798 (% _mstmutation="1" %)**AT+ARTEMP=? **(%%):  Gets the alarm range of the internal temperature sensor(% style="display:none" %)
799
800 **AT+ARTEMP=45,105**:  Set the internal temperature sensor alarm range from 45 to 105.
801
802 **AT+LEDALARM=1** :       Enable LED visual Alarm.
803 )))
804 )))
805
806 (% style="color:#4f81bd" %)**Downlink Command:**
807
808 AT+WMOD=1:  A501  ,  AT+WMOD=0 :  A600
809
810 AT+CITEMP=1 : A60001
811
812 AT+ARTEMP=1,60  :  A70001003C
813
814 AT+ARTEMP=-16,60 :  A7FFF0003C
815
816 AT+LEDALARM=1  :  3601
817
818
819 (% style="color:#4f81bd" %)**Downlink Command: AAXXXXXXXXXXXXXX**
820
821 Total bytes: 8 bytes
822
823 **Example: **AA0100010001003C
824
825 WMOD=01
826
827 CITEMP=0001
828
829 TEMPlow=0001
830
831 TEMPhigh=003C
832
833
834 **DS18B20 and TMP117 Threshold Alarm**
835
836 **~ AT+WMOD=1,60,-10,20**
837
838 (% style="color:#4f81bd" %)**Downlink Command:**
839
840 **Example: **A5013CFC180014
841
842 MOD=01
843
844 CITEMP=3C(S)
845
846 TEMPlow=FC18
847
848 TEMPhigh=0014
849
850
851 **Fluctuation alarm for DS18B20 and TMP117(Acquisition time: minimum 1s)**
852
853 **AT+WMOD=2,60,5** 
854
855 (% style="color:#4f81bd" %)**Downlink Command:**
856
857 **Example: **A5023C05
858
859 MOD=02
860
861 CITEMP=3C(S)
862
863 temperature fluctuation=05
864
865
866 **Sampling multiple times and uplink together**
867
868 **AT+WMOD=3,1,60,20,-16,32,1**   
869
870 Explain:
871
872 * (% style="color:#037691" %)**parameter1:**(%%)Set Working Mode to **Mode 3**
873 * (% style="color:#037691" %)**parameter2:**(%%) Set the temperature sampling mode to** 1**(1:DS18B20;2:TMP117;3:** **Internal GXHT30).
874 * (% style="color:#037691" %)**parameter3:**(%%)Sampling Interval is **60**s.
875 * (% style="color:#037691" %)**parameter4:**(%%)When there is **20** sampling dats, Device will send these data via one uplink. (max value is 60, means max 60 sampling in one uplink)
876 * (% style="color:#037691" %)**parameter5 & parameter6:**(%%)Temperature alarm range is **-16** to **32**°C,
877 * (% style="color:#037691" %)**parameter7:**(%%) 1 to enable temperature alarm, **0** to disable the temperature alarm. If alarm is enabled, a data will be sent immediately  if temperate exceeds the Alarm range.
878
879 (% style="color:#4f81bd" %)**Downlink Command:**
880
881 **Example: **A50301003C14FFF0002001
882
883 MOD=03
884
885 TEMP=DS18B20
886
887 CITEMP=003C(S)
888
889 Total number of acquisitions=14
890
891 TEMPlow=FFF0
892
893 TEMPhigh=0020
894
895 ARTEMP=01
896
897 **Uplink payload( Fport=3)**
898
899 **Example: CBEA**01**0992**//0A41//**09C4**
900
901 BatV=CBEA
902
903 TEMP=DS18B20
904
905 Temp1=0992  ~/~/ 24.50℃
906
907 Temp2=0A41  ~/~/ 26.25℃
908
909 Temp3=09C4  ~/~/ 25.00℃
910
911 (% style="color:red" %)**Note: This uplink will automatically select the appropriate DR according to the data length**
912
913 (% style="color:red" %)** In this mode, the temperature resolution of ds18b20 is 0.25℃ to save power consumption**
914 )))
915
916
917 === 2.7.2 ALARM MODE ( Before v1.3.1 firmware) ===
918
919
920 (% class="box infomessage" %)
921 (((
922 (((
923 **AT+WMOD=1**:  Enable/disable alarm mode. (0: Disabled, 1: Enabled Temperature Alarm for onboard temperature sensor)
924 )))
925
926 (((
927 **AT+CITEMP=1**:  The interval between checking the alarm temperature. (In minutes)
928 )))
929
930 (((
931 **AT+ARTEMP**:  Gets or sets the alarm range of the internal temperature sensor
932 )))
933
934 (((
935 (% _mstmutation="1" %)**AT+ARTEMP=? **(%%):  Gets the alarm range of the internal temperature sensor(% style="display:none" %)
936 )))
937
938 (((
939 **AT+ARTEMP=45,105**:  Set the internal temperature sensor alarm range from 45 to 105.
940 )))
941 )))
942
943 (% style="color:#4f81bd" %)**Downlink Command: AAXXXXXXXXXXXXXX**
944
945 Total bytes: 8 bytes
946
947 **Example:**AA0100010001003C
948
949 WMOD=01
950
951 CITEMP=0001
952
953 TEMPlow=0001
954
955 TEMPhigh=003C
956
957
958 == 2.8 LED Indicator ==
959
960
961 The LHT65 has a triple color LED which for easy showing different stage .
962
963 While user press ACT button, the LED will work as per LED status with ACT button.
964
965 In a normal working state:
966
967 * For each uplink, the BLUE LED or RED LED will blink once.
968 BLUE LED when external sensor is connected.
969 * RED LED when external sensor is not connected
970 * For each success downlink, the PURPLE LED will blink once
971
972
973 == 2.9 installation ==
974
975
976 [[image:image-20220516231650-1.png||_mstalt="428597" height="436" width="428"]]
977
978
979 = 3. Sensors and Accessories =
980
981 == 3.1 E2 Extension Cable ==
982
983
984 [[image:image-20220619092222-1.png||_mstalt="429533" height="182" width="188"]][[image:image-20220619092313-2.png||_mstalt="430222" height="182" width="173"]]
985
986
987 **1m long breakout cable for LHT65N. Features:**
988
989 * (((
990 Use for AT Command, works for both LHT52/LHT65N
991 )))
992 * (((
993 Update firmware for LHT65N, works for both LHT52/LHT65N
994 )))
995 * (((
996 Supports ADC mode to monitor external ADC
997 )))
998 * (((
999 Supports Interrupt mode
1000 )))
1001 * (((
1002 Exposed All pins from the LHT65N Type-C connector.
1003
1004
1005
1006 )))
1007
1008 [[image:image-20220619092421-3.png||_mstalt="430547" height="371" width="529"]]
1009
1010
1011 == 3.2 E3 Temperature Probe ==
1012
1013
1014 [[image:image-20220515080154-4.png||_mstalt="434681" alt="photo-20220515080154-4.png" height="182" width="161"]] [[image:image-20220515080330-5.png||_mstalt="428792" height="201" width="195"]]
1015
1016
1017 Temperature sensor with 2 meters cable long
1018
1019 * Resolution: 0.0625 °C
1020 * ±0.5°C accuracy from -10°C to +85°C
1021 * ±2°C accuracy from -55°C to +125°C
1022 * Operating Range: -40 ~~ 125 °C
1023 * Working voltage 2.35v ~~ 5v
1024
1025
1026 = 4. Configure LHT65N via AT command or LoRaWAN downlink =
1027
1028
1029 (((
1030 Use can configure LHT65N via AT Command or LoRaWAN Downlink.
1031 )))
1032
1033 * (((
1034 AT Command Connection: See [[FAQ>>||anchor="H6.FAQ"]].
1035 )))
1036
1037 * (((
1038 LoRaWAN Downlink instruction for different platforms: [[IoT LoRaWAN Server>>doc:Main.WebHome]]
1039 )))
1040
1041 (((
1042 There are two kinds of commands to configure LHT65N, they are:
1043 )))
1044
1045 * (((
1046 (% style="color:#4f81bd" %)**General Commands**.
1047 )))
1048
1049 (((
1050 These commands are to configure:
1051 )))
1052
1053 1. (((
1054 General system settings like: uplink interval.
1055 )))
1056 1. (((
1057 LoRaWAN protocol & radio-related commands.
1058 )))
1059
1060 (((
1061 They are the same for all Dragino Devices which supports DLWS-005 LoRaWAN Stack(Note~*~*). These commands can be found on the wiki: [[End Device Downlink Command>>doc:Main.End Device AT Commands and Downlink Command.WebHome]]
1062 )))
1063
1064 * (((
1065 (% style="color:#4f81bd" %)**Commands special design for LHT65N**
1066 )))
1067
1068 (((
1069 These commands are only valid for LHT65N, as below:
1070 )))
1071
1072
1073 == 4.1 Set Transmit Interval Time ==
1074
1075
1076 Feature: Change LoRaWAN End Node Transmit Interval.
1077
1078
1079 (% style="color:#4f81bd" %)**AT Command: AT+TDC**
1080
1081 [[image:image-20220523150701-2.png||_mstalt="427453"]]
1082
1083
1084 (% style="color:#4f81bd" %)**Downlink Command: 0x01**
1085
1086 Format: Command Code (0x01) followed by 3 bytes time value.
1087
1088 If the downlink payload=0100003C, it means set the END Node's Transmit Interval to 0x00003C=60(S), while type code is 01.
1089
1090 * **Example 1**: Downlink Payload: 0100001E  ~/~/ Set Transmit Interval (TDC) = 30 seconds
1091
1092 * **Example 2**: Downlink Payload: 0100003C  ~/~/ Set Transmit Interval (TDC) = 60 seconds
1093
1094
1095 == 4.2 Set External Sensor Mode ==
1096
1097
1098 Feature: Change External Sensor Mode.
1099
1100
1101 (% style="color:#4f81bd" %)**AT Command: AT+EXT**
1102
1103 [[image:image-20220523150759-3.png||_mstalt="432146"]]
1104
1105
1106 (% style="color:#4f81bd" %)**Downlink Command: 0xA2**
1107
1108 Total bytes: 2 ~~ 5 bytes
1109
1110 **Example:**
1111
1112 * 0xA201: Set external sensor type to E1
1113
1114 * 0xA209: Same as AT+EXT=9
1115
1116 * 0xA20702003c: Same as AT+SETCNT=60
1117
1118
1119 == 4.3 Enable/Disable uplink Temperature probe ID ==
1120
1121
1122 (((
1123 Feature: If PID is enabled, device will send the temperature probe ID on:
1124 )))
1125
1126 * (((
1127 First Packet after OTAA Join
1128 )))
1129 * (((
1130 Every 24 hours since the first packet.
1131 )))
1132
1133 (((
1134 PID is default set to disable (0)
1135
1136
1137 )))
1138
1139 (% style="color:#4f81bd" %)**AT Command:**
1140
1141 [[image:image-20220523150928-4.png||_mstalt="431821"]]
1142
1143
1144 (% style="color:#4f81bd" %)**Downlink Command:**
1145
1146 * **0xA800**  **~-~->** AT+PID=0
1147 * **0xA801**     **~-~->** AT+PID=1
1148
1149
1150 == 4.4 Set Password ==
1151
1152
1153 Feature: Set device password, max 9 digits
1154
1155
1156 (% style="color:#4f81bd" %)**AT Command: AT+PWORD**
1157
1158 [[image:image-20220523151052-5.png||_mstalt="428623"]]
1159
1160
1161 (% style="color:#4f81bd" %)**Downlink Command:**
1162
1163 No downlink command for this feature.
1164
1165
1166 == 4.5 Quit AT Command ==
1167
1168
1169 Feature: Quit AT Command mode, so user needs to input password again before use AT Commands.
1170
1171
1172 (% style="color:#4f81bd" %)**AT Command: AT+DISAT**
1173
1174 [[image:image-20220523151132-6.png||_mstalt="428649"]]
1175
1176
1177 (% style="color:#4f81bd" %)**Downlink Command:**
1178
1179 No downlink command for this feature.
1180
1181
1182 == 4.6 Set to sleep mode ==
1183
1184
1185 Feature: Set device to sleep mode
1186
1187 * **AT+Sleep=0**  : Normal working mode, device will sleep and use lower power when there is no LoRa message
1188 * **AT+Sleep=1** :  Device is in deep sleep mode, no LoRa activation happen, used for storage or shipping.
1189
1190 (% style="color:#4f81bd" %)**AT Command: AT+SLEEP**
1191
1192 [[image:image-20220523151218-7.png||_mstalt="430703"]]
1193
1194
1195 (% style="color:#4f81bd" %)**Downlink Command:**
1196
1197 * There is no downlink command to set to Sleep mode.
1198
1199
1200 == 4.7 Set system time ==
1201
1202
1203 Feature: Set system time, unix format. [[See here for format detail.>>||anchor="H2.6.2UnixTimeStamp"]]
1204
1205
1206 (% style="color:#4f81bd" %)**AT Command:**
1207
1208 [[image:image-20220523151253-8.png||_mstalt="430677"]]
1209
1210
1211 (% style="color:#4f81bd" %)**Downlink Command:**
1212
1213 0x306007806000  ~/~/  Set timestamp to 0x(6007806000),Same as AT+TIMESTAMP=1611104352
1214
1215
1216 == 4.8 Set Time Sync Mode ==
1217
1218
1219 (((
1220 Feature: Enable/Disable Sync system time via LoRaWAN MAC Command (DeviceTimeReq), LoRaWAN server must support v1.0.3 protocol to reply this command.
1221 )))
1222
1223 (((
1224 SYNCMOD is set to 1 by default. If user want to set a different time from LoRaWAN server, user need to set this to 0.
1225
1226
1227 )))
1228
1229 (% style="color:#4f81bd" %)**AT Command:**
1230
1231 [[image:image-20220523151336-9.png||_mstalt="431717"]]
1232
1233
1234 (% style="color:#4f81bd" %)**Downlink Command:**
1235
1236 0x28 01  ~/~/  Same As AT+SYNCMOD=1
1237 0x28 00  ~/~/  Same As AT+SYNCMOD=0
1238
1239
1240 == 4.9 Set Time Sync Interval ==
1241
1242
1243 Feature: Define System time sync interval. SYNCTDC default value: 10 days.
1244
1245
1246 (% style="color:#4f81bd" %)**AT Command:**
1247
1248 [[image:image-20220523151411-10.png||_mstalt="449696"]]
1249
1250
1251 (% style="color:#4f81bd" %)**Downlink Command:**
1252
1253 **0x29 0A**  ~/~/ Same as AT+SYNCTDC=0x0A
1254
1255
1256 == 4.10 Print data entries base on page. ==
1257
1258
1259 Feature: Print the sector data from start page to stop page (max is 416 pages).
1260
1261
1262 (% style="color:#4f81bd" %)**AT Command: AT+PDTA**
1263
1264 [[image:image-20220523151450-11.png||_mstalt="451035"]]
1265
1266
1267 (% style="color:#4f81bd" %)**Downlink Command:**
1268
1269 No downlink commands for feature
1270
1271
1272 == 4.11 Print last few data entries. ==
1273
1274
1275 Feature: Print the last few data entries
1276
1277
1278 (% style="color:#4f81bd" %)**AT Command: AT+PLDTA**
1279
1280 [[image:image-20220523151524-12.png||_mstalt="452101"]]
1281
1282
1283 (% style="color:#4f81bd" %)**Downlink Command:**
1284
1285 No downlink commands for feature
1286
1287
1288 == 4.12 Clear Flash Record ==
1289
1290
1291 Feature: Clear flash storage for data log feature.
1292
1293
1294 (% style="color:#4f81bd" %)**AT Command: AT+CLRDTA**
1295
1296 [[image:image-20220523151556-13.png||_mstalt="454129"]]
1297
1298
1299 (% style="color:#4f81bd" %)**Downlink Command: 0xA3**
1300
1301 * Example: 0xA301  ~/~/  Same as AT+CLRDTA
1302
1303
1304 == 4.13 Auto Send None-ACK messages ==
1305
1306
1307 Feature: LHT65N will wait for ACK for each uplink, If LHT65N doesn't get ACK from the IoT server, it will consider the message doesn't arrive server and store it. LHT65N keeps sending messages in normal periodically. Once LHT65N gets ACK from a server, it will consider the network is ok and start to send the not-arrive message.
1308
1309
1310 (% style="color:#4f81bd" %)**AT Command: AT+PNACKMD**
1311
1312 The default factory setting is 0
1313
1314 (% border="1" cellspacing="4" style="background-color:#ffffcc; color:green; width:367px" %)
1315 |=(% style="width: 158px;" %)**Command Example**|=(% style="width: 118px;" %)**Function**|=(% style="width: 87px;" %)**Response**
1316 |(% style="width:158px" %)AT+PNACKMD=1|(% style="width:118px" %)Poll None-ACK message|(% style="width:87px" %)OK
1317
1318 (% style="color:#4f81bd" %)**Downlink Command: 0x34**
1319
1320 * Example: 0x3401  ~/~/  Same as AT+PNACKMD=1
1321
1322
1323 == 4.14 Modified WMOD command for external sensor TMP117 or DS18B20 temperature alarm(Since firmware 1.3.0) ==
1324
1325
1326 Feature: Set internal and external temperature sensor alarms.
1327
1328 (% border="1" cellspacing="4" style="background-color:#ffffcc; color:green; width:500px" %)
1329 |=(% style="width: 250px;" %)**Command Example**|=(% style="width: 200px;" %)**Function**|=(% style="width: 50px;" %)**Response**
1330 |(% style="width:268px" %)AT+WMOD=parameter1,parameter2,parameter3,parameter4|(% style="width:255px" %)Set internal and external temperature sensor alarms|(% style="width:181px" %)OK
1331
1332 (% style="color:#037691" %)**AT+WMOD=parameter1,parameter2,parameter3,parameter4**
1333
1334 (% style="color:#037691" %)**Parameter 1**(%%):  Alarm mode:
1335
1336 0): Cancel
1337
1338 1): Threshold alarm
1339
1340 2): Fluctuation alarm
1341
1342
1343 (% style="color:#037691" %)** Parameter 2**(%%):  Sampling time. Unit: seconds, up to 255 seconds.
1344
1345 (% style="color:red" %)**Note: When the collection time is less than 60 seconds and always exceeds the set alarm threshold, the sending interval will not be the collection time, but will be sent every 60 seconds.**
1346
1347
1348 (% style="color:#037691" %) **Parameter 3 and parameter 4:**
1349
1350 1):  If Alarm Mode is set to 1: Parameter 3 and parameter 4 are valid, as before, they represent low temperature and high temperature.
1351
1352 Such as AT+WMOD=1,60,45,105, it means high and low temperature alarm.
1353
1354
1355 2):  If Alarm Mode is set to 2: Parameter 3 is valid, which represents the difference between the currently collected temperature and the last uploaded temperature.
1356
1357 Such as AT+WMOD=2,10,2,it means that it is a fluctuation alarm.
1358
1359 If the difference between the current collected temperature and the last Uplin is ±2 degrees, the alarm will be issued.
1360
1361
1362 (% style="color:#4f81bd" %)**Downlink Command: 0xA5**
1363
1364 0xA5 00 ~-~- AT+WMOD=0.
1365
1366 0xA5 01 0A 11 94 29 04 ~-~- AT+WMOD=1,10,45,105  (AT+WMOD = second byte, third byte, fourth and fifth bytes divided by 100, sixth and seventh bytes divided by 100 )
1367
1368 0XA5 01 0A F9 C0 29 04 ~-~-AT+WMOD=1,10,-16,105(Need to convert -16 to -1600 for calculation,-1600(DEC)=FFFFFFFFFFFFF9C0(HEX)  FFFFFFFFFFFFF9C0(HEX) +10000(HEX)=F9C0(HEX))
1369
1370 0xA5 02 0A 02 ~-~- AT+WMOD=2,10,2  (AT+WMOD = second byte, third byte, fourth byte)
1371
1372 0xA5 FF ~-~- After the device receives it, upload the current alarm configuration (FPORT=8). Such as 01 0A 11 94 29 04 or 02 0A 02.
1373
1374
1375 = 5. Battery & How to replace =
1376
1377 == 5.1 Battery Type ==
1378
1379
1380 (((
1381 LHT65N is equipped with a 2400mAH Li-MnO2 (CR17505) battery . The battery is an un-rechargeable battery with low discharge rate targeting for up to 8~~10 years use. This type of battery is commonly used in IoT devices for long-term running, such as water meters.
1382 )))
1383
1384 (((
1385 The discharge curve is not linear so can't simply use percentage to show the battery level. Below is the battery performance.
1386
1387
1388 [[image:image-20220515075034-1.png||_mstalt="428961" height="208" width="644"]]
1389 )))
1390
1391 The minimum Working Voltage for the LHT65N is ~~ 2.5v. When battery is lower than 2.6v, it is time to change the battery.
1392
1393
1394 == 5.2 Replace Battery ==
1395
1396
1397 LHT65N has two screws on the back, Unscrew them, and changing the battery inside is ok. The battery is a general CR17450 battery. Any brand should be ok.
1398
1399 [[image:image-20220515075440-2.png||_mstalt="429546" height="338" width="272"]][[image:image-20220515075625-3.png||_mstalt="431574" height="193" width="257"]]
1400
1401
1402 == 5.3 Battery Life Analyze ==
1403
1404
1405 (((
1406 Dragino battery-powered products are all run in Low Power mode. User can check the guideline from this link to calculate the estimated battery life:
1407 [[https:~~/~~/www.dragino.com/downloads/downloads/LoRa_End_Node/Battery_Analyze/DRAGINO_Battery_Life_Guide.pdf>>https://www.dragino.com/downloads/downloads/LoRa_End_Node/Battery_Analyze/DRAGINO_Battery_Life_Guide.pdf]]
1408 )))
1409
1410
1411 (((
1412 A full detail test report for LHT65N on different frequency can be found at : [[https:~~/~~/www.dropbox.com/sh/r2i3zlhsyrpavla/AAB1sZw3mdT0K7XjpHCITt13a?dl=0>>https://www.dropbox.com/sh/r2i3zlhsyrpavla/AAB1sZw3mdT0K7XjpHCITt13a?dl=0]]
1413 )))
1414
1415
1416 = 6. FAQ =
1417
1418 == 6.1 How to use AT Command? ==
1419
1420
1421 LHT65N supports AT Command set.User can use a USB to TTL adapter plus the Program Cable to connect to LHT65 for using AT command, as below.
1422
1423 [[image:image-20220530085651-1.png||_mstalt="429949"]]
1424
1425
1426 **Connection:**
1427
1428 * (% style="background-color:yellow" %)**USB to TTL GND <~-~->GND**
1429 * (% style="background-color:yellow" %)**USB to TTL RXD <~-~-> D+**
1430 * (% style="background-color:yellow" %)**USB to TTL TXD <~-~-> A11**
1431
1432 (((
1433 In PC, User needs to set serial tool(such as [[**putty**>>https://www.chiark.greenend.org.uk/~~sgtatham/putty/latest.html]], SecureCRT) baud rate to (% style="color:green" %)**9600**(%%) to access to access serial console for LHT65N. The AT commands are disable by default and need to enter password (default:(% style="color:green" %)**123456**) (%%)to active it. Timeout to input AT Command is 5 min, after 5-minute, user need to input password again. User can use AT+DISAT command to disable AT command before timeout.
1434 )))
1435
1436
1437 Input password and ATZ to activate LHT65N,As shown below:
1438
1439 [[image:image-20220530095701-4.png||_mstalt="430014"]]
1440
1441
1442 AT Command List is as below:
1443
1444 AT+<CMD>? :  Help on <CMD>
1445
1446 AT+<CMD> :  Run <CMD>
1447
1448 AT+<CMD>=<value> :  Set the value
1449
1450 AT+<CMD>=? :  Get the value
1451
1452 AT+DEBUG:  Set more info output
1453
1454 ATZ:  Trig a reset of the MCU
1455
1456 AT+FDR:  Reset Parameters to Factory Default, Keys Reserve
1457
1458 AT+DEUI:  Get or Set the Device EUI
1459
1460 AT+DADDR:  Get or Set the Device Address
1461
1462 AT+APPKEY:  Get or Set the Application Key
1463
1464 AT+NWKSKEY:  Get or Set the Network Session Key
1465
1466 AT+APPSKEY:  Get or Set the Application Session Key
1467
1468 AT+APPEUI:  Get or Set the Application EUI
1469
1470 AT+ADR:  Get or Set the Adaptive Data Rate setting. (0: off, 1: on)
1471
1472 AT+TXP:  Get or Set the Transmit Power (0-5, MAX:0, MIN:5, according to LoRaWAN Spec)
1473
1474 AT+DR:  Get or Set the Data Rate. (0-7 corresponding to DR_X)
1475
1476 AT+DCS:  Get or Set the ETSI Duty Cycle setting - 0=disable, 1=enable - Only for testing
1477
1478 AT+PNM:  Get or Set the public network mode. (0: off, 1: on)
1479
1480 AT+RX2FQ:  Get or Set the Rx2 window frequency
1481
1482 AT+RX2DR:  Get or Set the Rx2 window data rate (0-7 corresponding to DR_X)
1483
1484 AT+RX1DL:  Get or Set the delay between the end of the Tx and the Rx Window 1 in ms
1485
1486 AT+RX2DL:  Get or Set the delay between the end of the Tx and the Rx Window 2 in ms
1487
1488 AT+JN1DL:  Get or Set the Join Accept Delay between the end of the Tx and the Join Rx Window 1 in ms
1489
1490 AT+JN2DL:  Get or Set the Join Accept Delay between the end of the Tx and the Join Rx Window 2 in ms
1491
1492 AT+NJM:  Get or Set the Network Join Mode. (0: ABP, 1: OTAA)
1493
1494 AT+NWKID:  Get or Set the Network ID
1495
1496 AT+FCU:  Get or Set the Frame Counter Uplink
1497
1498 AT+FCD:  Get or Set the Frame Counter Downlink
1499
1500 AT+CLASS:  Get or Set the Device Class
1501
1502 AT+JOIN:  Join network
1503
1504 AT+NJS:  Get the join status
1505
1506 AT+SENDB:  Send hexadecimal data along with the application port
1507
1508 AT+SEND:  Send text data along with the application port
1509
1510 AT+RECVB:  Print last received data in binary format (with hexadecimal values)
1511
1512 AT+RECV:  Print last received data in raw format
1513
1514 AT+VER:  Get current image version and Frequency Band
1515
1516 AT+CFM:  Get or Set the confirmation mode (0-1)
1517
1518 AT+CFS:  Get confirmation status of the last AT+SEND (0-1)
1519
1520 AT+SNR:  Get the SNR of the last received packet
1521
1522 AT+RSSI:  Get the RSSI of the last received packet
1523
1524 AT+TDC:  Get or set the application data transmission interval in ms
1525
1526 AT+PORT:  Get or set the application port
1527
1528 AT+DISAT:  Disable AT commands
1529
1530 AT+PWORD: Set password, max 9 digits
1531
1532 AT+CHS:  Get or Set Frequency (Unit: Hz) for Single Channel Mode
1533
1534 AT+CHE:  Get or Set eight channels mode,Only for US915,AU915,CN470
1535
1536 AT+PDTA:  Print the sector data from start page to stop page
1537
1538 AT+PLDTA:  Print the last few sets of data
1539
1540 AT+CLRDTA:  Clear the storage, record position back to 1st
1541
1542 AT+SLEEP:  Set sleep mode
1543
1544 AT+EXT:  Get or Set external sensor model
1545
1546 AT+BAT:  Get the current battery voltage in mV
1547
1548 AT+CFG:  Print all configurations
1549
1550 AT+WMOD:  Get or Set Work Mode
1551
1552 AT+ARTEMP:  Get or set the internal Temperature sensor alarm range
1553
1554 AT+CITEMP:  Get or set the internal Temperature sensor collection interval in min
1555
1556 AT+SETCNT:  Set the count at present
1557
1558 AT+RJTDC:  Get or set the ReJoin data transmission interval in min
1559
1560 AT+RPL:  Get or set response level
1561
1562 AT+TIMESTAMP:  Get or Set UNIX timestamp in second
1563
1564 AT+LEAPSEC:  Get or Set Leap Second
1565
1566 AT+SYNCMOD:  Get or Set time synchronization method
1567
1568 AT+SYNCTDC:  Get or set time synchronization interval in day
1569
1570 AT+PID:  Get or set the PID
1571
1572
1573 == 6.2 Where to use AT commands and Downlink commands ==
1574
1575
1576 **AT commands:**
1577
1578 [[image:image-20220620153708-1.png||_mstalt="429806" height="603" width="723"]]
1579
1580
1581 **Downlink commands:**
1582
1583
1584 (% style="color:blue" %)**TTN:**
1585
1586 [[image:image-20220615092124-2.png||_mstalt="429221" height="649" width="688"]]
1587
1588
1589
1590 (% style="color:blue" %)**Helium:**
1591
1592 [[image:image-20220615092551-3.png||_mstalt="430794" height="423" width="835"]]
1593
1594
1595
1596 (% style="color:blue" %)**Chirpstack: The downlink window will not be displayed until the network is accessed**
1597
1598
1599 [[image:image-20220615094850-6.png||_mstalt="433082"]]
1600
1601
1602 [[image:image-20220615094904-7.png||_mstalt="433485" height="281" width="911"]]
1603
1604
1605
1606 (% style="color:blue" %)**Aws:**
1607
1608 [[image:image-20220615092939-4.png||_mstalt="434460" height="448" width="894"]]
1609
1610
1611 == 6.3 How to change the uplink interval? ==
1612
1613
1614 Please see this link: [[http:~~/~~/wiki.dragino.com/xwiki/bin/view/Main/How%20to%20set%20the%20transmit%20time%20interval/>>url:http://wiki.dragino.com/xwiki/bin/view/Main/How%20to%20set%20the%20transmit%20time%20interval/||_mstmutation="1" style="background-color: rgb(255, 255, 255);"]]
1615
1616
1617 == 6.4 How to use TTL-USB to connect a PC to input AT commands? ==
1618
1619
1620 [[image:image-20220615153355-1.png||_mstalt="430222"]]
1621
1622 [[image:1655802313617-381.png||_mstalt="293917"]]
1623
1624
1625 (((
1626 In PC, User needs to set serial tool(such as [[**putty**>>https://www.chiark.greenend.org.uk/~~sgtatham/putty/latest.html]], SecureCRT) baud rate to (% style="color:green" %)**9600** (%%)to access to access serial console for LHT65N. The AT commands are disable by default and need to enter password (default:(% style="color:green" %)**123456**(% style="color:red" %))(%%) to active it. Timeout to input AT Command is 5 min, after 5-minute, user need to input password again. User can use AT+DISAT command to disable AT command before timeout.
1627 )))
1628
1629
1630 Input password and ATZ to activate LHT65N,As shown below:
1631
1632 [[image:image-20220615154519-3.png||_mstalt="431925" height="672" width="807"]]
1633
1634
1635 == 6.5 How to use TTL-USB to connect PC to upgrade firmware? ==
1636
1637
1638 [[image:image-20220615153355-1.png||_mstalt="430222"]]
1639
1640
1641 (% style="color:blue" %)**Step1**(%%): Install [[TremoProgrammer>>https://www.dropbox.com/sh/g99v0fxcltn9r1y/AAAnJD_qGZ42bB52o4UmH9v9a/LHT65N%20Temperature%20%26%20Humidity%20Sensor/tool?dl=0&subfolder_nav_tracking=1]]  first.
1642
1643 [[image:image-20220615170542-5.png||_mstalt="430638"]]
1644
1645
1646
1647 (% _mstmutation="1" style="color:blue" %)**Step2**(%%):wiring method.(% style="display:none" %)
1648
1649 First connect the four lines;(% style="display:none" %)
1650
1651 [[image:image-20220621170938-1.png||_mstalt="431340" height="413" width="419"]],(% style="display:none" %)
1652
1653
1654 Then use DuPont cable to short circuit port3 and port1, and then release them, so that the device enters bootlaod mode.
1655
1656 [[image:image-20220621170938-2.png||_mstalt="431704"]]
1657
1658
1659
1660 (% style="color:blue" %)**Step3:**(%%)Select the device port to be connected, baud rate and bin file to be downloaded.
1661
1662 [[image:image-20220615171334-6.png||_mstalt="431028"]]
1663
1664
1665 Click the (% style="color:blue" %)**start**(%%) button to start the firmware upgrade.
1666
1667
1668 When this interface appears, it indicates that the download has been completed.
1669
1670 [[image:image-20220620160723-8.png||_mstalt="430703"]]
1671
1672
1673 Finally, unplug the DuPont cable on port4, and then use the DuPont cable to short circuit port3 and port1 to reset the device.
1674
1675
1676 == 6.6 Using USB-TYPE-C to connect to the computer using the AT command ==
1677
1678
1679 [[image:image-20220623110706-1.png||_mstalt="427869"]]
1680
1681
1682 **UART Port of LHT65N:**
1683
1684 * (% class="mark" %)**PB0: RXD**
1685 * (% class="mark" %)**PB1: TXD**
1686 * (% class="mark" %)**GND**
1687
1688 [[image:image-20220623112117-4.png||_mstalt="428350" height="459" width="343"]]
1689
1690
1691 (((
1692 In PC, User needs to set serial tool(such as [[**putty**>>https://www.chiark.greenend.org.uk/~~sgtatham/putty/latest.html]], SecureCRT) baud rate to (% style="color:green" %)**9600** (%%)to access to access serial console for LHT65N. The AT commands are disable by default and need to enter password (default:(% style="color:green" %)**123456**(% style="color:red" %))(%%) to active it. Timeout to input AT Command is 5 min, after 5-minute, user need to input password again. User can use AT+DISAT command to disable AT command before timeout.
1693 )))
1694
1695
1696 Input password and ATZ to activate LHT65N,As shown below:
1697
1698 [[image:image-20220615154519-3.png||_mstalt="431925" height="672" width="807"]]
1699
1700
1701 == 6.7 How to use  USB-TYPE-C to connect PC to upgrade firmware? ==
1702
1703
1704 [[image:image-20220623110706-1.png||_mstalt="427869"]]
1705
1706
1707 (% style="color:blue" %)**Step1**(%%): Install [[TremoProgrammer>>https://www.dropbox.com/sh/g99v0fxcltn9r1y/AAAnJD_qGZ42bB52o4UmH9v9a/LHT65N%20Temperature%20%26%20Humidity%20Sensor/tool?dl=0&subfolder_nav_tracking=1]]  first.
1708
1709 [[image:image-20220615170542-5.png||_mstalt="430638"]]
1710
1711
1712
1713 (% _mstmutation="1" style="color:blue" %)**Step2**(%%):wiring method.(% style="display:none" %)
1714
1715 First connect the four lines;
1716
1717 [[image:image-20220623113959-5.png||_mstalt="433485" height="528" width="397"]]
1718
1719 Connect A8 and GND with Dupont wire for a while and then separate,enter reset mode
1720
1721
1722
1723 (% style="color:blue" %)**Step3:**(%%)Select the device port to be connected, baud rate and bin file to be downloaded.
1724
1725 [[image:image-20220615171334-6.png||_mstalt="431028"]]
1726
1727
1728 Click the (% style="color:blue" %)**start**(%%) button to start the firmware upgrade.
1729
1730
1731 When this interface appears, it indicates that the download has been completed.
1732
1733 [[image:image-20220620160723-8.png||_mstalt="430703"]]
1734
1735
1736 Finally,Disconnect 3.3v,Connect A8 and GND with Dupont wire for a while and then separate,exit reset mode
1737
1738
1739 == 6.8 Why can't I see the datalog information ==
1740
1741
1742 ~1. The time is not aligned, and the correct query command is not used.
1743
1744 2. Decoder error, did not parse the datalog data, the data was filtered.
1745
1746
1747 = 7. Order Info =
1748
1749
1750 Part Number: (% style="color:#4f81bd" %)** LHT65N-XX-YY**
1751
1752 (% style="color:#4f81bd" %)**XX **(%%): The default frequency band
1753
1754 * (% style="color:#4f81bd" %)** **(% _mstmutation="1" style="color:red" %)**AS923**(%%): LoRaWAN AS923 band
1755 * (% style="color:#4f81bd" %)** **(% _mstmutation="1" style="color:red" %)**AU915**(%%): LoRaWAN AU915 band
1756 * (% style="color:#4f81bd" %)** **(% _mstmutation="1" style="color:red" %)**EU433**(%%): LoRaWAN EU433 band
1757 * (% style="color:#4f81bd" %)** **(% _mstmutation="1" style="color:red" %)**EU868**(%%): LoRaWAN EU868 band
1758 * (% style="color:#4f81bd" %)** **(% _mstmutation="1" style="color:red" %)**KR920**(%%): LoRaWAN KR920 band
1759 * (% style="color:#4f81bd" %)** **(% _mstmutation="1" style="color:red" %)**US915**(%%): LoRaWAN US915 band
1760 * (% style="color:#4f81bd" %)** **(% _mstmutation="1" style="color:red" %)**IN865**(%%): LoRaWAN IN865 band
1761 * (% style="color:#4f81bd" %)** **(% _mstmutation="1" style="color:red" %)**CN470**(%%): LoRaWAN CN470 band
1762
1763 (% style="color:#4f81bd" %)**YY**(%%): Sensor Accessories
1764
1765 * (% style="color:red" %)**E3**(%%): External Temperature Probe
1766
1767
1768 = 8. Packing Info =
1769
1770
1771 **Package Includes**:
1772
1773 * LHT65N Temperature & Humidity Sensor x 1
1774 * Optional external sensor
1775
1776 **Dimension and weight**:
1777
1778 * Device Size:  10 x 10 x 3.5 mm
1779 * Device Weight: 120.5g
1780
1781
1782 = 9. Reference material =
1783
1784
1785 * [[Datasheet, photos, decoder, firmware>>https://www.dropbox.com/sh/una19zsni308dme/AACOKp6J2RF5TMlKWT5zU3RTa?dl=0]]
1786
1787
1788 = 10. FCC Warning =
1789
1790
1791 This device complies with part 15 of the FCC Rules.Operation is subject to the following two conditions:
1792
1793 (1) This device may not cause harmful interference;
1794
1795 (2) this device must accept any interference received, including interference that may cause undesired operation.
1796
1797
1798