DS03A-NB NB-IoT Door Sensor
This manual describes the product specifications of the DS03A-NB, its door‑sensor detection and alarm functions, as well as the methods for connecting to a server via NB‑IoT, configuring AT commands, reading data, and updating the firmware. Applicable to equipment selection, installation and commissioning, and routine maintenance.
On this page
chinese user manual
Product function installation and configuration data message alarm and maintenance
Fig. 1 DS03A-NB equipment and door magnetic probe
This manual describes the product specifications of the DS03A-NB, its door‑sensor detection and alarm functions, as well as the methods for connecting to a server via NB‑IoT, configuring AT commands, reading data, and updating the firmware. Applicable to equipment selection, installation and commissioning, and routine maintenance.
Corresponding to Dragino online documents, the finishing date is October 9, 2026. The command, parameter, protocol field and message value are written in the original text. The operation screenshot retains the original interface with Chinese legend.
Original Document
Dragino DS03A-NB Online Documentation
1 Product introduction
What is the 1.1 DS03A-NB?
Dragino DS03A-NB is a NB-IoT door magnetic sensor for IoT solutions. It detects the open or closed state of the door and reports the data to the Internet of Things server through the NB-IoT network. The user can view the door status, the door opening duration and the number of door opening times in the server.
The DS03A-NB reports data regularly every 2 hours and every time the door is opened or closed. The device also counts the number of door openings and calculates the duration of the last door opening. Users can also turn off the reporting of successive door opening and closing events, instead of recording each door opening event and reporting it regularly.
Translation:Section 1.1 reports every 2 hours by default and section 2.3 reports every 4 hours. The two are inconsistent. Please read the current configuration via AT TDC and refer to the actual firmware and settings.
DS03A-NB support door opening timeout alarm. When this function is enabled and set, the device sends an alarm if the door remains open for the specified duration.
DS03A-NB for outdoor use, with weather-resistant housing and industrial-grade batteries, can work in low to high temperature environments.
The DS03A-NB supports uplink communication methods such as MQTT, MQTTs, UDP, TCP, and CoAP, and can access a variety of IoT servers according to application requirements.
The DS03A-NB supports configuration and OTA firmware upgrade through BLE, which is easy to use and maintain.
The DS03A-NB is powered by a lithium thionyl chloride battery with a capacity of 8500 mAh. It is designed for long-term use and has a service life of several years.
The DS03A-NB provides an optional pre-installed SIM card and a default IoT server connection version, which is simple to configure and can be used.
1.2 features
- NB-IoT frequency band: B1/B2/B3/B4/B5/B8/B12/B13/B17/B18/B19/B20/B25/B28/B66/B70/B85, using H-FDD.
- Ultra low power consumption.
- Detect the open and closed state of the door.
- Statistical door opening and closing events.
- Support door opening timeout alarm.
- Probe line length 40cm.
- One report after multiple samples is supported.
- Support Bluetooth 5.1 remote configuration and firmware upgrade.
- Periodic reporting is supported.
- Support to modify the configuration through the downlink command.
- 8500 mAh battery, suitable for long-term use.
- Equipped with Nano SIM card slot, can install NB-IoT SIM card.
1.3 Technical Specifications
General DC electrical characteristics
- Supply voltage: 2.5V to 3.6V.
- Operating temperature:-40 to 85°C.
NB-IoT specifications
NB-IoT module: BC660K-GL.
Supported Bands and Frequencies
NB-IoT band | Frequency MHz |
|---|---|
B1 H-FDD | 2100 |
B2 H-FDD | 1900 |
B3 H-FDD | 1800 |
B4 H-FDD | 2100 |
B5 H-FDD | 860 |
B8 H-FDD | 900 |
B12 H-FDD | 720 |
B13 H-FDD | 740 |
B17 H-FDD | 730 |
B18 H-FDD | 870 |
B19 H-FDD | 870 |
B20 H-FDD | 790 |
B25 H-FDD | 1900 |
B28 H-FDD | 750 |
B66 H-FDD | 2000 |
B70 H-FDD | 2000 |
B85 H-FDD | 700 |
Battery specifications
- Lithium thionyl chloride battery, non-rechargeable.
- Capacity: 8500 mAh.
- Self-discharge rate: less than 1%/year at 25°C.
- Maximum continuous current: 130 mA.
- Maximum pulse current: 2 A for 1 second.
Power consumption
- STOP mode current: 10 μA, supply voltage is 3.3V.
- Maximum emission current: 350 mA, supply voltage 3.3V.
Translator's Note:The original label is "Max transmit power", but the unit mA represents current, so it is translated as maximum emission current here. Values remain as they are.
1.4 Application Scenarios
Figure 2 Supermarket Warehouse Garage Villa Home and Store Application Scenarios
The scenes in the picture are: Supermarket Supermarket, Warehouse Warehouse, Garage Garage, Villa, Home Area Home Area and Store Store.
1.5 Deep Sleep Mode and Working Mode
Deep sleep mode: The sensor does not have the NB-IoT function enabled. This mode is used for storage and transportation to save battery power.
Operating mode: The device is connected to the NB-IoT network as a NB-IoT sensor and sends sensor data to the server. Between periodic sampling, transmitting, and receiving operations, the device enters an IDLE idle mode. The power consumption of the IDLE mode is the same as that of the DEEP SLEEP mode.
1.6 buttons and LED indicators
Figure 3 Device external structure and ACT button position
Note in the figure: Antenna Attachable removable antenna; Push Button button; LED Indicator indicator light; Pressure Balance Valve pressure balance valve.
ACT key operation | Function | Device Action |
|---|---|---|
Press and hold for 1 to 3 seconds | Send uplink data | If the device has been connected to the NB-IoT network, it will send an uplink packet and the blue light will flash once. At the same time, BLE is enabled, and the user can configure the device through BLE. |
Press and hold for more than 3 seconds | Activate device | The green light quickly flashes 5 times, the device enters OTA mode and stays for 12 seconds, then starts to access the NB-IoT network. The blue light flashes once to indicate that the device is powered on. Once activated, BLE is enabled and available for configuration, whether or not connected. After finding the network signal, the blue light is always on for 3 seconds. |
Press 5 times consecutively | Deactivate Device | The red light is always on for 5 seconds, indicating that the device enters deep sleep mode. |
Note: When the device executes the program, the key operation may be temporarily invalid. It is recommended to operate the button after the end of the program.
1.7 BLE connection
DS03A-NB supports remote configuration and firmware upgrade via BLE.
BLE can be used to configure sensor parameters or view the console output of the device. Enable BLE only if:
- Press the button to trigger an uplink data transmission.
- Press the key to activate the device.
- The device is powered on or reset.
If there is no active BLE connection for 60 seconds, the device will turn off the BLE module and enter a low-power mode.
1.8 pin switch with SIM card orientation
Figure 4 Circuit board pin jumper SW1 switch and SIM card slot
1.8.1 JP2 Jumpers
After the JP2 jumper is plugged in, the device is powered on.
1.8.2 BOOT MODE AND SW1 SWITCH
1)ISP: firmware upgrade mode. In this mode, the device does not output a signal, the LED does not work, and the application firmware does not run, but it is ready to receive a firmware upgrade.
2)Flash: Normal working mode. The device starts running and outputs console information for further debugging.
1.8.3 Reset button
Press this button to restart the device.
1.8.4 SIM card installation direction
For SIM card installation directions, please refer to the instructions on "How to insert a SIM card.
See:Relevant operating instructions
1.9 mechanical dimensions
Fig. 5 Mechanical Dimensions of Equipment Body
Probe mechanical dimensions
Fig. 6 Mechanical Dimensions of Door Magnetic Probe and Magnet
1.10 magnet sensing distance
- Wooden door: 10 mm to 30mm.
- Iron door: 30 mm to 45mm.
2 Communicate with IoT server
2.1 sending data over a NB-IoT network
DS03A-NB built-in NB-IoT module. The pre-installed firmware reads the data collected by the sensor and sends it to the local NB-IoT network through the NB-IoT module. The network then forwards the data to the IoT server according to the protocol configured by the device.
The network structure is shown in the following figure.
Figure 7 DS03A-NB NB-IoT network connection structure
Data path: door magnetic sensor → NB-IoT network and base station → Internet → Internet of things server → dashboard. You can use MQTT, MQTTs, UDP, TCP, or CoAP protocols.
DS03A-NB offer-GE and -1T versions. The GE Universal Edition does not include a SIM card and does not preset an IoT server. The user needs to use the AT command to complete the following two-step configuration before sending data to the server.
- Install the NB-IoT SIM card and configure the APN. See the "Access Network" instructions for the method of operation.
See also:Related operation instructions
- Configure the IoT server to which the sensor is connected. The operation method is described in "Connecting the Configuration of Different Servers.
See also:Related operation instructions
The following table provides an overview of how different servers are presented.
Server | Presentation or remarks |
|---|---|
Node-Red | The original text provides an example of the dashboard, as shown in the figure below. |
DataCake | The original text provides an example of the dashboard, as shown in the figure below. |
Tago.IO | No dashboard examples or comments are provided in the original text. |
Universal UDP | Receiving the original load requires developers to make their own dashboards. |
Generic MQTT | Receiving the original load requires developers to make their own dashboards. |
ThingSpeak | The original text provides an example of the dashboard, as shown in the figure below. |
ThingsBoard | The original text provides a dashboard example, as shown in the figure below. |
Figure 8 Node-Red dashboard example
Figure 9 Example of DataCake dashboard
Figure 10 Example of ThingSpeak dashboard
Figure 11 Example of ThingsBoard dashboard
The 1T version comes preloaded with a 1NCE SIM card and is preconfigured to send data to the ThingsEye. Users only need to select the sensor type in the ThingsEye and activate the DS03A-NB to view the data in the ThingsEye. See the ThingsEye configuration instructions for specific operations.
See also:Related operation instructions
2.2 uplink data format
To meet the requirements of different servers, the DS03A-NB supports multiple data payload formats.
The following types are supported:
- Generic JSON format, Type = 5.
- Hexadecimal HEX format, Type = 0.
- ThingSpeak format, Type = 1.
- ThingsBoard format, Type = 3.
When you select a connection agreement, you can also specify the data format. For example:
AT PRO = 2,0 // Use UDP connection and HEX data format
AT PRO = 2,5 // Use UDP connection and JSON data format
AT PRO = 3,5 // Use MQTT connection and JSON data format
2.2.1 Common JSON Format Type 5
The data length of the common JSON format is different in single-channel mode and dual-channel mode.
Example 1 of generic JSON data is as follows.
{
"IMEI": "863663062798914",
"IMSI": "460083513507314",
"Model": "DS03A-NB",
"level status": 1,
"alarm status": 0,
"door open num": 0,
"last open time": 0,
"level status2": 1,
"alarm status2": 0,
"door open num2": 0,
"last open time2": 0,
"battery": 3.22,
"signal": 14,
"time": "2024/11/20 07:08:20",
"1": [1, 0, 0, 1, 0, 0, "2024/11/20 06:54:23"],
"2": [1, 0, 0, 1, 0, 0, "2024/11/20 06:39:23"],
"3": [0, 0, 0, 8, 0, 126977, "2024/11/20 05:29:33"],
"4": [0, 0, 0, 8, 0, 323585, "2024/11/20 05:14:33"],
"5": [0, 0, 0, 8, 0, 192513, "2024/11/20 04:59:33"],
"6": [0, 0, 0, 8, 0, 192513, "2024/11/20 04:44:33"],
"7": [0, 0, 0, 8, 0, 192513, "2024/11/20 04:29:33"],
"8": [0, 0, 0, 8, 0, 258049, "2024/11/20 04:14:33"]
}
Figure 12 The MQTT receiving interface of the first generic JSON data example
The description of the above data is as follows:
- level status, alarmstatus, door open num, last open time, level status2, alarmstatus, door open status2, door open sum2, last open time2, Battery, signal, and time indicate the real-time values at the time of reporting.
- The JSON entries numbered 1 to 8 represent the data of the most recent 1 to 8 samples, set by AT CLOCKLOG = 1,65535,15,8. Each record contains, from left to right:
level status, door open num, last open time, and sampling time.
Example 2 of generic JSON data is as follows.
{
"IMEI": "863663062798914",
"IMSI": "460083513507314",
"Model": "DS03A-NB",
"level status": 1,
"alarm status": 0,
"door open num": 0,
"last open time": 0,
"level status2": 1,
"alarm status2": 0,
"door open num2": 0,
"last open time2": 0,
"battery": 3.21,
"signal": 19,
"time": "2024/11/20 06:31:03",
"1": [0, 0, 0, 8, 0, 126977, "2024/11/20 05:29:33"],
"2": [0, 0, 0, 8, 0, 323585, "2024/11/20 05:14:33"],
"3": [0, 0, 0, 8, 0, 192513, "2024/11/20 04:59:33"],
"4": [0, 0, 0, 8, 0, 192513, "2024/11/20 04:44:33"],
"5": [0, 0, 0, 8, 0, 192513, "2024/11/20 04:29:33"],
"6": [0, 0, 0, 8, 0, 258049, "2024/11/20 04:14:33"],
"7": [0, 200, 300, 0, 16319072, 61441, "2024/11/20 02:03:04"],
"8": [0, 200, 300, 0, 16253640, 192513, "2024/11/14 10:00:21"]
}
Figure 13 MQTT receiving interface of generic JSON data example 2
The description of the above data is as follows:
- Level status, alarm status, door open count, last open time, level status2, alarm status2, door open sum2, last open time2, Battery, Signal, and time represent the real-time values at the time of reporting.
- JSON entries numbered 1 through 8 represent data from the most recent 1 to 8 samples, as configured by AT CLOCKLOG=1,65535,15,8. Each record contains, from left to right:
level status, door open num, last open time, level status2, door open sum2, last open time2, and sampling time.
Translator's Note:The name of door open sum2 in the field description is different from that of door open num2 in the example, and the case of Battery and Signal is also different. In addition, the history array of JSON example one contains two-channel values, while the field order description that follows lists only single-channel fields. The analysis procedure should be checked according to the actual message and channel settings, and cannot only rely on the instructions here.
2.2.2 HEX Format Type 0
The HEX format has different byte lengths in single-channel mode and dual-channel mode.
The HEX data in the single channel mode is as follows.
f863663062798914f46008351350731412820ca30f010100000000000000673d8fb701000000000000673d8b 2301000000000000673d879f01000000000000673d841b0800000001f001673d73bd0800000004f001673d70 390800000002f001673d6cb50800000002f001673d69310800000002f001673d65ad
The above only wrap by reading width, and continuous hexadecimal strings should still be used when sending or parsing.
HEX Field Layout and Sample Values
Field | Number of bytes | Example value |
|---|---|---|
f IMEI | 8 | f863663062798914 |
f IMSI | 8 | f460083513507314 |
Version | 2 | 1282 |
Battery BAT | 2 | 0ca3 |
Signal | 1 | 0f |
Modes Mod | 1 | 01 |
PA8 door status | 1 | 01 |
PA8 alarm status | 1 | 00 |
PA8 opening times | 3 | 000000 |
PA8 Last opening time | 3 | 000000 |
Timestamp Timestamp | 4 | 673d8fb7 |
The IMEI and the IMSI each occupy 8 bytes; the subsequent real-time data occupies 18 bytes. The example in the figure carries the last 8 historical records, each accounting for 11 bytes.
Field order for each history
Field | Number of bytes |
|---|---|
PA8 Door Status | 1 |
PA8 opening times | 3 |
PA8 Last opening time | 3 |
sampling timestamp | 4 |
History records | Sample HEX data |
|---|---|
Recently 1st | 0100000000000000673d8b23 |
2nd most recently | 0100000000000000673d879f |
Third most recently. | 0100000000000673d841b |
4 recently. | 080000000001f001673d73bd |
5th most recently. | 0800000004f001673d7039 |
6 recently. | 0800000002f001673d6cb5 |
Recently 7th | 0800000002f001673d6931 |
8th most recently. | 0800000002 f001673d65ad |
After using the MQTT client to subscribe to the corresponding topic, you can see the information shown in the following figure when the NB sensor reports data.
Figure 14 MQTT receiving interface for single-channel HEX data
The data of the two-channel mode is as follows. The original text here is "JSON format", but the content listed is HEX data.
f863663062798914f46008351350731412820c9f110101000000000000000100000000000000673d8c8a0100 000000000001000000000000673d8b230100000000000001000000000000673d879f01000000000000010000 00000000673d841b0800000001f00100000000000000673d73bd0800000004f00100000000000000673d7039 0800000002f00100000000000000673d6cb50800000002f00100000000000000673d69310800000002f00100 000000000000673d65ad
The above is only wrapped according to the display width; when sending or parsing, a continuous hexadecimal string should still be used.
HEX field layout and example values
Field | Number of bytes | Example value |
|---|---|---|
f IMEI | 8 | f863663062798914 |
f IMSI | 8 | f460083513507314 |
Version | 2 | 1282 |
Battery BAT | 2 | 0c9f |
signal | 1 | 11 |
Mode Mod | 1 | 01 |
PA8 Door Status | 1 | 01 |
PA8 Alarm Status | 1 | 00 |
PA8 Number of door openings | 3 | 000000 |
PA8 last door open duration | 3 | 000000 |
PA4 door status | 1 | 01 |
PA4 alarm status | 1 | 00 |
PA4 opening times | 3 | 000000 |
PA4 Last opening time | 3 | 000000 |
Timestamp | 4 | 673d8c8a |
The IMEI and the IMSI each occupy 8 bytes; the subsequent real-time data occupies a total of 25 bytes. The example in the figure carries the last 8 historical records, each of which occupies 18 bytes.
Field order of each historical record
Field | Number of bytes |
|---|---|
PA8 Door Status | 1 |
PA8 Number of door openings | 3 |
PA8 last door open duration | 3 |
PA4 Door Status | 1 |
PA4 Number of door openings | 3 |
PA4 last door opening duration | 3 |
Sampling timestamp | 4 |
History records | Example HEX data |
|---|---|
Recently, for the first time. | Kan |
Recently, the 2nd time. | Kan |
Recently, the 3rd time. | 0100000000000000000000000000673d841b |
Recently, the 4th time. | Kan |
Recently, the 5th time. | Kan |
Recently, the 6th time. | Kan |
Recently, the 7th time. | Kan |
Recently, the 8th time. | Kan |
After subscribing to the corresponding topic using an MQTT client, you can see the information shown in the figure below when the NB sensor reports data.
Figure 15 MQTT receiving interface for dual-channel HEX data
Version Information Version
These two bytes contain hardware model and software version information.
The high byte specifies the sensor model. DS03A-NB corresponds to 0x12.
The low byte specifies the software version. 0x 82=130 for firmware version 1.3.0.
Battery Information BAT
Example: 0x0DDA = 3546 mV.
Signal Strength Signal Strength
Indicates the NB-IoT network signal strength.
Example: 0x 15=21.
0:-113 dBm or less.
1:-111 dBm.
2 to 30:-109 dBm to -53 dBm.
31:-51 dBm or higher.
99: Unknown or undetectable.
PA8 Door Status
Corresponds to level status in JSON and represents the status of the PA8 pin.
0x 00:PA8 is high, indicating that the door is closed.
0x 01:PA8 is low, indicating that the gate is open.
PA8 Alarm Status
Indicates whether this packet is triggered by a timeout alarm on the PA8 pin.
0x 00: Normal upstream data packet.
0x 01: Uplink packet triggered by PA8 timeout alarm.
PA8 door open num
Indicates the number of door opening detected by the door magnetic sensor connected to the PA 8.
Example: 0 x00000A (hexadecimal) = 10 (decimal), that is, the cumulative open 10 times.
PA8 Last open time
Indicates the last time the door was opened, in seconds.
Example: 0 x00012C (hexadecimal) = 300 (decimal), which is 300 seconds.
PA4 Door Status
Corresponds to the level status2 in JSON and represents the state of the PA4 pin.
0x 00:PA4 is high, indicating that the door is closed.
0x 01:PA4 is low, indicating that the gate is open.
PA4 Alarm Status
Indicates whether this packet is triggered by a timeout alarm on the PA4 pin.
0x00: Normal uplink data packet.
0x 01: Uplink packet triggered by PA4 timeout alarm.
PA4 door open num
Indicates the number of door opening detected by the door magnetic sensor connected to PA4.
Example: 0x00000A (hexadecimal) = 10 (decimal), meaning the door has been opened a total of 10 times.
PA4 Last open time
Indicates the duration of the last door opening, in seconds.
Example: 0x00012C (hexadecimal) = 300 (decimal), which is 300 seconds.
Timestamp
Unix timestamp example: 650ABC40 (hexadecimal) = 1695202368 (decimal).
Enter the decimal value into epochconverter.com to convert to a date and time.
See also:Related operation instructions
2.2.3 ThingsBoard Format Type 3
The Type 3 data format is designed for ThingsBoard and adjusts other default server settings to ThingsBoard.
Type 3 data for single channel mode is as follows.
{
"topic": "004-NB",
"payload": {
"IMEI": "863663062765285",
"IMSI": "460086859301439",
"Model": "DS03A-NB",
"level status": 1,
"alarm status": 0,
"door open num": 0,
"last open time": 0,
"level status2": 1,
"alarm status2": 0,
"door open num2": 0,
"last open time2": 0,
"battery": 3.33,
"signal": 22,
"time": "2024/12/07 00:56:00",
"1": [0, 5123224, 5340135, "1970/03/01 07:07:05"],
"2": [0, 0, 5339235, "1970/07/14 04:20:16"],
"3": [0, 5123224, 5338335, "1970/03/01 07:07:05"],
"4": [0, 0, 5337435, "1970/07/14 04:20:16"],
"5": [0, 5123224, 5336535, "1970/03/01 07:07:05"],
"6": [0, 0, 5335635, "1970/07/14 04:20:16"],
"7": [0, 5123224, 5334735, "1970/03/01 07:07:05"],
"8": [0, 0, 5333835, "1970/07/14 04:20:16"]
}
}
Figure 16 ThingsBoard Single Channel Data Receiving Example
The Type 3 data of the dual channel mode is as follows.
{
"topic": "004-NB",
"payload": {
"IMEI": "863663062765285",
"IMSI": "460086859301439",
"Model": "DS03A-NB",
"level status": 1,
"alarm status": 0,
"door open num": 0,
"last open time": 0,
"level status2": 1,
"alarm status2": 0,
"door open num2": 0,
"last open time2": 0,
"battery": 3.32,
"signal": 24,
"time": "2024/12/07 00:58:29",
"1": [0, 0, 0, 0, 5123224, 5340135, "1970/03/01 07:07:05"],
"2": [0, 0, 0, 0, 0, 5339235, "1970/07/14 04:20:16"],
"3": [0, 0, 0, 0, 5123224, 5338335, "1970/03/01 07:07:05"],
"4": [0, 0, 0, 0, 0, 5337435, "1970/07/14 04:20:16"],
"5": [0, 0, 0, 0, 5123224, 5336535, "1970/03/01 07:07:05"],
"6": [0, 0, 0, 0, 0, 5335635, "1970/07/14 04:20:16"],
"7": [0, 0, 0, 0, 5123224, 5334735, "1970/03/01 07:07:05"],
"8": [0, 0, 0, 0, 0, 5333835, "1970/07/14 04:20:16"]
}
}
Figure 17 ThingsBoard dual-channel data reception example
2.2.4 ThingSpeak Format Type 1
This format meets the requirements of ThingSpeak platforms, contains 8 fields, and is only applicable to ThingSpeak platforms.
The data is displayed as shown in the following figure.
Figure 18 ThingSpeak the four data fields for the first channel
The four fields in the figure are: door status, alarm status, number of door openings, and last door opening duration. Second channel field name with suffix 2.
Figure 19 ThingSpeak the four data fields of the second channel.
The four fields in the figure are: door status, alarm status, number of door openings, and last door opening duration. Second channel field name with suffix 2.
2.3 test reporting and modification reporting cycle
By default, the sensor reports every 4 hours.
Users can modify the reporting cycle using the following commands.
AT command: AT TDC.
Example: AT TDC = 7200 // Set the reporting period to 7200 seconds, I .e. 2 hours.
Downward command: 0x01.
Format: Instruction code 0x 01, followed by 3 bytes.
Example: 12 hours = 43200 seconds; 43200 (decimal) = 0xA8C0 (hexadecimal).
下行载荷:01 00 A8 C0 // 对应 AT+TDC=43200,将上报周期设为 12 小时。
Note: Press and hold the button for more than 1 second, can also trigger a report.
One report after 2.4 multiple sampling
Note: The AT NOUD function has been upgraded to the Clock Logging timer function. See Section 2.13.
To conserve power, the DS03A-NB samples every 15 minutes and reports every 2 hours. Therefore, each report contains 8 sets of stored data and 1 set of real-time data, which are defined by the following parameters. The original text writes the sampling object here as "water flow data".
Translator's Note:The "water flow data" here is inconsistent with the theme of door magnetic products, which may be a reuse copy; AT TR and AT NOUD are retained according to the original text. See Section 2.13 for the new configuration of the Timed Record.
- AT TR = 900 // in seconds. By default, data is recorded every 900 seconds, that is, 15 minutes, and the minimum can be set to 180 seconds.
- AT NOUD = 8 // By default, 8 groups of recorded data are reported at a time, up to 32 groups can be reported.
The following figure further illustrates the relationship of TR, NOUD, and TDC.
Fig. 20 Relationship between Number of NOUD Records at TR Sampling Interval and TDC Reporting Cycle
In the figure, Sample indicates sampling, Record indicates storage record, and Tx indicates reporting. TR determines the sampling interval, NOUD determines the number of historical records carried in the report, and TDC determines the periodic reporting interval. Different combinations affect the records covered by each transmission.
2.5 report through external interrupt trigger
DS03A-NB supports externally triggered interrupts. Users can trigger data packet reporting through the PA8 pin.
AT Command
- AT INTMOD // Set the interrupt trigger mode.
- AT INTMOD = 0 // Disable interrupts.
- AT INTMOD = 1 // Both rising and falling edges trigger.
- AT INTMOD = 2 // Falling edge trigger.
- AT INTMOD = 3 // rising edge trigger.
2.6 Enable or Disable Switch Door Event Alarm
Function: Enable or disable door event alarm, the default value is 0.
AT commands
Command example | Function | Return value |
|---|---|---|
AT DISALARM=1 | Data packets are sent only in accordance with the TDC cycle. | OK |
AT DISALARM=0 | Data packets are sent according to the TDC cycle, and are also sent when the gate magnetic state changes. | OK |
Downlink command
0xA7 01 // Equivalent to AT DISALARM = 1.
0xA7 00 // is equivalent to AT DISALARM = 0.
2.7 state continuous timeout alarm
The DS03A-NB can monitor the duration of a certain state and give an alarm after a timeout, such as monitoring that the door is open for too long. The relevant parameters are as follows.
- Keep Status: The status to be monitored.
Keep Status = 1: Monitors events that change from off to on.
Keep Status = 0: Monitor events that change from on to off.
- Keep Time: the timeout period before sending the alarm.
The range is 0 to 65535 seconds, or 0xFFFF.
When Keep Time = 0, the state continuous timeout alarm is disabled.
When Keep Time>0, the device monitors the status change specified by Keep Status; if the status does not change after timeout, an alarm is sent.
- Downlink command
Command format: 0xA9 aa bb cc dd.
A9: Instruction type code.
aa:01 indicates TTRIG1, and 02 indicates TTRIG2.
bb: Status to be monitored.
cc dd: timeout duration.
1)AT TTRIG1: Corresponds to the PA8 pin.
AT Configuration Commands
- AT TTRIG1 = 1,30: When the door changes from closed to open and continues to open for more than 30 seconds, the DS03A-NB sends an upstream packet with the Alarm1 bit set to 1. The original text describes this bit as bit 2 of the first byte of the payload.
- AT TTRIG1 = 0,30: The original description is that the door changes from open to closed, but then "stays open for more than 30 seconds" sends an alarm and sets the Alarm1 bit to 1. The original text describes this bit as the second bit of the first byte of the payload. There is a contradiction in the description of this state, see the translation of this section.
- AT TTRIG1 = 0,0: default value, timeout alarm is disabled.
Downlink Configuration Command
0xA9 01 01 00 1E is equivalent to AT TTRIG1 = 1,30;0xA9 01 00 00 00 is equivalent to AT TTRIG1 = 0,0.
2)AT TTRIG2: corresponding to PA4 pin, AT TTRCHANNEL = 2 needs to be set first.
AT configuration commands
- AT TTRIG2 = 1,30: When the door changes from closed to open and continues to open for more than 30 seconds, the DS03A-NB sends an upstream packet with the Alarm2 bit set to 1. The original text describes this bit as bit 2 of the 12th byte of the payload.
- AT TTRIG2 = 0,30: The original description is that the door changes from open to closed, but then "stays open for more than 30 seconds" sends an alarm and sets the Alarm2 bit to 1. The original text describes this bit as bit 2 of the 12th byte of the payload. There is a contradiction in the description of this state, see the translation of this section.
- AT TTRIG2 = 0,0: Default value, timeout alarm is disabled.
Downlink Configuration Command
0xA9 02 00 00 1E is equivalent to AT TTRIG2 = 0,30;0xA9 02 00 00 00 is equivalent to AT TTRIG2 = 0,0.
Translator's Note:The definition of Keep Status = 0 is to monitor the closed state, but the English of the two = 0 and 30 examples still write "keep open", which is contradictory. The original description of the byte positions of Alarm1 and Alarm2 is also difficult to directly correspond to the HEX layout in this section. The implementation should be combined with the actual firmware, channel and load format to verify the alarm bit, if necessary to confirm with the manufacturer.
2.8 TTRIG1 and TTRIG2 persistent timeout alarms
This function needs to be used in conjunction with AT TTRIG1 or AT TTRIG2. After the TTRIG1 or TTRIG2 timeout triggers the alarm, if the status remains unchanged, the device will repeatedly send the alarm data packet according to the set alarm interval.
AT commands
Command example | Function | Return value |
|---|---|---|
AT TTRALARM=0 | Duplicate alarms are disabled. | OK |
AT TTRALARM=60 | Set the repeat alarm interval to 60 minutes in minutes. | OK |
Downlink command
Example: 0C aa corresponds to AT TTRALARM = aa.
2.9 counting mode
Function: Set the counting mode manually.
AT commands
Command example | Function | Return value |
|---|---|---|
AT COUNTMOD=0 | The count value is continuously accumulated. | OK |
AT COUNTMOD=1 | The count value is reset after each TDC cycle. The original text includes a note to reset the last closing duration after each report. | OK |
Translator's Note:The original text includes the use of the Last Close Duration and the other chapters use the last open time, which have different meanings. The description is kept here, and the closing time is not directly changed to the opening time.
Downlink command
Example: 0B aa corresponds to AT COUNTMOD = aa, and the second byte represents the count mode.
Number of 2.10 gate magnetic channels
Function: Set the number of channels of the door magnetic sensor.
AT commands
Command example | Function | Return value |
|---|---|---|
AT TTRCHANNEL=1 | Single channel, using only PA8 as the interrupt pin. | OK |
AT TTRCHANNEL=2 | Dual channel, using PA8 and PA4 as interrupt pins. | OK |
Downlink command
Example: 0D aa corresponds to AT TTRCHANNEL = aa, and the second byte indicates the number of channels.
2.11 clear the opening times and last opening time
AT commands
Command example | Function | Return value |
|---|---|---|
AT CLRC | Clear the number of door openings and the duration of the last door opening. | OK |
Downlink command: 0xA6 01.
After execution, the equipment clears the number of door openings and the last door opening duration.
2.12 Set door opening count value
AT commands
Command example | Function | Return value |
|---|---|---|
AT SETCNT=1,100 | The door opening count of the PA8 is set to 100 times. | OK |
AT SETCNT=1,0 | Clear the open count of PA8. | OK |
AT SETCNT=2,50 | Sets the open door count for PA4. The original description is 100 times, but both the parameter and the downward example are 50, see translation. | OK |
Translator's Note:AT SETCNT = 2,50 and downlink data 0xA6 02 00 00 32 both correspond to 50, and "100 times" in the original table is suspected to be a clerical error.
Downlink command
0xA6 01 00 00 64 corresponds to AT SETCNT = 1,100.
0xA6 01 00 00 00 corresponds to AT SETCNT = 1,0.
0xA6 02 00 00 32 corresponds to AT SETCNT = 2,50.
2.13 Timing Record Firmware v1.2.1 is supported
When multiple terminals are deployed in the field, it may be necessary to sample all sensors at the same time and report them together for analysis. At this time, the Clock Logging timer recording function can be used.
This command sets the start time and interval for data logging to meet the needs of a specified collection time.
- AT command: AT CLOCKLOG = a, B, c,d.
a:0 indicates that timed logging is disabled, while 1 indicates that it is enabled.
B: Specifies the number of seconds from the first sample, ranging from 0 to 3599, or 65535 special values. When set to 65535, the recording period starts after the terminal accesses the network and transmits a packet.
c: Sampling interval, ranging from 0 to 255 minutes.
d: the number of records carried in each TDC reporting cycle, with a maximum of 32 records.
Note: The stop recording parameter given in the original text is AT CLOCKLOG = 1,65535,0,0.
Translator's Note:The parameter a is defined as 0 disabled and 1 enabled; However, the original example of stopping recording is still a = 1, and the interval and number of records are set to 0. This example is retained in this article. Please check the specific behavior according to the actual firmware.
Figure 21 Relationship between sampling and reporting time of timing record
The illustrated example is AT CLOCKLOG = 1,0,15,8: The device reports for the first time immediately after accessing the network at 10:34:35, and samples and records every 15 minutes from 11:00:00. The TDC reporting cycle is set to 2 hours; the second report carries battery information, the latest 8 historical records and time stamps, and includes the latest sampling value at the time of reporting.
Example
AT CLOCKLOG=1,65535,1,5
After the terminal sends the first data packet, data is recorded to the memory every 1 minute. Each time it is reported by TDC cycle, the load contains the battery information and the last 5 storage records, each record contains the data load and timestamp.
Figure 22 Timing record configuration and message example
Note: The server time needs to be synchronized before configuring this command. If the time is not synchronized first, the command does not take effect until the terminal is reset.
- Downward command: 0x0A.
Format: Instruction code 0x0A, followed by 5 bytes.
- Example 1: downlink load 0A01FFFF0F08, corresponding to AT CLOCKLOG = 1,65535,15,8, set recording time. The original will sample the object writing SHT.
- Example 2: Downlink load 0A0104B00F08, corresponding to AT CLOCKLOG = 1,1200,15,8, set recording time. The original will sample the object writing SHT.
Note: When entering the downstream payload, there must be no spaces between bytes.
2.14 Query Saved History
- AT command: AT CDP.
This command can query the saved history, record up to 32 sets of data, each set of historical data up to 100 bytes.
Figure 23 Using AT CDP to Query History
2.15 query uplink logs
- AT command: AT GETLOG.
This command can query the upstream sending log of the data packet.
Figure 24 Using AT GETLOG to query upstream logs
2.16 timing domain name resolution
This directive is used to set up scheduled domain name resolution.
AT commands
- AT DNSTIMER = XX // The unit is hours.
After setting, the device will periodically perform domain name resolution.
2.17 setting MQTT QoS level
This command is used to set the QoS level for MQTT.
AT commands
- AT MQOS = xx // can be set from 0 to 2.
Downward command: 0x07.
Format: Instruction code 0x 07, followed by 1 byte.
Example 1: The downlink load is 0x 0700, corresponding to AT MQOS = 0.
Example 2: Downlink payload 0x 0701, corresponding to AT MQOS = 1.
2.18 Downlink Debug Mode supported since firmware v1.3.0
Function: Enable or disable downlink debug mode. After the TE platform is updated, you no longer need to select a platform version, and you only need to switch the downlink debugging mode.
AT command: AT DOWNTE.
Command example | Function or parameter | Return value or description |
|---|---|---|
AT DOWNTE=? | Read the current settings. | 0,0 (default) |
AT DOWNTE=0,a | a: Enables or disables downstream debugging. | 0: Downstream debugging is disabled. |
Note: The first parameter is fixed to 0, only the second parameter is configurable.
Example
- AT DOWNTE = 0,1: Enable downlink debug mode.
- AT DOWNTE = 0,0: Downstream debug mode is disabled.
Downlink command
This function does not provide down commands.
2.19 domain name resolution settings firmware v1.3.0 support
Function: Set dynamic domain name resolution and alternate IP address.
AT command: AT BKDNS.
Directive or parameter | Function | Description |
|---|---|---|
AT BKDNS=? | Reading the current settings. | 0,0,NULL (default) |
AT BKDNS=a, B ,c | Set up domain name resolution and alternate addresses. | The meanings of a, B and c are given in the following lines. |
a=1 | Disable dynamic domain name updates. | Save the IP address after resolution; use the most recently saved IP address when the resolution fails next time. |
a=2 | Enable dynamic domain name updates. | Save the IP address after parsing; use the most recently saved IP when parsing fails next time, and update the parsing according to the cycle set by the user. |
b | The interval at which domain name resolution is periodically updated. | Units are hours. |
c | Set the IP address manually. | The format is the same as AT SERVADDR. If the resolution fails, use the address directly. If the resolution is successful, update C to the IP address successfully resolved. |
Example
- AT BKDNS = 1,0 // Disable dynamic domain name updates.
- AT BKDNS = 2,1 // Enable dynamic domain name updates and set the automatic update cycle to 1 hour.
- AT BKDNS = 2,4,3.69.98.183,1883 // Enable dynamic domain name update, set the cycle to 4 hours, and manually specify the IP address and port. When the domain name resolution fails, the IP address is used for communication. When the domain name resolution succeeds, the IP address is updated to the newly resolved IP address.
Downlink command
This function does not provide downlink commands.
3 Configuration DS03A-NB
3.1 Configuration Mode
DS03A-NB supports the following configurations:
- Send AT commands via Bluetooth connection, recommended. See BLE configuration instructions for details.
See also:Related operation instructions
- Send AT commands through the UART connection. See UART connection instructions for details.
See also:Related operation instructions
3.2 serial port access password
After successfully establishing a Bluetooth or UART connection, use the serial port access password to enter the AT command window.
The terminal box label is printed with the initial password in the format AT PIN = xxxxxx. When logging in, you can enter the AT command window by directly entering the six-digit password, and you do not need to enter the AT PIN = prefix.
Figure 25 Using the Initial Password to Enter the AT Command Window
Screenshot tip: Don't enter AT PIN = xxxxxx, just enter xxxxxx itself.
To change the password, use AT PWORD = xxxxxx. The password length is 6 characters. NB terminal only supports lowercase letters.
Translator's Note:The original text calls the initial password "six-digit password" and explains that only lowercase letters are supported for password modification. The screenshot also shows a combination of letters and numbers. The expressions of password character rules are inconsistent. Check the characters supported by the device firmware before modification.
Figure 26 Changing the serial port access password using AT PWORD
Note: After entering the command, you need to add a line break. You can also set the automatic line break in the Bluetooth tool or UART connection tool.
Figure 27 Settings for the serial port tool to automatically add line breaks.
In the screenshot, select Auto add line feed when send to automatically add line breaks when sending commands.
3.3 AT Instruction Set
Directives or Syntax | Description |
|---|---|
AT? | Displays help. |
AT | Execute the instruction. |
AT = | Set the parameter value. |
AT =? | Read the parameter value. |
General Instructions
See also:Related operation instructions
Command or syntax | Description |
|---|---|
AT | A wake-up or attention instruction. |
AT? | Brief help. |
ATZ | MCU reset. |
AT TDC | Application data transmission period. |
AT CFG | Output all configurations. |
AT CFGMOD | Select the working mode. |
AT DEUI | Read or set the device ID. |
AT INTMOD | Sets the interrupt trigger mode. |
AT 5VT | Extend the 5 V power supply time. |
AT PRO | Select the communication protocol. |
AT RXDL | Extend send and receive time. |
AT DNSCFG | Read or set the DNS server. |
AT GETSENSORVALUE | Returns the current sensor measurement. |
AT NOUD | Read or set the number of reported records. |
AT CDP | Read or clear cached data. |
AT SERVADDR | The server address. |
MQTT Management Commands
Command or syntax | Description |
|---|---|
AT CLIENT | Read or set the MQTT client. |
AT UNAME | Read or set the MQTT user name. |
AT PWD | Read or set the MQTT password. |
AT PUBTOPIC | Read or set the MQTT publish topic. |
AT SUBTOPIC | Read or set the MQTT subscription topic. |
INFORMATION AND MAINTENANCE INSTRUCTIVE
Command or syntax | Description |
|---|---|
AT FDR | Restore factory settings. |
AT PWORD | Serial access password. |
AT LDATA | Obtain the latest reported data. |
AT CDP | Read or clear cached data. |
4 Battery and power consumption
A battery pack of ER26500 and SPC1520 is DS03A-NB used. The battery information, power consumption analysis and replacement method are detailed below.
Battery information and power consumption analysis.
See also:Related operation instructions
5 Firmware upgrade
Users can update the firmware for the following purposes:
- Get new features.
- Repair program defects.
Firmware and update logs are available via the firmware download link.
See also:Related operation instructions
Firmware Upgrade Method
- Recommended method: OTA firmware upgrade through BLE. For details, see the operating instructions.
See also:Related operation instructions
- Upgrade via UART TTL interface, see operating instructions.
See also:Related operation instructions
6 Frequently Asked Questions
6.1 How to access BC660K-GL AT commands
Users can directly access the BC660K-GL module and send AT commands.
See BC660K-GL AT instruction set for details.
See also:Related operation instructions
6.2 how to configure certificates
Refer to the certificate configuration instructions and follow the steps to complete the configuration.
See also:Related operation instructions
Why does the LED not light up after the 6.3 solar panel model is pressed?
The LED does not light up after pressing the button, probably because the battery has entered the protection state.
Solution: Put the solar panel in direct sunlight to reactivate the battery. For more information, see the "Battery Protection Status" description, which applies to the combination of solar panels and lithium-ion batteries.
See also:Related operation instructions
Translator's Note:This question and answer is for solar panel and lithium ion battery models; standard DS03A-NB non-rechargeable lithium thionyl chloride batteries should not be treated as solar charging.
7 Ordering Information
Product model: DS03A-NB-XX.
XX indicates the following versions:
- GE: Universal version, does not contain SIM card.
- 1T: Comes with a 1NCE SIM card, contains 10 years and 500 MB of traffic, and is pre-configured to connect to a ThingsEye server.
8 Packaging information
Package contents
- One DS03A-NB NB-IoT door flux sensor.
- 1 external antenna.
Size and weight
- Device size: 13.0 x 5 x 4.5cm.
- Equipment weight: 150g.
- Single package size: 14.0 x 8 x 5cm.
- Single package weight: 180g.
9 Technical support
- Technical support is from Monday to Friday from 09:00 to 18:00 and the time zone is GMT 8. Due to the time difference, real-time support cannot be provided, but will be replied as soon as possible within the above working hours.
- When consulting, please provide complete information as much as possible, including product model, accurate problem description and repeat steps, and send an email to support@dragino.com.
See also:Send an email to Technical Support
