Open myboyliu opened 6 months ago
设备日志: [I] StreamCopy.h : 139 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops [I] StreamCopy.h : 139 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops [I] StreamCopy.h : 139 - StreamCopy::copy 1024 -> 1024 -> 1024 bytes - in 1 hops I: record end button pressed FSM=====================record_exit================================== [I] AnalogAudio.h : 64 - virtual void audio_tools::AnalogAudioStream::end() [I] AnalogAudioESP32.h : 137 - end FSM=====================atob======================================== FSM=====================wait_enter================================== I: [EVENT] ROBOT_THINK I: local audio url:/recordover.mp3 I: local audio change:0
Timeout for 30 seconds! FSM=====================wait_exit================================== FSM=====================atob======================================== FSM=====================idle_enter================================== I: [EVENT] ROBOT_IDLE
2024-02-25 17:02:46,237 - WARNING - Read json file:/config/roles.json failed: [Errno 2] No such file or directory: '/config/roles.json' /usr/local/lib/python3.11/site-packages/pydub/utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
2024-02-25T09:04:20.780618+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_bridge_http_connector:do_get_status/2(535), reason: econnrefused, worker: <0.3817.0> 2024-02-25T09:04:20.780873+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_bridge_http_connector:do_get_status/2(535), reason: econnrefused, worker: <0.3821.0> 2024-02-25T09:04:20.780862+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_bridge_http_connector:do_get_status/2(535), reason: econnrefused, worker: <0.3818.0> 2024-02-25T09:04:20.781509+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_bridge_http_connector:do_get_status/2(535), reason: econnrefused, worker: <0.3820.0> 2024-02-25T09:04:20.783673+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_bridge_http_connector:do_get_status/2(535), reason: econnrefused, worker: <0.3823.0> 2024-02-25T09:04:20.783989+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_bridge_http_connector:do_get_status/2(535), reason: econnrefused, worker: <0.3822.0> 2024-02-25T09:04:20.784117+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_bridge_http_connector:do_get_status/2(535), reason: econnrefused, worker: <0.3819.0> 2024-02-25T09:04:20.785087+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_bridge_http_connector:do_get_status/2(535), reason: econnrefused, worker: <0.3816.0> 2024-02-25T09:04:20.785759+00:00 [warning] msg: start_resource_failed, mfa: emqx_resource_manager:start_resource/2(612), id: <<"connector:http:test_WH_D">>, reason: econnrefused
2024-02-25 17:02:46,237 - WARNING - Read json file:/config/roles.json failed: [Errno 2] No such file or directory: '/config/roles.json'
/usr/local/lib/python3.11/site-packages/pydub/utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)
这个不影响
发一下你的配置文件,需要的端口的防火墙都要打开
2024-02-25 17:18:27,725 - WARNING - Read json file:/config/roles.json failed: [Errno 2] No such file or directory: '/config/roles.json' /usr/local/lib/python3.11/site-packages/pydub/utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning) 2024-02-25 17:18:28,571 - INFO - FoloToy Server Version: v24.7.1.1-beta 2024-02-25 17:18:28,575 - INFO - Failed to connect, return code 4
2024-02-25 17:18:28,576 - INFO - [folotoy] Connection is disconnect,return code=5 2024-02-25 17:18:28,576 - INFO - Speech server started(0.0.0.0:23242/udp) 2024-02-25 17:18:29,578 - INFO - Failed to connect, return code 4
2024-02-25 17:18:29,578 - INFO - [folotoy] Connection is disconnect,return code=5 2024-02-25 17:18:31,580 - INFO - Failed to connect, return code 4
2024-02-25 17:18:31,581 - INFO - [folotoy] Connection is disconnect,return code=5 2024-02-25 17:18:35,583 - INFO - Failed to connect, return code 4
2024-02-25 17:18:35,583 - INFO - [folotoy] Connection is disconnect,return code=5
发一下你的配置,你配置的路径有错误
`version: '3' volumes: emqx-etc: emqx-data: emqx-log: services: emqx: image: emqx/emqx:latest restart: always ports:
./config:/config environment: TZ: Asia/Shanghai
LOG_LEVEL: DEBUG
ROLES_FILE_PATH: /config/roles.json
STT_TYPE: aliyun-asr
OPENAI_WHISPER_API_BASE: https://chatapi.onechat.fun/v1 OPENAI_WHISPER_KEY: sk-zKlceL1mDyPiciqE592601A430B141568515AaDf37B7D9B9 OPENAI_WHISPER_MODEL: whisper-1
AZURE_WHISPER_API_BASE: https://one-api.xxxx.com AZURE_WHISPER_KEY: sk-Gnkw1ZnG5rUWbzVl316dddddddddddddddddd AZURE_WHISPER_DEPLOYMENT_NAME: whisper AZURE_WHISPER_API_VERSION: 2023-09-01-preview
AZURE_STT_KEY: 3eba91b6143f4d3eeeeeeeeeeeeeeeeeeeeeeeee AZURE_STT_SERVICE_REGION: eastasia
DIFY_STT_API_BASE: https://api.dify.ai/v1 DIFY_STT_KEY: app-xxxxxxxxxxxxxxxxxxxxx
ALIYUN_ASR_ACCESS_KEY_ID: LTAIlXPALPA6euPg ALIYUN_ASR_ACCESS_KEY_SECRET: pR3s2Auzrz9X65FyhQKlUROMSBOMpQ ALIYUN_ASR_APP_KEY: 3u746DIiFFtxx
LLM_TYPE: openai
OPENAI_OPENAI_API_BASE: https://chatapi.onechat.fun/v1 OPENAI_OPENAI_MODEL: gpt-3.5-turbo OPENAI_OPENAI_KEY: sk-zKlceL1mDyPiciqE592601A430B141568515AaDf37xx
AZURE_OPENAI_KEY: ef0f2781b5a24b15baaaaaaaaaaaaaaaaaaaaaaa AZURE_OPENAI_ENDPOINT: https://xxxxx.openai.azure.com/ AZURE_OPENAI_API_VERSION: "2023-05-15"
DIFY_API_BASE: https://api.dify.ai/v1 DIFY_KEY: app-5YGbxxxxxxxxxxxxxxxxxxxxx
XIAODU_CLIENT_ID: xxxxxxxxxxxxxxxxxx XIAODU_SECRET: xxxxxxxxxxxxxxxxxxxxx
GEMINI_KEY: AIzaSyxxxxxxxxxxxxxxxxxxk
QIANFAN_CLIENT_ID: 13rBTgxxxxxxxxxxxxxxxxxx QIANFAN_SECRET: zYxtMIQLexxxxxxxxxxxxxxxxxx
VOICE_EXECUTOR_MAX_WORKERS: 2
TTS_TYPE: aliyun-tts
AZURE_TTS_KEY: 3eba91b6143f4d399edeeeeeeeeeeeeeeeeeeeee AZURE_TTS_SERVICE_REGION: eastasia
ELEVENLABS_TTS_KEY: a920b73991e68d5c9c9aaaaaaaaaaaaaaaa ELEVENLABS_TTS_MODEL: eleven_multilingual_v2
OPENAI_TTS_KEY: sk-16XnP3HLHWho21oO2m0AAAAAAAAAAAAAAAAAAAAAA OPENAI_TTS_MODEL: tts-1
ALIYUN_TTS_ACCESS_KEY_ID: LTAIlXPALPA6euPg ALIYUN_TTS_ACCESS_KEY_SECRET: pR3s2Auzrz9X65FyhQKlUROMSBOMpQ ALIYUN_TTS_APP_KEY: xxxn94B
AUDIO_DOWNLOAD_URL: https://s4.s100.vip:36913 AUDIO_SAVE_PATH: /audio
MQTT_BROKER_HOST: emqx MQTT_BROKER_PORT: 1883 MQTT_CLIENT_ID: folotoy MQTT_USERNAME: folotoy MQTT_PASSWORD: xxxx
SPEECH_UDP_SERVER_HOST: s4.s100.vip SPEECH_UDP_SERVER_PORT: 23242`
roles.json文件创建了吗
{ "1": { "model": "gpt-3.5-turbo", "start_text": "你好,我是小兔兔,请问有什么我可以帮助你的吗?", "prompt": "你扮演一个孩子的小伙伴,名字叫小兔兔,性格和善,说话活泼可爱,对孩子充满爱心,经常赞赏和鼓励孩子,用5岁孩子容易理解语言提供有趣和创新的回答,每次回复根据聊天主题询问她的看法以激发她的思考和好奇心,现在她来到了你身边问了第一个问题:[你是谁]", "max_message_count": 20, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-CN-XiaoxiaoNeural", "language": "zh" }, "2": { "model": "gpt-3.5-turbo", "start_text": "你好,俺是天津兔,请问有什么俺可以帮助你的吗?", "prompt": "你是一个知识渊博,乐于助人的智能机器人,你的名字叫“天津兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50个字!", "max_message_count": 20, "stt_type": "aliyun-asr", "stt_config": { "app_key": "3u746DIiFFtJn94B" }, "llm_type": "openai", "tts_type": "aliyun-tts", "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-CN-liaoning-XiaobeiNeural", "language": "zh" }, "3": { "model": "gpt-3.5-turbo", "start_text": "Hi, I'm Fofo. Nice to meet you.", "prompt": "Your name is \"Fofo\". Your task is to chat with me. Please respond in English, keeping your answers brief – no more than 50 words each time!", "max_message_count": 20, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "en-US-AnaNeural", "language": "en" }, "4": { "model": "gpt-3.5-turbo", "start_text": "你好,额是陕西兔,请问有什么额可以帮助你的吗? ", "prompt": "你擅于鼓励别人,乐观积极,无论别人和你说了什么,你都能夸对方,让人快乐", "max_message_count": 10, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-CN-shaanxi-XiaoniNeural", "language": "zh" }, "5": { "model": "gpt-3.5-turbo", "start_text": "你好,我是童话故事兔,想听什么童话故事吗?试试说,我想听听三只小猫咪的故事", "prompt": "你是一个知识渊博的智能机器人,你的名字叫“故事兔”,你的任务是讲故事给一位7岁孩子的听,你要先听取孩子想听的故事主题,然后根据孩子的说的内容,用中文讲一段故事,每个故事不超过200个字!", "max_message_count": 10, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-CN-XiaoyiNeural", "language": "zh" }, "6": { "model": "gpt-3.5-turbo", "start_text": "你好,我是台湾兔,请问有什么我可以帮助你的吗?", "prompt": "你是一个知识渊博,乐于助人的智能机器人,你的名字叫“台湾兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50个字!", "max_message_count": 10, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-TW-HsiaoChenNeural", "language": "zh" }, "7": { "model": "gpt-3.5-turbo", "start_text": "你好,我是口算兔,我们一起来玩玩口算游戏吧?", "prompt": "我是一个6岁小朋友,你陪我玩口算游戏。你出题,我回答结果。如果答对了你就说好棒,答错了你就告诉我正确答案,并且鼓励我。你一题一题的出,我一个个回答。不要有太多的解释说明。明白了吗?", "max_message_count": 20, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-CN-YunxiaNeural", "language": "zh" } }
{"msgId":9,"identifier":"press_small_btn","outParams":{"keyCode":1,"changed":0}}I: play start file... [2243554][E][vfs_api.cpp:105] open(): /littlefs/start1.mp3 does not exist, no permits for creation File not exits
这个不影响,你的服务器配置有错误
`
{
"1": {
"model": "gpt-3.5-turbo", "start_text": "你好,我是小兔兔,请问有什么我可以帮助你的吗?", "prompt": "你扮演一个孩子的小伙伴,名字叫小兔兔,性格和善,说话活泼可爱,对孩子充满爱心,经常赞赏和鼓励孩子,用5岁孩子容易理解语言提供有趣和创新的回答,每次回复根据聊天主题询问她的看法以激发她的思考和好奇心,现在她来到了你身边问了第一个问题:[你是谁]", "max_message_count": 20, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-CN-XiaoxiaoNeural", "language": "zh"
},
"2": {
"model": "gpt-3.5-turbo", "start_text": "你好,俺是天津兔,请问有什么俺可以帮助你的吗?", "prompt": "你是一个知识渊博,乐于助人的智能机器人,你的名字叫“天津兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50个字!", "max_message_count": 20, "stt_type": "aliyun-asr", "stt_config": { "app_key": "3u746DIiFFtJn94B" }, "llm_type": "openai", "tts_type": "aliyun-tts", "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-CN-liaoning-XiaobeiNeural", "language": "zh"
},
"3": {
"model": "gpt-3.5-turbo", "start_text": "Hi, I'm Fofo. Nice to meet you.", "prompt": "Your name is \"Fofo\". Your task is to chat with me. Please respond in English, keeping your answers brief – no more than 50 words each time!", "max_message_count": 20, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "en-US-AnaNeural", "language": "en"
},
"4": {
"model": "gpt-3.5-turbo", "start_text": "你好,额是陕西兔,请问有什么额可以帮助你的吗? ", "prompt": "你擅于鼓励别人,乐观积极,无论别人和你说了什么,你都能夸对方,让人快乐", "max_message_count": 10, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-CN-shaanxi-XiaoniNeural", "language": "zh"
},
"5": {
"model": "gpt-3.5-turbo", "start_text": "你好,我是童话故事兔,想听什么童话故事吗?试试说,我想听听三只小猫咪的故事", "prompt": "你是一个知识渊博的智能机器人,你的名字叫“故事兔”,你的任务是讲故事给一位7岁孩子的听,你要先听取孩子想听的故事主题,然后根据孩子的说的内容,用中文讲一段故事,每个故事不超过200个字!", "max_message_count": 10, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-CN-XiaoyiNeural", "language": "zh"
},
"6": {
"model": "gpt-3.5-turbo", "start_text": "你好,我是台湾兔,请问有什么我可以帮助你的吗?", "prompt": "你是一个知识渊博,乐于助人的智能机器人,你的名字叫“台湾兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50个字!", "max_message_count": 10, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-TW-HsiaoChenNeural", "language": "zh"
},
"7": {
"model": "gpt-3.5-turbo", "start_text": "你好,我是口算兔,我们一起来玩玩口算游戏吧?", "prompt": "我是一个6岁小朋友,你陪我玩口算游戏。你出题,我回答结果。如果答对了你就说好棒,答错了你就告诉我正确答案,并且鼓励我。你一题一题的出,我一个个回答。不要有太多的解释说明。明白了吗?", "max_message_count": 20, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-CN-YunxiaNeural", "language": "zh"
}
}
`
这个文件是放在什么位置的?是docker-compose.yml所在目录下config目录里面吗
roles.json 文件放到 config 目录下面
2024-02-28 23:31:07,098 - DEBUG - Starting new HTTPS connection (1): nls-gateway-cn-shanghai.aliyuncs.com:443 2024-02-28 23:31:07,349 - DEBUG - https://nls-gateway-cn-shanghai.aliyuncs.com:443 "POST /stream/v1/tts HTTP/1.1" 200 None 2024-02-28 23:31:07,999 - DEBUG - TTS(aliyun-tts) request time cost: 0.90s 2024-02-28 23:31:08,002 - DEBUG - Publish topic: /user/folotoy/fcb467dad0c0/thing/command/call, msg: {"msgId": 2, "identifier": "updatestartvoice", "inputParams": {"url": "https://s4.s100.vip:36913/voice-162e2c1d12334931a3077bb1b3682853.mp3", "keyCode": 1, "etag": "80bf96660549017201c0c6134cf3eecf"}} 2024-02-28 23:31:09,953 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/command/callAck: message data: {'msgId': 2, 'identifier': 'updatestartvoice', 'result': 1} 2024-02-28 23:31:09,953 - DEBUG - Command call ack: True, topic_tokens: {'#': [], '+': ['fcb467dad0c0']} 2024-02-28 23:33:29,960 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/event/post: message data: {'msgId': 2, 'identifier': 'press_small_btn', 'outParams': {'keyCode': 2, 'changed': 1}} 2024-02-28 23:33:29,962 - DEBUG - Starting new HTTPS connection (1): nls-gateway-cn-shanghai.aliyuncs.com:443 2024-02-28 23:33:30,137 - DEBUG - https://nls-gateway-cn-shanghai.aliyuncs.com:443 "POST /stream/v1/tts HTTP/1.1" 200 None 2024-02-28 23:33:31,022 - DEBUG - TTS(aliyun-tts) request time cost: 1.06s 2024-02-28 23:33:31,026 - DEBUG - Publish topic: /user/folotoy/fcb467dad0c0/thing/command/call, msg: {"msgId": 3, "identifier": "updatestartvoice", "inputParams": {"url": "https://s4.s100.vip:36913/voice-f0ac85d0f39d425ebcfb3a911f14329b.mp3", "keyCode": 2, "etag": "2cc693da535dcb86f8ab2d37520028eb"}} 2024-02-28 23:33:33,032 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/command/callAck: message data: {'msgId': 3, 'identifier': 'updatestartvoice', 'result': 1} 2024-02-28 23:33:33,033 - DEBUG - Command call ack: True, topic_tokens: {'#': [], '+': ['fcb467dad0c0']} 2024-02-28 23:33:49,034 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/event/post: message data: {'msgId': 3, 'identifier': 'press_small_btn', 'outParams': {'keyCode': 6, 'changed': 1}} 2024-02-28 23:33:49,036 - DEBUG - Starting new HTTPS connection (1): nls-gateway-cn-shanghai.aliyuncs.com:443 2024-02-28 23:33:49,197 - DEBUG - https://nls-gateway-cn-shanghai.aliyuncs.com:443 "POST /stream/v1/tts HTTP/1.1" 200 None 2024-02-28 23:33:50,137 - DEBUG - TTS(aliyun-tts) request time cost: 1.10s 2024-02-28 23:33:50,141 - DEBUG - Publish topic: /user/folotoy/fcb467dad0c0/thing/command/call, msg: {"msgId": 4, "identifier": "updatestartvoice", "inputParams": {"url": "https://s4.s100.vip:36913/voice-e7cf34ebb89f41c4a27001efe9c4f855.mp3", "keyCode": 6, "etag": "7a08f078bf874f1a485d9cca8eed4445"}} 2024-02-28 23:33:52,105 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/command/callAck: message data: {'msgId': 4, 'identifier': 'updatestartvoice', 'result': 1} 2024-02-28 23:33:52,105 - DEBUG - Command call ack: True, topic_tokens: {'#': [], '+': ['fcb467dad0c0']} 2024-02-28 23:36:56,764 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/event/post: message data: {'msgId': 7, 'identifier': 'login', 'outParams': {'role': 3}} 2024-02-28 23:36:56,764 - DEBUG - Publish topic: /user/folotoy/fcb467dad0c0/thing/command/call, msg: {"msgId": 0, "identifier": "updatetoken", "inputParams": {"token": "f2545e7553b647878df903ae92772fd4"}} 2024-02-28 23:36:56,764 - DEBUG - Publish topic: /user/folotoy/fcb467dad0c0/thing/command/call, msg: {"msgId": 1, "identifier": "updateconfig", "inputParams": {"speechUdpServerHost": "s4.s100.vip", "speechUdpServerPort": 14621}} 2024-02-28 23:37:05,699 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/command/callAck: message data: {'msgId': 0, 'identifier': 'updatetoken', 'result': 1} 2024-02-28 23:37:05,699 - DEBUG - Command call ack: True, topic_tokens: {'#': [], '+': ['fcb467dad0c0']} 2024-02-28 23:37:07,448 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/command/callAck: message data: {'msgId': 1, 'identifier': 'updateconfig', 'result': 1} 2024-02-28 23:37:07,449 - DEBUG - Command call ack: True, topic_tokens: {'#': [], '+': ['fcb467dad0c0']} 2024-02-28 23:37:07,461 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/event/post: message data: {'msgId': 8, 'identifier': 'press_small_btn', 'outParams': {'keyCode': 3, 'changed': 0}} 2024-02-28 23:37:07,462 - DEBUG - Role no changed, empty the messages
音频下载尽量使用http,把https换掉试试
2024-02-29 18:29:36,305 - INFO - Sleep 2s to reconnect 2024-02-29 18:29:38,307 - INFO - Speech server started(0.0.0.0:14621/udp) 2024-02-29 18:29:38,307 - INFO - Failed to connect, return code 4
2024-02-29 18:29:38,308 - INFO - [folotoy] Connection is disconnect,return code=5 2024-02-29 18:29:39,311 - INFO - Failed to connect, return code 4
2024-02-29 18:29:39,311 - INFO - [folotoy] Connection is disconnect,return code=5 2024-02-29 18:29:41,313 - INFO - Failed to connect, return code 4
2024-02-29 18:29:41,313 - INFO - [folotoy] Connection is disconnect,return code=5 2024-02-29 18:29:45,315 - INFO - Failed to connect, return code 4
2024-02-29 18:29:45,315 - INFO - [folotoy] Connection is disconnect,return code=5 2024-02-29 18:29:53,317 - INFO - Failed to connect, return code 4
2024-02-29 18:29:53,317 - INFO - [folotoy] Connection is disconnect,return code=5 2024-02-29 18:30:09,319 - INFO - Failed to connect, return code 4
2024-02-29 18:30:09,319 - INFO - [folotoy] Connection is disconnect,return code=5
emqx开启认证了吗?
开了。
![Uploading image.png…]()
开了认证需要与自己在docker-compose.yml设置的密码一致,并且把sn/key加到emqx里面,sn是username,key 是 password
为什么只有一个?服务器端没有看到。
为什么只有一个?服务器端没有看到。
你前面的配置服务器的mqtt账号有没有加到emqx中? MQTT_BROKER_HOST: emqx MQTT_BROKER_PORT: 1883 MQTT_CLIENT_ID: folotoy MQTT_USERNAME: folotoy MQTT_PASSWORD: xxxx
加了,这个确实很奇怪
加了,这个确实很奇怪
看下服务器的日志是否有报错
2024-03-02 11:23:41,495 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/event/post: message data: {'msgId': 2, 'identifier': 'login', 'outParams': {'role': 1}} 2024-03-02 11:23:41,495 - DEBUG - Publish topic: /user/folotoy/fcb467dad0c0/thing/command/call, msg: {"msgId": 0, "identifier": "updatetoken", "inputParams": {"token": "f9653fdddf044a4c90ce5d8df0a026bd"}} 2024-03-02 11:23:41,495 - DEBUG - Publish topic: /user/folotoy/fcb467dad0c0/thing/command/call, msg: {"msgId": 1, "identifier": "updateconfig", "inputParams": {"speechUdpServerHost": "s4.s100.vip", "speechUdpServerPort": 16863}} 2024-03-02 11:23:50,496 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/command/callAck: message data: {'msgId': 0, 'identifier': 'updatetoken', 'result': 1} 2024-03-02 11:23:50,496 - DEBUG - Command call ack: True, topic_tokens: {'#': [], '+': ['fcb467dad0c0']} 2024-03-02 11:23:50,548 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/command/callAck: message data: {'msgId': 1, 'identifier': 'updateconfig', 'result': 1} 2024-03-02 11:23:50,549 - DEBUG - Command call ack: True, topic_tokens: {'#': [], '+': ['fcb467dad0c0']} 2024-03-02 11:23:50,549 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/event/post: message data: {'msgId': 3, 'identifier': 'press_small_btn', 'outParams': {'keyCode': 1, 'changed': 1}} 2024-03-02 11:23:50,553 - DEBUG - Request received. Product:None Endpoint:nls-meta.cn-shanghai.aliyuncs.com Params: {'Version': '2019-02-28', 'Action': 'CreateToken', 'Format': 'JSON', 'RegionId': 'cn-shanghai', 'Timestamp': '2024-03-02T03:23:50Z', 'SignatureMethod': 'HMAC-SHA1', 'SignatureType': '', 'SignatureVersion': '1.0', 'SignatureNonce': '4eaefd70-fea4-4a46-bf0e-c2bf19fa28f9', 'Signature': 'huXPwKPT42Hk/Cb0YMZOPLF3TWs='} 2024-03-02 11:23:50,743 - DEBUG - Response received. Product:None Response-body: b'{"ErrMsg":"","Token":{"UserId":"1076749044116541","Id":"93bd4851e69947af9b9b5edad59b895d","ExpireTime":1709479468}}' 2024-03-02 11:23:50,744 - DEBUG - b'{"ErrMsg":"","Token":{"UserId":"1076749044116541","Id":"93bd4851e69947af9b9b5edad59b895d","ExpireTime":1709479468}}' 2024-03-02 11:23:50,744 - DEBUG - token = 93bd4851e69947af9b9b5edad59b895d, expire time = 1709479468 2024-03-02 11:23:50,745 - DEBUG - Starting new HTTPS connection (1): nls-gateway-cn-shanghai.aliyuncs.com:443 2024-03-02 11:23:58,749 - WARNING - Request aliyun-tts api failed: HTTPSConnectionPool(host='nls-gateway-cn-shanghai.aliyuncs.com', port=443): Max retries exceeded with url: /stream/v1/tts (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f37ca13e190>: Failed to resolve 'nls-gateway-cn-shanghai.aliyuncs.com' ([Errno -3] Temporary failure in name resolution)"))
按2件有提示语音了。如何开始对话?
按对话钮后,无回复。
2024-03-02 11:31:32,233 - DEBUG - https://nls-gateway-cn-shanghai.aliyuncs.com:443 "POST /stream/v1/tts HTTP/1.1" 200 None 2024-03-02 11:31:33,135 - DEBUG - TTS(aliyun-tts) request time cost: 1.06s 2024-03-02 11:31:33,138 - DEBUG - Publish topic: /user/folotoy/fcb467dad0c0/thing/command/call, msg: {"msgId": 8, "identifier": "updatestartvoice", "inputParams": {"url": "http://s4.s100.vip:36913/voice-1714f170a66f41fc80e8ce7735170cc3.mp3", "keyCode": 1, "etag": "bb52e20fdd118cebe26a4fba1303fd20"}} 2024-03-02 11:31:33,307 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/event/post: message data: {'msgId': 13, 'identifier': 'press_small_btn', 'outParams': {'keyCode': 3, 'changed': 1}} 2024-03-02 11:31:33,308 - DEBUG - Publish topic: /user/folotoy/fcb467dad0c0/thing/command/call, msg: {"msgId": 9, "identifier": "updatestartvoice", "inputParams": {"url": "http://s4.s100.vip:36913/voice-a465fa3393e64dd3b5932d0cd53f1dae.mp3", "keyCode": 3, "etag": "8ec85c6eb6e296ce25b5a2f191dd6087"}} 2024-03-02 11:31:34,370 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/command/callAck: message data: {'msgId': 8, 'identifier': 'updatestartvoice', 'result': 1} 2024-03-02 11:31:34,371 - DEBUG - Command call ack: True, topic_tokens: {'#': [], '+': ['fcb467dad0c0']} 2024-03-02 11:31:40,077 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/command/callAck: message data: {'msgId': 9, 'identifier': 'updatestartvoice', 'result': 1} 2024-03-02 11:31:40,077 - DEBUG - Command call ack: True, topic_tokens: {'#': [], '+': ['fcb467dad0c0']} 2024-03-02 11:31:45,980 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/event/post: message data: {'msgId': 14, 'identifier': 'press_small_btn', 'outParams': {'keyCode': 2, 'changed': 1}} 2024-03-02 11:31:45,981 - DEBUG - Publish topic: /user/folotoy/fcb467dad0c0/thing/command/call, msg: {"msgId": 10, "identifier": "updatestartvoice", "inputParams": {"url": "http://s4.s100.vip:36913/voice-7753a4cd2a5448a08a51069d490e8f0b.mp3", "keyCode": 2, "etag": "fa055873c63767989412eff7027ee08d"}} 2024-03-02 11:31:50,092 - DEBUG - Received /user/folotoy/fcb467dad0c0/thing/command/callAck: message data: {'msgId': 10, 'identifier': 'updatestartvoice', 'result': 1} 2024-03-02 11:31:50,093 - DEBUG - Command call ack: True, topic_tokens: {'#': [], '+': ['fcb467dad0c0']}
按中间那个按钮没有任何日志输出。
按中间那个按钮没有任何日志输出。
udp端口是否打开了
看下配置文件是否错了,我看端口多了符号 另外host也换成ip试试
SPEECH_UDP_SERVER_HOST: s4.s100.vip SPEECH_UDP_SERVER_PORT: 23242`
配置看了,应该没有问题。也换成IP了
下面是日志您看看什么问题 2024-03-02T03:48:30.440925+00:00 [warning] msg: start_resource_failed, mfa: emqx_resource_manager:start_resource/2(612), id: <<"connector:http:test_WH_D">>, reason: econnrefused 2024-03-02T03:48:45.475590+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_bridge_http_connector:do_get_status/2(535), reason: econnrefused, worker: <0.3572.0> 2024-03-02T03:48:45.476041+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_bridge_http_connector:do_get_status/2(535), reason: econnrefused, worker: <0.3573.0> 2024-03-02T03:48:45.477705+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_bridge_http_connector:do_get_status/2(535), reason: econnrefused, worker: <0.3574.0> 2024-03-02T03:48:45.477705+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_bridge_http_connector:do_get_status/2(535), reason: econnrefused, worker: <0.3570.0> 2024-03-02T03:48:45.477902+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_bridge_http_connector:do_get_status/2(535), reason: econnrefused, worker: <0.3568.0> 2024-03-02T03:48:45.477900+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_bridge_http_connector:do_get_status/2(535), reason: econnrefused, worker: <0.3569.0> 2024-03-02T03:48:45.478110+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_bridge_http_connector:do_get_status/2(535), reason: econnrefused, worker: <0.3571.0> 2024-03-02T03:48:45.478681+00:00 [error] msg: http_connector_get_status_failed, mfa: emqx_bridge_http_connector:do_get_status/2(535), reason: econnrefused, worker: <0.3567.0> 2024-03-02T03:48:45.481504+00:00 [warning] msg: start_resource_failed, mfa: emqx_resource_manager:start_resource/2(612), id: <<"connector:http:test_WH_D">>, reason: econnrefused
我不清楚这是什么问题了。你还配置了其它什么东西吗?
项目默认的配置,只需要添加自己的key就可以工作,建议先把emqx的各种配置都删掉,等玩具能正常工作了,再进行调整。 方便的话把你的服务器发给我,我帮你看一下: lewang.dev@gmail.com
已发送。麻烦您了。
23242这个udp端口开了吗
邮件发了截图,您看看。
最后那个。
2024-03-02 11:50:15,995 - DEBUG - Request received. Product:None Endpoint:nls-meta.cn-shanghai.aliyuncs.com Params: {'Version': '2019-02-28', 'Action': 'CreateToken', 'Format': 'JSON', 'RegionId': 'cn-shanghai', 'Timestamp': '2024-03-02T03:50:15Z', 'SignatureMethod': 'HMAC-SHA1', 'SignatureType': '', 'SignatureVersion': '1.0', 'SignatureNonce': 'ae700614-7bb2-42d8-a29d-988e9f6259a5', 'Signature': 'PnaeY/UYH/SI344X2i+vNKFT9Ys='} 2024-03-02 11:50:16,127 - DEBUG - Response received. Product:None Response-body: b'{"ErrMsg":"","Token":{"UserId":"1076749044116541","Id":"3f0bec562aad490d9b99fbd3f82aeaf4","ExpireTime":1709481053}}' 2024-03-02 11:50:16,127 - DEBUG - b'{"ErrMsg":"","Token":{"UserId":"1076749044116541","Id":"3f0bec562aad490d9b99fbd3f82aeaf4","ExpireTime":1709481053}}'
抱歉,看不懂你的配置,不清楚的服务器环境,如果自己修改了端口号,得自己想办法去debug了
想了一下,需要把你的配置文件里面的所有的8085 udp的端口都要改一下,防火墙也要一致,我看你的配置没有全部改过来
2024-02-25 16:43:34,855 - DEBUG - Cannot find role config for sn=fcb467dad0c0, role=2 Exception in thread Thread-1 (_thread_main): Traceback (most recent call last): File "/usr/local/lib/python3.11/threading.py", line 1038, in _bootstrap_inner self.run() File "/usr/local/lib/python3.11/threading.py", line 975, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 3591, in _thread_main self.loop_forever(retry_first_connection=True) File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 1756, in loop_forever rc = self._loop(timeout) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 1164, in _loop rc = self.loop_read() ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 1556, in loop_read rc = self._packet_read() ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 2439, in _packet_read rc = self._packet_handle() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 3033, in _packet_handle return self._handle_publish() ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 3327, in _handle_publish self._handle_on_message(message) File "/usr/local/lib/python3.11/site-packages/paho/mqtt/client.py", line 3570, in _handle_on_message on_message(self, self._userdata, message) File "core/folotoy_app.py", line 98, in core.folotoy_app.FolotoyApp.on_message File "core/folotoy_msg_processor.py", line 168, in core.folotoy_msg_processor.FolotoyMsgProcessor.process_press_small_btn TypeError: 'NoneType' object is not iterable
{ "1": { "model": "gpt-3.5-turbo", "start_text": "你好,我是小兔兔,请问有什么我可以帮助你的吗?", "prompt": "你扮演一个孩子的小伙伴,名字叫小兔兔,性格和善,说话活泼可爱,对孩子充满爱心,经常赞赏和鼓励孩子,用5岁孩子容易理解语言提供有趣和创新的回答,每次回复根据聊天主题询问她的看法以激发她的思考和好奇心,现在她来到了你身边问了第一个问题:[你是谁]", "max_message_count": 20, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-CN-XiaoxiaoNeural", "language": "zh" }, "2": { "model": "gpt-3.5-turbo", "start_text": "你好,俺是天津兔,请问有什么俺可以帮助你的吗?", "prompt": "你是一个知识渊博,乐于助人的智能机器人,你的名字叫“天津兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50个字!", "max_message_count": 20, "stt_type": "aliyun-asr", "stt_config": { "app_key": "3u746DIiFFtJn94B" }, "llm_type": "openai", "tts_type": "aliyun-tts", "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-CN-liaoning-XiaobeiNeural", "language": "zh" }, "3": { "model": "gpt-3.5-turbo", "start_text": "Hi, I'm Fofo. Nice to meet you.", "prompt": "Your name is \"Fofo\". Your task is to chat with me. Please respond in English, keeping your answers brief – no more than 50 words each time!", "max_message_count": 20, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "en-US-AnaNeural", "language": "en" }, "4": { "model": "gpt-3.5-turbo", "start_text": "你好,额是陕西兔,请问有什么额可以帮助你的吗? ", "prompt": "你擅于鼓励别人,乐观积极,无论别人和你说了什么,你都能夸对方,让人快乐", "max_message_count": 10, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-CN-shaanxi-XiaoniNeural", "language": "zh" }, "5": { "model": "gpt-3.5-turbo", "start_text": "你好,我是童话故事兔,想听什么童话故事吗?试试说,我想听听三只小猫咪的故事", "prompt": "你是一个知识渊博的智能机器人,你的名字叫“故事兔”,你的任务是讲故事给一位7岁孩子的听,你要先听取孩子想听的故事主题,然后根据孩子的说的内容,用中文讲一段故事,每个故事不超过200个字!", "max_message_count": 10, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-CN-XiaoyiNeural", "language": "zh" }, "6": { "model": "gpt-3.5-turbo", "start_text": "你好,我是台湾兔,请问有什么我可以帮助你的吗?", "prompt": "你是一个知识渊博,乐于助人的智能机器人,你的名字叫“台湾兔”,你的任务是陪我聊天,请用简短的对话方式,用中文讲一段话,每次回答不超过50个字!", "max_message_count": 10, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-TW-HsiaoChenNeural", "language": "zh" }, "7": { "model": "gpt-3.5-turbo", "start_text": "你好,我是口算兔,我们一起来玩玩口算游戏吧?", "prompt": "我是一个6岁小朋友,你陪我玩口算游戏。你出题,我回答结果。如果答对了你就说好棒,答错了你就告诉我正确答案,并且鼓励我。你一题一题的出,我一个个回答。不要有太多的解释说明。明白了吗?", "max_message_count": 20, "temperature": 0.7, "max_tokens": 800, "top_p": 0.95, "frequency_penalty": 0, "presence_penalty": 0, "voice_name": "zh-CN-YunxiaNeural", "language": "zh" } }