Return
1、When the power bank is returned to the cabinet, regardless of success or failure, the MQTT result is reported.
2、When the power bank is returned to the cabinet, only the success status is available, and the HTTP result is reported.
Command Reply △
Publish to topic: /powerbank/{uuid}/user/update
Data format: bytecode data, Hex, hexadecimal analysis
Bytecode | Name | Identification code | Remarks |
---|---|---|---|
Byte[0] | Header code | head | Default: 0xA8 |
Byte[1~2] | Packet length | length | Default: 0x00 0x15, converted to decimal, equal to 21 |
Byte[3] | Command name | cmd | Default: 0x28, return the power bank (self-test) |
Byte[4] | Movement board address | controlIndex | Default: 0x10 |
Byte[5] | Position address | holeIndex | Default: 0x01 |
Byte[6] | Return status | state | 0x00:Return failed 0x01:Return successful 0x11:Failed to obtain SN 0x12:Failed to obtain voltage, temperature and other information 0x13:Failed to obtain software and hardware version information 0x14:Battery lock command failed 0x21:Failed to obtain SN, and motor action failed 0x22:Failed to obtain voltage, temperature and other information, and motor action failed 0x23:Battery lock command failed, and motor action failed 0x24:Anti-theft switch detection failed (within 5 minutes, 0x28 return self-test command will be reported) |
Byte[7] | Reserved 1 | undefined1 | Default: 0x00 |
Byte[8] | Reserved 2 | Undefined 2 | Default: 0x00 |
Byte[9] | Area code | area | Customized |
Byte[10~13] | Power bank SN | powerbankSN | 0x00 0x00 0x0B 0xCF = SN:3023 0x00 0x9B 0xD2 0x10 = SN:10211856 0xFF 0xFF 0xFF 0xFF = SN:4294967295 |
Byte[14] | Power | soc | 0x00: 0 0x10: 16% 0xFF: 255% |
Byte[15] | Temperature | temp | 0x00: No NTC 0x10: 16℃ 0x64: 100℃ |
Byte[16] | Charging voltage | chargeVolt | Keep 1 decimal place For example, 0x10=16 means 1.6V |
Byte[17] | Charging current | chargeCurr | Keep 1 decimal place For example, 0x10=16 means 1.6A |
Byte[18] | Software version number | softVersion | 0x00: 0 0x10: 16 0xFF: 255 |
Byte[19] | Hardware version number | hardVersion | 0x00: 0 0x10: 16 0xFF: 255 |
Byte[20] | Verification code | verify | Data packet complement verification |
Example: Report SN pop-up data
A8 00 15 28 02 08 01 00 00 01 05 11 2F FA 4B 21 00 00 0D 01 56
json
A8 -------------------------------------------- Byte[0] Header code
00 15 ----------------------------------------- Byte[1~2] Packet length 21
28 -------------------------------------------- Byte[3] Return power bank command (self-fix)
02 -------------------------------------------- Byte[4] Movement board address
08 -------------------------------------------- Byte[5] Position number: 8
01 -------------------------------------------- Byte[6] Return status: 01 Normal
00 -------------------------------------------- Byte[7] Reserved
00 -------------------------------------------- Byte[8] Reserved
01 -------------------------------------------- Byte[9] Area code: 01
05 11 2F FA ------------------------------------Byte[10~13] Power bank SN: 85012474
4B -------------------------------------------- Byte[14] Battery level: 75%
21 -------------------------------------------- Byte[15] Temperature: 33℃
00 -------------------------------------------- Byte[16] Charging voltage: 0V
00 -------------------------------------------- Byte[17] Charging current: 0V
0D -------------------------------------------- Byte[18] Software version: V13
01 -------------------------------------------- Byte[19] Hardware version: V1
56 -------------------------------------------- Byte[20] Checksum
API Request
After the power bank self-checks successfully, the entire device will be reported immediately via HTTP.