|
@@ -1,3 +1,4 @@
|
|
|
|
|
+#include <app_pwm.h>
|
|
|
/*
|
|
/*
|
|
|
* Copyright (c) 2006-2020, RT-Thread Development Team
|
|
* Copyright (c) 2006-2020, RT-Thread Development Team
|
|
|
*
|
|
*
|
|
@@ -18,7 +19,6 @@
|
|
|
#include "stdarg.h"
|
|
#include "stdarg.h"
|
|
|
#include "string.h"
|
|
#include "string.h"
|
|
|
#include "sht30_collect.h"
|
|
#include "sht30_collect.h"
|
|
|
-#include "beep.h"
|
|
|
|
|
#include "easyflash.h"
|
|
#include "easyflash.h"
|
|
|
#include "sound.h"
|
|
#include "sound.h"
|
|
|
#include "ymodem.h"
|
|
#include "ymodem.h"
|
|
@@ -408,18 +408,6 @@ static void HMI_Decode(void)
|
|
|
LOG_I("关闭补光!!!");
|
|
LOG_I("关闭补光!!!");
|
|
|
ctr_led(OFF);
|
|
ctr_led(OFF);
|
|
|
}
|
|
}
|
|
|
- //关闭加热
|
|
|
|
|
- else if(strstr(rx_buffer,"putTest.switchHeat=0")!=NULL) {
|
|
|
|
|
- device_status.heat_status = 0;
|
|
|
|
|
- ctr_Heat(OFF);
|
|
|
|
|
- LOG_I("Close Heat!");
|
|
|
|
|
- }
|
|
|
|
|
- //打开加热
|
|
|
|
|
- else if(strstr(rx_buffer,"putTest.switchHeat=1")!=NULL) {
|
|
|
|
|
- device_status.heat_status = 1;
|
|
|
|
|
- ctr_Heat(ON);
|
|
|
|
|
- LOG_I("Open Heat!");
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
//清扫
|
|
//清扫
|
|
|
else if (strstr(rx_buffer,"clear")!=NULL) {
|
|
else if (strstr(rx_buffer,"clear")!=NULL) {
|
|
@@ -443,11 +431,8 @@ static void HMI_Decode(void)
|
|
|
{
|
|
{
|
|
|
device_status.test_flag=1;
|
|
device_status.test_flag=1;
|
|
|
rt_kprintf("Open Lamp!\n");
|
|
rt_kprintf("Open Lamp!\n");
|
|
|
- ctr_lamp(ON,1);
|
|
|
|
|
- #if LAMP_EN == 1
|
|
|
|
|
- ctr_lamp(ON,2);
|
|
|
|
|
- ctr_lamp(ON,3);
|
|
|
|
|
- #endif
|
|
|
|
|
|
|
+ //ctr_lamp(ON,1);
|
|
|
|
|
+
|
|
|
DTU_Write("{\"cmd\":\"workstart\"}");
|
|
DTU_Write("{\"cmd\":\"workstart\"}");
|
|
|
USHORT dkdg[] = {0xb4f2,0xbfaa,0xb5c6,0xb9dc};
|
|
USHORT dkdg[] = {0xb4f2,0xbfaa,0xb5c6,0xb9dc};
|
|
|
_485_play(dkdg,4);
|
|
_485_play(dkdg,4);
|
|
@@ -458,27 +443,13 @@ static void HMI_Decode(void)
|
|
|
{
|
|
{
|
|
|
device_status.test_flag=0;
|
|
device_status.test_flag=0;
|
|
|
rt_kprintf("Close Lamp1!\n");
|
|
rt_kprintf("Close Lamp1!\n");
|
|
|
- ctr_lamp(OFF,1);
|
|
|
|
|
- #if LAMP_EN == 1
|
|
|
|
|
- ctr_lamp(OFF,2);
|
|
|
|
|
- ctr_lamp(OFF,3);
|
|
|
|
|
- #endif
|
|
|
|
|
|
|
+ //ctr_lamp(OFF,1);
|
|
|
|
|
+
|
|
|
DTU_Write("{\"cmd\":\"workdone\"}");
|
|
DTU_Write("{\"cmd\":\"workdone\"}");
|
|
|
USHORT gbdg[] = {0xb9d8,0xb1d5,0xb5c6,0xb9dc};
|
|
USHORT gbdg[] = {0xb9d8,0xb1d5,0xb5c6,0xb9dc};
|
|
|
_485_play(gbdg,4);
|
|
_485_play(gbdg,4);
|
|
|
}
|
|
}
|
|
|
- //关闭加热
|
|
|
|
|
- else if(strstr(rx_buffer,"putTest.switchHeat=0")!=NULL) {
|
|
|
|
|
- device_status.heat_status = 0;
|
|
|
|
|
- ctr_Heat(OFF);
|
|
|
|
|
- rt_kprintf("Close Heat!\n");
|
|
|
|
|
- }
|
|
|
|
|
- //打开加热
|
|
|
|
|
- else if(strstr(rx_buffer,"putTest.switchHeat=1")!=NULL) {
|
|
|
|
|
- device_status.heat_status = 1;
|
|
|
|
|
- ctr_Heat(ON);
|
|
|
|
|
- rt_kprintf("Open Heat!\n");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
//设置设备时间
|
|
//设置设备时间
|
|
|
else if (strstr(rx_buffer,"stamp=")!=NULL)
|
|
else if (strstr(rx_buffer,"stamp=")!=NULL)
|
|
@@ -887,35 +858,7 @@ static void Ctr_Mortor_entry(void* parameter)
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
//拍照
|
|
//拍照
|
|
|
- if(device_status.photo_ws==1)
|
|
|
|
|
- {
|
|
|
|
|
- photo_led_sec--;
|
|
|
|
|
- ctr_led(ON);
|
|
|
|
|
- //打开补光灯
|
|
|
|
|
- if(photo_led_sec==890)
|
|
|
|
|
- {
|
|
|
|
|
- gettimeofday(&tv, NULL);
|
|
|
|
|
- device_status.photo_stamp = tv.tv_sec;
|
|
|
|
|
- DTU_Write("takephoto.mp3");
|
|
|
|
|
- //延时
|
|
|
|
|
- rt_thread_delay(1000);
|
|
|
|
|
- LOG_I("测试拍照!");
|
|
|
|
|
- Hk_Take_io();
|
|
|
|
|
- char *takephotojson = makeJson_takephoto();
|
|
|
|
|
- DTU_Write("%s",takephotojson);
|
|
|
|
|
- rt_free(takephotojson);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if(photo_led_sec==500) //4800W相机
|
|
|
|
|
- {
|
|
|
|
|
- ctr_led(OFF);
|
|
|
|
|
- photo_led_sec = 900;
|
|
|
|
|
- device_status.photo_ws = 0;
|
|
|
|
|
- HMI_WRITE("sysTest.switchPhoto.val=0");
|
|
|
|
|
- HMI_WRITE("sysTest.switchFill.val=0");
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }else if(device_status.photo_ws ==2){
|
|
|
|
|
|
|
+ if(device_status.photo_ws ==2){
|
|
|
ctr_led(ON);
|
|
ctr_led(ON);
|
|
|
photo_led_sec--;
|
|
photo_led_sec--;
|
|
|
if(photo_led_sec==890){
|
|
if(photo_led_sec==890){
|
|
@@ -1007,39 +950,24 @@ void Check_ParamConfig(void)
|
|
|
/*设备类型,7孢子仪,3测报灯,默认设置测报灯*/
|
|
/*设备类型,7孢子仪,3测报灯,默认设置测报灯*/
|
|
|
device_status.dtype = 8;
|
|
device_status.dtype = 8;
|
|
|
device_status.version_type = 8; //4.0
|
|
device_status.version_type = 8; //4.0
|
|
|
- device_status.clt_time = 10; //收集时间
|
|
|
|
|
- device_status.heattime = 10; //加热时间
|
|
|
|
|
- device_status.heatvalue=100;//加热温度
|
|
|
|
|
device_status.thsp = 300; //默认熄屏时间5分钟
|
|
device_status.thsp = 300; //默认熄屏时间5分钟
|
|
|
device_status.sunBar = 9; //光控定时时长
|
|
device_status.sunBar = 9; //光控定时时长
|
|
|
- device_status.startBar = 9; //定时开始时间
|
|
|
|
|
- device_status.stopBar = 17; //定时结束时间
|
|
|
|
|
|
|
+ device_status.startBar = 9; //定时开始时间
|
|
|
|
|
+ device_status.stopBar = 17; //定时结束时间
|
|
|
device_status.tph = 70; //高温保护阈值
|
|
device_status.tph = 70; //高温保护阈值
|
|
|
device_status.tpl = 5; //低温保护阈值
|
|
device_status.tpl = 5; //低温保护阈值
|
|
|
- device_status.shake_ws = 1; //震动开关,默认开
|
|
|
|
|
- device_status.shake_sec = 1; //震动时间,s
|
|
|
|
|
device_status.vol = 7; //音量
|
|
device_status.vol = 7; //音量
|
|
|
device_status.timeSwitch = 1; //工作模式:时控
|
|
device_status.timeSwitch = 1; //工作模式:时控
|
|
|
- device_status.passWord = 8888; //屏幕密码
|
|
|
|
|
- device_status.dattim = 20; //数据上传间隔
|
|
|
|
|
|
|
+ device_status.passWord = 8888; //屏幕密码
|
|
|
|
|
+ device_status.dattim = 60; //数据上传间隔
|
|
|
device_status.ds = 1; //设备状态
|
|
device_status.ds = 1; //设备状态
|
|
|
device_status.update_flag = 0;
|
|
device_status.update_flag = 0;
|
|
|
device_status.sleep_mode = 0;
|
|
device_status.sleep_mode = 0;
|
|
|
- /*孢子仪*/
|
|
|
|
|
- /*孢子仪*/
|
|
|
|
|
- device_status.collecting_sh1 = 9;
|
|
|
|
|
- device_status.collecting_eh1 = 10;
|
|
|
|
|
- device_status.collecting_sh2 = 14;
|
|
|
|
|
- device_status.collecting_eh2 = 16;
|
|
|
|
|
- device_status.cold_sw = 0;
|
|
|
|
|
- device_status.heat_sw =0;
|
|
|
|
|
- device_status.cul_time = 60;
|
|
|
|
|
device_status.run_sta = 0;
|
|
device_status.run_sta = 0;
|
|
|
device_status.InsectSpecies = 0;
|
|
device_status.InsectSpecies = 0;
|
|
|
device_status.Power_Type = 0;
|
|
device_status.Power_Type = 0;
|
|
|
sprintf(device_status.deviceId,"0");
|
|
sprintf(device_status.deviceId,"0");
|
|
|
sprintf(device_status.driver, "%s",VERSION);
|
|
sprintf(device_status.driver, "%s",VERSION);
|
|
|
-
|
|
|
|
|
rt_sprintf(device_status.tempture, "-15");
|
|
rt_sprintf(device_status.tempture, "-15");
|
|
|
rt_sprintf(device_status.humidity, "31");
|
|
rt_sprintf(device_status.humidity, "31");
|
|
|
rt_sprintf(device_status.mqttcfg1, "8.136.98.49");
|
|
rt_sprintf(device_status.mqttcfg1, "8.136.98.49");
|
|
@@ -1050,27 +978,13 @@ void Check_ParamConfig(void)
|
|
|
ef_set_env_blob("stopBar", &device_status.stopBar, sizeof(device_status.stopBar));
|
|
ef_set_env_blob("stopBar", &device_status.stopBar, sizeof(device_status.stopBar));
|
|
|
ef_set_env_blob("timeSwitch", &device_status.timeSwitch, sizeof(device_status.timeSwitch));
|
|
ef_set_env_blob("timeSwitch", &device_status.timeSwitch, sizeof(device_status.timeSwitch));
|
|
|
ef_set_env_blob("sunBar", &device_status.sunBar, sizeof(device_status.sunBar));
|
|
ef_set_env_blob("sunBar", &device_status.sunBar, sizeof(device_status.sunBar));
|
|
|
- ef_set_env_blob("jtime", &device_status.heattime, sizeof(device_status.heattime));
|
|
|
|
|
- ef_set_env_blob("jheat", &device_status.heatvalue, sizeof(device_status.heatvalue));
|
|
|
|
|
ef_set_env_blob("tph", &device_status.tph, sizeof(device_status.tph));
|
|
ef_set_env_blob("tph", &device_status.tph, sizeof(device_status.tph));
|
|
|
ef_set_env_blob("tpl", &device_status.tpl, sizeof(device_status.tpl));
|
|
ef_set_env_blob("tpl", &device_status.tpl, sizeof(device_status.tpl));
|
|
|
- ef_set_env_blob("shake_ws", &device_status.shake_ws, sizeof(device_status.shake_ws)); //震动开关
|
|
|
|
|
- ef_set_env_blob("shake_sec", &device_status.shake_sec, sizeof(device_status.shake_sec)); //震动时间
|
|
|
|
|
ef_set_env_blob("thsp", &device_status.thsp, sizeof(device_status.thsp));
|
|
ef_set_env_blob("thsp", &device_status.thsp, sizeof(device_status.thsp));
|
|
|
ef_set_env_blob("passWord", &device_status.passWord,sizeof(device_status.passWord));
|
|
ef_set_env_blob("passWord", &device_status.passWord,sizeof(device_status.passWord));
|
|
|
ef_set_env_blob("dattim",&device_status.dattim,sizeof(device_status.dattim)); //上传时间
|
|
ef_set_env_blob("dattim",&device_status.dattim,sizeof(device_status.dattim)); //上传时间
|
|
|
ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
- ef_set_env_blob("env_t",&device_status.tempture,sizeof(device_status.tempture)); //温度
|
|
|
|
|
- ef_set_env_blob("env_h",&device_status.humidity,sizeof(device_status.humidity)); //湿度
|
|
|
|
|
ef_set_env_blob("platform",&device_status.mqttcfg1,sizeof(device_status.mqttcfg1)); //上传平台
|
|
ef_set_env_blob("platform",&device_status.mqttcfg1,sizeof(device_status.mqttcfg1)); //上传平台
|
|
|
-
|
|
|
|
|
- ef_set_env_blob("cul_time",&device_status.cul_time,sizeof(device_status.cul_time)); //采集时间
|
|
|
|
|
- ef_set_env_blob("cold_sw",&device_status.cold_sw,sizeof(device_status.cold_sw)); //制冷开关
|
|
|
|
|
- ef_set_env_blob("heat_sw",&device_status.heat_sw,sizeof(device_status.heat_sw)); //加热开关
|
|
|
|
|
- ef_set_env_blob("collecting_sh1",&device_status.collecting_sh1,sizeof(device_status.collecting_sh1)); //风机开关
|
|
|
|
|
- ef_set_env_blob("collecting_eh1",&device_status.collecting_eh1,sizeof(device_status.collecting_eh1)); //采集时间
|
|
|
|
|
- ef_set_env_blob("collecting_sh2",&device_status.collecting_sh2,sizeof(device_status.collecting_sh2)); //采集时间
|
|
|
|
|
- ef_set_env_blob("collecting_eh2",&device_status.collecting_eh2,sizeof(device_status.collecting_eh2)); //采集时间
|
|
|
|
|
ef_set_env_blob("run_sta", &device_status.run_sta, sizeof(device_status.run_sta)); //
|
|
ef_set_env_blob("run_sta", &device_status.run_sta, sizeof(device_status.run_sta)); //
|
|
|
ef_set_env_blob("InsectSpecies", &device_status.InsectSpecies, sizeof(device_status.InsectSpecies)); //昆虫种类
|
|
ef_set_env_blob("InsectSpecies", &device_status.InsectSpecies, sizeof(device_status.InsectSpecies)); //昆虫种类
|
|
|
ef_set_env_blob("Power_Type", &device_status.Power_Type, sizeof(device_status.Power_Type)); //供电类型
|
|
ef_set_env_blob("Power_Type", &device_status.Power_Type, sizeof(device_status.Power_Type)); //供电类型
|
|
@@ -1079,7 +993,6 @@ void Check_ParamConfig(void)
|
|
|
LOG_I("SOFTWARE VERSION:%s",device_status.driver);
|
|
LOG_I("SOFTWARE VERSION:%s",device_status.driver);
|
|
|
LOG_I("Default paramconf is:");
|
|
LOG_I("Default paramconf is:");
|
|
|
LOG_I("clt_time:%d",device_status.iSave);
|
|
LOG_I("clt_time:%d",device_status.iSave);
|
|
|
- LOG_I("cul_time:%d",device_status.cul_time);
|
|
|
|
|
LOG_I("startBar:%d",device_status.startBar);
|
|
LOG_I("startBar:%d",device_status.startBar);
|
|
|
LOG_I("stopBar:%d",device_status.stopBar);
|
|
LOG_I("stopBar:%d",device_status.stopBar);
|
|
|
LOG_I("timeSwitch:%d",device_status.timeSwitch);
|
|
LOG_I("timeSwitch:%d",device_status.timeSwitch);
|
|
@@ -1100,10 +1013,6 @@ void Check_ParamConfig(void)
|
|
|
ef_get_env_blob("stopBar", &device_status.stopBar, sizeof(device_status.stopBar), NULL); //结束时间
|
|
ef_get_env_blob("stopBar", &device_status.stopBar, sizeof(device_status.stopBar), NULL); //结束时间
|
|
|
ef_get_env_blob("timeSwitch", &device_status.timeSwitch, sizeof(device_status.timeSwitch), NULL); //模式
|
|
ef_get_env_blob("timeSwitch", &device_status.timeSwitch, sizeof(device_status.timeSwitch), NULL); //模式
|
|
|
ef_get_env_blob("sunBar", &device_status.sunBar, sizeof(device_status.sunBar), NULL); //光控时间
|
|
ef_get_env_blob("sunBar", &device_status.sunBar, sizeof(device_status.sunBar), NULL); //光控时间
|
|
|
- ef_get_env_blob("jtime", &device_status.heattime, sizeof(device_status.heattime), NULL); //加热时间
|
|
|
|
|
- ef_get_env_blob("jheat", &device_status.heatvalue, sizeof(device_status.heatvalue), NULL); //加热温度
|
|
|
|
|
- ef_get_env_blob("shake_ws", &device_status.shake_ws, sizeof(device_status.shake_ws), NULL); //震动开关
|
|
|
|
|
- ef_get_env_blob("shake_sec", &device_status.shake_sec, sizeof(device_status.shake_sec), NULL); //震动时间
|
|
|
|
|
ef_get_env_blob("tph", &device_status.tph, sizeof(device_status.tph), NULL); //高温保护
|
|
ef_get_env_blob("tph", &device_status.tph, sizeof(device_status.tph), NULL); //高温保护
|
|
|
ef_get_env_blob("tpl", &device_status.tpl, sizeof(device_status.tpl), NULL); //低温保护
|
|
ef_get_env_blob("tpl", &device_status.tpl, sizeof(device_status.tpl), NULL); //低温保护
|
|
|
ef_get_env_blob("dattim", &device_status.dattim, sizeof(device_status.dattim), NULL); //数据上传间隔
|
|
ef_get_env_blob("dattim", &device_status.dattim, sizeof(device_status.dattim), NULL); //数据上传间隔
|
|
@@ -1116,24 +1025,13 @@ void Check_ParamConfig(void)
|
|
|
ef_get_env_blob("ds",&device_status.ds,sizeof(device_status.ds),NULL); //开关机状态
|
|
ef_get_env_blob("ds",&device_status.ds,sizeof(device_status.ds),NULL); //开关机状态
|
|
|
ef_get_env_blob("env_t",&device_status.tempture,sizeof(device_status.tempture),NULL); //环境温度
|
|
ef_get_env_blob("env_t",&device_status.tempture,sizeof(device_status.tempture),NULL); //环境温度
|
|
|
ef_get_env_blob("env_h",&device_status.humidity,sizeof(device_status.humidity),NULL); //环境湿度
|
|
ef_get_env_blob("env_h",&device_status.humidity,sizeof(device_status.humidity),NULL); //环境湿度
|
|
|
- ef_get_env_blob("json_w_clock",&device_status.json_w_clock,sizeof(device_status.json_w_clock),NULL); //时间
|
|
|
|
|
- ef_get_env_blob("json_w_reset",&device_status.json_w_reset,sizeof(device_status.json_w_reset),NULL); //重置
|
|
|
|
|
- ef_get_env_blob("json_w_platform",&device_status.json_w_platform,sizeof(device_status.json_w_platform),NULL);//平台
|
|
|
|
|
ef_get_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type),NULL); //版本类型
|
|
ef_get_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type),NULL); //版本类型
|
|
|
ef_get_env_blob("driver_bl",&device_status.driver_bl,sizeof(device_status.driver_bl),NULL); //BL版本号 进BL的时候存储到FLASH
|
|
ef_get_env_blob("driver_bl",&device_status.driver_bl,sizeof(device_status.driver_bl),NULL); //BL版本号 进BL的时候存储到FLASH
|
|
|
ef_get_env_blob("platform",&device_status.mqttcfg1,sizeof(device_status.mqttcfg1),NULL); //平台地址
|
|
ef_get_env_blob("platform",&device_status.mqttcfg1,sizeof(device_status.mqttcfg1),NULL); //平台地址
|
|
|
- /*孢子仪*/
|
|
|
|
|
- ef_get_env_blob("cul_time",&device_status.cul_time,sizeof(device_status.cul_time),NULL); //培养时间
|
|
|
|
|
- ef_get_env_blob("cold_sw",&device_status.cold_sw,sizeof(device_status.cold_sw),NULL); //制冷开关
|
|
|
|
|
- ef_get_env_blob("heat_sw",&device_status.heat_sw,sizeof(device_status.heat_sw),NULL); //加热开关
|
|
|
|
|
- ef_get_env_blob("collecting_sh1",&device_status.collecting_sh1,sizeof(device_status.collecting_sh1),NULL); //采集开始1
|
|
|
|
|
- ef_get_env_blob("collecting_eh1",&device_status.collecting_eh1,sizeof(device_status.collecting_eh1),NULL); //采集结束1
|
|
|
|
|
- ef_get_env_blob("collecting_sh2",&device_status.collecting_sh2,sizeof(device_status.collecting_sh2),NULL); //采集开始2
|
|
|
|
|
- ef_get_env_blob("collecting_eh2",&device_status.collecting_eh2,sizeof(device_status.collecting_eh2),NULL); //采集结束2
|
|
|
|
|
ef_get_env_blob("run_sta",&device_status.run_sta,sizeof(device_status.run_sta),NULL); //运行状态
|
|
ef_get_env_blob("run_sta",&device_status.run_sta,sizeof(device_status.run_sta),NULL); //运行状态
|
|
|
ef_get_env_blob("InsectSpecies",&device_status.InsectSpecies,sizeof(device_status.InsectSpecies),NULL); //昆虫种类
|
|
ef_get_env_blob("InsectSpecies",&device_status.InsectSpecies,sizeof(device_status.InsectSpecies),NULL); //昆虫种类
|
|
|
- ef_get_env_blob("Power_Type",&device_status.Power_Type,sizeof(device_status.Power_Type),NULL); //昆虫种类
|
|
|
|
|
- ef_get_env_blob("deviceId",&device_status.deviceId,sizeof(device_status.deviceId),NULL); //昆虫种类
|
|
|
|
|
|
|
+ ef_get_env_blob("Power_Type",&device_status.Power_Type,sizeof(device_status.Power_Type),NULL); //昆虫种类
|
|
|
|
|
+ ef_get_env_blob("deviceId",&device_status.deviceId,sizeof(device_status.deviceId),NULL); //昆虫种类
|
|
|
ef_get_env_blob("sleep_mode",&device_status.sleep_mode,sizeof(device_status.sleep_mode),NULL); //休眠开关
|
|
ef_get_env_blob("sleep_mode",&device_status.sleep_mode,sizeof(device_status.sleep_mode),NULL); //休眠开关
|
|
|
device_status.light_over_tim = device_status.sunBar * 3600; //光控计数
|
|
device_status.light_over_tim = device_status.sunBar * 3600; //光控计数
|
|
|
device_status.work_done = 0;
|
|
device_status.work_done = 0;
|
|
@@ -1142,11 +1040,9 @@ void Check_ParamConfig(void)
|
|
|
{
|
|
{
|
|
|
device_status.dattim = 10;
|
|
device_status.dattim = 10;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
device_status.dtype = 8;
|
|
device_status.dtype = 8;
|
|
|
device_status.version_type = 8;
|
|
device_status.version_type = 8;
|
|
|
rt_sprintf(device_status.driver, "%s",VERSION);
|
|
rt_sprintf(device_status.driver, "%s",VERSION);
|
|
|
-
|
|
|
|
|
if(device_status.Power_Type>1) device_status.Power_Type = 0;
|
|
if(device_status.Power_Type>1) device_status.Power_Type = 0;
|
|
|
|
|
|
|
|
LOG_I("SOFTWARE VERSION:%s-imei:%s--iccid:%s",device_status.driver,device_status.imei,device_status.iccid);
|
|
LOG_I("SOFTWARE VERSION:%s-imei:%s--iccid:%s",device_status.driver,device_status.imei,device_status.iccid);
|
|
@@ -1155,7 +1051,6 @@ void Check_ParamConfig(void)
|
|
|
LOG_I("定时开始时间:%d",device_status.startBar);
|
|
LOG_I("定时开始时间:%d",device_status.startBar);
|
|
|
LOG_I("定时结束时间:%d",device_status.stopBar);
|
|
LOG_I("定时结束时间:%d",device_status.stopBar);
|
|
|
LOG_I("timeSwitch:%d",device_status.timeSwitch);
|
|
LOG_I("timeSwitch:%d",device_status.timeSwitch);
|
|
|
- LOG_I("光控定时时长:%d",device_status.sunBar);
|
|
|
|
|
LOG_I("诱虫时间:%d",device_status.cul_time);
|
|
LOG_I("诱虫时间:%d",device_status.cul_time);
|
|
|
LOG_I("加热温度:%d",device_status.heatvalue);
|
|
LOG_I("加热温度:%d",device_status.heatvalue);
|
|
|
LOG_I("震动开关:%d",device_status.shake_ws);
|
|
LOG_I("震动开关:%d",device_status.shake_ws);
|
|
@@ -1185,11 +1080,10 @@ void Check_ParamConfig(void)
|
|
|
rt_sprintf(device_status.net,"1");
|
|
rt_sprintf(device_status.net,"1");
|
|
|
rt_sprintf(device_status.csq,"0");
|
|
rt_sprintf(device_status.csq,"0");
|
|
|
rt_sprintf(device_status.sim,"1");
|
|
rt_sprintf(device_status.sim,"1");
|
|
|
- ctr_RTU_DTU(ON);
|
|
|
|
|
- ctr_router(ON);
|
|
|
|
|
|
|
+ ctr_RTU_12V(ON); //RTU供电
|
|
|
|
|
+ ctr_router(ON); //路由器供电
|
|
|
Hmi_Fresh();
|
|
Hmi_Fresh();
|
|
|
- Control_clear();
|
|
|
|
|
- Control_heat();
|
|
|
|
|
|
|
+ Check_Self();
|
|
|
dtu_data_play();
|
|
dtu_data_play();
|
|
|
sht30_collect();
|
|
sht30_collect();
|
|
|
|
|
|
|
@@ -1235,14 +1129,14 @@ void Check_ParamConfig(void)
|
|
|
dtu_send_data_start();
|
|
dtu_send_data_start();
|
|
|
Workstatus_check();
|
|
Workstatus_check();
|
|
|
Work_Loop_Task();
|
|
Work_Loop_Task();
|
|
|
-
|
|
|
|
|
|
|
+ Check_gaoya();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void ResetParamDefault(void)
|
|
void ResetParamDefault(void)
|
|
|
{
|
|
{
|
|
|
ctr_router(ON);
|
|
ctr_router(ON);
|
|
|
- ctr_RTU_DTU(ON);
|
|
|
|
|
|
|
+ ctr_RTU_12V(ON);
|
|
|
device_status.dtype = 8;
|
|
device_status.dtype = 8;
|
|
|
device_status.version_type = 8;
|
|
device_status.version_type = 8;
|
|
|
ef_set_env_blob("dtype", &device_status.dtype, sizeof(device_status.dtype));
|
|
ef_set_env_blob("dtype", &device_status.dtype, sizeof(device_status.dtype));
|
|
@@ -1253,44 +1147,36 @@ void ResetParamDefault(void)
|
|
|
device_status.thsp = 300;
|
|
device_status.thsp = 300;
|
|
|
device_status.passWord = 8888;
|
|
device_status.passWord = 8888;
|
|
|
device_status.dattim = 30;
|
|
device_status.dattim = 30;
|
|
|
- device_status.collecting_sh1 = 9;
|
|
|
|
|
- device_status.collecting_eh1 = 10;
|
|
|
|
|
- device_status.collecting_sh2 = 14;
|
|
|
|
|
- device_status.collecting_eh2 = 16;
|
|
|
|
|
device_status.Power_Type = 0;
|
|
device_status.Power_Type = 0;
|
|
|
ef_set_env_blob("Power_Type", &device_status.Power_Type, sizeof(device_status.Power_Type));
|
|
ef_set_env_blob("Power_Type", &device_status.Power_Type, sizeof(device_status.Power_Type));
|
|
|
- if(device_status.dtype==8)
|
|
|
|
|
- {
|
|
|
|
|
- device_status.cul_time = 60; //收集时间
|
|
|
|
|
- ef_set_env_blob("cul_time", &device_status.cul_time, sizeof(device_status.cul_time));
|
|
|
|
|
- device_status.dattim = 30; //数据上传间隔
|
|
|
|
|
- ef_set_env_blob("dattim", &device_status.dattim, sizeof(device_status.dattim)); //数据上传间隔
|
|
|
|
|
-
|
|
|
|
|
- device_status.startBar = 9; //定时开始时间
|
|
|
|
|
- device_status.stopBar = 18; //定时结束时间
|
|
|
|
|
-
|
|
|
|
|
- device_status.heattime = 10; //加热时间
|
|
|
|
|
- device_status.shake_ws = 1; //针对开关
|
|
|
|
|
- device_status.shake_sec = 1; //震动时间1-100ms
|
|
|
|
|
- device_status.sunBar = 8;
|
|
|
|
|
- device_status.tph = 70; //高温保护阈值
|
|
|
|
|
- device_status.tpl = -5; //低温保护阈值
|
|
|
|
|
- device_status.timeSwitch = 1; //定时模式:时控
|
|
|
|
|
- device_status.heatvalue=100; //加热温度
|
|
|
|
|
- device_status.sleep_mode = 0;
|
|
|
|
|
- ef_set_env_blob("sleep_mode", &device_status.sleep_mode, sizeof(device_status.sleep_mode));
|
|
|
|
|
- ef_set_env_blob("cul_time", &device_status.cul_time, sizeof(device_status.cul_time));
|
|
|
|
|
- ef_set_env_blob("startBar", &device_status.startBar, sizeof(device_status.startBar));
|
|
|
|
|
- ef_set_env_blob("stopBar", &device_status.stopBar, sizeof(device_status.stopBar));
|
|
|
|
|
- ef_set_env_blob("timeSwitch", &device_status.timeSwitch, sizeof(device_status.timeSwitch));
|
|
|
|
|
- ef_set_env_blob("sunBar", &device_status.sunBar, sizeof(device_status.sunBar));
|
|
|
|
|
- ef_set_env_blob("jtime", &device_status.heattime, sizeof(device_status.heattime));
|
|
|
|
|
- ef_set_env_blob("jheat", &device_status.heatvalue, sizeof(device_status.heatvalue));
|
|
|
|
|
- ef_set_env_blob("tph", &device_status.tph, sizeof(device_status.tph));
|
|
|
|
|
- ef_set_env_blob("tpl", &device_status.tpl, sizeof(device_status.tpl));
|
|
|
|
|
- ef_set_env_blob("shake_ws", &device_status.shake_ws, sizeof(device_status.shake_ws)); //震动开关
|
|
|
|
|
- ef_set_env_blob("shake_sec", &device_status.shake_sec, sizeof(device_status.shake_sec)); //震动时间
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
+ device_status.cul_time = 60; //收集时间
|
|
|
|
|
+ ef_set_env_blob("cul_time", &device_status.cul_time, sizeof(device_status.cul_time));
|
|
|
|
|
+ device_status.dattim = 30; //数据上传间隔
|
|
|
|
|
+ ef_set_env_blob("dattim", &device_status.dattim, sizeof(device_status.dattim)); //数据上传间隔
|
|
|
|
|
+
|
|
|
|
|
+ device_status.startBar = 9; //定时开始时间
|
|
|
|
|
+ device_status.stopBar = 18; //定时结束时间
|
|
|
|
|
+
|
|
|
|
|
+ device_status.heattime = 10; //加热时间
|
|
|
|
|
+
|
|
|
|
|
+ device_status.sunBar = 8;
|
|
|
|
|
+ device_status.tph = 70; //高温保护阈值
|
|
|
|
|
+ device_status.tpl = -5; //低温保护阈值
|
|
|
|
|
+ device_status.timeSwitch = 1; //定时模式:时控
|
|
|
|
|
+ device_status.heatvalue=100; //加热温度
|
|
|
|
|
+ device_status.sleep_mode = 0;
|
|
|
|
|
+ ef_set_env_blob("sleep_mode", &device_status.sleep_mode, sizeof(device_status.sleep_mode));
|
|
|
|
|
+ ef_set_env_blob("cul_time", &device_status.cul_time, sizeof(device_status.cul_time));
|
|
|
|
|
+ ef_set_env_blob("startBar", &device_status.startBar, sizeof(device_status.startBar));
|
|
|
|
|
+ ef_set_env_blob("stopBar", &device_status.stopBar, sizeof(device_status.stopBar));
|
|
|
|
|
+ ef_set_env_blob("timeSwitch", &device_status.timeSwitch, sizeof(device_status.timeSwitch));
|
|
|
|
|
+ ef_set_env_blob("sunBar", &device_status.sunBar, sizeof(device_status.sunBar));
|
|
|
|
|
+ ef_set_env_blob("jtime", &device_status.heattime, sizeof(device_status.heattime));
|
|
|
|
|
+ ef_set_env_blob("jheat", &device_status.heatvalue, sizeof(device_status.heatvalue));
|
|
|
|
|
+ ef_set_env_blob("tph", &device_status.tph, sizeof(device_status.tph));
|
|
|
|
|
+ ef_set_env_blob("tpl", &device_status.tpl, sizeof(device_status.tpl));
|
|
|
|
|
+
|
|
|
|
|
|
|
|
ef_set_env_blob("ds", &device_status.ds, sizeof(device_status.ds));
|
|
ef_set_env_blob("ds", &device_status.ds, sizeof(device_status.ds));
|
|
|
ef_set_env_blob("thsp", &device_status.thsp, sizeof(device_status.thsp));
|
|
ef_set_env_blob("thsp", &device_status.thsp, sizeof(device_status.thsp));
|
|
@@ -1303,7 +1189,7 @@ void ResetParamDefault(void)
|
|
|
void ResetParamDefault_DC(void)
|
|
void ResetParamDefault_DC(void)
|
|
|
{
|
|
{
|
|
|
ctr_router(ON);
|
|
ctr_router(ON);
|
|
|
- ctr_RTU_DTU(ON);
|
|
|
|
|
|
|
+ ctr_RTU_12V(ON);
|
|
|
device_status.dtype = 8;
|
|
device_status.dtype = 8;
|
|
|
device_status.version_type = 8;
|
|
device_status.version_type = 8;
|
|
|
ef_set_env_blob("dtype", &device_status.dtype, sizeof(device_status.dtype));
|
|
ef_set_env_blob("dtype", &device_status.dtype, sizeof(device_status.dtype));
|
|
@@ -1322,11 +1208,7 @@ void ResetParamDefault_DC(void)
|
|
|
device_status.heattime = 10; //加热时间
|
|
device_status.heattime = 10; //加热时间
|
|
|
device_status.shake_ws = 1; //针对开关
|
|
device_status.shake_ws = 1; //针对开关
|
|
|
device_status.shake_sec = 1; //震动时间1-100ms
|
|
device_status.shake_sec = 1; //震动时间1-100ms
|
|
|
- #if LAMP_EN == 1
|
|
|
|
|
- device_status.sunBar = 3; //光控定时时长
|
|
|
|
|
- #else
|
|
|
|
|
device_status.sunBar = 4;
|
|
device_status.sunBar = 4;
|
|
|
- #endif
|
|
|
|
|
device_status.Power_Type = 1;
|
|
device_status.Power_Type = 1;
|
|
|
device_status.tph = 70; //高温保护阈值
|
|
device_status.tph = 70; //高温保护阈值
|
|
|
device_status.tpl = -5; //低温保护阈值
|
|
device_status.tpl = -5; //低温保护阈值
|