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 2 hours 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
  • Smart Cities
  • Smart Factory

1.5  Mechanical

1667211179108-212.png

1667211192189-120.png

1.6  Installation

image-20221101180548-1.png

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)
  • A periodically update at every 10 minutes when in water leak.(Interval can be changed)

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-20230426084856-1.png

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:

  • Leak/No leak 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 LWL03A Joined the network, it will uplink this message to the server. After that, LWL03A will uplink Device Status every 12 hours.

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

Device Status (FPORT=5)
Size (bytes)12112
ValueSensor ModelFirmware VersionFrequency BandSub-bandBAT

Example parse in TTNv3:

image-20221031161732-8.png

  • Sensor Model: For LWL03A, this value is 0x14
  • 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

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

 Size(bytes)31121
ValueTDC (unit: sec)DisalarmKeep statusKeep time (unit: sec)Leak alarm time
  • TDC: (default: 0x001C20)

Uplink interval for the Leak/No leak Event, default value is 0x001C20 which is 7200 seconds = 2 hours.

  • Disalarm: (default: 0)

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

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

 Note: When Disalarm=0, a high frequently Leak/No leak 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

  • Leak alarm time

Regularly update a confirm uplink when water leaks, default value is 0x0A which is 10 minutes.

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

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

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

2. There is an Leak/No leak event. 

Uplink Payload totals 11 bytes.

Real-Time Open/Close Status, FPORT=2
Size(bytes)1334
ValueStatus & Alarm

&TDC flag

Total leak events

last leak
duration (unit: sec)

Unix TimeStamp

Status & Alarm:

Size(bit)6111
ValueReserve

TDC flag
0:No;1:Yes

Alarm
0: No Alarm;
1: Alarm

Status
0: No leak, 1: leak

1667205498482-181.png

Please check the decoder from this link: https://github.com/dragino/dragino-end-node-decoder/tree/main/LWL03A

2.3.4  Historical Water Leak/No leak Event, FPORT=3

LWL03A 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 leak/no leak status.

 

  • Each data entry is 11 bytes and has the same structure as Real-Time open/close status, to save airtime and battery, LWL03A 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 LWL03A doesn't have any data in the polling time. It will uplink 11 bytes of 0

1667205726581-981.png

Access via serial port:

image-20221031164229-9.png

Downlink:

0x31 63 5C D2 B8 63 5C D8 1C 05

Uplink:

01 00 00 0A 00 00 0A 63 5C D2 F2 00 00 00 0A 00 00 15 63 5C D3 07 03 00 00 0F 00 00 00 63 5C D4 99 00 00 00 0F 00 00 28 63 5C D4 B7 02 00 00 11 00 00 E3 63 5C D6 52 00 00 00 00 00 00 00 63 5C D7 11 02 00 00 10 00 00 01 63 5C D7 51 00 00 00 10 00 00 01 63 5C D7 81 01 00 00 00 00 00 01 63 5C D7 8F 00 00 00 0D 00 00 0D 63 5C D7 F9

Parsed Value:

[ALARM, WATER_LEAK_STATUS, WATER_LEAK_TIMES, LAST_WATER_LEAK_DURATION, TIME]

[FALSE,LEAK,10,10,2022-10-29 07:14:58],

[FALSE,NO LEAK,10,21,2022-10-29 07:15:19],

[TRUE,LEAK,15,0,2022-10-29 07:22:01],

[FALSE,NO LEAK,15,40,2022-10-29 07:22:31],

[TRUE,NO LEAK,17,227,2022-10-29 07:29:22],

[FALSE,NO LEAK,0,0,2022-10-29 07:32:33],

[TRUE,NO LEAK,16,1,2022-10-29 07:33:37],

[FALSE,NO LEAK,16,1,2022-10-29 07:34:25],

[FALSE,LEAK,0,1,2022-10-29 07:34:39],

[FALSE,NO LEAK,13,13,2022-10-29 07:36:25],

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

LWL03A 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 LWL03A Joined the LoRaWAN network, it will send the MAC command (DeviceTimeReq) and the server will reply with (DeviceTimeAns) to send the current time to LWL03A. If LWL03A fails to get the time from the server, LWL03A 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 LWL03A in Datacake.

image-20221102092921-1.png

image-20221102092921-2.png

image-20221102092921-3.png

image-20221102092921-4.png

image-20221102092921-5.png

image-20221102092921-6.png

image-20221102092921-7.png

image-20221102092921-8.png

image-20221102092921-9.png

1667352851343-365.png

3.  Configure LWL03A via AT Command or LoRaWAN Downlink

Use can configure LWL03A via AT Command or LoRaWAN Downlink.

There are two kinds of commands to configure LWL03A, 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-007 LoRaWAN Stack. These commands can be found on the wiki: End Device AT Commands and Downlink Command

 

  •  Commands special design for LWL03A

These commands only valid for LWL03A, as below:

3.1  Set Transmit Interval Time

Feature: Change LoRaWAN End Node Transmit Interval.

AT Command: AT+TDC

Command ExampleFunctionResponse
AT+TDC=?Show current transmit Interval

30000
OK
the interval is 30000ms = 30s

AT+TDC=60000Set Transmit Interval

OK
Set transmit interval to 60000ms = 60 seconds

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:

Command ExampleFunctionResponse
AT+DISALARM=1End node will only send packet in TDC time.OK
AT+DISALARM=0End node will send packet in TDC time or status change for water leak sensorOK

Downlink Command:

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

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

3.5  Set system time

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

AT Command:

Command ExampleFunctionResponse
AT+TIMESTAMP=1611104352Set System time to 2021-01-20 00:59:12OK

Downlink Command:

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

3.6  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:

