Skip to content

Periodic Upload

1、The device is powered on for 1 minute and reports data once.
2、The cabinet reports the complete machine data every 20 minutes.
3、Return the power bank (self-fix 0x28) and report the data immediately.

Command send ▼

Subscribe to topic: /powerbank/{uuid}/user/get

Data format: JSON string

NameIdentification codeData typeRemarks
Command namecmdstringupload_all

Update the whole machine report

{ "cmd":"upload_all" }

Command Reply △

None, But Trigger API request

API Request

Request URL

POST

https://{host}/api/rentbox/client/upload?rentboxSN={rentboxSN}&signal={signal}&sign={sign} 

text
/api/rentbox/client/upload
text
Content-Type:text/plain

Request Parameters

NameIdentification codeIs it requiredRemarks
Server domain namehostYESProvided by the customer, for example: s.abc.com
cabinet SNrentboxSNYES4G communication module, IMEI number
signal valuesignalYES-
Interface signaturesignYESMD5 encryption

Interface signature

text
sign=MD5("rentboxSN={rentboxSN}|signal={signal}")

Body

Data format: bytecode data, Hex, hexadecimal analysis

BytecodeNameIdentification codeRemarks
Byte[0]Head codeheadDefault: 0xA8
Byte[1~2]Packet lengthlengthFor example: 0x01 0x25, converted to decimal, the packet length is 293
Byte[3]Command namecmdDefault: 0x10, cabinet information
Byte[4~n]Custom datadataControl board information, position information
Byte[n+1]Check codeverifyPacket complement check

Example: Report 18-port cabinet information

A8 01 25 10 10 00 00 00 6E 6E 01 01 00 F1 04 05 8E 17 08 5F 18 00 00 CA 00 02 01 00 E1 04 05 8E 15 F0 63 18 00 00 CA 00 03 00 00 00 00 00 00 00 00 FF FF 00 00 00 80 04 01 00 EB 04 05 8D 99 F7 5F 18 00 00 CA 00 05 01 00 EA 04 05 8D FC 12 5F 18 00 00 CA 00 06 01 00 B6 04 05 8D 93 E7 1A 1C 32 14 CA 00 20 00 00 00 6E 6E 07 01 00 F1 04 05 8E 17 08 5F 18 00 00 CA 00 08 01 00 E1 04 05 8E 15 F0 63 18 00 00 CA 00 09 00 00 00 00 00 00 00 00 FF FF 00 00 00 80 0A 01 00 EB 04 05 8D 99 F7 5F 18 00 00 CA 00 0B 01 00 EA 04 05 8D FC 12 5F 18 00 00 CA 00 0C 01 00 B6 04 05 8D 93 E7 1A 1C 32 14 CA 00 30 00 00 00 6E 6E 0D 01 00 F1 04 05 8E 17 08 5F 18 00 00 CA 00 0E 01 00 E1 04 05 8E 15 F0 63 18 00 00 CA 00 0F 00 00 00 00 00 00 00 00 FF FF 00 00 00 80 10 01 00 EB 04 05 8D 99 F7 5F 18 00 00 CA 00 11 01 00 EA 04 05 8D FC 12 5F 18 00 00 CA 00 12 01 00 B6 04 05 8D 93 E7 1A 1C 32 14 CA 00 88

json
A8 ---------------------------------------------Byte[0] header code
01 25 ------------------------------------------Byte[1~2] package Length: 293
10 -------------------------------------------- Byte[3] Report Cabinet information command
10 00 00 00 6E 6E ----------------------------- Control board information 1
01 01 00 F1 04 05 8E 17 08 5F 18 00 00 CA 00 -- Position information: 1
02 01 00 E1 04 05 8E 15 F0 63 18 00 00 CA 00 -- Position information: 2
03 00 00 00 00 00 00 00 00 FF FF 00 00 00 80 -- Position information: 3
04 01 00 EB 04 05 8D 99 F7 5F 18 00 00 CA 00 -- Position information: 4
05 01 00 EA 04 05 8D FC 12 5F 18 00 00 CA 00 -- Position information: 5
06 01 00 B6 04 05 8D 93 E7 1A 1C 32 14 CA 00 -- Position information: 6
20 00 00 00 6E 6E ----------------------------- Control board information 2
07 01 00 F1 04 05 8E 17 08 5F 18 00 00 CA 00 -- Position information: 7
08 01 00 E1 04 05 8E 15 F0 63 18 00 00 CA 00 -- Position information: 8
09 00 00 00 00 00 00 00 00 FF FF 00 00 00 80 -- Position information: 9
0A 01 00 EB 04 05 8D 99 F7 5F 18 00 00 CA 00 -- Position information: 10
0B 01 00 EA 04 05 8D FC 12 5F 18 00 00 CA 00 -- Position information: 11
0C 01 00 B6 04 05 8D 93 E7 1A 1C 32 14 CA 00 -- Position information: 12
30 00 00 00 6E 6E ----------------------------- Control board information 3
0D 01 00 F1 04 05 8E 17 08 5F 18 00 00 CA 00 -- Position information: 13
0E 01 00 E1 04 05 8E 15 F0 63 18 00 00 CA 00 -- Position information: 14
0F 00 00 00 00 00 00 00 00 FF FF 00 00 00 80 -- Position information: 15
10 01 00 EB 04 05 8D 99 F7 5F 18 00 00 CA 00 -- Position information: 16
11 01 00 EA 04 05 8D FC 12 5F 18 00 00 CA 00 -- Position information: 17
12 01 00 B6 04 05 8D 93 E7 1A 1C 32 14 CA 00 -- Position information: 18
88 ---------------------------------------------Byte[292] Code verification

