Table of Contents:
- 1. Introduction
- 2. Configure DS03A-LB to connect to LoRaWAN network
- 3. Configure DS03A-LB
- 4. Battery & Power Consumption
- 5. OTA firmware update
- 6. FAQ
- 7. Order Info
- 8. Packing Info
- 9. Support
1. Introduction
1.1 What is DS03A-LB LoRaWAN Door Sensor
The Dragino DS03A-LB is a LoRaWAN Door Sensor for Internet of Things solution. It detects door open/close status and uplinks to IoT server via LoRaWAN network. user can see the door status, open duration, open counts in the IoT Server.
The LoRa wireless technology used in DS03A-LB allows device to send data and reach extremely long ranges at low data-rates. It provides ultra-long range spread spectrum communication and high interference immunity whilst minimizing current consumption.
The DS03A-LB will send periodically data every 2 hours as well as for each door open/close action. It also counts the door open times and calculates the last door open duration. Users can also disable the uplink for each open/close event, instead, DS03A-LB can count each open event and uplink periodically.
DS03A-LB supports Datalog Feature, it can save the data when there is no LoRaWAN network and uplink when network recover.
DS03A-LB has the Open Alarm Feature, user can set this feature so the device will send an alarm if the door has been open for a certain time.
DS03A-LB is designed for outdoor use. It has a weatherproof enclosure and industrial level battery to work in low to high temperatures
DS03A-LB supports BLE configure and wireless OTA update which make user easy to use.
DS03A-LB is powered by 8500mAh Li-SOCI2 battery, it is designed for long term use up to 5 years.
Each DS03A-LB is pre-load with a set of unique keys for LoRaWAN registrations, register these keys to local LoRaWAN server and it will auto connect after power on.
1.2 Features
- LoRaWAN 1.0.3 Class A
- Ultra-low power consumption
- Bands: CN470/EU433/KR920/US915/EU868/AS923/AU915/IN865
- Door Open/Close detect
- Door open/close statistics
- Datalog Feature, Open Alarm Feature
- Support Bluetooth v5.1 and LoRaWAN remote configure
- Support wireless OTA update firmware
- Uplink on periodically
- Downlink to change configure
- 8500mAh Battery for long term use
- Wall Mountable
- Outdoor Use
1.3 Specification
Common DC Characteristics:
- Supply Voltage: built in 8500mAh Li-SOCI2 battery , 2.5v ~ 3.6v
- Operating Temperature: -40 ~ 85°C
Sensor Detect Distance:
- Wood Door: 10mm ~ 30mm
- Iron Door: 30 ~ 45mm
LoRa Spec:
- Frequency Range, Band 1 (HF): 862 ~ 1020 Mhz
- Max +22 dBm constant RF output vs.
- RX sensitivity: down to -139 dBm.
- Excellent blocking immunity
Battery:
- Li/SOCI2 un-chargeable battery
- Capacity: 8500mAh
- Self-Discharge: <1% / Year @ 25°C
- Max continuously current: 130mA
- Max boost current: 2A, 1 second
Power Consumption
- Sleep Mode: 5uA @ 3.3v
- LoRa Transmit Mode: 125mA @ 20dBm, 82mA @ 14dBm
1.4 Applications
1.5 Sleep mode and working mode
Deep Sleep Mode: Sensor doesn't have any LoRaWAN activate. This mode is used for storage and shipping to save battery life.
Working Mode: In this mode, Sensor will work as LoRaWAN Sensor to Join LoRaWAN network and send out sensor data to server. Between each sampling/tx/rx periodically, sensor will be in IDLE mode), in IDLE mode, sensor has the same power consumption as Deep Sleep mode.
1.6 Button & LEDs
Behavior on ACT | Function | Action |
---|---|---|
Pressing ACT between 1s < time < 3s | Send an uplink | If sensor is already Joined to LoRaWAN network, sensor will send an uplink packet, blue led will blink once. |
Pressing ACT for more than 3s | Active Device | Green led will fast blink 5 times, device will enter OTA mode for 3 seconds. And then start to JOIN LoRaWAN network. |
Fast press ACT 5 times. | Deactivate Device | Red led will solid on for 5 seconds. Means Device is in Deep Sleep Mode. |
1.7 BLE connection
D2x-LB support BLE remote configure.
BLE can be used to configure the parameter of sensor or see the console output from sensor. BLE will be only activate on below case:
- Press button to send an uplink
- Press button to active device.
- Device Power on or reset.
If there is no activity connection on BLE in 60 seconds, sensor will shut down BLE module to enter low power mode.
1.8 Mechanical
2. Configure DS03A-LB to connect to LoRaWAN network
2.1 How it works
The DS03A-LB is configured as LoRaWAN OTAA Class A mode by default. It has OTAA keys to join LoRaWAN network. To connect a local LoRaWAN network, you need to input the OTAA keys in the LoRaWAN IoT server and press the button to activate the DS03A-LB. It will automatically join the network via OTAA and start to send the sensor value. The default uplink interval is 20 minutes.
2.2 Quick guide to connect to LoRaWAN server (OTAA)
Following is an example for how to join the TTN v3 LoRaWAN Network. Below is the network structure; we use the LPS8v2 as a LoRaWAN gateway in this example.
The LPS8V2 is already set to connected to TTN network , so what we need to now is configure the TTN server.
Step 1: Create a device in TTN with the OTAA keys from DS03A-LB.
Each DS03A-LB is shipped with a sticker with the default device EUI as below:
You can enter this key in the LoRaWAN Server portal. Below is TTN screen shot:
Register the device
Add APP EUI and DEV EUI
Add APP EUI in the application
Add APP KEY
Step 2: Activate on DS03A-LB
Press the button for 5 seconds to activate the DS03A-LB.
Green led will fast blink 5 times, device will enter OTA mode for 3 seconds. And then start to Join LoRaWAN network. Green led will solidly turn on for 5 seconds after joined in network.
After join success, it will start to upload messages to TTN and you can see the messages in the panel.
2.3 Uplink Payload
2.3.1 Device Status, FPORT=5
Users can use the downlink command(0x26 01) to ask DS03A-LB to send device configure detail, include device configure status. DS03A-LB will uplink a payload via FPort=5 to server.
The Payload format is as below.
Device Status (FPORT=5) | |||||
Size (bytes) | 1 | 2 | 1 | 1 | 2 |
Value | Sensor Model | Firmware Version | Frequency Band | Sub-band | BAT |
Example parse in TTNv3
Sensor Model: For DS03A-LB, this value is 0x1B
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 Real-Time Open/Close Status, Uplink FPORT=2
DS03A-LB will send this uplink after Device Status once join the LoRaWAN network successfully. And DS03A-LB will send uplinks when:
- Every 2 hours, this interval can be changed.
- There is an Open/Close event. (This info can be disabled by AT+DISALARM=1)
Uplink Payload totals 11 bytes.
Real-Time Open/Close Status, FPORT=2 | ||||
---|---|---|---|---|
Size(bytes) | 1 | 3 | 3 | 4 |
Value | Status & Alarm | Total open door events | The last door open duration (unit: min) | Unix TimeStamp |
Status & Alarm:
Size(bit) | bit7 | bit6 | [bit5:bit2] | bit1 | bit0 |
Value | No ACK Message | Poll Message Flag | Reserve | Enable/disable Timeout Alarm 0: No Alarm; 1: Alarm | Status 0: Close, 1: Open |
2.3.3 Historical Door Open/Close Event, FPORT=3
DS03A-LB 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, DS03A-LB 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 DS03A-LB doesn't have any data in the polling time. It will uplink 11 bytes of 0
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.3.4 Sensor Configuration, FPORT=4
DS03A-LB will only send this command after getting the downlink command (0x26 02) from the server.
Sensor Configuration FPORT=4 | ||||
Size(bytes) | 3 | 1 | 1 | 2 |
Value | TDC (unit:sec) | Disalarm | Keep status | Keep time (unit: min) |
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, DS03A-LB 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, DS03A-LB 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
2.4 Payload Decoder file
In TTN, use can add a custom payload so it shows friendly.
In the page Applications --> Payload Formats --> Custom --> decoder to add the decoder from: https://github.com/dragino/dragino-end-node-decoder
2.5 Datalog Feature
Datalog Feature is to ensure IoT Server can get all sampling data from Sensor even if the LoRaWAN network is down. For each sampling, DS03A-LB will store the reading for future retrieving purposes.
2.5.1 Ways to get datalog via LoRaWAN
Set PNACKMD=1, DS03A-LB will wait for ACK for every uplink, when there is no LoRaWAN network,DS03A-LB 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.
- a) DS03A-LB will do an ACK check for data records sending to make sure every data arrive server.
- b) DS03A-LB will send data in CONFIRMED Mode when PNACKMD=1, but DS03A-LB 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 DS03A-LB gets a ACK, DS03A-LB will consider there is a network connection and resend all NONE-ACK Message.
Below is the typical case for the Datalog Feature (Set PNACKMD=1)
2.5.2 Unix TimeStamp
DS03A-LB uses Unix TimeStamp format based on
User can get this time from link: https://www.epochconverter.com/ :
Below is the converter example
So, we can use AT+TIMESTAMP=1611889405 or downlink 3060137afd00 to set the current time 2021 – Jan -- 29 Friday 03:03:25
2.5.3 Set Device Time
User need to set SYNCMOD=1 to enable sync time via MAC command.
Once DS03A-LB Joined LoRaWAN network, it will send the MAC command (DeviceTimeReq) and the server will reply with (DeviceTimeAns) to send the current time to DS03A-LB. If DS03A-LB fails to get the time from the server, DS03A-LB will use the internal time and wait for next time request (AT+SYNCTDC to set the time request period, default is 10 days).
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 and loriot support but TTN 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 v2 if SYNCMOD=1.
2.6 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 1: Link TTNv3 to Datacake.https://docs.datacake.de/lorawan/lns/thethingsindustries#create-integration-on-tti
Step 2: Configure DS03A-LB in Datacake.
2.7 Frequency Plans
The DS03A-LB uses OTAA mode and below frequency plans by default. If user want to use it with different frequency plan, please refer the AT command sets.
http://wiki.dragino.com/xwiki/bin/view/Main/End%20Device%20Frequency%20Band/
2.8 Firmware Change Log
Firmware download link: https://www.dropbox.com/sh/b0uwyzjs4px4eao/AADvI7fPRwsFKTglEmaRRuaaa?dl=0
3. Configure DS03A-LB
3.1 Configure Methods:
DS03A-LB supports below configure method:
- AT Command via Bluetooth Connection (Recommended): BLE Configure Instruction.
- AT Command via UART Connection : See Connection.
- LoRaWAN Downlink. Instruction for different platforms: See IoT LoRaWAN Server section.
3.2 General Commands
These commands are to configure:
- General system settings like: uplink interval.
- LoRaWAN protocol & radio related command.
They are same for all Dragino Devices which support DLWS-005 LoRaWAN Stack. These commands can be found on the wiki:
http://wiki.dragino.com/xwiki/bin/view/Main/End%20Device%20AT%20Commands%20and%20Downlink%20Command/
3.3 Commands special design for DS03A-LB
These commands only valid for DS03A-LB, as below:
3.3.1 Set Transmit Interval Time
Feature: Change LoRaWAN End Node Transmit Interval.
AT Command: AT+TDC
Command Example | Function | Response |
---|---|---|
AT+TDC=? | Show current transmit Interval | 30000 |
AT+TDC=60000 | Set Transmit Interval | OK |
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.3.2 Get Device Status
Send a LoRaWAN downlink to ask device send Alarm settings.
- Downlink Payload: 0x26 01
Sensor will upload Device Status via FPORT=5. See payload section for detail.
3.3.3 Enable / Disable Alarm
Feature: Enable/Disable Alarm for open/close event. Default value 0.
AT Command:
Command Example | Function | Response |
AT+DISALARM=1 | End node will only send packets in TDC time. | OK |
AT+DISALARM=0 | End node will send packets in TDC time or status change for door sensor | OK |
Downlink Command:
0xA7 01 // Same As AT+DISALARM=1
0xA7 00 // Same As AT+DISALARM=0
3.3.4 Alarm Base on Timeout
DS03A-LB 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.3.5 Count Mod
AT Command:
Command Example | Function | Response |
---|---|---|
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.3.6 Interrupt Pin Channel Mod
AT Command:
Command Example | Function | Response |
---|---|---|
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.3.7 Change the name of AT+TTRIG to AT+TTRIG1
Downlink Command:
Example: A9 01 aa bb cc => AT+TTRIG1= third byte, 4th byte and 5th byte
3.3.8 Added AT+TTRIG2 for PB15 pin
Downlink Command:
Example: A9 02 aa bb cc => AT+TTRIG2= third byte, 4th byte and 5th byte
3.3.9 TTRIG1/2 timeout status alarm
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 Example | Function | Response |
---|---|---|
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= aa
3.3.10 Select counting mode
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 Example | Function | Response |
---|---|---|
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 & Power Consumption
DS03A-LB use ER26500 + SPC1520 battery pack. See below link for detail information about the battery info and how to replace.
Battery Info & Power Consumption Analyze .
5. OTA firmware update
User can change firmware DS03A-LB to:
- Change Frequency band/ region.
- Update with new features.
- Fix bugs.
Firmware and changelog can be downloaded from : Firmware download link
Methods to Update Firmware:
- (Recommanded way) OTA firmware update via wireless: http://wiki.dragino.com/xwiki/bin/view/Main/Firmware%20OTA%20Update%20for%20Sensors/
- Update through UART TTL interface. Instruction.
6. FAQ
7. Order Info
Part Number: DS03A-LB-XX
XX: The default frequency band
- AS923: LoRaWAN AS923 band
- AU915: LoRaWAN AU915 band
- EU433: LoRaWAN EU433 band
- EU868: LoRaWAN EU868 band
- KR920: LoRaWAN KR920 band
- US915: LoRaWAN US915 band
- IN865: LoRaWAN IN865 band
- CN470: LoRaWAN CN470 band
8. Packing Info
Package Includes:
- DS03A-LB LoRaWAN Temperature Sensor
Dimension and weight:
- Device Size: cm
- Device Weight: g
- Package Size / pcs : cm
- Weight / pcs : g
9. 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.cc.