zhunk 8 месяцев назад
Родитель
Сommit
207a3a3616

+ 2 - 1
Application_cbd_apm32f1/applications/control.c

@@ -314,6 +314,7 @@ void WorkTask_XYV3(void)
     LOG_I("工作状态:%d",device_status.work_status);
     LOG_I("开关机状态:%d",device_status.ds);
     LOG_I("温控状态:%d",device_status.temp_status);
+    LOG_I("雨控状态:%d",device_status.rain_status);
     while(device_status.work_status==1&&
             device_status.bat_status==0&&
             device_status.ds==1&&
@@ -333,7 +334,7 @@ void WorkTask_XYV3(void)
                 device_status.photo_ws = 2;
                 cal_n = device_status.cul_time * 60;
             }
-            if(cal_n%60==0)    //每隔1分钟高压通电5S
+            if(cal_n%2==0)    //每隔2S钟高压通电5S
             {
                 ctr_router(ON);
                 ctr_RTU_12V(ON);

+ 2 - 3
Application_cbd_apm32f1/applications/control.h

@@ -20,8 +20,7 @@
 
 ////////////////////////////////////////////////////////////////
 
-#define VERSION  "3.0.1"
-
+#define VERSION  "3.1.3"
 
 extern rt_event_t event_485_play;
 
@@ -180,7 +179,7 @@ typedef struct  _packed
 #define DC_M2 GET_PIN(C,7)
 
 #define SIGNAL_GuangShan GET_PIN(B,5)
-//#define SIGNAL_GuangShan GET_PIN(B,8)
+#define RAIN_POWER GET_PIN(B,8)
 #define LIMIT_FB GET_PIN(B,9)
 /***************************************************************/
 

+ 7 - 16
Application_cbd_apm32f1/applications/dtu_uart2.c

@@ -262,15 +262,6 @@ static void dtu_thread_entry_send(void *parameter)
                 rt_free(readinfo);
                 rt_thread_delay(1000);
                 UpLoad_Data();
-                if(atoi(device_status.fuse_voltage)<1)
-                {
-                    rt_thread_delay(500);
-                    static char res[30];
-                    sprintf(res, "Fuse is fusing:%s",device_status.fuse_voltage);
-                    char * res_fuse_warn = makeJson_Warn(res,"device");
-                    DTU_Write("%s",res_fuse_warn);
-                    rt_free(res_fuse_warn);
-                }
                 device_status.num_updata = device_status.dattim * 60;
                 if(device_status.dattim==0) device_status.dattim=30;   //数据上传时间间隔设置为0?
             }
@@ -1210,13 +1201,13 @@ int parseDtu(char *json_string)
 
                   if(value_commn!=RT_NULL)
                   {
-                      device_status.camsta = value_commn->valueint;
+                      device_status.camera_sta = atoi(value_commn->valuestring);
                   }
                   value_commn = cJSON_GetObjectItem(item_ext,"cpu_tmp");
-                  sprintf(device_status.cpu_temp,"%s",value_commn->valuestring);
                   if(value_commn!=RT_NULL)
                   {
-                      HMI_WRITE("menu.cpu.txt=\"%d.%d\"",atoi(value_commn->valuestring)/1000,atoi(value_commn->valuestring)%1000);
+                      sprintf(device_status.cpu_temp,"%s",value_commn->valuestring);
+                      HMI_WRITE("menu.cpu.txt=\"%s\"",value_commn->valuestring);
                   }
                   if(link_ip!=NULL)
                   {
@@ -1270,10 +1261,10 @@ int parseDtu(char *json_string)
                           }else
                           {
                              timestamp_diff = tv.tv_sec - timestamp;
-                             if(timestamp_diff>1000)   //
-                             {
-                                 setSystemTime(tm_time);
-                             }
+                          }
+                          if(timestamp_diff>1000)   //
+                          {
+                              setSystemTime(tm_time);
                           }
                           if (timestamp_diff<300&&tm_now.tm_year+1900>=2025) {
                              setSystemTime(tm_time);

+ 21 - 7
Application_cbd_apm32f1/applications/hmi.c

@@ -268,13 +268,23 @@ static void HMI_Decode(void)
             //更新下仓门状态
             HMI_WRITE("workSta.downStatus.val=%d",device_status.down_status);
 
-            HMI_WRITE("menu.eth1_sta.val=%d",!device_status.camera_sta);
+            HMI_WRITE("menu.eth1_sta.val=%d",device_status.camera_sta);
             //更新工作状态
             HMI_WRITE("menu.workStatus.val=%d",device_status.work_status);
-            //更新温控状态
-            HMI_WRITE("workSta.tempStatus.val=%d",device_status.temp_status);
+
             //更新雨控状态
-            HMI_WRITE("workSta.rainStatus.val=%d",device_status.rain_status);
+            if(device_status.rain_status){
+                HMI_WRITE("menu.t6.pco=63488");
+            }else{
+                HMI_WRITE("menu.t6.pco=65535");
+            }
+            //更新温控状态
+            if(device_status.temp_status){
+                HMI_WRITE("menu.t5.pco=63488");
+            }else{
+                HMI_WRITE("menu.t5.pco=65535");
+            }
+
             //更新光控状态
             HMI_WRITE("workSta.sunStatus.val=%d",device_status.sun_status);
             //更新有线连接状态
@@ -382,7 +392,7 @@ static void HMI_Decode(void)
         rt_free(takephotojson);
         HMI_WRITE("sysTest.switchPhoto.val=0");
         #else
-        device_status.photo_ws = 1;
+        device_status.photo_ws = 2;
         #endif
     }
     else if (strstr(rx_buffer,"putTest.switchPic=1")!=NULL) {
@@ -394,7 +404,7 @@ static void HMI_Decode(void)
         rt_free(takephotojson);
         HMI_WRITE("sysTest.switchPhoto.val=0");
         #else
-        device_status.photo_ws = 1;
+        device_status.photo_ws = 2;
         #endif
     }
 
