1.Upload firmware to server

Upload the firmware to be upgraded to a directory on the server based on the corresponding operating system of the server.
Taking Ubuntu as an example, I used xFTP to upload the firmware to be upgraded to my server.

2.Generate firmware URL

We can install NGINX and generate firmware URL.
Execute the following script to install Nginx on the Ubuntu server.

apt-get install nginx

After Nginx installation is completed, we need to configure the firmware resource directory.
For example, we create a downloadconf file in the /etc/nginx/conf.d directory, which contains the following settings:

autoindex on; #Open file directory preview
autoindex_exact_size on;
autoindex_localtime on;
charset utf-8;

server {
    listen 8888;
    server_name download; 
    root /opt/download; #Firmware File Resource Directory
}

Finally, we can see the file url of the firmware on the server through the browser. The complete URL of the upgrade package corresponding to the command provided to the device below this url.

3.Send upgrade command to devices

The upgrade command message ID of the device is 0x8105, and the corresponding command word is 32.

Command Example:

7E81050094413050959369000120303B303B687474703A2F2F3132342E3232332E36302E3233343A383838382F464F54412F3130302F414F56585F41583330302D58585F48322E305F56322E302E345F7632312E62696E3B313B687474703A2F2F3132372E302E302E313A383838382F464F54412F3130302F414F56585F41583330302D58585F48322E305F56322E302E345F7632312E62696E3B313233343536407E

Example Description:

7E -->Start Flag
8105 -->Messgae Id 0x8105
006C -->Message Body Properties
413050959369 -->Device S/N
0001 -->Serial number
20 -->This is the hexadecimal command word, corresponding to the decimal command word of 32.
30 3B -->Convert 30 to an ASCII string of "0", which corresponds to TYPE: 0 for app upgrade, 1 for core upgrade; The ASCII string corresponding to 3B is ";", which corresponds to the separator character.
30 3B -->Convert 30 to an ASCII string of "0", which corresponds to MODE: 0 represents the full package, and 1 represents the differential package; The ASCII string corresponding to 3B is ";", which corresponds to the separator character.
414F56585F41583330302D58585F48322E305F56322E302E345F763231 3B -->414F56585F41583330302D58585F48322E305F56322E302E345F763231 is the hexadecimal string with the version,value is:"AOVX_AX300-XX_H2.0_V2.0.4_v21";The ASCII string corresponding to 3B is ";", which corresponds to the separator character.
31 3B -->Convert 31 to an ASCII string of "1",which corresponds to PROTOCOL:0 represents the FTP protocol, 1 represents the HTTP protocol;The ASCII string corresponding to 3B is ";", which corresponds to the separator character.
687474703A2F2F3132372E302E302E313A383838382F464F54412F3130302F414F56585F41583330302D58585F48322E305F56322E302E345F7632312E62696E 3B -->687474703A2F2F3132372E302E302E313A383838382F464F54412F3130302F414F56585F41583330302D58585F48322E305F56322E302E345F7632312E62696E  is the hexadecimal string of the firmware URL, value is:" http://127.0.0.1:8888/FOTA/100/AOVX_AX300 -XX_ H2.0_ V2.0.4_ v21.bin";The ASCII string corresponding to 3B is ";", which corresponds to the separator character.
313233343536 -->The value of MD5 key defaults to 123456
F0 -->Check Code
7E -->End Flag

4.Device responds to upgrade command

After sending the upgrade command, the device will respond with 0x0001, indicating that the device has received the upgrade task.
Afterwards, the device will provide the upgrade progress and whether the upgrade has been completed based on the data type in the 0xF6 extension message of 0x0002.

作者:admin  创建时间:2023-04-29 21:04
最后编辑:admin  更新时间:2023-04-30 17:13