Skip to content

Upgrade(MCU)

1、After sending an upgrade command, the device disconnected from the network and could not reply with MQTT results.
2、The cabinet receives the upgrade command and requests HTTP to obtain the latest version number and firmware download address.
3、The cabinet uses the version number of the firmware name to determine whether it needs to be upgraded.
4、Upgraded firmware includes: main control board, control board

The firmware name, including version number and other information, is provided by the manufacturer and cannot be changed at will.
For example: BST6_ZS_EC20_V6088_0x926C_100520.bin

Command Send ▼

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

Data format: JSON string

NameIdentification codeData typeRemarks
command namecmdstringpush_version_publish

Upgrade all firmware

{ "cmd":"push_version_publish" }

Command Reply △

None, But Trigger API request

API Request

Tips

Server API address, only needs to return the correct Body data, no strict requirement on the request path. We recommend the following writing method:

GET Main board firmware

https://{host}/api/rentbox/client/version/main?id={id} 

GET Control board firmware

https://{host}/api/rentbox/client/version/control?id={id} 

text
/api/rentbox/client/version/main
text
/api/rentbox/client/version/control

Request Parameters

NameIdentification codeIs it requiredRemarks
Server domain namehostYESProvided by the customer, for example: s.abc.com
Firmware IDidYESProvided by the customer, for example: 1, 2, 3. Depending on the manufacturer and model, different IDs need to be passed in and different upgrade addresses are returned. Example:
1. Quectel master firmware
2. Quectel master firmware (backup power)
3. MeiG master firmware
4. MeiG master upgrade (backup power)
5. Android master firmware

API Example

API Response

json
{
    "code":200,
    "type":0,
    "data":"BST6_ZS_EC20_V6088_0x926C_100520.bin,100520,http://abc.com/apps/xxxxxx.bin",
    "msg":"OK",
    "time":1705479460869
}
NameIdentification codeTypeRemarks
status codecodeintDefault: 200
status typetypeintDefault: 0
Custom datadatastringUpgrade parameters, "," split array
Exception messagemsgstringDefault: OK
timestamptimelongcurrent millisecond timestamp

Upgrade Parameters

-NameIdentification codeTypeRemarks
array[0]Firmware namefileNamestringFor example: BST6_ZS_EC20_V6088_0x926C_100520.bin
array[1]Firmware lengthfileSizelongFor example: 100520
array[2]Download addressurlstringFor example: http://abc.com/apps/xxxxxx.bin