Reference
Last revision 2025/12/18
The article provides an overview of communication protocols for devices, including how to check real-time data and set device addresses using specific commands and return values, with examples on interpreting register data and command structures.
Communication Protocol Description
- Check all the current real-time data directive--0x21
Command:
| Word Head | Device Address | Frame Length | Command Word | Checksum |
| 0x55 | 0xAA | 0x11 | 0x00 | 0x21 |
This command will check all data of current device.There are 10 register data totally.A register data is 16 digit,consisting of 8 high digit and 8 low digit.
Return the following:
| Content Order | Register Illustration | Register Data | Register Range |
| 1 | manually/automatically set address status | 0x00 0x01 | 1 for automatic; 0 for manual |
| 2 | Humidity Measurement | 0x00 0x02 | 0.0 to 100.0%(RH) |
| 3 | Temperature Measurement | 0x00 0x03 | -40.0 to 128.0(℃) |
| 4 | SHT1X error status | 0x00 0x04 | 1 for error; 0 for normal |
| 5 | Analog Measurement 1 | 0x00 0x05 | 0 to 1023 |
| 6 | Analog Measurement 2 | 0x00 0x06 | 0 to 1023 |
| 7 | Analog Measurement 3 | 0x00 0x07 | 0 to 1023 |
| 8 | Analog Measurement 4 | 0x00 0x08 | 0 to 1023 |
| 9 | Analog Measurement 5 | 0x00 0x09 | 0 to 1023 |
| 10 | Analog Measurement 6 | 0x00 0x10 | 0 to 1023 |
'''Instruction Description: content value consists of 2 byte; 0.0 to 100.0 degree stand for 0 to 1000; -40.0 to 128.0 degree stand for -400 to 1280 '''
Return Value:
| Word Head | Device Address | Frame Length | Command Word | Content | Checksum |
| 0x55 | 0xAA | 0x11 | 0x14 | 0x21 | H |
Sample:
Send instruction:
| Word Head | Device Address | Frame Length | Command Word | Checksum |
| 0x55 | 0xAA | 0x11 | 0x00 | 0x21 |
Return instruction:
| Word Head | Device Address | Frame Length | Command Word | Content1 | Content2 | Content3 |
| 0x55 | 0xAA | 0x11 | 0x14 | 0x21 | 0x00 0x00 | 0x00 0x00 |
| Content4 | Content5 | Content6 | Content7 | Content8 | Content9 | Content10 |
| 0x00 0x01 | 0x00 0x66 | 0x00 0x99 | 0x00 0x66 | 0x00 0x99 | 0x00 0x66 | 0x00 0x99 |
- Set address for the model --0x55
Command:
| Word Head | Device Address | Frame Length | Command Word | Content | Checksum |
| 0x55 | 0xAA | 0xAB | 0x01 | 0x55 | 0x22 |
Return Value:
| Word Head | Device Address | Frame Length | Command Word | Content | Checksum |
| 0x55 | 0xAA | 0xAB | 0x01 | 0x55 | 0x22 |
Instruction Description: 0xAB is broadcast address,that is, it is shared address of all models. Send 0x55 to address 0xAB in order to set model address in the uncertain model status
According to new device address,model will return 0x55 after address set successfully; In manual status,sending 0x55 can't set current device address,if the product can set device address manually and automatically.Then, the return value is 0xFE that illustrates product in manual setting address status.
Return Value:
| Word Head | Device Address | Frame Length | Command Word | Content | Checksum |
| 0x55 | 0xAA | 0xAB | 0x01 | 0x55 | 0xFF |
Sample:
Send instruction:
| Word Head | Device Address | Frame Length | Command Word | Content | Checksum |
| 0x55 | 0xAA | 0xAB | 0x01 | 0x55 | 0x11 |
this sample is used for setting device address as 0x11.
In the status of setting address manually
Send instruction:
| Word Head | Device Address | Frame Length | Command Word | Content | Checksum |
| 0x55 | 0xAA | 0xAB | 0x01 | 0x55 | 0x11 |
Return instruction:
| Word Head | Device Address | Frame Length | Command Word | Content | Checksum |
| 0x55 | 0xAA | 0xAB | 0x01 | 0x55 | 0xFF |
Was this article helpful?