@@ -966,6 +976,7 @@ void Check_ParamConfig(void)
         device_status.run_sta = 0;
         device_status.InsectSpecies = 0;
         device_status.Power_Type = 0;
+        device_status.cul_time = 60;
         sprintf(device_status.deviceId,"0");
         sprintf(device_status.driver, "%s",VERSION);
         rt_sprintf(device_status.tempture, "-15");
@@ -973,6 +984,7 @@ void Check_ParamConfig(void)
         rt_sprintf(device_status.mqttcfg1, "8.136.98.49");
         ef_set_env_blob("iSave", &device_status.iSave, sizeof(device_status.iSave));  //
         ef_set_env_blob("ds", &device_status.ds, sizeof(device_status.ds));
+        ef_set_env_blob("cul_time", &device_status.cul_time, sizeof(device_status.cul_time));  //
         ef_set_env_blob("stime", &device_status.clt_time, sizeof(device_status.clt_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));
@@ -1033,7 +1045,9 @@ void Check_ParamConfig(void)
         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("cul_time",&device_status.cul_time,sizeof(device_status.cul_time),NULL);                       //诱虫时间
         device_status.light_over_tim = device_status.sunBar * 3600;                                                 //光控计数
+
         device_status.work_done = 0;
         //工作完成标志位
         if(device_status.dattim==0)
@@ -1044,7 +1058,7 @@ void Check_ParamConfig(void)
         device_status.version_type = 8;
         rt_sprintf(device_status.driver, "%s",VERSION);
         if(device_status.Power_Type>1) device_status.Power_Type = 0;
-
+        if(device_status.clt_time==0) device_status.clt_time = 60;
         LOG_I("SOFTWARE VERSION:%s-imei:%s--iccid:%s",device_status.driver,device_status.imei,device_status.iccid);
         LOG_I("read flash paramconfis:%d-%s-%s",device_status.version_type,device_status.driver_bl,device_status.driver_compile);
         LOG_I("开机次数:%d",device_status.rebootcnt);

+ 3 - 1
Application_cbd_apm32f1/applications/sht30_collect.c

@@ -202,6 +202,7 @@ static void Power_ReadCheck(void *parameter)
     //MovingAverageFilter* filter_hi = moving_average_filter_init(10);
     MovingAverageFilter* filter_v = moving_average_filter_init(10);
     rt_thread_delay(1000);
+    rt_pin_mode(RAIN_POWER, PIN_MODE_OUTPUT);
     while(1)
     {
         rt_uint16_t _24v_current_int = moving_average_filter_update(filter,Read_Real_Current());
@@ -263,7 +264,8 @@ static void Power_ReadCheck(void *parameter)
         //LOG_D("voltage is:%sV",device_status.voltage);
         //sprintf(device_status.fuse_voltage, "%d.%02d",Read_Fuse_Voltage()/100,Read_Fuse_Voltage()%100);
         //LOG_D("高压检测:%d",Read_Fuse_Voltage());
-        rt_thread_mdelay(100);
+        rt_thread_mdelay(500);
+        rt_pin_write(RAIN_POWER,~ON);
     }
 }
 /*读取电流值*/

+ 3 - 3
Application_cbd_apm32f1/packages/syswatch-latest/src/syswatch.c

@@ -408,9 +408,9 @@ static void syswatch_thread_entry(void *parameter)
                 (alarm_new.tm_hour==04) ||
                 (alarm_new.tm_hour==23))
         {
-            if((alarm_new.tm_min==05)&&(alarm_new.tm_sec==0))
+            if((alarm_new.tm_min==05)&&(alarm_new.tm_sec>30))
             {
-                if(alarm_new.tm_year>=2025)
+                if(alarm_new.tm_year+1900>=2025)
                 {
                     ctr_router(OFF);
                     ctr_RTU_12V(OFF);
@@ -422,7 +422,7 @@ static void syswatch_thread_entry(void *parameter)
         //
         if((alarm_new.tm_hour==6) || (alarm_new.tm_hour==7))
         {
-            if((alarm_new.tm_min==0) && (alarm_new.tm_sec==0))
+            if((alarm_new.tm_min==0) && (alarm_new.tm_sec>30))
             {
                 ctr_router(ON);
                 ctr_RTU_12V(ON);

+ 11 - 0
Application_cbd_apm32f1/readme.md

@@ -1,3 +1,14 @@
+# 2026-03-01 更新说明
+	版本:3.1.3
+	1. 修复屏幕触发拍照测试无效;
+	2. 修复修改诱虫时间无效(拍照间隔)无效
+# 2026-02-28 更新说明
+	版本:3.1.2
+	1. 修复诱虫时间错误问题;
+# 2026-02-27 更新说明
+	版本:3.1.1
+1、适配易丰性诱
+2、工作状态高压的开启关闭为每关闭2S,再启动5S
 # 2025-12-08 更新说明
 	版本:3.0.0
 1、基于2.5.9版本项目适配[YF_IO_BOARD V1.0 BYTSX 20251030]