Command ExampleFunctionResponse
AT+SYNCMOD=1Enable Sync system time via LoRaWAN MAC Command (DeviceTimeReq) The default is zero time zone.OK
AT+SYNCMOD=1,8Enable Sync system time via LoRaWAN MAC Command (DeviceTimeReq) Set to East eight time zone.OK
AT+SYNCMOD=1,-12Enable Sync system time via LoRaWAN MAC Command (DeviceTimeReq) Set to West Twelve Time Zone.OK

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.7  Alarm Base on Timeout

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

User configure this feature by using:

AT Command to configure:

  • AT+TTRIG=1,30   --> When status change from no leak to leak, and device keep in leak status for more than 30 seconds. LWL03A 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,30   --> When status change from leak to no leak, and device keep in no leak status for more than 30 seconds. LWL03A 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.8  The working mode of the total water leakage event

AT Command to configure:

  • AT+COUNTMOD=0 --> Default Value, Total leak events since factory.
  • AT+COUNTMOD=1 --> Total leak events since last TDC uplink.

Downlink Command to configure:

Command: 0x0B aa

0B: Command Type Code

aa: mod

If user send 0x0B 01: equal to AT+COUNTMOD=1

Or

0x0B 00: Equal to AT+COUNTMOD=0

3.9  Regularly update a confirm uplink when water leaks

AT Command to configure:

  • AT+LEAKALARM=10 --> Default Value, A periodically update at every 10 minutes when in water leak.
  • AT+LEAKALARM=0   --> Disable a periodically update when in water leak.

Downlink Command to configure:

Command: 0x0C aa

0C: Command Type Code

aa: uplink interval

If user send 0x0C 0A: equal to AT+LEAKALARM=10

Or

0x0C 00: Equal to AT+LEAKALARM=0.

3.10  Delay time for state changes to take effect

AT Command to configure:

  • AT+DETEDELAY=50 --> Default Value, Set state change, valid signal is 50ms.
  • AT+DETEDELAY=0   --> Disable valid signal detection..

Downlink Command to configure:

Command: 0x0D aa bb

0D: Command Type Code

aa bb: timeout

If user send 0x0D 00 32: equal to AT+DETEDELAY=50

Or

0x0D 00 00: Equal to AT+DETEDELAY=0.

3.11  Print data entries base on page

Feature: Print the sector data from start page to stop page (max is 400 pages).

AT Command: AT+PDTA

Command ExampleResponse
AT+PDTA=1,1

Stop Tx events when read sensor data

8016000 22/10/28 00:39:05 bat:3627 status:leak    leak_times:0 last_leak_duration:0 alarm:false

8016010 22/10/28 00:48:57 bat:3633 status:leak    leak_times:0 last_leak_duration:0 alarm:false

8016020 22/10/28 00:58:57 bat:3633 status:leak    leak_times:0 last_leak_duration:0 alarm:false

8016030 22/10/28 01:08:57 bat:3635 status:leak    leak_times:0 last_leak_duration:0 alarm:false

8016040 22/10/28 01:11:40 bat:3635 status:no_leak leak_times:0 last_leak_duration:32 alarm:false

8016050 22/10/28 01:12:12 bat:3633 status:leak    leak_times:1 last_leak_duration:32 alarm:false

8016060 22/10/28 01:12:22 bat:3633 status:no_leak leak_times:1 last_leak_duration:0 alarm:false

8016070 22/10/28 02:31:54 bat:3630 status:no_leak leak_times:0 last_leak_duration:0 alarm:false

Start Tx events

OK

Downlink Command:

No downlink command for this feature.

3.12  Print last few data entries

Feature: Print the last few data entries

AT Command: AT+PLDTA

Command ExampleResponse
AT+PLDTA=10

Stop Tx events when read sensor data

1 22/10/29 09:58:45 bat:3620 status:no_leak leak_times:0 last_leak_duration:7 alarm:false

2 22/10/31 00:51:04 bat:3641 status:no_leak leak_times:0 last_leak_duration:0 alarm:false

3 22/10/31 00:56:52 bat:3643 status:leak    leak_times:1 last_leak_duration:0 alarm:false

4 22/10/31 00:58:40 bat:3641 status:leak    leak_times:0 last_leak_duration:0 alarm:false

5 22/10/31 00:59:22 bat:3641 status:no_leak leak_times:0 last_leak_duration:0 alarm:false

6 22/10/31 01:01:50 bat:3641 status:leak    leak_times:0 last_leak_duration:0 alarm:false

7 22/10/31 01:02:22 bat:3641 status:leak    leak_times:1 last_leak_duration:0 alarm:false

8 22/10/31 02:20:40 bat:3627 status:leak    leak_times:0 last_leak_duration:0 alarm:false

9 22/10/31 02:34:59 bat:3627 status:leak    leak_times:0 last_leak_duration:0 alarm:false

10 22/10/31 02:45:55 bat:3625 status:leak    leak_times:0 last_leak_duration:0 alarm:false

Start Tx events

OK

Downlink Command:

No downlink command for this feature.

3.13  Clear Flash Record

Feature: Clear flash storage for data log feature.

AT Command: AT+CLRDTA

Command ExampleFunctionResponse
AT+CLRDTAClear flash storage for data log feature.Clear all stored sensor data… OK

Downlink Command:

Example: 0xA301   //  Same as AT+CLRDTA

4.  Battery & Power Consumption

LWL03A uses ER26500 + SPC1520 battery pack. See below link for detail information about the battery info and how to replace.

Battery Info & Power Consumption Analyze .

5.  FAQ

5.1  How to use AT Command to configure LWL03A

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

Notice: LWL03A includes a one meter water leak cable, If user want to extend the lenght, please choose Water Leak Cable DR-WLN-XXX.

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