mirror of
https://gitee.com/qpy-solutions/tracker-v2.git
synced 2025-05-18 18:48:25 +08:00
update: delete quechting docs.
This commit is contained in:
parent
15e27edbaf
commit
318c31ad62
@ -1,354 +0,0 @@
|
||||
{
|
||||
"properties": [
|
||||
{
|
||||
"identifier": "GeoLocation",
|
||||
"dataType": {
|
||||
"type": "struct",
|
||||
"specs": [
|
||||
{
|
||||
"identifier": "Longitude",
|
||||
"dataType": {
|
||||
"type": "double"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "Latitude",
|
||||
"dataType": {
|
||||
"type": "double"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "Altitude",
|
||||
"dataType": {
|
||||
"type": "double"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "CoordinateSystem",
|
||||
"dataType": {
|
||||
"type": "enum"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "power_switch",
|
||||
"dataType": {
|
||||
"type": "bool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "energy",
|
||||
"dataType": {
|
||||
"type": "int"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "phone_num",
|
||||
"dataType": {
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "loc_method",
|
||||
"dataType": {
|
||||
"type": "struct",
|
||||
"specs": [
|
||||
{
|
||||
"identifier": "gps",
|
||||
"dataType": {
|
||||
"type": "bool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "cell",
|
||||
"dataType": {
|
||||
"type": "bool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "wifi",
|
||||
"dataType": {
|
||||
"type": "bool"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "work_mode",
|
||||
"dataType": {
|
||||
"type": "enum"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "work_cycle_period",
|
||||
"dataType": {
|
||||
"type": "int"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "local_time",
|
||||
"dataType": {
|
||||
"type": "date"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "low_power_alert_threshold",
|
||||
"dataType": {
|
||||
"type": "int"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "low_power_shutdown_threshold",
|
||||
"dataType": {
|
||||
"type": "int"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "sw_ota",
|
||||
"dataType": {
|
||||
"type": "bool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "sw_ota_auto_upgrade",
|
||||
"dataType": {
|
||||
"type": "bool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "sw_voice_listen",
|
||||
"dataType": {
|
||||
"type": "bool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "sw_voice_record",
|
||||
"dataType": {
|
||||
"type": "bool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "sw_fault_alert",
|
||||
"dataType": {
|
||||
"type": "bool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "sw_low_power_alert",
|
||||
"dataType": {
|
||||
"type": "bool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "sw_over_speed_alert",
|
||||
"dataType": {
|
||||
"type": "bool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "sw_sim_abnormal_alert",
|
||||
"dataType": {
|
||||
"type": "bool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "sw_disassemble_alert",
|
||||
"dataType": {
|
||||
"type": "bool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "sw_drive_behavior_alert",
|
||||
"dataType": {
|
||||
"type": "bool"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "drive_behavior_code",
|
||||
"dataType": {
|
||||
"type": "enum"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "power_restart",
|
||||
"dataType": {
|
||||
"type": "enum"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "over_speed_threshold",
|
||||
"dataType": {
|
||||
"type": "int"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "device_module_status",
|
||||
"dataType": {
|
||||
"type": "struct",
|
||||
"specs": [
|
||||
{
|
||||
"identifier": "net",
|
||||
"dataType": {
|
||||
"type": "enum"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "location",
|
||||
"dataType": {
|
||||
"type": "enum"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "temp_sensor",
|
||||
"dataType": {
|
||||
"type": "enum"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "light_sensor",
|
||||
"dataType": {
|
||||
"type": "enum"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "move_sensor",
|
||||
"dataType": {
|
||||
"type": "enum"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "mike",
|
||||
"dataType": {
|
||||
"type": "enum"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "gps_mode",
|
||||
"dataType": {
|
||||
"type": "enum"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "user_ota_action",
|
||||
"dataType": {
|
||||
"type": "enum"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "ota_status",
|
||||
"dataType": {
|
||||
"type": "struct",
|
||||
"specs": [
|
||||
{
|
||||
"identifier": "sys_current_version",
|
||||
"dataType": {
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "sys_target_version",
|
||||
"dataType": {
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "app_current_version",
|
||||
"dataType": {
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "app_target_version",
|
||||
"dataType": {
|
||||
"type": "text"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "upgrade_module",
|
||||
"dataType": {
|
||||
"type": "enum"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "upgrade_status",
|
||||
"dataType": {
|
||||
"type": "enum"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "voltage",
|
||||
"dataType": {
|
||||
"type": "int"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "current_speed",
|
||||
"dataType": {
|
||||
"type": "float"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "work_mode_timeline",
|
||||
"dataType": {
|
||||
"type": "int"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "loc_gps_read_timeout",
|
||||
"dataType": {
|
||||
"type": "int"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "temperature",
|
||||
"dataType": {
|
||||
"type": "double"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identifier": "humidity",
|
||||
"dataType": {
|
||||
"type": "double"
|
||||
}
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"identifier": "sos_alert",
|
||||
"type": "alert"
|
||||
},
|
||||
{
|
||||
"identifier": "fault_alert",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"identifier": "low_power_alert",
|
||||
"type": "alert"
|
||||
},
|
||||
{
|
||||
"identifier": "sim_abnormal_alert",
|
||||
"type": "alert"
|
||||
},
|
||||
{
|
||||
"identifier": "drive_behavior_alert",
|
||||
"type": "alert"
|
||||
},
|
||||
{
|
||||
"identifier": "disassemble_alert",
|
||||
"type": "alert"
|
||||
},
|
||||
{
|
||||
"identifier": "over_speed_alert",
|
||||
"type": "alert"
|
||||
}
|
||||
]
|
||||
}
|
@ -1 +1 @@
|
||||
Subproject commit 6cbaed9ea93bf5de4807d8f242d3683ec4b3e248
|
||||
Subproject commit 118d052324b7eb42b83d64229224772f7932cc47
|
File diff suppressed because it is too large
Load Diff
@ -149,8 +149,6 @@
|
||||
| Battery | 电池模块,获取电池电量与电压 |
|
||||
| LowEnergyManage | 低功耗唤醒模块,用于设置不同级别的低功耗模型,定时唤醒模块进行业务工作。 |
|
||||
| Location | 定位模块,可获取GPS,基站,WIFI三种定位方式的定位信息。 |
|
||||
| QuecThing | 移远云模块,主要用于与云端的消息交互与OTA升级 |
|
||||
| QuecObjectModel | 移远云物模型抽象类,将移远云导出的物模型(json格式)抽象为一个类进行功能使用 |
|
||||
| AliYunIot | 阿里云模块,主要用于与云端的消息交互与OTA升级 |
|
||||
| AliObjectModel | 阿里云物模型抽象类,将阿里云导出的精简物模型(json格式)抽象为一个类进行功能使用 |
|
||||
| RemotePublish | 云端消息发布类,用于兼容不同云的消息发布与OTA升级检测与确认 |
|
||||
|
@ -7,7 +7,7 @@
|
||||
## 内置功能模块
|
||||
|
||||
- [x] 阿里云(aliyunIot): 提供阿里云物联网物模型的消息发布与订阅,OTA升级功能。
|
||||
- [x] 移远云(quecthing): 提供移远云物联网物模型的消息发布与订阅,OTA升级功能。
|
||||
- [x] ThingsBoard(thingsboard): 提供ThingsBoard平台物联网物模型的消息发布与订阅,OTA升级功能。
|
||||
- [x] 电池模块(battery): 提供设电池电量,电压数据查询,充电状态查询功能。
|
||||
- [x] LED模块(led): 提供LED开关控制功能,周期性闪烁功能。
|
||||
- [x] 定位模块(location): 提供内置/外置GPS,基站,WIFI定位查询功能。
|
||||
@ -23,19 +23,11 @@
|
||||
|--code
|
||||
|--aliyun_object_model.json
|
||||
|--main.py
|
||||
|--quec_object_model.json
|
||||
|--settings.py
|
||||
|--settings_alicloud.py
|
||||
|--settings_jtt808.py
|
||||
|--settings_cloud.py
|
||||
|--settings_loc.py
|
||||
|--settings_queccloud.py
|
||||
|--settings_sys.py
|
||||
|--settings_user.py
|
||||
|--test_tracker.py
|
||||
|--tracker.py
|
||||
|--tracker_collector.py
|
||||
|--tracker_controller.py
|
||||
|--tracker_devicecheck.py
|
||||
|--tracker_tb.py
|
||||
|--modules
|
||||
|--aliyunIot.py
|
||||
|--battery.py
|
||||
@ -45,10 +37,10 @@
|
||||
|--location.py
|
||||
|--logging.py
|
||||
|--mpower.py
|
||||
|--quecthing.py
|
||||
|--remote.py
|
||||
|--temp_humidity_sensor.py
|
||||
|--sensor.py
|
||||
|--thingsboard.py
|
||||
```
|
||||
|
||||
## 项目配置
|
||||
@ -87,25 +79,6 @@
|
||||
|
||||

|
||||
|
||||
#### 移远云
|
||||
|
||||
1. [创建产品与设备](https://iot-cloud-docs.quectelcn.com/quickStart/ProductDevelop.html)
|
||||
|
||||

|
||||

|
||||
|
||||
2. [为产品定义物模型](https://iot-cloud-docs.quectelcn.com/quickStart/ProductDevelop.html)
|
||||
|
||||

|
||||
|
||||
3. 项目提供了[物模型demo](https://gitee.com/qpy-solutions/tracker-v2/blob/dev/object_model_demo/quec_cloud_object_model.json), 可直接导入生成,无需手动创建
|
||||
|
||||

|
||||
|
||||
4. 导出JSON格式的物模型, 重命名后, 放入项目根目录`code`下, 建议命名`quec_object_model.json`
|
||||
|
||||

|
||||
|
||||
### 设置项目配置参数
|
||||
|
||||
#### 项目基础配置(settings_sys)
|
||||
@ -135,17 +108,6 @@ life_time = 120 # 通信之间允许的最长时间段(以秒为单位), 范围
|
||||
burning_method = _burning_method.one_machine_one_secret # 一机一密,一型一密
|
||||
```
|
||||
|
||||
#### 移远云配置(settings_queccloud)
|
||||
|
||||
```python
|
||||
PK = "{ProductKey}" # 产品KEY
|
||||
PS = "{ProductSecret}" # 产品密钥
|
||||
DK = "{DeviceKey}" # 设备名称
|
||||
DS = "{DeviceSecret}" # 设备密钥
|
||||
SERVER = "iot-south.quectel.com:1883" # 连接的服务器名称
|
||||
life_time = 120 # 通信之间允许的最长时间段(以秒为单位), 范围(60-1200)
|
||||
```
|
||||
|
||||
#### 定位功能配置(settings_loc)
|
||||
|
||||
```python
|
||||
@ -328,62 +290,6 @@ ota_status = {
|
||||
|
||||

|
||||
|
||||
### 移远云
|
||||
|
||||
> **项目文件升级包,建议以压缩包的形式打包多个项目文件上传云端**
|
||||
|
||||
#### 固件升级
|
||||
|
||||
1. 制作固件升级差分包(联系固件开发人员);
|
||||
2. 创建OTA升级模型,添加固件组件,MCU组件(用于项目升级)
|
||||
+ 固件类型的组件标识以设备平台名称命名,如: `EC600N-CNLC`.
|
||||
+ MCU类型的组件标识以`settings.py`中`PROJECT_NAME`命名,如: `QuecPython-Tracker`.
|
||||
|
||||

|
||||
|
||||
3. 创建固件版本升级包
|
||||
|
||||

|
||||
|
||||
4. 创建固件升级计划
|
||||
|
||||

|
||||
|
||||
5. 等待设备升级,查看升级结果
|
||||
|
||||
+ 当设备开启OTA升级和OTA自动升级,则等待设备升级完成,查看升级结果;
|
||||
+ 当设备开启OTA升级,但未开启自动升级时,可通过在线调试模块下发`user_ota_action=1`的物模型设置指令,进行OTA升级。
|
||||
|
||||

|
||||
|
||||
#### 项目升级
|
||||
|
||||
1. 将项目文件打包成压缩包,打包指令: `tar -zcvf sotaFile.tar.gz *.py`;
|
||||
2. 创建OTA升级模型,添加固件组件,MCU组件(用于项目升级)
|
||||
+ 固件类型的组件标识以设备平台名称命名,如: `EC600N-CNLC`.
|
||||
+ MCU类型的组件标识以`settings.py`中`PROJECT_NAME`命名,如: `QuecPython-Tracker`.
|
||||
|
||||

|
||||
|
||||
3. 如果在创建OTA模型时未创建MCU组件,可在模型中添加组件
|
||||
|
||||

|
||||
|
||||
4. 创建项目版本升级包
|
||||
|
||||

|
||||
|
||||
4. 创建项目升级计划
|
||||
|
||||

|
||||
|
||||
5. 等待设备升级,查看升级结果
|
||||
|
||||
+ 当设备开启OTA升级和OTA自动升级,则等待设备升级完成,查看升级结果;
|
||||
+ 当设备开启OTA升级,但未开启自动升级时,可通过在线调试模块下发`user_ota_action=1`的物模型设置指令,进行OTA升级。
|
||||
|
||||

|
||||
|
||||
## 功能模块注册流程
|
||||
|
||||
### 功能注册说明流程图
|
||||
@ -417,20 +323,7 @@ devicecheck.add_module(sensor)
|
||||
|
||||
### 云模块初始化 ###
|
||||
cloud_init_params = current_settings["cloud"]
|
||||
if current_settings["sys"]["cloud"] & SYSConfig._cloud.quecIot:
|
||||
cloud = QuecThing(
|
||||
cloud_init_params["PK"],
|
||||
cloud_init_params["PS"],
|
||||
cloud_init_params["DK"],
|
||||
cloud_init_params["DS"],
|
||||
cloud_init_params["SERVER"],
|
||||
mcu_name=PROJECT_NAME,
|
||||
mcu_version=PROJECT_VERSION
|
||||
)
|
||||
# Cloud object model init
|
||||
cloud_om = QuecObjectModel()
|
||||
cloud.set_object_model(cloud_om)
|
||||
elif current_settings["sys"]["cloud"] & SYSConfig._cloud.AliYun:
|
||||
if current_settings["sys"]["cloud"] & SYSConfig._cloud.AliYun:
|
||||
client_id = cloud_init_params["client_id"] if cloud_init_params.get("client_id") else modem.getDevImei()
|
||||
cloud = AliYunIot(
|
||||
cloud_init_params["PK"],
|
||||
@ -596,22 +489,7 @@ locator = Location(current_settings["LocConfig"]["gps_mode"], current_settings["
|
||||
|
||||
### 云模块初始化 ###
|
||||
cloud_init_params = current_settings["cloud"]
|
||||
if current_settings["sys"]["cloud"] & SYSConfig._cloud.quecIot:
|
||||
# 初始化移远云服务模块
|
||||
cloud = QuecThing(
|
||||
cloud_init_params["PK"],
|
||||
cloud_init_params["PS"],
|
||||
cloud_init_params["DK"],
|
||||
cloud_init_params["DS"],
|
||||
cloud_init_params["SERVER"],
|
||||
mcu_name=PROJECT_NAME,
|
||||
mcu_version=PROJECT_VERSION
|
||||
)
|
||||
# 转化物模型json为对象
|
||||
cloud_om = QuecObjectModel()
|
||||
# 将物模型实例对象注册到云服务对象中
|
||||
cloud.set_object_model(cloud_om)
|
||||
elif current_settings["sys"]["cloud"] & SYSConfig._cloud.AliYun:
|
||||
if current_settings["sys"]["cloud"] & SYSConfig._cloud.AliYun:
|
||||
client_id = cloud_init_params["client_id"] if cloud_init_params.get("client_id") else modem.getDevImei()
|
||||
# 初始化阿里云服务模块
|
||||
cloud = AliYunIot(
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user