image-20221031143350-3.png

  

Table of Contents:

1.  Introduction

1.1  ​What is LWL03A LoRaWAN Water Leak

 

The Dragino LWL03A is a LoRaWAN None-Position Rope Type Water Leak Controller. User can lay the LWL03A + Water Leak Cable on the ground to detect water leakage. The water leak cable is sensitivity, when there is water over the leak cable. LWL03A will indicates a water leak event and uplink to IoT server via LoRaWAN network.

LWL03A is powered by 8500mAh battery and target for long time use up to 10 years.

The LWL03A will send periodically data every day as well as for each water leak event. It also counts the water leak times and calculate last water leak duration.

Each LWL03A is pre-load with a set of unique keys for LoRaWAN registration, register these keys to LoRaWAN server and it will auto connect after power on.

​1.2  Features

  • LoRaWAN v1.0.3 Class A protocol.
  • Frequency Bands: CN470/EU433/KR920/US915/EU868/AS923/AU915/IN865/RU864
  • Water Leak detect
  • 8500mAh Li-SoCI2 battery
  • AT Commands to change parameters
  • Uplink on periodically and leakage event
  • Remote configure parameters via LoRa Downlink
  • Firmware upgradable via program port

1.3  Cable Specification

1.4  ​Applications

  • Smart Buildings & Home Automation
  • Logistics and Supply Chain Management
  • Smart Metering
  • Smart Agriculture
  • Smart Cities
  • Smart Factory

1.5  Mechanical

1654741444887-479.png

1654741488515-626.png

1654741510204-377.png

1.6  Installation

image-20221031145604-4.png

1.7  Firmware Change log

LWL03A Image files – Download link & Changelog

1.8  Pin Definitions and Switch

1654741572060-177.png

LWL03A is based on LSN50v2

1.8.1  Pin Definition

The device is pre-configured to connect to a door sensor. The other pins are not used. If user wants to know more about other pins, please refer to the user manual of LSN50v2 at:  https://www.dropbox.com/sh/djkxs7mr17y94mi/AABVlWbM9uzK9OA3mXyAT10Za?dl=0

1.8.2  Jumper JP2(Power ON/OFF)

Power on Device when putting this jumper.

1.8.3  BOOT MODE / SW1

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.

2)  Flash: work mode, the device starts to work and send out console output for further debug

1.8.4  Reset Button

Press to reboot the device.

1.8.5  LED

It will flash:

1. Boot the device in flash mode

2. Send an uplink packet

2.  Operation Mode

2.1  How it works

The LWL03A is configured as LoRaWAN OTAA Class A mode by default. It has OTAA keys to join network. To connect a local LoRaWAN network, user just need to input the OTAA keys in the network server and power on the LWL03A. It will auto join the network via OTAA.

In case user can't set the OTAA keys in the network server and has to use the existing keys from server. User can use AT Command to set the keys in the devices.

2.2  Example to use for LoRaWAN network

Here shows an example for how to join the TTN V3 Network. Below is the network structure, we use LG308 as LoRaWAN gateway here.

 

image-20221031151740-5.png

 

The LWL03A has water leak detect probe as above. When there is water between these two detect probe, they will be short and generate the water leak event. and send the status to LoRaWAN server. The LWL03A will uplink two type of messages to the server.

  • A keep-alive message which send every 2 hours. (Interval can be changed)
  • An emergency event message when detect a water leak/water no leak. (leak/no leak event can be disabled)
  • A periodically update at every 10 minutes when in water leak.(Interval can be changed)
  • A message when switch from water leak to none water leak. (Alarm event can be disabled)

The LG308 is already set to connect to TTN V3 network . What we need to now is only configure the TTN V3:

 

Step 1:  Create a device in TTN V3 with the OTAA keys from LWL03A.

Each LWL03A is shipped with a sticker with the default device EUI as below:

image-20220607170145-1.jpeg

Users can enter these keys in the LoRaWAN Server portal. Below is the TTN V3 screenshot:

Add APP EUI in the application:

1654742558691-332.png

1654742595660-519.png

1654742610413-498.png

1654742630064-347.png

Add APP KEY and DEV EUI

Step 2: Power on LWL03A

1654742860601-778.png

Put the jumper to power on LWL03A and it will auto-join to the TTN V3 network. After join success, it will start to upload sensor data to TTN V3 and the user can see it in the panel.

