Skip to content

Upgrade(Android)

1、Send upgrade command, the device is disconnected from the network, and cannot reply to the MQTT result
2、The cabinet receives the upgrade command, requests HTTP, and obtains the latest version name and APK download address.
3、The cabinet determines whether it needs to be upgraded based on the APK version name

Command Send ▼

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

Data format: JSON string

NameIdentification codeData typeRemarks
command namecmdstringpush_version_apk

Upgrade APK

{ "cmd":"push_version_apk" }

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 APK

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

text
/api/rentbox/client/version/main

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":"V12,100520,http://abc.com/apps/xxxxxx.apk",
    "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]version nameversionNamestringFor example:V12
array[1]APK lengthfileSizelongFor example: 100520
array[2]Download addressurlstringFor example: http://abc.com/apps/xxxxxx.bin