python-wechaty-getting-started icon indicating copy to clipboard operation
python-wechaty-getting-started copied to clipboard

Wechaty - ERROR - The network is not good, the bot will try to restart after 60 seconds.

Open LitttleZhao opened this issue 3 years ago • 7 comments

我的hostie token验证成功了,但在本地跑的时候就会说网不行,对了我的配置是这样的: export WECHATY_PUPPET_SERVICE_TOKEN=puppet_padlocal_xxxxxxxxxxxxxxxxxxxxxxxx export WECHATY_PUPPET=wechaty-puppet-padlocal

LitttleZhao avatar Apr 20 '21 17:04 LitttleZhao

然后我试了Python Wechaty如何使用PadLocal Puppet Service上的方法,发现如下图所示,希望能看下谢谢啦 question

LitttleZhao avatar Apr 20 '21 18:04 LitttleZhao

Padlocal token is to connect with pad service. Wechaty token is to connect with gateway service in python-wechaty. So you should set wechaty token in python-wechaty.

wj-Mcat avatar Apr 22 '21 09:04 wj-Mcat

我也遇到同样的问题 你的解决了吗

377123 avatar Jun 15 '21 10:06 377123

@377123 there are some docs which can you understand the usage of python-wechaty: https://python-wechaty.readthedocs.io/zh_CN/latest/introduction/use-padlocal-protocol/

wj-Mcat avatar Jul 21 '21 01:07 wj-Mcat

@377123 看看是这个问题吗?https://github.com/wechaty/python-wechaty-puppet-service/issues/60

yangruihan avatar Aug 04 '21 01:08 yangruihan

我也遇到同样的问题,用的web协议,配置如下: export WECHATY_LOG="verbose" export WECHATY_PUPPET="wechaty-puppet-wechat" export WECHATY_PUPPET_SERVER_PORT="8080" export WECHATY_TOKEN="python-wechaty-uos-token" export WECHATY_PUPPET_SERVICE_TOKEN=python-wechaty-uos-token export WECHATY_PUPPET_SERVICE_ENDPOINT=127.0.0.1:8080

用docker跑的服务然后用python连接服务: sudo docker run -ti
--name wechaty_puppet_service_token_gateway
--rm
-e WECHATY_LOG="$WECHATY_LOG"
-e WECHATY_PUPPET="$WECHATY_PUPPET"
-e WECHATY_PUPPET_SERVER_PORT="$WECHATY_PUPPET_SERVER_PORT"
-e WECHATY_TOKEN="$WECHATY_TOKEN"
-p "$WECHATY_PUPPET_SERVER_PORT:$WECHATY_PUPPET_SERVER_PORT"
--mount type=bind,source="$(pwd)",target=/bot
wechaty/wechaty:latest "$@"

Martinits avatar Sep 15 '21 09:09 Martinits

@LitttleZhao @Martinits 看下这个解决方案,我的成功了

Padlocal token is to connect with pad service. Wechaty token is to connect with gateway service in python-wechaty. So you should set wechaty token in python-wechaty.

启动客户端时token需要为 启动 puppet_local设置的token

WECHATY_PUPPET_PADLOCAL_TOKEN 远端服务注册的token WECHATY_TOKEN 是本机puppet_local网关注册的token。

tmp.png

注意版本问题

是因为最新版的 puppet service 需要 TLS,目前只有 ts 版本的 wechaty 才适配。我降到了 0.65 版本的解决了问题。 via https://v2ex.com/t/798612

koreQAQ avatar Sep 19 '21 12:09 koreQAQ