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
For example: BST6_ZS_EC20_V6088_0x926C_100520.bin
Command Send ▼
Subscribe to topic:/powerbank/{uuid}/user/get
Data format: JSON string
Name | Identification code | Data type | Remarks |
---|---|---|---|
command name | cmd | string | push_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}
/api/rentbox/client/version/main
/api/rentbox/client/version/control
Request Parameters
Name | Identification code | Is it required | Remarks |
---|---|---|---|
Server domain name | host | YES | Provided by the customer, for example: s.abc.com |
Firmware ID | id | YES | Provided 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
GET Main board firmware
GET Control board firmware
API Response
{
"code":200,
"type":0,
"data":"BST6_ZS_EC20_V6088_0x926C_100520.bin,100520,http://abc.com/apps/xxxxxx.bin",
"msg":"OK",
"time":1705479460869
}
Name | Identification code | Type | Remarks |
---|---|---|---|
status code | code | int | Default: 200 |
status type | type | int | Default: 0 |
Custom data | data | string | Upgrade parameters, "," split array |
Exception message | msg | string | Default: OK |
timestamp | time | long | current millisecond timestamp |
Upgrade Parameters
- | Name | Identification code | Type | Remarks |
---|---|---|---|---|
array[0] | Firmware name | fileName | string | For example: BST6_ZS_EC20_V6088_0x926C_100520.bin |
array[1] | Firmware length | fileSize | long | For example: 100520 |
array[2] | Download address | url | string | For example: http://abc.com/apps/xxxxxx.bin |