关闭5定时器发送心跳
authordxy <1731678236qq.com>
Thu, 4 Sep 2025 08:19:17 +0000 (16:19 +0800)
committerdxy <1731678236qq.com>
Thu, 4 Sep 2025 08:19:17 +0000 (16:19 +0800)
2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/ai_VC.py
2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/protocol.py

index 07fbbfc..c8640db 100644 (file)
@@ -1380,6 +1380,7 @@ class AI_dev(Abstract):
         EventMesh.publish("publish_AI_btnInfo",{"func":self.AI_dev_timer_event})  
     def AI_dev_timer_event(self):
         #EventMesh.publish("audio_montage_play",["liuliangtishi.mp3"])
+        EventMesh.publish("send_power_init_data")
         if self.is_wdt == 1:
             self.wdt.feed()
         VC_satrt_flag = EventMesh.publish("get_VC_satrt_flag")#获取vc是否在运行
index 51fdf90..f86b5f4 100644 (file)
@@ -984,6 +984,7 @@ class sosInfoCallManager(Abstract):
                             EventMesh.publish("stop_voice_record") #电话优先级最高
                             EventMesh.publish("stop_AI_record")
                             EventMesh.publish("play_tts",[tts_str,1])  #播放tts闹钟文本内容
+                            self.sos_timer1.stop()
                             self.sos_timer1.start(2000, 0, self.phone110112_cb)
                         elif p110 == "1":
                             self.phone110112 = "112"
@@ -991,6 +992,7 @@ class sosInfoCallManager(Abstract):
                             EventMesh.publish("stop_voice_record") #电话优先级最高
                             EventMesh.publish("stop_AI_record")
                             EventMesh.publish("play_tts",[tts_str,1])  #播放tts闹钟文本内容
+                            self.sos_timer1.stop()
                             self.sos_timer1.start(2000, 0, self.phone110112_cb)
             
         else:
@@ -1013,6 +1015,7 @@ class sosInfoCallManager(Abstract):
                 return -1
             else:
                 EventMesh.publish(constants.EVENT.START_LOCATION,WEB_CMD_ENUM.POST_SOS_S_CMD) #开始AL定位
+                self.sos_timer2.stop()
                 self.sos_timer2.start(30000, 0, self.sos_time_out_phone)
         return 1
             
@@ -1041,6 +1044,7 @@ class sosInfoCallManager(Abstract):
             EventMesh.publish("stop_voice_record") #电话优先级最高
             EventMesh.publish("stop_AI_record")
             EventMesh.publish("play_tts",[tts_str,1])  #播放tts闹钟文本内容
+            self.sos_timer1.stop()
             self.sos_timer1.start(2000, 0, self.sos_call_out_phone)
             
             
@@ -1048,7 +1052,7 @@ class sosInfoCallManager(Abstract):
     def sos_time_out_phone(self, msg):#30s超时未打通或者信号不好则重新拨打
         
         if self.sos_flag == 1:
-            if self.call_state == 0 or self.call_state == 3 or self.call_state == 4:
+            if self.call_state == 0:
                 voiceCall.callEnd() #挂断
                 EventMesh.publish("set_sos_info_call") #电话优先级最高
             pass #再次拨打
@@ -1227,8 +1231,8 @@ except Exception as e:
     usys.print_exception(e)
     import ai_alarm as _schedule
 DEFIEN_HR_REPORT_TIME = 5*60
-DEFINE_TIME_COUNT = 5
-DEFIEN_LOCATION_REPORT_TIME = 5
+DEFINE_TIME_COUNT = 10
+DEFIEN_LOCATION_REPORT_TIME = DEFINE_TIME_COUNT
 WEB_CONNECT_MAX_COUNT = 10 #默认重连次数
 class SockMangager(Abstract):
     def __init__(self):
@@ -1310,6 +1314,7 @@ class SockMangager(Abstract):
         EventMesh.subscribe("send_unbind_dev_to_iot",self.send_unbind_dev_to_iot)
         EventMesh.subscribe("set_location_timer",self.set_location_timer)
         EventMesh.subscribe("post_device_state",self.post_device_state)
+        EventMesh.subscribe("send_power_init_data",self.send_power_init_data)
         # count = 0
         # while True:
         #     count += 1
@@ -1572,6 +1577,9 @@ class SockMangager(Abstract):
         self.resolver = resolver
     def hr_report_event(self, *args, **kwargs):
         EventMesh.publish("publish_AI_btnInfo",{"func":self.hr_report_event_cb}) #self.connect_iot_websocket()
+    def send_power_init_data(self,event=None,msg=None):
+        self.hr_report_event_cb()
+
     def hr_report_event_cb(self):
         """电池平均值"""
         temp = Power.getVbatt()
@@ -1592,6 +1600,7 @@ class SockMangager(Abstract):
         if EventMesh.publish("get_sos_flag") != None:
             if EventMesh.publish("get_sos_flag") == 1:
                 EventMesh.publish(constants.EVENT.SYSTEM_UP)#唤醒休眠
+
         EventMesh.publish("AI_alarm_start") #检查是否有闹钟需要提醒
         EventMesh.publish("AI_schedule_open")#检查日程是否需要提醒
         # self.alarm_test()
@@ -1611,7 +1620,6 @@ class SockMangager(Abstract):
                     self.timerLocation+=DEFINE_TIME_COUNT
                     if self.timerLocation >= self.locate_duration:
                         self.timerLocation= 0
-                        
                         EventMesh.publish(constants.EVENT.START_LOCATION,WEB_CMD_ENUM.POST_LOCATION_S_CMD) #定位上报
                 else:
                     self.timerLocation= 0
@@ -1699,7 +1707,7 @@ class SockMangager(Abstract):
                 print("self.iot_protocol_client %d self.start_voice_flag:%d",self.iot_protocol_client,self.start_voice_flag)
                 if self.iot_protocol_client != None:
                     if self.timer_id == 0:
-                        self.hr_report_timer.start(DEFINE_TIME_COUNT*1000, 1, self.hr_report_event)
+                        # self.hr_report_timer.start(DEFINE_TIME_COUNT*1000, 1, self.hr_report_event)
                         self.timer_id=1
             else:
                 print("没有token!!!!!!!!!!")