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] | Head code | head | Default: 0xA8 |
Byte[1~2] | Packet length | length | Default: 0x00 0x0E, converted to decimal, equal to 14 |
Byte[3] | Command name | cmd | Default: 0x40, return power bank |
Byte[4] | Control board address | controlIndex | Default: 0x10 |
Byte[5] | Position address | holeIndex | Default: 0x01 |
Byte[6] | Area code | area | Customized |
Byte[7~10] | Power bank SN | powerbankSN | 0x00 0x00 0x0B 0xCF = SN:3023 0x00 0x9B 0xD2 0x10 = SN:10211856 0xFF 0xFF 0xFF 0xFF = SN:4294967295 |
Byte[11] | 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[12] | Power bank version | software | 0x00: No power bank 0x01: V001 0x10: V016 |
Byte[13] | Power bank power level | soc | 0x00: 0% 0x01: 1% 0x64: 100% |
Byte[14] | Check code | verify | Packet complement check |
Example: Report SN pop-up data
A8 00 0F 40 10 01 04 05 8E 17 08 01 CA 5F 18
json
A8 ----------------------------------------------- Byte[0] header code
00 0F -------------------------------------------- Byte[1~2] package Length 15
40 ----------------------------------------------- Byte[3] Return Power bank instructions
10 ----------------------------------------------- Byte[4] Control Board address
01 ----------------------------------------------- Byte[5] Position Number
04 ----------------------------------------------- Byte[6] area code
05 8E 17 08 -------------------------------------- Byte[7~10] Power bank SN: 93198088
01 ----------------------------------------------- Byte[11] Return state
CA ----------------------------------------------- Byte[12] Charging Treasure version V202
5F ----------------------------------------------- Byte[13] Charging Bao power 95%
18 ----------------------------------------------- Byte[14] 1Code verification
API Request
The API can be requested only after the return is successful.
Request URL
GET
https://{host}/api/rentbox/client/return?rentboxSN={rentboxSN}&singleSN={singleSN}&hole={hole}&sign={sign}
text
/api/rentbox/client/return
Request Parameters
Name | Identification code | Is it required | Remarks |
---|---|---|---|
Server domain name | host | YES | Provided by the customer, for example: s.abc.com |
Cabinet SN | rentboxSN | YES | 4G communication module, IMEI number |
power bank SN | singleSN | YES | - |
Position number | hole | YES | - |
Interface signature | sign | YES | MD5 encryption |
Interface signature
text
sign=MD5("hole={hole}|rentboxSN={rentboxSN}|singleSN={singleSN}")
API Example
sign = f0bd0053d4431f2de7642b33d8b309f7
MD5("hole=1|rentboxSN=860602069165357|singleSN=93198088")
API Response
json
{
"code":200,
"type":0,
"data":"",
"msg":"OK",
"time":1705661910697
}
Name | Identification code | Type | Remarks |
---|---|---|---|
status code | code | int | Default: 200 |
status type | type | int | Default: 0 |
Custom data | data | string | Default: "" |
Exception message | msg | string | Default: OK |
timestamp | time | long | current millisecond timestamp |