image-20221031161420-7.png

2.3  ​Uplink Payload

Uplink payloads have two types:

  • Open/Close Status: Use FPORT=2

  • Other control commands: Use other FPORT fields.

The application server should parse the correct value based on FPORT settings.

 

 

2.3.1  Device Status, FPORT=5

 

Include device configure status. Once LDS03A Joined the network, it will uplink this message to the server. After that, LDS03A will uplink Device Status every 12 hours.

Users can also use the downlink command(0x26 01) to ask LDS03A to resend this uplink. This uplink payload also includes the DeviceTimeReq to get time.

image-20220609105437-3.png

Example parse in TTNv3

image-20220609105101-2.png

  • Sensor Model: For LDS03A, this value is 0x0A
  • Firmware Version: 0x0100, Means: v1.0.0 version
  • Frequency Band:

*0x01: EU868

*0x02: US915

*0x03: IN865

*0x04: AU915

*0x05: KZ865

*0x06: RU864

*0x07: AS923

*0x08: AS923-1

*0x09: AS923-2

*0x0a: AS923-3

*0x0b: CN470

*0x0c: EU433

*0x0d: KR920

*0x0e: MA869

  • Sub-Band:
    • AU915 and US915:value 0x00 ~ 0x08
    • CN470: value 0x0B ~ 0x0C
    • Other Bands: Always 0x00
  • Battery Info:

Check the battery voltage.

Ex1: 0x0B45 = 2885mV

Ex2: 0x0B49 = 2889mV

2.3.2  Sensor Configuration, FPORT=4

LDS03A will only send this command after getting the downlink command (0x26 02) from the server.

image-20220609110123-5.png

 

  • TDC: (default: 0x001C20)

Uplink interval for the Open/Close Event, default value is 0x001C20 which is 7200 seconds = 2 hours.

 

  • Disalarm: (default: 0)

 If Disalarm = 1, LDS03A will only send uplink at every TDC periodically. This is normally use for pulse meter application, in this application, there are many open/close event, and platform only care about the total number of pulse.

 If Disalarm = 0, LDS03A will send uplink at every TDC periodically and send data on each open/close event. This is useful for the application user need to monitor the open/close event in real-time.

 

 Note: When Disalarm=0, a high frequently open/close event will cause lots of uplink and drain battery very fast. 

 

  • Keep Status & Keep Time

Shows the configure value of Alarm Base on Timeout Feature

image-20220609110018-4.png

2.3.3  Real-Time Open/Close Status, Uplink FPORT=2

LDS03A will send this uplink after Device Status once join the LoRaWAN network successfully. And LDS03A will:

1. periodically send this uplink every 2 hours, this interval can be changed.

2. There is an Open/Close event.  

Uplink Payload totals 11 bytes.

Real-Time Open/Close Status, FPORT=2
Size(bytes)1334
ValueStatus & AlarmTotal open door events

The last door open
duration (unit: min)

Unix TimeStamp
Status & Alarm field
Size(bit)611
ValueReserveEnable/disable Timeout Alarm
0: No Alarm; 1: Alarm
Status
0: Close, 1: Open

image-20220609110547-6.png

2.3.4  Historical Door Open/Close Event, FPORT=3

LDS03A stores sensor values and users can retrieve these history values via the downlink command.

The historical payload includes one or multiplies entries and every entry has the same payload as Real-Time open/close status.

 

  • Each data entry is 11 bytes and has the same structure as Real-Time open/close status, to save airtime and battery, LDS03A will send max bytes according to the current DR and Frequency bands.

For example, in the US915 band, the max payload for different DR is:

  1. DR0: max is 11 bytes so one entry of data

  2. DR1: max is 53 bytes so devices will upload 4 entries of data (total 44 bytes)

  3. DR2: total payload includes 11 entries of data

  4. DR3: total payload includes 22 entries of data.

 

If LDS03A doesn't have any data in the polling time. It will uplink 11 bytes of 0

image-20220609112215-7.png

Downlink:

0x31 61 8E 57 40 61 8E 81 70 05

 

Uplink:

00 00 00 00 00 00 00 61 8E 5F 8F 01 00 00 01 00 00 00 61 8E 5F D2 00 00 00 01 00 00 02 61 8E 60 64 01 00 00 02 00 00 02 61 8E 60 75 00 00 00 02 00 00 01 61 8E 60 C6 00 00 00 02 00 00 01 61 8E 7B A7 01 00 00 03 00 00 01 61 8E 7F 38 00 00 00 03 00 00 02 61 8E 7F CE 01 00 00 04 00 00 02 61 8E 81 1B 00 00 00 04 00 00 00 61 8E 81 50

 

Parsed Value:

[ALARM, DOOR_OPEN_STATUS, DOOR_OPEN_TIMES,LAST_DOOR_OPEN_DURATION, TIME]

 

[FALSE, CLOSE, 0, 0, 2021-11-12 12:35:27],

[FALSE, OPEN,  1, 0, 2021-11-12 12:36:34],

[FALSE, CLOSE, 1, 2, 2021-11-12 12:39:00],

[FALSE, OPEN,  2, 2, 2021-11-12 12:39:17],

[FALSE, CLOSE, 2, 1, 2021-11-12 12:40:38],

[FALSE, CLOSE, 2, 1, 2021-11-12 14:35:19],

[FALSE, OPEN,  3, 1, 2021-11-12 14:50:32],

[FALSE, CLOSE, 3, 2, 2021-11-12 14:53:02],

[FALSE, OPEN,  4, 2, 2021-11-12 14:58:35],

[FALSE, CLOSE, 4, 0, 2021-11-12 14:59:28],

2.4  Datalog Feature

When a user wants to retrieve sensor value, he can send a poll command from the IoT platform to ask the sensor to send value in the required time slot.

2.4.1  Unix TimeStamp

LDS03A use Unix TimeStamp format based on

image-20220609113256-8.png

Users can get this time from the link:  https://www.epochconverter.com/ :

Below is the converter example

image-20220609113256-9.png

So, we can use AT+TIMESTAMP=1611889405 or downlink 3060137afd00 to set the current time 2021 – Jan -- 29 Friday 03:03:25

2.4.2  Set Device Time

There are two ways to set the device's time:

 

1.  Through LoRaWAN MAC Command (Default settings)

Users need to set SYNCMOD=1 to enable sync time via the MAC command.

Once LDS03A Joined the LoRaWAN network, it will send the MAC command (DeviceTimeReq) and the server will reply with (DeviceTimeAns) to send the current time to LDS03A. If LDS03A fails to get the time from the server, LDS03A will use the internal time and wait for the next time request [via Device Status (FPORT=5)].

 

Note: LoRaWAN Server needs to support LoRaWAN v1.0.3(MAC v1.0.3) or higher to support this MAC command feature.

 

2.  Manually Set Time

Users need to set SYNCMOD=0 to manual time, otherwise, the user set time will be overwritten by the time set by the server.

2.5 ​Show Data in DataCake IoT Server

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:

 

Step 2: Configure LDS03A in Datacake.

1654746350207-427.png

1654747162439-840.png

1654746405400-203.png

1654746763908-732.png

1654746716087-684.png

1654746693868-718.png

1654746674738-826.png

1654746646379-591.png

1654746549277-209.png

1654746593411-887.png

3.  Configure LDS03A via AT Command or LoRaWAN Downlink

Use can configure LDS03A via AT Command or LoRaWAN Downlink.

  • AT Command Connection: See FAQ.

  • LoRaWAN Downlink instruction for different platforms: IoT LoRaWAN Server

     

There are two kinds of commands to configure LDS03A, they are:

  •  General Commands.

These commands are to configure:

  • General system settings like: uplink interval.

  • LoRaWAN protocol & radio related command.

They are same for all Dragino Device which support DLWS-005 LoRaWAN Stack. These commands can be found on the wiki: End Device AT Commands and Downlink Command

 

  •  Commands special design for LDS03A

These commands only valid for LDS03A, as below:

3.1  Set Transmit Interval Time

Feature: Change LoRaWAN End Node Transmit Interval.

AT Command: AT+TDC

image-20220607171554-8.png

Downlink Command: 0x01

Format: Command Code (0x01) followed by 3 bytes time value.

If the downlink payload=0100003C, it means set the END Node's Transmit Interval to 0x00003C=60(S), while type code is 01.

  • Example 1: Downlink Payload: 0100001E        // Set Transmit Interval (TDC) = 30 seconds

  • Example 2: Downlink Payload: 0100003C       // Set Transmit Interval (TDC) = 60 seconds

     

3.2  Set Password

Feature: Set device password, max 9 digits.

AT Command: AT+PWORD

