IFREEQ Docs
  • Introduction
  • Update Log
  • General Knowledge
    • About IoT
    • Electricity
      • Plug & socket types around the world
        • Power plug & outlet Types A & B
        • Power plug & outlet Type C
        • Power plug & outlet Type D
        • Power plug & outlet Type E
        • Power plug & outlet Type F (Schuko)
        • Power plug & outlet Type G
        • Power plug & outlet Type H
        • Power plug & outlet Type I
        • Power plug & outlet Type J
        • Power plug & outlet Type K
        • Power plug & outlet Type L
        • Power plug & outlet Type M
        • Power plug & outlet Type N
        • Power plug & outlet Type O
      • Full list: Plug, socket & voltage by country
      • Map showing the spread of the different plug types worldwide
      • Useful information for travellers
      • History of domestic electricity
        • Why isn’t there a universal standard electric plug?
        • Why isn’t there a standard voltage around the world?
      • Three-phase electric power (industrial applications only)
    • Certifications
    • Home Automation Brand
    • Home Automation Catalog
    • Industry Term
    • Network Term
    • The Third-party Control
      • AliGenie
      • Amazon Alexa
        • FAQs About Amazon Alexa
      • DuerOS
        • FAQs About DuerOS
      • Google Assistant
        • FAQs About Google Assistant
      • Home Assistant
        • FAQs About Home Assistant
      • HomeKit
        • FAQs About Homekit
      • IFTTT
      • Xiao AI
      • Yandex Alice
        • FAQs About Yandex Alice
  • Developer
    • Introduction
      • What is Tuya Smart?
      • What does Tuya do?
      • Tuya Smart Cloud Platform Overview
      • Advantages
      • Terms
      • Limits
    • Quick Start
    • Configure in Platform
      • Create Products
      • Function Definition
        • Overview
        • Standard Functions
        • Custom Functions
        • Cloud Functions
      • Design App UI
      • Configure Hardware
      • Cloud Configuration
        • Introduction
        • Upgrade Firmwares
        • Set up Multilingual UI
        • Manage Alarms
        • Configure Network for Devices
        • Enable Toggles on App
        • Automate the Smart Devices
      • Mass Production
    • Device Development
      • Access Mode MCU
        • MCU Access Guide
        • Wi-Fi General Solution
          • Wi-Fi Module MCU Development Overview
          • Hardware Design Reference Wi-Fi
          • Software Reference Wi-Fi
            • Tuya Cloud Universal Serial Port Access Protocol
            • Overview of migrating Tuya's MCU SDK
        • Wi-Fi Power Off Fast Connect Device Solution
          • Overview
        • Zigbee General Solution
          • Overview
          • Software development
            • Tuya Zigbee module UART communication protocol
          • Hardware Design
        • BLE General Solution
          • BLE Module MCU Development Overview
          • BLE Hardware Design
        • NB-IoT General Solution
          • NB-IoT Development Guide
          • Introduction to NB Module - NM1
      • Access Mode SoC
        • SoC Development Overview
        • Lighting
          • Guidance
          • Design
          • Test
        • Electrician
          • Guidance
          • Design
          • Test
      • Access Mode Link
        • Wi-Fi Chip SDK
          • Tuya Wi-Fi SDK Reference
          • Development Environment Setup When Using Tuya Wi-Fi SDK
        • BLE Chip SDK
          • TUYA BLE SDK User Guide
        • Zigbee Chip SDK
          • TUYA Zigbee SDK Document
      • Cloud Mode
        • Wi-Fi&BT Dual Mode Module
        • Wi-Fi Module
        • Bluetooth Module
        • Zigbee Module
        • Sub-G Module
      • Tuya Development Boards
      • Access Mode Simmulator
        • Module Debugging Assistant Instruction
      • Embedded License
        • Embedded open source license
    • Smart Product Solution
      • Gateway
        • MCU Access
        • Link SDK Access
        • PCB Details
      • HouseHold
        • Cleaner Robot
        • Air Conditioner
      • IPC
      • Lock
        • BLE Lock
        • Wi-Fi Lock
        • Zigbee Lock
      • Remote Control
      • Voice Product
        • Domestic Voice Speaker Solution
        • Domestic Voice Infrared SoC Solution
        • Overseas Voice Solution
        • Design Reference Materials - Alexa Module
        • Design Reference Materials - Domestic Voice Module
    • Firmware
      • S8E
  • FAQs
    • Device Development
      • Cloud Module
        • Wi-Fi Module
        • Zigbee Module
        • BLE Module
        • GPRS Module
        • NB-IoT Module
        • Dual-mode Module
        • Other Module Issues
      • Access Mode SoC
      • MCU Access Mode
        • Wi-Fi General Solution
        • Zigbee General Solution
        • BLE General Solution
          • BLE Single-point Solution
          • BLE Mesh General Solution
          • Other Issues of BLE Solution
        • NB-IoT General Solution
        • Other Issues of MCU Access Mode
      • Module SDK Development
        • BLE Chip SDK(single point)
        • Linux General SDK
        • NB-IoT Chip SDK
        • Wi-Fi Chip SDK
        • Others about Module SDK
      • Other Issues of Device Development
    • Smart Product Solution
      • Electrical
        • Outlet
        • Scenario Switch
        • Switch
      • Lighting
        • Wi-Fi Lighting
        • Zigbee Lighting
        • Bluetooth Lighting
        • Other Issues of Lighting
      • Lock
        • BLE Lock
        • NB-IoT Lock
        • Wi-Fi Lock
        • Zigbee Lock
        • Other Issues of Lock
      • Sensor
      • Gateway
        • BLE Gateway
        • Wireless Gateway
        • Zigbee Gateway
        • Other Issues of Gateway
      • IPC
      • Infrared Products
        • Infrared remote control
        • Infrared Capability Introduction
        • Infrared Code Library
      • Sweeper
      • Household Appliances
      • Pet Supplier
      • BLE Mesh Typical Solution
        • BLE Mesh Lighting Solution
        • BLE Mesh Electrical Solution
        • BLE Mesh Sensor Solution
        • BLE Mesh General Solution
    • Products
      • Electric
        • Smart Switch
        • Smart Plug
        • Curtain Controller
      • Lighting
      • Security
        • E202/203 Smart Lock
    • More
  • Links
    • ifreeq.cn
    • ifreeq.com
    • AIoT Expo
    • Official Store
