Frequently asked questions about OTA- Relevant to SDK
Page Directory
1. Which parameters are required to be modified when running the project in VS?
2. Is the way for reporting download progress can be customized?
3. In which variable does the calculation result of signature encryption will be saved?
4. What should we do if we need to save task information?
5. Whether the fragmenting way for each pulling of file can be customized?
6. What should we do if the device power and signal don’t meet requirements?
7. How to acquire file name of the upgrade package?
8. What is the minimum length of fragmented package?
9. Why TCP connection is disconnected in the process of continuous downloading of upgrade package?
10. Where the upgrade package is saved when SDK is running on win platform?
11. How to redownload upgrade package in SDK?
1.Which parameters are required to be modified when running the project in VS?
A: Following parameters are required to be modified when running the project in VS:
default_device_id(device ID)
default_manuf(device module manufacturer number)
default_model(device module number)
default_type(upgrade type)
default_fota_version(device firmware version number)
default_sota_version(device application version number)
default_res(resource and resource entity ID)and
default_access_key(product access_key)。
2. Is the way for reporting download progress can be customized?
A: The way for reporting download progress can be defined freely in OTA_EVENT_REPORT_DOWNLOAD_PROGRESS event.
Note: Make sure that the download progress is reported after the last fragment package has been downloaded so as to trigger upgrade.
3.In which variable does the calculation result of signature encryption will be saved?
A: In the function OTA_Pack_Authorization_Info, the calculation result encrypted with signature is saved to the encrypt_result variable in the context.
In OTA_EVENT_custom_save_task_info event, it can be saved into flash or re-calculated when it is re-started to restore the status.
4.What should we do if we need to save task information?
A: In ota_save_flash function, when it is necessary to save some data into flash for restoring the working status, it is recommended to save the token, signal request, power requirements, times of retry, retry time interval, upgrade package size, size of upgrade package downloaded and md5 information of upgrade package returned when the task is detected successfully. In addition, every time when the fragment package is saved successfully, the size of the upgrade package downloaded shall be updated into flash.
5. Whether the fragmenting way for each pulling of file can be customized?
A: The fragment range of the file pulled every time is calculated in ota_calculate_range() function.
It is downloaded in multiple times with fixed size every time by default. Fragmenting logic can be designed based on actual needs.
6. What should we do if the device power and signal don’t meet requirements?
A: If the power is low or the signal is weak when downloading the upgrade package, isRetry can be reset to retry state in callback event.
7.How to acquire file name of the upgrade package?
A: If the file name of the upgrade package is required, it can be obtained from Content- Disposition in the message returned when downloading API of upgrade package.
8.What is the minimum length of fragmented package?
A: The minimum range of fragment packet obtained every time is limited to 2 bytes.
9.Why TCP connection is disconnected in the process of continuous downloading of upgrade package?
A: The upper limit of the times of request in one TCP connection is 1,000. TCP connection will be disconnected in case the upper limit is exceeded. It is only required to re-establish TCP connection in this case.
10.Where the upgrade package is saved when SDK is running on win platform?
A: The upgrade package downloaded is saved to \build\OtaSample by default in SDK. The upgrade package is deleted in OTA_EVENT_custom_delete_package event after the process is completed. It will only need to modify the even in case it is required to view the integrity of the upgrade package.
11. How to redownload upgrade package in SDK?
A: It shall be marked for retry in case no data have been received within a certain period of time during upgrade package downloading process (ctx_net_state is reset to be NET_STATE_NULL, isRetry is reset to be DownLoadRetry_True).