Command ExampleFunctionResponse

AT+PWORD=?

Show password

123456

OK

AT+PWORD=999999

Set password

OK

Downlink Command:

No downlink command for this feature.

3.3  Quit AT Command

Feature: Quit AT Command mode, so user needs to input the password again before using AT Commands.

AT Command: AT+DISAT

Command ExampleFunctionResponse
AT+DISATQuit AT Commands modeOK

Downlink Command:

No downlink command for this feature.

3.4  Enable / Disable Alarm

Feature: Enable/Disable Alarm for open/close event. Default value 0.

AT Command:

image-20220609140712-1.png

Downlink Command:

0xA7 01     // Same As AT+DISALARM=1

0xA7 00     // Same As AT+DISALARM=0

3.5  Clear count

Feature: Clear current door open.

AT Command:

Command ExampleFunctionResponse
AT+CLRCClear the count of door open events.OK

Downlink Command:

0xA6 01 // Same As AT+ CLRC

3.6  Set system time

Feature: Set system time, Unix format. See here for format detail.

AT Command:

image-20220609141735-2.png

Downlink Command:

0x306007806000      // Set timestamp to 0x(6007806000),Same as AT+TIMESTAMP=1611104352

3.7  Set Time Sync Mode

Feature: Enable/Disable Sync system time via LoRaWAN MAC Command (DeviceTimeReq), LoRaWAN server must support v1.0.3 protocol to reply to this command.

SYNCMOD is set to 1 by default. If user wants to set a different time from the LoRaWAN server, the user needs to set this to 0.

AT Command:

image-20220609142205-4.png

Downlink Command:

0x28 01           // Same As AT+SYNCMOD=1

0x28 01 08      // Same As AT+SYNCMOD=1,8

0x28 01 F4      // Same As AT+SYNCMOD=1,-12

0x28 00           // Same As AT+SYNCMOD=0

3.8  Alarm Base on Timeout

LDS03A can monitor the timeout for a status change, this feature can be used to monitor some events such as door opening too long etc. Related Parameters are:

 

  • Keep Status: Status to be monitor

Keep Status = 1: Monitor Close to Open event

Keep Status = 0: Monitor Open to Close event

 

  • Keep Time: Timeout to send an Alarm

Range 0 ~ 65535(0xFFFF) seconds.

If keep time = 0, Disable Alarm Base on Timeout feature.

If keep time > 0, device will monitor the keep status event and send an alarm when status doesn't change after timeout.

 

AT Command to configure:

  • AT+TTRIG=1,30   --> When the Keep Status change from close to open, and device remains in open status for more than 30 seconds. LDS03A will send an uplink packet, the Alarm bit (the second bit of 1st byte of payload) on this uplink packet is set to 1.

  • AT+TTRIG=0,0       -->  Default Value, disable timeout Alarm.

 

Downlink Command to configure:

Command: 0xA9 aa bb cc

A9: Command Type Code

aa: status to be monitored

bb cc: timeout.

 

If user send 0xA9 01 00 1E: equal to AT+TTRIG=1,30

Or

0xA9 00 00 00: Equal to AT+TTRIG=0,0. Disable timeout Alarm.

3.9  Clear Flash Record

Feature: Clear flash storage for data log feature.

AT Command: AT+CLRDTA

image-20220609142912-5.png

 

Downlink Command:

Example: 0xA301   //  Same as AT+CLRDTA

3.10  Count Mod (Since firmware v1.2.0)

AT Command:

Command ExampleFunctionResponse

AT+COUNTMOD=0

the count value keeps accumulating mode

 

OK

AT+COUNTMOD=1

the count value will be reset after each TDC time(Last Close Duration Reset after each uplink)

OK

Downlink Command:

Example:  0B aa  => AT+COUNTMOD = second byte

3.11  Interrupt Pin Channel Mod(Since firmware v1.2.0)

AT Command:

Command ExampleFunctionResponse

AT+TTRCHANNEL=1

set as single channel, only use PB14 pin as interrupt pin.

 

OK

AT+TTRCHANNEL=2

is set as dual channel, use PB14 pin and PB15 pin as interrupt pin.

OK

Downlink Command:

Example:  0D aa => AT+TTRCHANNEL = second byte

3.12  Change the name of AT+TTRIG to AT+TTRIG1(Since firmware v1.2.0)

Downlink Command:

Example:  A9 01 aa bb cc  => AT+TTRIG1= third byte, 4th byte and 5th byte

3.13  Added AT+TTRIG2 for PB15 pin(Since firmware v1.2.0)

Downlink Command:

Example: A9 02 aa bb cc  => AT+TTRIG2= third byte, 4th byte and 5th byte

3.14  TTRIG1/2 timeout status alarm(Since firmware v1.2.0)

It needs to be used with AT+TTRIG1 or AT+TTRIG2. When TTRIG1 or TTRIG2 times out and causes an alarm, and the status does not change subsequently, an alarm packet will be sent at the alarm interval.

AT Command:

Command ExampleFunctionResponse

AT+TTRALARM=0

disable continuous alarm

 

OK

AT+TTRALARM=60

 The alarm interval is 60 minutes (unit: minutes)

OK

Downlink Command:

Example:  0C aa  => AT+TTRALARM= third byte

3.15  Select counting mode(Since firmware V1.2.1)

AT+TTRMODx=a,b

When a=0, the door is opened to count, and when a=1,the closed door is counted.

When b=0, it is the last door open duration, and when b=1,the last door close duration.

AT Command:

Command ExampleFunctionResponse

AT+TTRMODx=1,0

Door closed count and record the last door opened duration

 

OK

AT+TTRMODx=0,1

Door opened count and record the last door Door Door open closed duration

OK

4.  Battery & How to replace

4.1  Battery Info

LWL03A is equipped with a 8500mAH ER18505 Li-SOCI2 battery. The battery is an un-rechargeable battery with a low discharge rate targeting 8~10 years of use. This type of battery is commonly used in IoT targets for long-term running, such as water meters.

The battery related documents as below:

The discharge curve is not linear so can't simply use percentage to show the battery level. Below is the battery performance.

 

1654593587246-335.png

Minimum Working Voltage for the LWL03A:

LWL03A:  2.45v ~ 3.6v

4.1.1  ​Battery Note

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.

4.2  Replace Battery

Any battery with range 2.45 ~ 3.6v can be a replacement. We recommend to use Li-SOCl2 Battery.

And make sure the positive and negative pins match.

image-20221031154914-6.png

4.3  Battery Life Analyze

Dragino battery powered products are all run in Low Power mode. User can check the guideline from this link to calculate the estimate battery life:

https://www.dragino.com/downloads/downloads/LoRa_End_Node/Battery_Analyze/DRAGINO_Battery_Life_Guide.pdf

When entering the first command, the RED LED will on and user can now input AT Commands. After input all needed AT Commands, please input AT+CLPM=1 to set the device to work in Low Power mode and RED LED will be off.

More detail AT Command manual can be found at AT Command Manual

 

5.  FAQ

5.1  How to use AT Command to configure LDS03A

LWL03A UART connection photo

1654757007713-791.png

In the PC, you need to set the serial baud rate to 9600 to access the serial console for LWL03A. LWL03A will output system info once power on as below:

 image-20220609144231-3.png

5.2  How to upgrade the firmware?

A new firmware might be available for:

  • Support new features

  • For bug fix

  • Change LoRaWAN bands.

Instruction for how to upgrade: Firmware Upgrade Instruction

Firmware location: 

https://www.dropbox.com/sh/23v29gi61jq9mp6/AABgwJQ_xuybFivgbDZwTyNGa?dl=0

5.3  How to change the LoRa Frequency Bands/Region?

Users can follow the introduction for how to upgrade image. When downloading the images, choose the required image file for download.

6.  Order Info

Water Leak Controller Part Number: LWL03A-XXX

XXX

  • EU433: frequency bands EU433
  • EU868: frequency bands EU868
  • KR920: frequency bands KR920
  • CN470: frequency bands CN470
  • AS923: frequency bands AS923
  • AU915: frequency bands AU915
  • US915: frequency bands US915
  • IN865: frequency  bands IN865
  • CN779: frequency bands CN779

Water Leak Cable Part Number: DR-WLN-XXX

XXX:

  • 1M : 1 meter water leak cable
  • 5M : 5 meters water leak cable
  • 10M: 10 meters water leak cable

7.  ​Packing Info

LWL03A Package Includes:

  • LWL03A x 1
  • 1 x 1m water lead cable
  • 1 x termination end

8.  ​Support

  • 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.
  • 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.

Tags:
    
Copyright ©2010-2022 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0