Powered by GitBook
On this page
  • Universal Docking Agreement
  • 1. *Introduction*
  • 1.1 *Hardware connection*
  • 2. *Serial port communication*
  • 2.1 *Frame format*
  • 2.2 *Frame format description*
  • *2.3 datapoint Data unit format*
  • 3. *Protocol details*
  • 3.1 *Wake up command*
  • 3.2 *Check product info*
  • 3.3 *Check the module network status*
  • 3.4 *Configure Zigbee module*
  • *3.5 Data Command issued*
  • *3.6 MCU data reported*
  • *3.7 Zigbee notice*
  • *3.8 Requesting a Dynamic Password*
  • *3.9 Zigbee module functional test*
  • *3.10* *MCU* *OTA*
  • *3.11 OTA update notice*
  • *3.12 OTA firmware content requests*
  • *3.13 OTA firmware upgrade result report*
  • *3.14 Data format for record-type status reporting (including time stamp)*
  • *3.15 Time synchronization data format*
  • 4. *DP explanation*
  • Functions of smart residential locks
  • Change log
  • Connect to network
  • Battery percentage status
  • Unlocking event record
  • Member management
  • Message and alarm
  • Remote control on App
  • Dynamic password
  • Temporary password
  • Factory setting restoration

Was this helpful?

  1. Developer
  2. Smart Product Solution
  3. Lock

Zigbee Lock

PreviousWi-Fi LockNextRemote Control

Last updated 4 years ago

Was this helpful?

Universal Docking Agreement

1. *Introduction*

The Tuya Zigbee serial port general protocol is a Tuya customorize Zigbee module serial port general protocol, which is mainly used for Tuya Zigbee module, it directly connected to other MCU serial ports for serial communication. Its block diagram is shown in Figure 1 below.

Universal Docking Agreement

1.1 *Hardware connection*

The Tuya Zigbee module and MCU control both use DC 3.3V power supply.

The baud rate of UART communication between Tuya Zigbee module and MCU is 115200-8-N-1, and there is no data flow control. The UART interface pins use the standard logic. In the idle state, the TXD and RXD pins are both high level, the low level is the start bit and the high level is the stop bit. The pin stays high even even the device in hibernation.

