Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LitttleZhao opened this issue Apr 20, 2021 · 7 comments

Comments

@LitttleZhao
Copy link

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

@LitttleZhao
Copy link
Author

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

@wj-Mcat
Copy link
Collaborator

wj-Mcat commented Apr 22, 2021

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.

@377123
Copy link

377123 commented Jun 15, 2021

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

@wj-Mcat
Copy link
Collaborator

wj-Mcat commented Jul 21, 2021

@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/

@yangruihan
Copy link

@377123 看看是这个问题吗?wechaty/python-wechaty-puppet-service#60

@Martinits
Copy link

Martinits commented Sep 15, 2021

我也遇到同样的问题,用的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 "$@"

@koreQAQ
Copy link

koreQAQ commented Sep 19, 2021

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants