对一二代功能进行进一步划分
authorazao <821478748@qq.com>
Mon, 22 Dec 2025 08:05:58 +0000 (16:05 +0800)
committerazao <821478748@qq.com>
Mon, 22 Dec 2025 08:05:58 +0000 (16:05 +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/main_init.py
2.sdk/project/7PIN_1_5/sdk/services/microPython/ports/quectel/core/protocol.py

index 0c6e485..4715c1a 100644 (file)
@@ -3218,6 +3218,11 @@ class AI_VC(Abstract):
                                             self.ota_update_notice =data["data"]["ota_update_notice"]
                                             EventMesh.publish("set_storage_config",["ota_update_notice",self.ota_update_notice])
                                             print("配置ota_update_notice成功")
+                                        if "VC_TTS_volume" in data["data"]:
+                                            self.VC_TTS_volume =data["data"]["VC_TTS_volume"]
+                                            EventMesh.publish("set_storage_config",["VC_TTS_volume",self.VC_TTS_volume])
+                                            print("配置VC_TTS_volume成功")
+                                            
                     except Exception as e:
                             usys.print_exception(e)
             else:
@@ -4243,7 +4248,8 @@ class AI_VC(Abstract):
                             EventMesh.publish("open_led_blue")
                         elif jsload_data["event"] == "asr.result" :#asr结果
                             self.AI_ASR_str = jsload_data["payload"]["content"]
-                            
+                            if self.AI_ASR_str == "":#没识别到
+                                self.AI_TTS_str = "我没听清,请再说一遍"
                             EventMesh.publish("open_led_blue")
                         elif jsload_data["event"] == "asr.completed" :#asr 终止的标识 
                             print("self.commands_mode:{}".format(self.commands_mode))
index 40e3f61..fe9941c 100644 (file)
@@ -5,7 +5,8 @@ import machine
 import EventMesh
 import usys
 
-    
+dev_type = "7PIN"#柒牌1代  
+# dev_type = "7PIN_1_5"#柒牌1.5代  
 resp=bytearray(50)
 # atcmd.sendSync('AT+log=52,1\r\n',resp,'',200)
 # EventMesh.debug_log("AT+log=52,1:{}".format(resp))
@@ -209,53 +210,52 @@ def main_init():
             app.append_manager(pro.IOTWebLocationManager())
             app.append_manager(pro.sosInfoCallManager())
             pcr = pro.ProtoColResolver()
-            pcr.add_support(pro.IOTWeb_HRProtoCol())
-            pcr.add_support(pro.IOTWeb_LocateNowProtoCol())
-            pcr.add_support(pro.IOTWeb_post_sosProtoCol())
-            pcr.add_support(pro.IOTWeb_post_device_stateProtoCol())
-            pcr.add_support(pro.IOTWeb_post_alarmProtoCol())
-            pcr.add_support(pro.IOTWeb_post_scheduleProtoCol())
-            pcr.add_support(pro.IOTWeb_post_locationProtoCol())
-            pcr.add_support(pro.IOTWeb_locatedurationProtoCol())
-            pcr.add_support(pro.IOTWeb_FindDeviceProtoCol())
-            # pcr.add_support(pro.IOTWeb_alarm_configProtoCol())
-            pcr.add_support(pro.IOTWeb_alarm_listProtoCol())
-            pcr.add_support(pro.IOTWeb_sos_listProtoCol())
+            if dev_type == "7PIN_1_5":#二代专属功能
+                pcr.add_support(pro.IOTWeb_HRProtoCol())
+                pcr.add_support(pro.IOTWeb_LocateNowProtoCol())
+                pcr.add_support(pro.IOTWeb_post_sosProtoCol())
+                pcr.add_support(pro.IOTWeb_post_device_stateProtoCol())
+                pcr.add_support(pro.IOTWeb_post_alarmProtoCol())
+                pcr.add_support(pro.IOTWeb_post_scheduleProtoCol())
+                pcr.add_support(pro.IOTWeb_post_locationProtoCol())
+                pcr.add_support(pro.IOTWeb_locatedurationProtoCol())
+                pcr.add_support(pro.IOTWeb_FindDeviceProtoCol())
+                # pcr.add_support(pro.IOTWeb_alarm_configProtoCol())
+                pcr.add_support(pro.IOTWeb_alarm_listProtoCol())
+                pcr.add_support(pro.IOTWeb_sos_listProtoCol())
+                pcr.add_support(pro.IOTWeb_sos_configProtoCol())
+                pcr.add_support(pro.IOTWeb_get_ringtoneProtoCol())
+                pcr.add_support(pro.IOTWeb_voice_recordProtoCol())
+                pcr.add_support(pro.IOTWeb_text_msgProtoCol())
+                pcr.add_support(pro.IOTWeb_scheduleProtoCol())
+                pcr.add_support(pro.IOTWeb_switch_bt_stateProtoCol())
+                pcr.add_support(pro.IOTWeb_bt_scanProtoCol())
+                pcr.add_support(pro.IOTWeb_bt_scan_restProtoCol())
+                pcr.add_support(pro.IOTWeb_ringtone_listProtoCol())
+                pcr.add_support(pro.IOTWeb_connect_btProtoCol())
+                pcr.add_support(pro.IOTWeb_disconnect_btProtoCol())
+                pcr.add_support(pro.IOTWeb_get_bt_stateProtoCol())
+                pcr.add_support(pro.IOTWeb_put_voice_msg_stateProtoCol())
+                pcr.add_support(pro.IOTWeb_new_voice_msg_listProtoCol())
+                pcr.add_support(pro.IOTWeb_get_new_voice_msgProtoCol())
+                pcr.add_support(pro.IOTWeb_find_new_voice_msgProtoCol())
+                pcr.add_support(pro.IOTWeb_new_voice_msgProtoCol())
+                pcr.add_support(pro.IOTWeb_get_bt_connect_record_listProtoCol())
+                pcr.add_support(pro.IOTWeb_bt_connect_record_listProtoCol())
+                pcr.add_support(pro.IOTWeb_fence_sosProtoCol())
+                pcr.add_support(pro.IOTWeb_player_controlProtoCol())
+                pcr.add_support(pro.IOTWeb_post_bt_connect_restProtoCol())
+                pcr.add_support(pro.IOTWeb_play_MusicProtoCol())
+                pcr.add_support(pro.IOTWeb_play_trans_TTSProtoCol())#播放下发翻译音频
+                pcr.add_support(pro.IOTWeb_come_transProtoCol())#接收小程序控制进入翻译
+                pcr.add_support(pro.IOTWeb_exit_transProtoCol())#接收小程序控制退出翻译
+                pcr.add_support(pro.IOTWeb_appcontrol_meetProtoCol())#接收小程序控制进入会议
             pcr.add_support(pro.IOTWeb_volumeProtoCol())
-            pcr.add_support(pro.IOTWeb_sos_configProtoCol())
-            pcr.add_support(pro.IOTWeb_get_ringtoneProtoCol())
-            pcr.add_support(pro.IOTWeb_voice_recordProtoCol())
-            pcr.add_support(pro.IOTWeb_text_msgProtoCol())
-            pcr.add_support(pro.IOTWeb_scheduleProtoCol())
-            pcr.add_support(pro.IOTWeb_switch_bt_stateProtoCol())
-            pcr.add_support(pro.IOTWeb_bt_scanProtoCol())
-            pcr.add_support(pro.IOTWeb_bt_scan_restProtoCol())
-            pcr.add_support(pro.IOTWeb_ringtone_listProtoCol())
-            pcr.add_support(pro.IOTWeb_connect_btProtoCol())
-            pcr.add_support(pro.IOTWeb_disconnect_btProtoCol())
-
-
-            pcr.add_support(pro.IOTWeb_get_bt_stateProtoCol())
-            pcr.add_support(pro.IOTWeb_put_voice_msg_stateProtoCol())
-            pcr.add_support(pro.IOTWeb_new_voice_msg_listProtoCol())
-            pcr.add_support(pro.IOTWeb_get_new_voice_msgProtoCol())
-            pcr.add_support(pro.IOTWeb_find_new_voice_msgProtoCol())
-            pcr.add_support(pro.IOTWeb_new_voice_msgProtoCol())
-            pcr.add_support(pro.IOTWeb_get_bt_connect_record_listProtoCol())
-            pcr.add_support(pro.IOTWeb_bt_connect_record_listProtoCol())
-            pcr.add_support(pro.IOTWeb_fence_sosProtoCol())
-            pcr.add_support(pro.IOTWeb_player_controlProtoCol())
             pcr.add_support(pro.IOTWeb_chat_configProtoCol())
             pcr.add_support(pro.IOTWeb_get_chat_configProtoCol())
-            pcr.add_support(pro.IOTWeb_post_bt_connect_restProtoCol())
             pcr.add_support(pro.IOTWeb_unbind_devProtoCol())
             pcr.add_support(pro.IOTWeb_user_unbind_devProtoCol())
-            pcr.add_support(pro.IOTWeb_play_MusicProtoCol())
             pcr.add_support(pro.IOTWeb_Nlp_ConfigProtoCol())
-            pcr.add_support(pro.IOTWeb_play_trans_TTSProtoCol())#播放下发翻译音频
-            pcr.add_support(pro.IOTWeb_come_transProtoCol())#接收小程序控制进入翻译
-            pcr.add_support(pro.IOTWeb_exit_transProtoCol())#接收小程序控制退出翻译
-            pcr.add_support(pro.IOTWeb_appcontrol_meetProtoCol())#接收小程序控制进入会议
             sm = pro.SockMangager()
 
             sm.add_support_resolver(pcr)
index d2a7ac0..e64e7d2 100644 (file)
@@ -25,6 +25,8 @@ import umqtt
 import modem
 SHA256 = uhashlib.sha256
 import SecureData
+dev_type = "7PIN"#柒牌1代  
+# dev_type = "7PIN_1_5"#柒牌1.5代  
 def server_init(server_type = None):
     #服务器选择1,防走丢,2大锤,3三基同创,4童信,5云米,6荣为 8:ds未知 dey.hinwatch. com:9968  9:183.62.239.121:31869 10:183.62.239.121:33461
     if server_type == None:
@@ -1903,16 +1905,17 @@ class SockMangager(Abstract):
         if self.send_device_time < DEFIEN_LOCATION_REPORT_TIME : #上电初始化上报一次设备状态信息
             self.send_device_time+=DEFINE_TIME_COUNT
         else:
-            if self.get_voice_new_msginit == 0: #开机获取一次语音未读消息
+            if self.get_voice_new_msginit == 0: 
                 self.get_voice_new_msginit=1
                 EventMesh.publish("publish_AI_btnInfo",{"func":self.hr_report_publish_event,"data":0}) 
                 device_state=EventMesh.publish("GET_IOT_WEB_SEND_CMD",WEB_CMD_ENUM.POST_DEVICE_STATE_S_CMD)
                 print("device_state{}".format(device_state))
                 EventMesh.publish(WEB_CMD_ENUM.POST_DEVICE_STATE_S_CMD,device_state) #上报设备状态
-                EventMesh.publish("set_open_device",1)
-                EventMesh.publish("set_history_voice_flag",1)
-                EventMesh.publish("set_wait_voice_flag",1)
-                EventMesh.publish(WEB_CMD_ENUM.GET_NEW_VOICE_MSG_S)#向IOT获取语音未读消息
+                if dev_type == "7PIN_1_5":#二代开机获取留言
+                    EventMesh.publish("set_open_device",1)
+                    EventMesh.publish("set_history_voice_flag",1)
+                    EventMesh.publish("set_wait_voice_flag",1)
+                    EventMesh.publish(WEB_CMD_ENUM.GET_NEW_VOICE_MSG_S)#向IOT获取语音未读消息
             
         
         # http://220.160.104.34:30800/ws-bus/test/voice-record/876226211472149?state=1,
@@ -2683,11 +2686,13 @@ def ai_cmd_handle(cmd):
         tts_play_str = "语速已经" + volume
         EventMesh.publish("play_tts",[tts_play_str,0])
     elif "会议纪要" in cmd:#当指令中有会议纪要时,进入会议纪要模式
-        print("cmd:已进入会议")
-        EventMesh.publish("come_meet_mode")#进入会议纪要
+        if dev_type == "7PIN_1_5":
+            print("cmd:已进入会议")
+            EventMesh.publish("come_meet_mode")#进入会议纪要
     elif "翻译" in cmd:#当指令中有翻译时,进入AI翻译模式
-        print("cmd:已进入翻译")
-        EventMesh.publish("come_trans_mode")#进入AI翻译纪要
+        if dev_type == "7PIN_1_5":
+            print("cmd:已进入翻译")
+            EventMesh.publish("come_trans_mode")#进入AI翻译纪要
     elif "声音改为" in cmd:#当指令中有声音改为时,进入音色修改
         voice_start_index = cmd.index("声音改为") + len("声音改为")#动态判断截取部分
         find = cmd[voice_start_index:]#查询截取
@@ -2714,11 +2719,12 @@ def ai_cmd_handle(cmd):
             EventMesh.publish("play_tts",[tts_play_str,0])
             
     elif "查看历史留言" in cmd :#当指令中有查看历史留言时,调用历史留言接口
-        EventMesh.publish(WEB_CMD_ENUM.GET_NEW_VOICE_MSG_S)
-        EventMesh.publish("set_history_voice_flag",1)#修改标志位
-        EventMesh.publish("clean_unread_vocie")#清空未读多条一起下发记录   
-        EventMesh.publish("set_storage_config",["is_noread_voice",0])
-        pass
+        if dev_type == "7PIN_1_5":
+            EventMesh.publish(WEB_CMD_ENUM.GET_NEW_VOICE_MSG_S)
+            EventMesh.publish("set_history_voice_flag",1)#修改标志位
+            EventMesh.publish("clean_unread_vocie")#清空未读多条一起下发记录   
+            EventMesh.publish("set_storage_config",["is_noread_voice",0])
+            pass
     elif "语速倍速设置为:" in cmd:#修改对话模式
         voice_start_index = cmd.index("语速倍速设置为:") + len("语速倍速设置为:")#动态判断截取部分
         find = cmd[voice_start_index:]#查询截取