There is a GPIO port reserved between the Tuya Zigbee module and the MCU, use as the module to wake up the MCU. The default setting is the internal pull-up state, which is effective when pulled down to 10ms. The MCU wakes up the Zigbee module by waking up the serial command. If the device is a strong current device, the MCU only needs to make a handshake connection when the device is powered on for the first time. If the device is a weak current device with dormant, apart from making a handshake connection when power on, the MCU needs to connect to the handshake connection before each active command is initiated.

*1.2 Timeout definition*

1.2.1 *Synchronization Timeout*

UART respond timeout time:500ms.

When the serial port of the module receives the wake-up frame of the MCU or the response frame of the wake-up frame, it will wake itself up for 500ms. At this time, the MCU can send other data. If the data interval between the two frames is 500ms, a wake-up frame needs to be added in the middle.

1.2.2 *Wake-up frame response timeout time*

After the module sends the wake-up frame, the MCU needs to respond within 20ms, otherwise the module will continue to resend it, twice each time. When the response frame of MCU is not received after 3 transmissions, the data to be transmitted will be stored in the transmission queue, and wait for the next wake up to send again.

2. *Serial port communication*

2.1 *Frame format*

The UART communication data frame between the Tuya Zigbee module and the MCU consists of the frame header (Front), version (Ver), serial number (Seq), command word (Cmd), data length (Length), data (Data) and checksum (Check) composition, definition and description are shown below. 2

Octets:2

1

2

1

2

Variable

1

Front

Ver

Seq

Cmd

Length

Data

Check

2.2 *Frame format description*

Field

description

Front frame(Front)

2 byte leading character, fixed to 0x55aa

Version (Ver)

Serial communication protocol version, for upgrading and expansion, the current version is 0x03

Serial number(Seq)

The serial number(1~0xfff0)

Command (Cmd)

The specific frame type, pls check sheet3

Data length(Length)

Transmitted effective data length

Data (Data)

Transmitted effective data

Revise (Check)

Data revise, byte-to-byte summation from the beginning of the frame, more than 256

Sheet 1:Frame format description

Note: The serial number (seq) is to check each frame. It is not necessary to use the same one. The range of seq is limited to (1 ~ 0xfff0). When the MCU needs to respond to the data sent by the module, the seq in the response frame uses the seq issued by the module. When the MCU needs to send data to the module actively, each time the data is issued, the seq needs to be incremented within the specified range.

Cmd ID

description

direction

0x00

Dormant wake up

(Zigbee<—>mcu)

Wake up response

(mcu<—>zigbee)

0x01

Product info check

(zigbee—>mcu)

Product info response

(mcu—>zigbee)

0x02

Zigbee status inquire

(mcu—>zigbee)

Zigbee status inquire response

(zigbee—>mcu)

0x03

Zigbee device reset

(mcu—>zigbee)

Zigbee device reset response

(zigbee—>mcu)

0x04

Data instruction issued

(zigbee—>mcu)

Data instruction issued response

(mcu—>zigbee)

0x05

Data report

(mcu—>zigbee)

Data report response

(zigbee—>mcu)

0x06

Zigbee status notice

(zigbee—>mcu)

0x07

Request dynamic password

(mcu—>zigbee)

Request a dynamic password response

(zigbee—>mcu)

0x23

Record-type status reporting Data format (including time stamp)

(mcu—>zigbee)

Response to data format for record-type status reporting

(zigbee—>mcu)

0x24

Mcu time synchronization request

(mcu—>zigbee)

Time synchronization request

(zigbee<—>mcu)

Sheet 2:Cmd description sheet

Description:

  1. All data larger than 1 byte is transmitted in big-endian mode

  2. In general, the command word one send and one receive synchronization mechanism is adopted, that is, one party sends a command and the other responds. If the sender does not receive the correct response packet after timeout, the transmission timeout

Note: The specific communication method is subject to the “detailed protocol”

  1. The module control command is issued and the MCU status is reported in asynchronous mode. Assuming that the module control command is issued with the "command word" as x and the MCU status is reported with the "command word" as y, as shown below:

1) Module control command is issued:

2) MCU status report:

MCU status reporting is divided into two cases: passive reporting and active reporting;

I. Passive reporting: The module sends a data command to the MCU. The MCU responds to the control command first, and then executes the command. The MCU reports the final result to the module. After receiving the module, it sends a response and the data exchange ends.

II. Proactive reporting: MCU status changes (physical operation or restart after power cut, etc.), reporting the current status to the module actively; MCU actively reporting as asynchronous operation, there is no status report response frame received within the timeout period, or the status of the response frame is unsuccessful, MCU must retransmit.