Control Board

6 bytes in total. Example: Single Dashboard Data

json
30 00 00 00 6E 6E
BytecodeNameIdentification codeRemarks
Byte[0]Control board addresscontrolIndexDefault: 0x10
Byte[1]Reserved 1undefined1Default: 0x00
Byte[2]Reserved 2undefined2Default: 0x00
Byte[3]Temperaturetemp0x00: No NTC
0x10: 16℃
0x64: 100℃
Byte[4]Software version numbersoftVersion0x00:0
0x10:16
0xFF:255
Byte[5]Hardware version numberhardVersion0x00:0
0x10:16
0xFF:255

Hole

15 bytes in total. Example: single position data

json
01 01 00 F1 04 05 8E 17 08 5F 18 00 00 CA 00
BytecodeNameIdentification codeRemarks
Byte[0]Position addressholeIndexRange: 0-100
Byte[1]State informationstate0x00:No mobile power supply 0x01:Power bank is normal 0x02:Charging abnormality 0x03:Communication exception 0x04:KaBao/Damaged 0x05:The key is forcibly released 0x06:The solenoid valve did not return to the position when returned 0x07:Reserved 0x08:Anti-theft protocol communication failed 0x09:Typec short circuit 0x0A:Return failed, battery does not pop out 0x0B~0xFF:Reserved
Byte[2]Power bank currentpowerbankCurrKeep 1 decimal place
For example: 0x10=16, means 1.6A
Byte[3]Power bank voltagepowerbankVoltKeep 1 decimal place
For example, 0x10=16, means 1.6V
Byte[4]Area codeareaCustomized
Byte[5~8]Power bank SNpowerbankSN0x00:0
0x10:16
0xFF:255
Byte[9]Batterysoc0x00: 0
0x10: 16%
0xFF: 255%
Byte[10]Temperaturetemp0x00: No NTC
0x10: 16℃
0x64: 100℃
Byte[11]Charging voltagechargeVoltKeep 1 decimal place
For example, 0x10=16, means 1.6V
Byte[12]Charging currentchargeCurrKeep 1 decimal place
For example, 0x10=16, means 1.6A
Byte[13]Software versionsoftVersion0x00:0
0x10:16
0xFF:255
Byte[14]Position detectionsensorParse to binary ----------- Bit[7]:Key detection: 0 closed, 1 open Bit[6]:Solenoid valve detection: 0 closed, 1 open Bit[5]:Reserved Bit[4]:Reserved Bit[3]:Reserved Bit[2]:Reserved Bit[1]:Reserved Bit[0]:Reserved ---------- 0X80=1000 0000:Button is disconnected, solenoid valve is closed 0X40=0100 0000:Button closed, solenoid valve open 0X00=0000 0000:Button closed, solenoid valve closed 0XC0=1100 0000:Button disconnected, solenoid valve disconnected

API Example

text
Content-Type:text/plain

Body Hex

A8 01 25 10 10 00 00 00 6E 6E 01 01 00 F1 04 05 8E 17 08 5F 18 00 00 CA 00 02 01 00 E1 04 05 8E 15 F0 63 18 00 00 CA 00 03 00 00 00 00 00 00 00 00 FF FF 00 00 00 80 04 01 00 EB 04 05 8D 99 F7 5F 18 00 00 CA 00 05 01 00 EA 04 05 8D FC 12 5F 18 00 00 CA 00 06 01 00 B6 04 05 8D 93 E7 1A 1C 32 14 CA 00 20 00 00 00 6E 6E 07 01 00 F1 04 05 8E 17 08 5F 18 00 00 CA 00 08 01 00 E1 04 05 8E 15 F0 63 18 00 00 CA 00 09 00 00 00 00 00 00 00 00 FF FF 00 00 00 80 0A 01 00 EB 04 05 8D 99 F7 5F 18 00 00 CA 00 0B 01 00 EA 04 05 8D FC 12 5F 18 00 00 CA 00 0C 01 00 B6 04 05 8D 93 E7 1A 1C 32 14 CA 00 30 00 00 00 6E 6E 0D 01 00 F1 04 05 8E 17 08 5F 18 00 00 CA 00 0E 01 00 E1 04 05 8E 15 F0 63 18 00 00 CA 00 0F 00 00 00 00 00 00 00 00 FF FF 00 00 00 80 10 01 00 EB 04 05 8D 99 F7 5F 18 00 00 CA 00 11 01 00 EA 04 05 8D FC 12 5F 18 00 00 CA 00 12 01 00 B6 04 05 8D 93 E7 1A 1C 32 14 CA 00 88

sign = f212709ce41a2c6ac4ac3f6c9bdee020

MD5("rentboxSN=860602069165357|signal=CSQ:30")

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