Skip to content

Standard

1、The server issues MQTT instructions, usually in JSON format.
2、The cabinet replies with execution results, usually in Hex format.
3、4. The server for device authentication, initial configuration, online upgrade, whole machine reporting, and screen advertising update needs to provide HTTP API interface

Command Send ▼

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

Data format: JSON string

NameIdentification codeData typeRemarks
command namecmdstringcommand name
command datadatastringcommand data
Main control board serial portiostringDefault: 0; Range: 0-1

Example, send an instruction to pop up position No. 2

{ "cmd":"popup", "data":"2", "io":"0" }

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 lengthlengthFor example: 0x00 0x14, converted to decimal, the packet length is 20
Byte[3]Command namecmdFor example: 0x21, means the device replies: Position pop-up result
Byte[4~n]Custom datadataReport different data according to different instructions
Byte[n+1]Check codeverifyPacket complement check

Example: Reply to the pop-up No. 2 warehouse result

A8 00 14 21 10 01 01 02 00 00 00 00 00 00 00 00 00 00 00 00

json
A8 ------------------------------------------------------ Byte[0] Head code
00 14 --------------------------------------------------- Byte[1~2] Packet length:20
21 ------------------------------------------------------ Byte[3] Command name 
10 01 01 02 00 00 00 00 00 00 00 00 00 00 00 ------------ Byte[4~n] Custom data
00 ------------------------------------------------------ Byte[n+1] Check code