*2.3 datapoint Data unit format*

1) datapoint The command / status data unit is as follows:

Data

longth(byte)

description

Dpid

1

Datapoint serial number

Type

1

Corresponds to the specific data type of a datapoint on the open platform, identified by the following "representation value"

type

Expressed value

length(byte)

explanation

raw

0x00

N

Corresponds to raw datapoint (module transparent transmission)

bool

0x01

1

Value range:0x00/0x01

value

0x02

4

Corresponding int type,大端表示

string

0x03

N

Corresponds to a specific string

enum

0x04

1

Enumerated type,range 0-255

bitmap

0x05

1/2/4

When the length is greater than 1 byte,大端表示

Len

2

Length corresponding number of bytes

Value

1/2/4/N

Hex means,Big-endian transmission should be used if more than 1 byte

2) Except for the "raw" type, the datapoint command / status data unit all belongs to the "obj" type datapoint.

3) The "command issuance" may include multiple datapoint "command data units".

4) "Command issuance" is an asynchronous processing protocol, corresponding to the "status report" of the MCU's datapoint.

3. *Protocol details*

3.1 *Wake up command*

Description:

Zigbee wakes MCU or MCU wakes zigbee with this command

This command will be resent 3 times until a response package is received. After being awakened, it will start to accept data. The maximum time for accepting is one second, and it will go sleep mode after more than 1 second.

This instruction is preceded by 7 BYTE preambles.

Module transmission:

Word

length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

55AA(固定序列号)

Command word

1

0x00

Data length

2

0x0000

Check the sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256.

MCU return:

Word

length(byte)

explanation

Frame head

2

0x55aa

Version

1

0x03

Serial number(Seq)

2

55AA(fix serial number)

Command word

1

0x00

Data length

2

0

Check the sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Note: When the module actively wakes up the MCU, the serial number is fixed at 55 AA, and the ACK number returned by the MCU is also 55 AA;

When the MCU actively wakes up the module, the serial number is fixed at 00 00, and the module's ACK serial number returned by the MCU is also 00 00;

example:

1、Module wake up MCU:

Note: When the module actively wakes up the MCU, the serial number is fixed at 55 AA, and the ACK number returned by the MCU is also 55 AA;

When the MCU actively wakes up the module, the serial number is fixed at 00 00, and the module's ACK serial number returned by the MCU is also 00 00;

example:

  1. The module wakes up the MCU:

Module send:

0x00 00 00 00 00 00 00 55 AA 03 55 AA 00 00 00 01

Leading code frame head version Seq command word data length checksum

MCU reply:

0x55 AA 03 55 AA 00 00 00 01

frame head version Seq command word data length checksum

2、MCU wake up module:

MCU send:

0x00 00 00 00 00 00 00 55 AA 03 00 00 00 00 00 02

Leading code frame head version Seq command word data length checksum

Module reply:

0x55 AA 03 00 00 00 00 00 02

frame head version Seq command word data length checksum

3.2 *Check product info*

Explanation:

1) product ID: Corresponds to the Tuya Developer Platform PID (Product Identification), which is generated by the Tuya Cloud Developer Platform and is used to record product related information in the cloud.

2) Product information consists of product ID and MCU software version.

3) MCU software version number format definition: in dotted decimal form, "x.x.x" (0 <= x <= 99), x is a decimal number.

Module send:

Word

length(byte)

explanation

Frame head

2

0x55aa

Version

1

0x03

Serial number(Seq)

2

In order

Command word

1

0x01

Data length

2

0x0000

Data

0

no

Check the sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:0x55 AA 03 33 77 01 00 00 AD

Frame head *version Seq command word data length check sum*

MCU return:

Word

length(byte)

explanation

Frame head

2

0x55aa

Version

1

0x03

Serial number(Seq)

2

The module issued seq

Command word

1

0x01

Data length

2

N

Data

N

{“p”:”AIp08kLI”,“v”:”1.0.0” }

Data

1

Support OTA or not, 1 support,0 not support

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:0x55 AA 03 33 77 01 00 1C 7B 22 70 22 3A 22 38 73 34 75 71 75 79 78 22 2C

Frame head *version Seq command word data length { " p " : " 8 s 4 u q u y x " ,*

22 76 22 3A 22 31 2E 30 2E 30 22 7D 01 7F

*" v " : " 1 . 0 . 0 " } check sum*

P means product ID is 8s4uquyx

