#dev_type = "7PIN_BK_coze"#k扣子小瑞
#dev_type = "7PIN_BK_EU"#英文小瑞
#dev_type = "7PIN_coze"#柒牌扣子
-# dev_type = "7PIN"#柒牌
-dev_type = "7PIN_1_5"#柒牌1.5
+dev_type = "7PIN"#柒牌
+# dev_type = "7PIN_1_5"#柒牌1.5
#dev_type = 'momo'#食梦貘
#dev_type = 'sjgq'#四季甘泉
#dev_type = 'szbst'#深圳百事通
url = "http://dmp-global.raisound.com/bz-api/dev/time"
else:
url = "https://qipai-dev.dobell.top/qp-dmp-api/dev/time"
+ url = "https://dmp-api.qipai.com/qp-dmp-api/dev/time"
+ # url = "http://dmp.raisound.com/bz-api/dev/time"
response = request.get(url,timeout=5)
data = response.json()
print("dev_NTP:{}".format(data))
url = "http://dmp-global.raisound.com/bz-api/dev/auth/active"
else:
url = "https://qipai-dev.dobell.top/qp-dmp-api/dev/auth/active"
- # url = "http://dmp-dev.raisound.com/bz-api/dev/auth/active"
+ url = "https://dmp-api.qipai.com/qp-dmp-api/dev/auth/active"
+ # url = "http://dmp.raisound.com/bz-api/dev/auth/active"
data =ujson.dumps(data)
response = None
response_result = 0
sign_url = "http://dmp-global.raisound.com/bz-api/dev/auth/sign_in" #登入地址
else:
sign_url = "https://qipai-dev.dobell.top/qp-dmp-api/dev/auth/sign_in" #登入地址
- # sign_url = "http://dmp-dev.raisound.com/bz-api/dev/auth/sign_in" #登入地址
+ sign_url = "https://dmp-api.qipai.com/qp-dmp-api/dev/auth/sign_in"
+ # sign_url = "http://dmp.raisound.com/bz-api/dev/auth/sign_in" #登入地址
#获取验证码
#url = "http://dmp.qipai.com.cn:30461/dev/device/bind-code/860132066060377"
# token = EventMesh.publish("get_dev_token")
url = "http://dmp-global.raisound.com/bz-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid)
else:
url = "https://qipai-dev.dobell.top/qp-dmp-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid)
+ url = "https://dmp-api.qipai.com/qp-dmp-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid)
+ # url = "http://dmp.raisound.com/bz-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid) #北科地址
print("{} H:{}".format(url,headers_T))
response = request.post(url,headers = headers_T)
if response.status_code == 200:
if dev_type == "7PIN_BK_EU":#英文小瑞
dev_tokenip = "http://dmp-global.raisound.com/bz-api/dev/auth/token" #设备新令牌更新地址
else:
- dev_tokenip = "http://dmp-dev.raisound.com/bz-api/dev/auth/token" #设备新令牌更新地址
dev_tokenip = "https://qipai-dev.dobell.top/qp-dmp-api/dev/auth/token" #设备新令牌更新地址
-
+ dev_tokenip = "https://dmp-api.qipai.com/qp-dmp-api/dev/auth/token"
+ # dev_tokenip = "http://dmp.raisound.com/bz-api/dev/auth/token" #设备新令牌更新地址
+
token = self.dev_token
if token == None:
token = ""
# url = "http://ota.qipai.com/bz-cmp-api/api/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
# else:
url = "https://qipai-dev.dobell.top/qp-dmp-api/ota/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
-
+ url = "https://dmp-api.qipai.com/qp-dmp-api/ota/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
print(url)
response = request.get(url,timeout=5)
if response.status_code == 200:
# url = "http://ota.qipai.com/bz-cmp-api/api/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
# else:
url = "https://qipai-dev.dobell.top/qp-dmp-api/ota/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
-
+ url = "https://dmp-api.qipai.com/qp-dmp-api/ota/task?deviceId={}&sourceVersion={}".format(modem.getDevImei(),sourceVersion)
print(url)
response = request.get(url,timeout=5)
if response.status_code == 200:
url =None
if dev_type == "7PIN_BK_EU":#英文小瑞
url = "http://dmp-global.raisound.com/bz-api/ota/result?deviceId={}¤tVersion={}".format(modem.getDevImei(),currentVersion)
- if dev_type == "7PIN" or dev_type == "7PIN_1_5" or dev_type == "7PIN_coze":#柒牌
- url = "http://ota.qipai.com/bz-cmp-api/api/result?deviceId={}¤tVersion={}".format(modem.getDevImei(),currentVersion)
- else:
- url = "https://qipai-dev.dobell.top/qp-dmp-api/ota/result?deviceId={}¤tVersion={}".format(modem.getDevImei(),currentVersion)
+ # if dev_type == "7PIN" or dev_type == "7PIN_1_5" or dev_type == "7PIN_coze":#柒牌
+ # url = "http://ota.qipai.com/bz-cmp-api/api/result?deviceId={}¤tVersion={}".format(modem.getDevImei(),currentVersion)
+ # else:
+ url = "https://qipai-dev.dobell.top/qp-dmp-api/ota/result?deviceId={}¤tVersion={}".format(modem.getDevImei(),currentVersion)
+ url = "https://dmp-api.qipai.com/qp-dmp-api/ota/result?deviceId={}¤tVersion={}".format(modem.getDevImei(),currentVersion)
print(url)
response = request.post(url,timeout=5)
if response.status_code == 200:
url = "http://dmp-global.raisound.com/bz-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid)
else:
url = "https://qipai-dev.dobell.top/qp-dmp-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid)
+ url = "https://dmp-api.qipai.com/qp-dmp-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid)
+ # url = "http://dmp.raisound.com/bz-api/dev/iccid?deviceId={}&iccid={}".format(modem.getDevImei(),iccid) #北科地址
print("{} H:{}".format(url,headers_T))
response = request.post(url,headers = headers_T,timeout=5)
if response.status_code == 200:
self.wait_first_flag = 0#是否进入未读判定(只播报一次)
self.wait_first_timer = osTimer()#如果播放未读留言的时候未读则不要播放了
self.wait_first_cnt = 0
+
+ self.wait_sort = 0#未读留言正在播第几条
EventMesh.subscribe("play_tts",self.play_tts)
EventMesh.subscribe("play_new_voice",self.play_new_voice)
EventMesh.subscribe("play_his_voice",self.play_his_voice)
# self.server_ip="118.145.158.207:22082"
# self.server_ip="118.145.158.207:22080/22087"
#self.server_ip="ai.qipai.com"
- self.server_ip="115.190.35.37:22082"
+ self.server_ip="dmp-api.qipai.com/qp-amp-api"
#self.server_ip="sevenpin1.qipai.com.cn:22082"
elif dev_type == "G10":
self.server_ip="115.190.94.208:22080"
self.commands = []
if self.VC_TTS_volume == None:
self.VC_TTS_volume = 100
+ #可ota配置的参数变量
+ self.emotion = EventMesh.publish("get_storage_config","emotion")#情绪
+ if self.emotion == None:
+ self.emotion = ""
+ self.ota_update_notice = EventMesh.publish("get_storage_config","ota_update_notice")#OTA升级提示语
+ if self.ota_update_notice == None:
+ self.ota_update_notice = ""
self.AI_audio_queue_thread_id = 0
self.AI_audio_queue_thread_lock = 0
self.AI_VC_send_data_queue_thread_id = 0
cat1_ota_flag = self.ai_OTA.min_sys_ota()
if bt_ota_flag==1 or cat1_ota_flag == 1:
#if 0:
- self.AI_TTS_str = "检测到有新版本需要升级啦!升级时可千万别断电或乱按哦,升级完成后设备会自动重启,重启就代表升级成功"
+ if self.ota_update_notice != "":
+ self.AI_TTS_str = self.ota_update_notice
+ else:
+ self.AI_TTS_str = "检测到有新版本需要升级啦!升级时可千万别断电或乱按哦,升级完成后设备会自动重启,重启就代表升级成功"
EventMesh.publish("publish_AI_btnInfo",{"func":self.AI_VC_start})
self.Close_flag = 1
# if self.ai_OTA.min_sys_ota()==2:
if "outbound_attributess_provider" in data["data"]:
self.outbound_attributess_provider = data["data"]["outbound_attributess_provider"]
EventMesh.publish("set_storage_config",["outbound_attributess_provider",self.outbound_attributess_provider])
+ print("配置outbound_attributess_provider成功")
if "inbound_attributess_provider" in data["data"]:
self.inbound_attributess_provider = data["data"]["inbound_attributess_provider"]
EventMesh.publish("set_storage_config",["inbound_attributess_provider",self.inbound_attributess_provider])
+ print("配置inbound_attributess_provider成功")
if "speech_rate" in data["data"]:
self.speech_rate = int(data["data"]["speech_rate"])
EventMesh.publish("set_storage_config",["speech_rate",self.speech_rate])
print("配置speech_rate成功")
+ if "emotion" in data["data"]:
+ self.emotion = data["data"]["emotion"]
+ EventMesh.publish("set_storage_config",["emotion",self.emotion])
+ print("配置emotion成功")
+ if "ota_update_notice" in data["data"]:
+ 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成功")
except Exception as e:
usys.print_exception(e)
else:
print("未读列表为空")
if self.pwk_cnt_voice == 0:#积累的留言已经全部播完
self.pwk_notice_flag = 0
+ self.wait_sort = 0
self.wait_first_flag = 0#让下次未读播放提示恢复
self.voice_notice = 1#开启回复
EventMesh.publish("set_storage_config",["is_noread_voice",0])
"bit_rate": 16,
"channel": 1,
"volume": self.VC_TTS_volume,
+ "emotion": self.emotion,
#"voice": "7426720361732980745",
"voice": voice,#音色
"speech_rate": self.speech_rate,#语速
elif "内蒙古话" in msg:
self.VC_TTS_voice_key = "内蒙古话"
EventMesh.publish("set_storage_config",["VC_TTS_voice_key",self.VC_TTS_voice_key])
- tts_play_str = "声音改为{}".format(voice)
+ tts_play_str = "声音已改为{}".format(voice)
EventMesh.publish("play_tts",[tts_play_str,0])
#闹钟的url播放接口
EventMesh.publish("set_app_new_voice_flag",0)
print("voice_add_to = {}".format(self.pwk_cnt_voice))
print("self.pwk_notice_flag = {}".format(self.pwk_notice_flag))
- if self.pwk_cnt_voice >0:
+ if self.pwk_cnt_voice >1:
if self.pwk_notice_flag == 0:
- tts_str = "您有" + str(self.pwk_cnt_voice) + "条语音留言,10秒内按下中间键可以收听"
+ tts_str = "您有" + str(self.pwk_cnt_voice) + "条未读语音留言,10秒内按下中间键可以收听"
EventMesh.publish("play_tts",[tts_str,1])
+ elif self.pwk_cnt_voice == 1:
+ tts_str = "您有1条语音留言,10秒内按下中间键可以收听"
+ EventMesh.publish("play_tts",[tts_str,1])
if is_close_VC != None:
self.Close_flag = is_close_VC
if self.AI_VC_send_data_queue.empty()!=True:
EventMesh.publish("play_tts",[tts_play_str,1])
# self.wait_first_timer.start(1000,1,self.noread_wait_vocie)
self.wait_first_flag = 1
+ self.wait_sort += 1
+ tts_play_str = "第"+str(self.wait_sort)+"条"
+ EventMesh.publish("play_tts",[tts_play_str,1])
if new_voice_url != "":
self.recv_voice = 1#收到留言
print("未读留言查看")