CPL03-LB/LS -- LoRaWAN Pulse/Contact Sensor User Manual
Table of Contents :
- 1. Introduction
- 2. Configure CPL03-LB/LS to connect to LoRaWAN network
- 3. Configure CPL03-LB/LS
- 3.1 Configure Methods
- 3.2 General Commands
- 3.3 Commands special design for CPL03-LB/LS
- 3.3.1 Set Transmit Interval Time
- 3.3.2 Set Power Output Duration
- 3.3.3 Enable / Disable Alarm
- 3.3.4 Alarm Base on Timeout
- 3.3.5 TTRIG timeout status alarm
- 3.3.6 Set trigger mode of PA8
- 3.3.7 Set trigger mode of PA4
- 3.3.8 Set trigger mode of PB15
- 3.3.9 Set the calculate flag
- 3.3.10 Set count number
- 3.3.11 Clear all counter values
- 3.3.12 Count Mod
- 3.3.13 Work Mod
- 3.3.14 Set Time Sync Mode
- 4. Battery & Power Consumption
- 5. OTA Firmware update
- 6. FAQ
- 7. Order Info
- 8. Packing Info
- 9. Support
1. Introduction
1.1 What is CPL03-LB/LS LoRaWAN Pulse/Contact Sensor
The Dragino CPL03-LB/LS is a LoRaWAN Contact Sensor for Internet of Things solution. It detects dry contact status, open time, open counts, and then upload to IoT server via LoRaWAN wireless protocol.
The CPL03-LB/LS will send periodically data every day as well as for each dry contact action. It also counts the contact open times and calculate last open duration. User can also disable the uplink for each open/close event, instead, device can count each open event and uplink periodically.
The LoRa wireless technology used in CPL03-LB/LS 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.
CPL03-LB/LS supports open alarm feature, user can set open alarm for instant notice. CPL03-LB/LS supports Datalog feature, it can save the data when there is no LoRaWAN network and uplink when network recover.
CPL03-LB/LS is designed for outdoor use. It has a weatherproof enclosure and industrial level battery to work in low to high temperatures.
CPL03-LB/LS supports BLE configure and wireless OTA update which make user easy to use.
CPL03-LB/LS is powered by 8500mAh Li-SOCI2 battery or solar powered + Li-ion battery, it is designed for long term use up to 5 years.
Each CPL03-LB/LS 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
- Bands: CN470/EU433/KR920/US915/EU868/AS923/AU915/IN865
- Ultra-low power consumption
- Open/Close detect
- Open/Close statistics
- Supports open alarm feature
- Supports Datalog feature
- Support Bluetooth v5.1 and LoRaWAN remote configure
- Support wireless OTA update firmware
- Uplink on periodically and open/close event
- Downlink to change configure
- 8500mAh Li/SOCl2 Battery (CPL03-LB)
- Solar panel + 3000mAh Li-ion battery (CPL03-LS)
1.3 Specification
Common DC Characteristics:
- Supply Voltage: Built-in Battery , 2.5v ~ 3.6v
- Operating Temperature: -40 ~ 85°C
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
- Open/Close Detection
- Pulse meter application
- Dry Contact Detection
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
CPL03-LB/LS 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 Pin Definitions
1.9 Mechanical
1.9.1 for LB version
1.9.2 for LS version
2. Configure CPL03-LB/LS to connect to LoRaWAN network
2.1 How it works
The CPL03-LB/LS 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 CPL03-LB/LS. It will automatically join the network via OTAA and start to send the sensor value. The default uplink interval is 2 hours.
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 CPL03-LB/LS.
Each CPL03-LB/LS 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 CPL03-LB/LS
Press the button for 5 seconds to activate the CPL03-LB/LS.
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
Include device configure status. Once CPL03-LB/LS Joined the network, it will uplink this message to the server. After that, CPL03-LB/LS will uplink Device Status every 12 hours.
Users can also use the downlink command(0x26 01) to ask CPL03-LB/LS to resend this uplink. This uplink payload also includes the DeviceTimeReq to get time.
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 CPL03-LB/LS, this value is 0x20
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
CPL03-LB/LS 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 | 1 | 1 | 1 | 1 |
Value | TDC (unit:sec) | Disalarm | Keep status | Keep time (unit: sec) | Trigger1 mod(PA8) | Trigger2 mod(PA4) | Trigger3 mod(PB15) | Alarm interval(unit: min) |
Example parse in TTNv3
TDC: (default: 0x001C20)
Uplink interval for the total pulse count, default value is 0x001C20 which is 7200 seconds = 2 hours.
Disalarm: (default: 0)
If Disalarm = 1, CPL03-LB/LS will only send uplink at every TDC periodically. This is normally use for pulse meter application, in this application, there are many disconnect/connect event, and platform only care about the total number of pulse.
If Disalarm = 0, CPL03-LB/LS sends the uplink at the timing of each TDC and also triggers the uplink when an interrupt event occurs.
Keep Status & Keep Time
Shows the configure value of Alarm Base on Timeout Feature
Trigger1 mod (default: 0)
The trigger mode of PA8 pin.
0: The pulse count will increment by one after a close to open event.
1: The pulse count will increment by one after a open to close event.
Trigger2 mod (default: 0)
The trigger mode of PA4 pin. Only valid when AT+MOD=2.
0: The pulse count will increment by one after a close to open event.
1: The pulse count will increment by one after a open to close event.
Trigger3 mod (default: 0)
The trigger mode of PB15 pin. Only valid when AT+MOD=2.
0: The pulse count will increment by one after a close to open event.
1: The pulse count will increment by one after a open to close event.
Alarm interval(default: 0)
When the state of the door sensor has not been changed after the timeout alarm, the device will send a uplink every alarm interval. It will stop the alarm until the state of the door sensor is changed after the timeout alarm.
2.3.3 Real-Time Open/Close Status, Uplink FPORT=2
Default working mode, AT+MOD=1:
The wiring of the Real-Time Open/Close Status mode is as follows:
CPL03-LB/LS will send this uplink after Device Status once join the LoRaWAN network successfully. And CPL03-LB/LS will:
periodically send this uplink every 2 hours, this interval can be changed.
Uplink Payload totals 11 bytes.
Real-Time Open/Close Status, FPORT=2 | ||||
---|---|---|---|---|
Size(bytes) | 1 | 3 | 3 | 4 |
Value | Status & Alarm | Total pulse | The last duration (unit: sec) | Unix TimeStamp |
Status & Alarm field:
Size(bit) | [bit7:bit6] | bit5 | bit4 | bit3 | bit2 | bit1 | bit0 |
Value | Reserve | Count mod | TDC flag 0:No;1:Yes | work mod | Trigger1 mod | Alarm: 0: No Alarm; 1: Alarm | Status 0: Close; 1: Open |
Count mod:Default=0
0: Uplink total open door times since factory
1 : Uplink total open door times since last FPORT=2 uplink.
- TDC flag
When the flag is 1, it means sending packets at normal time intervals.
Otherwise, it is a packet sent at non-TDC time.
- Work mod
0: CPL01-Real-Time Open/Close Status mode.
1: CPL03-3 pulse mode.
- Trigger1 mod
0: The pulse count will increment by one after a close to open event and the last duration is for the open event.
1: The pulse count will increment by one after a open to close event and the last duration is for the close event.
Alarm
Status
0: Open
1: Close
Total pulse
Total pulse/counting base on dry contact trigger event
Range (3 Bytes) : 0x000000 ~ 0xFFFFFF . Max: 16777215
The last duration
1) AT+TTRMOD1=0 : Dry Contact last open duration.(Unit: sec)
2) AT+TTRMOD1=1 : Dry Contact last close duration.(Unit: sec)
2.3.4 3 x pulse counting mode, Uplink FPORT=6
To use this working mode, you need to set AT+MOD=2.
The wiring of the three pulse counting mode are as follows:
Size(bytes) | 1 | 3 | 3 | 3 |
Value | Status | Port1 Total Pulse(PA8) | Port2 Total Pulse(PA4) | Port3 Total Pulse(PB15) |
Status:
Size(bit) | [bit7:bit6] | bit5 | bit4 | bit3 | [bit2:bit0] |
Value | Reserve | Count mod | TDC flag 0:No; 1:Yes | work mod | Calculate Flag |
Max COUNT for each port is 16777215. Exceed this number will reset to 1.
Count mod:Default=0
0: Uplink total open door times since factory
1 : Uplink total open door times since last FPORT=2 uplink.
- TDC flag
When the flag is 1, it means sending packets at normal time intervals.
Otherwise, it is a packet sent at non-TDC time.
- Work mod
0: CPL01-Real-Time Open/Close Status mode.
1: CPL03-3 pulse mode.
Calculate Flag
The calculate flag is a user define field, IoT server can use this filed to handle different meter with different pulse factor. For example, if there are 100 water meters, meter 1 ~50 are 1 liter/pulse and meter 51 ~ 100 has 1.5 liter/pulse.
User can set calculate flag to 1 for meter 1~50 and 2 for meter 51 ~ 100, So IoT Server can use this field for calculation.
Default value: 0.
Range (3 bits): (b)000 ~ (b) 111
Refer: Set Calculate Flag
Port1 Total Pulse(PA8 of pin)
Range (3 Bytes) : 0x000000 ~ 0xFFFFFF . Max: 16777215.Exceed this number will reset to 1.
Port2 Total Pulse(PA4 of pin)
Range (3 Bytes) : 0x000000 ~ 0xFFFFFF . Max: 16777215.Exceed this number will reset to 1.
Port3 Total Pulse(PB15 of pin)
Range (3 Bytes) : 0x000000 ~ 0xFFFFFF . Max: 16777215.Exceed this number will reset to 1.
Related AT Command:
AT+TTRMOD1: Port1 count mode; 0: Signal falling edge(Default), 1: Signal raising edge
AT+TTRMOD1=0 Downlink Command: 0xA4 01 00
AT+TTRMOD1=1 Downlink Command: 0xA4 01 01
AT+TTRMOD2: Port2 count mode; 0: Signal falling edge(Default), 1: Signal raising edge
AT+TTRMOD2=0 Downlink Command: 0xA4 02 00
AT+TTRMOD2=1 Downlink Command: 0xA4 02 01
AT+TTRMOD3: Port3 count mode; 0: Signal falling edge(Default), 1: Signal raising edge
AT+TTRMOD3=0 Downlink Command: 0xA4 03 00
AT+TTRMOD3=1 Downlink Command: 0xA4 03 01
AT+CALCFLAG: Calculate Flag ( Default : 0 )
AT+CALCFLAG=aa Downlink Command: 0xA5 aa
AT+COUNTMOD: Accumulative Mode; 0: Accumulative (Default),1: Reset after uplink.
AT+COUNTMOD=0 Downlink Command: 0x0B 00
AT+COUNTMOD=1 Downlink Command: 0x0B 01
AT+SETCNT: Set count value
AT+SETCNT=1,aa Downlink Command: 0xA6 01 aa aa aa
AT+SETCNT=2,aa Downlink Command: 0xA6 02 aa aa aa
AT+SETCNT=3,aa Downlink Command: 0xA6 03 aa aa aa
2.3.5 Historical Open/Close Event, FPORT=3
CPL03-LB/LS 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, CPL03-LB/LS 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:
a) DR0: max is 11 bytes so one entry of data
b) DR1: max is 53 bytes so devices will upload 4 entries of data (total 44 bytes)
c) DR2: total payload includes 11 entries of data
d) DR3: total payload includes 22 entries of data.
If CPL03-LB/LS doesn't have any data in the polling time. It will uplink 11 bytes of 0
Downlink:
0x31 64 AE 52 C2 64 AE 54 E0 05
Uplink:
41 00 00 01 00 00 32 64 AE 52 C2 41 00 00 20 00 00 00 64 AE 52 C9 61 00 00 0C 00 00 00 64 AE 53 45 64 00 00 12 00 00 3D 64 AE 54 11 78 00 00 00 00 00 00 64 AE 54 4B 68 00 00 17 00 00 05 64 AE 54 86 4C 00 00 17 00 00 05 64 AE 54 AB 4C 00 00 17 00 00 05 64 AE 54 B7 4C 00 00 17 00 00 05 64 AE 54 E0
Parsed Value:
CPL01:
[WORKMOD, COUNTMOD, TDC_FLAG, ALARM, STATUS, TRIGGER1_MOD, TOTAL_PULSE, LAST_DURATION, TIME]
[CPL01,SUM,NO,FALSE,OPEN,0,1,50,2023-07-12 07:14:10],
[CPL01,SUM,NO,FALSE,OPEN,0,32,0,2023-07-12 07:14:17],
[CPL01,PART,NO,FALSE,OPEN,0,12,0,2023-07-12 07:16:21],
[CPL01,PART,NO,FALSE,CLOSE,1,18,61,2023-07-12 07:19:45],
CPL03:Due to the limitation of byte length, only count value 1 and count value 2 are sent in the data record data.
[WORKMOD, COUNTMOD, TDC_FLAG, CALCULATE_FLAG, PORT1_TOTAL_PULSE, PORT2_TOTAL_PULSE, TIME]
[CPL03,PART,YES,0,0,0,2023-07-12 07:20:43],
[CPL03,PART,NO,0,23,5,2023-07-12 07:21:42],
[CPL03,SUM,NO,4,23,5,2023-07-12 07:22:19],
[CPL03,SUM,NO,4,23,5,2023-07-12 07:22:31],
[CPL03,SUM,NO,4,23,5,2023-07-12 07:23:12],
2.4 Payload Decoder file
In TTN, use can add a custom payload so it shows friendly reading
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, CPL03-LB/LS will store the reading for future retrieving purposes.
Note:After the device is reset, in cumulative counting mode ,the last stored count value will be read as the initial value.
2.5.1 Ways to get datalog via LoRaWAN
Set PNACKMD=1, CPL03-LB/LS will wait for ACK for every uplink, when there is no LoRaWAN network, CPL03-LB/LS 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) CPL03-LB/LS will do an ACK check for data records sending to make sure every data arrive server.
b) CPL03-LB/LS will send data in CONFIRMED Mode when PNACKMD=1, but CPL03-LB/LS 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 CPL03-LB/LS gets a ACK, CPL03-LB/LS will consider there is a network connection and resend all NONE-ACK messages.
2.5.2 Unix TimeStamp
CPL03-LB/LS 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 CPL03-LB/LS Joined LoRaWAN network, it will send the MAC command (DeviceTimeReq) and the server will reply with (DeviceTimeAns) to send the current time to CPL03-LB/LS. If CPL03-LB/LS fails to get the time from the server, CPL03-LB/LS 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 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.
2.5.4 Poll sensor value
Users can poll sensor values based on timestamps. Below is the downlink command.
Downlink Command to poll Open/Close status (0x31) | |||
1byte | 4bytes | 4bytes | 1byte |
31 | Timestamp start | Timestamp end | Uplink Interval |
Timestamp start and Timestamp end-use Unix TimeStamp format as mentioned above. Devices will reply with all data logs during this period, using the uplink interval.
For example, downlink command
Is to check 2021/11/12 12:00:00 to 2021/11/12 15:00:00's data
Uplink Internal =5s,means CPL03-LB/LS will send one packet every 5s. range 5~255s.
2.6 Frequency Plans
The CPL03-LB/LS uses OTAA mode and below frequency plans by default. Each frequency band use different firmware, user update the firmware to the corresponding band for their country.
http://wiki.dragino.com/xwiki/bin/view/Main/End%20Device%20Frequency%20Band/
3. Configure CPL03-LB/LS
3.1 Configure Methods
CPL03-LB/LS supports below configure method:
- AT Command via Bluetooth Connection (Recommended): BLE Configure Instruction.
- AT Command via UART Connection : See UART 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 CPL03-LB/LS
These commands only valid for CPL03-LB/LS, 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: 01 00 00 1E // Set Transmit Interval (TDC) = 30 seconds
Example 2: Downlink Payload: 01 00 00 3C // Set Transmit Interval (TDC) = 60 seconds
3.3.2 Set Power Output Duration
Control the output duration 5V . Before each sampling, device will
1. first enable the power output to external sensor,
2. keep it on as per duration, read sensor value and construct uplink payload
3. final, close the power output.
AT Command: AT+5VT
Command Example | Function | Response |
---|---|---|
AT+5VT=? | Show 5V open time. | 0 (default) OK |
AT+5VT=500 | Close after a delay of 500 milliseconds. | OK |
Downlink Command: 0x07
Format: Command Code (0x07) followed by 2 bytes.
The first and second bytes are the time to turn on.
- Example 1: Downlink Payload: 07 00 00 ---> AT+5VT=0
- Example 2: Downlink Payload: 07 01 F4 ---> AT+5VT=500
3.3.3 Enable / Disable Alarm
It only takes effect when AT+MOD=1.
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
It only takes effect when AT+MOD=1.
CPL03-LB/LS 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:
1. Keep Status: Status to be monitor
Keep Status = 1: Monitor Close to Open event
Keep Status = 0: Monitor Open to Close event
2. 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 connect to disconnect, and device remains in disconnect status for more than 30 seconds. CPL03-LB/LS 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 TTRIG timeout status alarm
It only takes effect when AT+MOD=1.
It needs to be used with AT+TTRIG . When TTRIG 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(default) |
AT+TTRALARM=60 | The alarm interval is 60 minutes (unit: minutes) | OK |
Downlink Command:
Example: 0C aa => AT+TTRALARM= aa
3.3.6 Set trigger mode of PA8
Feature: Set the trigger interrupt mode.
AT Command: AT+TTRMOD1
Command Example | Function | Response |
---|---|---|
AT+TTRMOD1=1 | Count and trigger from open to close (rising edge) | OK |
AT+TTRMOD1=0 | Count and trigger from close to open (falling edge) | OK(default) |
Downlink Command:
- Example1: 0xA4 01 01 // Same as AT+ TTRMOD1 =1
- Example2: 0xA4 01 00 // Same as AT+ TTRMOD1 =0
3.3.7 Set trigger mode of PA4
It only takes effect when AT+MOD=2.
Feature: Set the trigger interrupt mode.
AT Command: AT+TTRMOD2
Command Example | Function | Response |
---|---|---|
AT+TTRMOD2=1 | Count and trigger from open to close (rising edge) | OK |
AT+TTRMOD2=0 | Count and trigger from close to open (falling edge) | OK(default) |
Downlink Command:
- Example1: 0xA4 02 01 // Same as AT+ TTRMOD2 =1
- Example2: 0xA4 02 00 // Same as AT+ TTRMOD2 =0
3.3.8 Set trigger mode of PB15
It only takes effect when AT+MOD=2.
Feature: Set the trigger interrupt mode.
AT Command: AT+TTRMOD3
Command Example | Function | Response |
---|---|---|
AT+TTRMOD3=1 | Count and trigger from open to close (rising edge) | OK |
AT+TTRMOD3=0 | Count and trigger from close to open (falling edge) | OK(default) |
Downlink Command:
- Example1: 0xA4 03 01 // Same as AT+ TTRMOD3 =1
- Example2: 0xA4 03 00 // Same as AT+ TTRMOD3 =0
3.3.9 Set the calculate flag
It only takes effect when AT+MOD=2.
Feature: Set the calculate flag.(Range is 0 to 7)
AT Command: AT+CALCFLAG
Command Example | Function | Response |
---|---|---|
AT+CALCFLAG =0 | Set the calculate flag to 0. | OK(default) |
AT+CALCFLAG =2 | Set the calculate flag to 2. | OK |
Downlink Command:
- Example: 0XA5 01 // Same as AT+CALCFLAG =1
3.3.10 Set count number
Feature: Manually set the count number
In CPL01 work mode, the Total_pulse set by the "AT+SETCNT=1,xx" command.
In CPL03 work mode, the Port1_Total_pulse(PA8) set by the "AT+SETCNT=1,xx" command.
AT Command: AT+SETCNT
Command Example | Function | Response |
---|---|---|
AT+ SETCNT =1,100 | Set the count number to 0. | OK |
AT+ SETCNT =2,0 | Set the count number to 100. | OK |
AT+ SETCNT =3,50 | Set the count number to 50. | OK |
Downlink Command:
0xA6 01 00 00 64 ==> AT+SETCNT=1,100
0xA6 02 00 00 00 ==> AT+SETCNT=2,0
0xA6 03 00 00 32 ==> AT+SETCNT=3,50
3.3.11 Clear all counter values
Feature: Manually clear all counter values
AT Command:
Command Example | Function | Response |
---|---|---|
AT+CLRC | Set all counter values to 0. | OK |
Downlink Command: 0xA6 01
3.3.12 Count Mod
Feature: Manually set the count mode.
AT Command:
Command Example | Function | Response |
---|---|---|
AT+COUNTMOD=0 | the count value keeps accumulating mode | OK(default) |
AT+COUNTMOD=1 | the count value will be reset after each TDC time(Last Close Duration Reset after each uplink) | OK |
Downlink Command:
Example1: 0B 00 => AT+COUNTMOD=0
Example2: 0B 01 => AT+COUNTMOD=1
3.3.13 Work Mod
Feature: Manually set the work mode.
AT Command:
Command Example | Function | Response |
---|---|---|
AT+MOD=1 | Set the Real-Time Open/Close Status mode. | OK(default) |
AT+MOD=2 | Set the 3 x pulse counting mode. | OK |
Downlink Command:
Example1: 0A 01 => AT+MOD=1
Example2: 0A 02 => AT+MOD=2
3.3.14 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 Example | Function | Response |
---|---|---|
AT+SYNCMOD=1 | Enable Sync system time via LoRaWAN MAC Command (DeviceTimeReq) The default is zero time zone. | OK(default) |
AT+SYNCMOD=1,8 | Enable Sync system time via LoRaWAN MAC Command (DeviceTimeReq) Set to East eight time zone. | OK |
AT+SYNCMOD=1,-12 | Enable 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
4. Battery & Power Consumption
CPL03-LB use ER26500 + SPC1520 battery pack and CPL03-LS use 3000mAh Recharable Battery with Solar Panel. 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 CPL03-LB/LS 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
6.1 AT Commands input doesn't work
In the case if user can see the console output but can't type input to the device. Please check if you already include the ENTER while sending out the command. Some serial tool doesn't send ENTER while press the send key, user need to add ENTER in their string.
6.2 How to Connect Dry contacts or Wet Contacts
CPL03-LB/LS can only be connected to dry contacts by default, and the wiring method is to connect the two ports of dry contacts to the VDD pin and pulse input pin of CPL03-LB/LS respectively.
If you want to connect a wet contact, you need to change the original wiring method. The wiring method is that the GND of the wet contact is connected to the GND of CPL03-LB/LS, and the pulse output is connected to the pulse pin, but the pulse output voltage of the wet contact must be less than 3.6V.
6.3 What is the maximum total number of pulses for CPL03? What happens after the maximum total number of pulses is reached?
The maximum total number of pulses for CPL03 is three bytes FF FF FF (16,777,215)
The count is reset when the maximum total number of pulses is reached
7. Order Info
Part Number: CPL03-LB-XX or CPL03-LS-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:
- CPL03-LB or CPL03-LS LoRaWAN Pulse/Contact Sensor x 1
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.