V means MCUversion is 1.0.0

Support OTA

3.3 *Check the module network status*

Device status ID

Description

0x00

Device is not connected to the gateway

0x01

Device connected to the gateway

0x02

Device is entered server

0x03

The device is connected to the gateway and entered the server

0x04

Device is not connected to the sever

0x05

The device is connected to the gateway but has not entered the server

0x10

Transmission report successful

0x20

Transmission report fail

0x40

Transmission report timeout

0x80

Transmission report busy

​ Picture 4 module status sheet(8421)

explanation:

1) The device is not connected to the network: When the device is powered on for the first time, or fails to connect to the network, or is disconnected from the network, the device status is not connected to the network, this status will send to MCU.

2) The device is in the networked status: After the device is successfully connected to the network, the device is in the networked status; the status is sent to the MCU.

3) When the module detects the process of MCU restart or MCU disconnect then online again, it will actively send the module network status to the MCU.

4) When the network status of the module changes, it will actively send the network status of the module to the MCU.

MCU sends

Word

length(byte)

explanation

Frame head

2

0x55aa

Version

1

0x03

Serial number(Seq)

2

MCU effects

Command word

1

0x02

Word length

2

0x0000

Data

0

no

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

example: 0x55 AA 03 00 00 02 00 00 04

​ Frame head *version Seq command word data length check sum*

Module return:

word

Length (byte)

description

Frame head

2

0x55aa

Version

1

0x03

Serial number(Seq)

2

MCU send SEQ

Command word

1

0x02

Data length

2

0x0001

Data

1

Indicate module working status:Zigbee status,check picture 4

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

例:0x55 AA 03 00 00 02 00 01 03 08

Frame head *version Seq command word data length data check sum*

3.4 *Configure Zigbee module*

Description:

1) If the device is a low-voltage device, the MCU needs to send a wake-up command to the module first, and then send a configuration command to the module; a strong-power device directly sends a configuration command to the module.

a. There are two types of commands for configuring the Zigbee module, as shown in the figure below.

command

description

0x00

Reset the module to factory default status (not connected to the network)

0x01

Configure the module to start network configuration

MCU send:

word

length(byte)

description

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

MCU effects

Comand word

1

0x03

Data length

2

0x0001

Data

1

0x00/0x01

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:0x55 AA 03 00 00 03 00 01 01 07

​ Frame head *version Seq command word data length data check sum*

Module return:

word

length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

MCU send SEQ

Command word

1

0x03

Data length

2

0x0001

data

1

0x00:OK,0x01:error

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

example:0x55 AA 03 00 00 03 00 01 00 06

Frame head *version Seq command word data length data check sum*

*3.5 Data Command issued*

Module send:

word

length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

Effect in order

Comand word

1

0x04

Data length

2

Depends on "command data unit" type and number

Data

N

“2.3data command unit”

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

example:“doorbell select”,

0x55 AA 03 00 1C 04 00 05 0E 04 00 01 00 3A

Frame head *version Seq command word data length dpID dp type data length data check sum*

mcu返回:

word

length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

The seq issued by module

Comand word

1

0x04

Data length

2

0x0001

Data

1

0x00:OK,0x01:error

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

例:0x55 AA 03 00 1C 04 00 01 00 23

Frame head *version Seq command word data length data check sum*

*3.6 MCU data reported*

Explanation:

1) After the MCU receives the 04 command, it must reply the 04 command immediately, and the reply is receivingcorrect or failed;

2) After receiving the 04 instruction successfully, the MCU will process the 04 instruction and send the processed result to the module through the 05 instruction, and inform the module of the 04 instruction execution status;

3) The module will immediately return ACK to the MCU after receiving the datapoint information of the 05 instruction;

4) Multiple datapoint "command data units" may be included. For details of the datapoint status data unit, see "Section 2.3", but the data frame length cannot exceed 64 bytes.

MCU send:

word

length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

MCU effects

Comand word

1

0x05

Data length

2

Depends on the type and number of "status data unit", including SeqNum and data

N

“2.3status data unit”

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:“doorbell ring”,

0x55 AA 03 00 00 05 00 05 0E 01 00 01 01 1D

*Frame head version Seq command word data length dpID dp type data length data check sum*

Module return:

word

Length (byte)

Explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

MCU send SEQ

Comand word

1

0x05

Data length

2

0x0001

Data

1

Zigbee status,check picture 4

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:0x55 AA 03 00 00 05 00 01 10 18

