Skip to content

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

BytecodeNameIdentification codeRemarks
Byte[0]Head codeheadDefault: 0xA8
Byte[1~2]Packet lengthlengthDefault: 0x00 0x0E, converted to decimal, equal to 14
Byte[3]Command namecmdDefault: 0x40, return power bank
Byte[4]Control board addresscontrolIndexDefault: 0x10
Byte[5]Position addressholeIndexDefault: 0x01
Byte[6]Area codeareaCustomized
Byte[7~10]Power bank SNpowerbankSN0x00 0x00 0x0B 0xCF = SN:3023
0x00 0x9B 0xD2 0x10 = SN:10211856
0xFF 0xFF 0xFF 0xFF = SN:4294967295
Byte[11]Return statusstate0x00: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 versionsoftware0x00: No power bank
0x01: V001
0x10: V016
Byte[13]Power bank power levelsoc0x00: 0%
0x01: 1%
0x64: 100%
Byte[14]Check codeverifyPacket 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

NameIdentification codeIs it requiredRemarks
Server domain namehostYESProvided by the customer, for example: s.abc.com
Cabinet SNrentboxSNYES4G communication module, IMEI number
power bank SNsingleSNYES-
Position numberholeYES-
Interface signaturesignYESMD5 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
}
NameIdentification codeTypeRemarks
status codecodeintDefault: 200
status typetypeintDefault: 0
Custom datadatastringDefault: ""
Exception messagemsgstringDefault: OK
timestamptimelongcurrent millisecond timestamp