update: tracker user guide doc ota module

This commit is contained in:
JackSun 2022-05-17 16:28:06 +08:00
parent f2fbd941a1
commit c92eb71983
19 changed files with 128 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

View File

@ -138,7 +138,7 @@ git checkout master
### 设置项目配置参数 ### 设置项目配置参数
#### settings_sys 项目基础配置 #### 项目基础配置(settings_sys)
```python ```python
debug = True # 是否开启debug日志 debug = True # 是否开启debug日志
@ -151,7 +151,7 @@ base_cfg = {
user_cfg = True # 是否启用用户配置模块 user_cfg = True # 是否启用用户配置模块
``` ```
#### settings_alicoud 阿里云配置 #### 阿里云配置(settings_alicoud)
```python ```python
PK = "{ProductKey}" # 产品KEY PK = "{ProductKey}" # 产品KEY
@ -165,7 +165,7 @@ life_time = 120 # 通信之间允许的最长时间段(以秒为单位), 范围
burning_method = _burning_method.one_machine_one_secret # 一机一密,一型一密 burning_method = _burning_method.one_machine_one_secret # 一机一密,一型一密
``` ```
#### settings_queccloud 移远云配置 #### 移远云配置(settings_queccloud)
```python ```python
PK = "{ProductKey}" # 产品KEY PK = "{ProductKey}" # 产品KEY
@ -176,7 +176,7 @@ SERVER = "iot-south.quectel.com:1883" # 连接的服务器名称
life_time = 120 # 通信之间允许的最长时间段(以秒为单位), 范围(60-1200) life_time = 120 # 通信之间允许的最长时间段(以秒为单位), 范围(60-1200)
``` ```
#### settings_loc 定位功能配置 #### 定位功能配置(settings_loc)
```python ```python
@ -217,7 +217,7 @@ gps_sleep_mode = _gps_sleep_mode.none # GPS 休眠模式 0-无;1-pull off(关
``` ```
#### settings_user tracker业务相关配置 #### tracker业务相关配置(settings_user)
> 该模块配置参数为业务定义的物模型的参数与默认值,用户可根据具体业务的物模型参数进行调整。 > 该模块配置参数为业务定义的物模型的参数与默认值,用户可根据具体业务的物模型参数进行调整。
@ -275,12 +275,12 @@ ota_status = {
} }
``` ```
## 启动项目 ## 运行项目
1. 设置好模块的配置参数; 1. 设置好模块的配置参数;
2. 将物模型JSON文件放入项目根目录中; 2. 将物模型JSON文件放入项目根目录中;
3. 开发主机安装好设备驱动与调试软件QPYcom; 3. 开发主机安装好设备驱动与调试软件QPYcom;
4. 给设备安装SIM卡并连接主机; 4. 给设备安装SIM卡并连接主机启动电源;
5. 打开对应的设备串口将项目代码通过QPYcom烧录至设备中; 5. 打开对应的设备串口将项目代码通过QPYcom烧录至设备中;
![](./media/tracker_code_import.png) ![](./media/tracker_code_import.png)
@ -289,11 +289,130 @@ ota_status = {
![](./media/tracker_running.png) ![](./media/tracker_running.png)
## 功能模块注册流程图 7. 在云服务SaaS平台查看设备状态信息.
![](./media/aliyun_tracker_running_saas_view.png)
8. 可通过在线调试下发指令到设备端进行设备控制与数据交互.
![](./media/aliyun_online_send_message.png)
## OTA升级
> - **固件升级只支持差分升级,不支持整包升级**
### 阿里云
> - **项目文件升级包,建议以修改代码文件后缀名为`.bin`的方式做成升级包,上传云端,可上传多个文件**
#### 固件升级
1. 制作固件升级差分包(联系固件开发人员);
2. 创建OTA模块以设备平台名称命名如: `EC600N-CNLC`.
![](./media/aliyun_ota_fota_module.png)
3. 创建OTA升级包
![](./media/aliyun_ota_fota_upgrade_package.png)
4. 选择批量升级, 创建升级计划
![](./media/aliyun_ota_fota_plain.png)
5. 等待设备升级,查看升级结果
+ 当设备开启OTA升级和OTA自动升级则等待设备升级完成查看升级结果;
+ 当设备开启OTA升级但未开启自动升级时可通过在线调试模块下发`user_ota_action=1`的物模型设置指令进行OTA升级。
![](./media/aliyun_ota_fota_upgrade_process.png)
#### 项目升级
1. 创建OTA模块`settings.py``PROJECT_NAME`命名,如: `QuecPython-Tracker`.
![](./media/aliyun_ota_sota_module.png)
2. 将需要升级的项目文件后缀名修改为`.bin`
3. 创建OTA升级包
+ 此处需要在**推送给设备的自定义信息**中编写升级文件名对应的设备全路径文件名, 如: `{"files":{"common.bin":"/usr/modules/common.py","settings.bin":"/usr/settings.py","test_tracker.bin":"/usr/test_tracker.py"}}`
![](./media/aliyun_ota_sota_upgrade_package.png)
4. 选择批量升级, 创建升级计划
![](./media/aliyun_ota_sota_plain.png)
5. 等待设备升级,查看升级结果
+ 当设备开启OTA升级和OTA自动升级则等待设备升级完成查看升级结果;
+ 当设备开启OTA升级但未开启自动升级时可通过在线调试模块下发`user_ota_action=1`的物模型设置指令进行OTA升级。
![](./media/aliyun_ota_sota_upgrade_process.png)
### 移远云
> - **项目文件升级包,建议以压缩包的形式打包多个项目文件上传云端**
#### 固件升级
1. 制作固件升级差分包(联系固件开发人员);
2. 创建OTA升级模型添加固件组件MCU组件(用于项目升级)
+ 固件类型的组件标识以设备平台名称命名,如: `EC600N-CNLC`.
+ MCU类型的组件标识以`settings.py``PROJECT_NAME`命名,如: `QuecPython-Tracker`.
![](./media/quec_ota_model.png)
3. 创建固件版本升级包
![](./media/quec_ota_fota_version_package.png)
4. 创建固件升级计划
![](./media/quec_ota_fota_plain.png)
5. 等待设备升级,查看升级结果
+ 当设备开启OTA升级和OTA自动升级则等待设备升级完成查看升级结果;
+ 当设备开启OTA升级但未开启自动升级时可通过在线调试模块下发`user_ota_action=1`的物模型设置指令进行OTA升级。
![](./media/quec_ota_fota_upgrade_process.png)
#### 项目升级
1. 将项目文件打包成压缩包,打包指令: `tar -zcvf sotaFile.tar.gz *.py`;
2. 创建OTA升级模型添加固件组件MCU组件(用于项目升级)
+ 固件类型的组件标识以设备平台名称命名,如: `EC600N-CNLC`.
+ MCU类型的组件标识以`settings.py``PROJECT_NAME`命名,如: `QuecPython-Tracker`.
![](./media/quec_ota_model.png)
3. 如果在创建OTA模型时未创建MCU组件可在模型中添加组件
![](./media/quec_ota_model_add_mcu_module.png)
4. 创建项目版本升级包
![](./media/quec_ota_sota_version_package.png)
4. 创建项目升级计划
![](./media/quec_ota_sota_plain.png)
5. 等待设备升级,查看升级结果
+ 当设备开启OTA升级和OTA自动升级则等待设备升级完成查看升级结果;
+ 当设备开启OTA升级但未开启自动升级时可通过在线调试模块下发`user_ota_action=1`的物模型设置指令进行OTA升级。
![](./media/quec_ota_sota_upgrade_process.png)
## 功能模块注册流程
### 功能注册说明流程图
![](./media/tracker_modules_registration_process.png) ![](./media/tracker_modules_registration_process.png)
**代码样例:** ### 代码样例
```python ```python
### 基础模块初始化 ### ### 基础模块初始化 ###