Frame head *version Seq command word data length data check sum*

*3.7 Zigbee notice*

Note: zigbee asynchronous notification or network status change notification

Module sends:

word

length(byte)

description

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

Effects in order

Comand word

1

0x06

Data length

1

0x02

Data

1

Zigbee status,check picture 4

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:“network status”effects:

0x55 AA 03 00 77 06 00 01 05 85

Frame head *version Seq command word data length data check sum*

MCU returns:

word

length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

Seq issued by module

Comand word

1

0x06

Data length

2

0x0001

Data

1

Zigbee status,check picture 4

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:“network status”respnse:

0x55 AA 03 00 77 06 00 01 10 90

Frame head *version Seq command word data length data check sum*

*3.8 Requesting a Dynamic Password*

Note: (1) The time data in the protocol is used to calculate the current dynamic password. The dynamic password calculation time here is the current Green Time. The device needs to give the module Green Time data.

(2)On the APP side, you can set a mixed calculation whether the device currently needs to add the administrator password to the participate dynamic passwords. Every time the device requests to verify the dynamic password again, it needs to lock all the current door of the module. Administrator password.

(3) The data length of the sending package is at least 15 bytes, time data + password + the number of administrator password groups transmitted (not including the optional administrator password).

MCU sends:

word

length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

MCU effects

Comand word

1

0x07

Data length

2

xx xx

Data

4

Data length is 4bytes: the current device green time: data[0]-data[3]

8

Password data entered by the user: Data[4]Data[11] the data content range‘0’’9’ data transmmit ASCLL code

1

The number of administrator password groups (0 ~ 10), numbers of groups of administrator passwords are followed by the corresponding group number data

1

The length of the first password (up to 8)

n

The first group of administrator password (the password is composed of numbers) The data content range is ‘0’ ~ ’9’ The data transmission uses ASCLL code

1

The length of the second set of passwords (no more than 8)

n

The second group of administrator password (the password is composed of numbers) The data content range is ‘0’ ~ ’9’ The data transmission uses ASCLL code

…

…

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:

55 AA 03 00 00 07 00 1D 5B BC 3A 41 33 37 32 32 34 32 30 31 02 Frame head *version Seq command word data length time stamp active password Administrator password numbers*

06 30 31 32 33 34 35 08

*First set of password length The first administrator password Second set of password length* 31 32 33 34 35 36 37 38 30

*The second set of administrator passwords check sum*

Module return:

word

length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

MCU issued SEQ

Comand word

1

0x07

Data length

2

0x0001

Data

1

0x00(password check successful) 0x01(Password check failed) 0x02(device not get seckey) 0x03(Data length error)

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:55 AA 03 00 00 07 00 01 00 0A

Frame head *version Seq command word data length data check sum*

*3.9 Zigbee module functional test*

Note: The RF test method of the module is performed by loopback test between DUT (equipment under test) and GU (golden unit). That is, the DUT sends packets, and the GU sends the packets to DUT. Perform statistics and report the results to the MCU through the serial port. Round trip time interval is 3S.

1) Send the production test command within 300ms after power on.

MCU send:

word

length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

MCU effects

Comand word

1

0x09

Data length

2

0x0001

Data

Data

Channel value(11-26)

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:0x00 00 00 00 00 00 00 55 AA 03 00 00 09 00 01 19 25

Preamble Frame head *version Seq command word data length data check sum*

Module return:

word

Length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

MCU下发的SEQ

Comand word

1

0x09

Data length

2

0x0001

Data

2

RFreceive0-100%(Suggested success rate80%)

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:0x55 AA 03 00 00 09 00 02 01 3C 4A

Frame head *version Seq command word data length data check sum*

Note:****:support firmware version:1.0.4****

*3.10* *MCU* *OTA*

The MCU ota process is as follow:

**MCU version check**

If MCU upgrade is supported, this command must be implemented, and the MCU can also report actively;

Query scenarios: 1. During network distribution 2. When the MCU upgrade process is abnormal;

Proactive reporting scenarios: 1. After network pairing successful (must be added) 2. Upgrade finished;

Module send:

word

Length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

Module effects

Comand word

1

0x0A

Data length

2

0x0000

Data

0

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:0x55 AA 03 00 f0 0A 00 00 26

Frame head *version Seq command word data length check sum*

MCU response or module send:

word

Length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

MCU issued SEQ

Comand word

1

0x0A

Data length

2

0x0001

Data

1

Version number (current version)01.00.0001 à1.0.1

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

*3.11 OTA update notice*

Module send

word

Length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

Module effects

Comand word

1

0x0B

Data length

2

0x000F

Data

8

Data[0]~ Data[7] PID

Data

1

Version number (update version)01.00.0001 à1.0.1

Data

4

Firmwware size at most 64K

Data

4

Firmware checksum:Byte-by-byte sum from the beginning of the frame,the result is remainder of 2^32

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:0x55 AA 03 00 1C 0B 00 0F 30 31 32 33 34 35 36 37 41

Frame head *version Seq command word data length PID V*

MCU corresponding:

word

Length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

Module issued seq

Comand word

1

0x0B

Data length

2

0x0001

Data

1

0x00:OK,0x01:error

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:0x55 AA 03 00 1C 0B 00 01 00 23

Frame head *version Seq command word data length data check sum*

*3.12 OTA firmware content requests*

MCU send:

word

Length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

0x0000

Comand word

1

0x0C

Data length

2

0x0006

Data

8

PID

Data

1

Version number (update version) 01.00.0001 à1.0.1

Data

4

Offset of data package (location of firmware)

Data

1

Data package size

Checksum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:0x55 AA 03 00 f0 0C 00 06 26

Frame head *version Seq command word data length checksum*

Module corresponding:

word

length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

0x0000

Comand word

1

0x0C

Data length

6+N

0x0006+N

Data

1

Status 0 succeed 1:fail

Data

8

PID

Data

1

Version number (update version) 01.00.0001 à1.0.1

Data

4

Offset of data package (location of firmware)

Data

N

Data

checksum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:

55 AA 03 00 39 24 00 08 00 00 0D 2B 00 00 7D AB C7

Frame head *version Seq command word data length standard time* *local time check sum*

*3.13 OTA firmware upgrade result report*

Note: This result is reported after the MCU upgrade is completed; no matter whether the MCU upgrade is successful or failed, as long as the upgrade action is initiated, the upgrade process must be terminated through the result report command;

MCU sends:

word

Length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

MCU issued SEQ

Comand word

1

0x0D

Data length

2

0x0004

Data

1

Status 0 succeed 1:fail

Data

8

PID

Data

1

Version number (update version) 01.00.0001 à1.0.1

Checksum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:

0x55 AA 03 00 f0 0C 00 06 26

Frame head *version Seq command word data length checksum*

Module corresponding:

word

Length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

MCU下发的SEQ

Comand word

1

0x0D

Data length

2

0x0001

Data

1

0x00:OK,0x01:error

Check sum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:0x55 AA 03 00 1C 0D 00 01 00 23

​ Frame head *version Seq command word data length data checksum*

*3.14 Data format for record-type status reporting (including time stamp)*

Explanation:

1) When the MCU data changes , such as various door opening actions, various alarm information, local password changes, etc., which involves the local operation of the door lock, the door lock MCU needs to use this command to send the corresponding DP data to the module;

2) When reporting the frame data, the frame needs to carry a time stamp. If the MCU has time data locally, the time stamp needs to be included in the data;

3) Multiple datapoint "command data units" can be included. For details of the datapoint status data unit, see "Section 2.3", but the data frame length cannot exceed 64 bytes.

MCUsend:

word

Length(byte)

explanation

Frame head

2

0x55aa

version

1

0x03

Serial number(Seq)

2

MCU effects

Comand word

1

0x23

Data length

2

Depends on the type and number of "status data unit"

Data

5

Data[0]: whether use mcu time or not0:use gateway time1:Time reported using mcuData[1]~ Data[4] time stamp

N

“Status data unit”

Checksum

1

Byte-by-byte sum from the beginning of the frame,the result is remainder of 256

Example:“Fingerprint unlock”:

0x55 AA 03 00 00 23 00 0D 01 5B F6 67 B1 01 02

Frame head *version Seq command word data length MCU time time stamp dpID dp type*

00 04 00 00 00 0B AE

*data length data checksum*

“Password + fingerprint combination unlock”:

0x55 AA 03 00 00 23 00 15 00 5B F6 67 B1 02

Frame head *version Seq command word data length gateway time time stamp dpID(password)*

02 00 04 00 00 00 01 01 02 00 04 00 00 00 05 B8

*Dp type data length data dpID(pingerprint) dp type data length data checksum*

Data return:

word

Length(byte)