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

小米插座2 蓝牙网关版, 提示token长度不等于32 #216

Closed
hzh-hzh opened this issue Aug 18, 2021 · 9 comments
Closed

小米插座2 蓝牙网关版, 提示token长度不等于32 #216

hzh-hzh opened this issue Aug 18, 2021 · 9 comments

Comments

@hzh-hzh
Copy link

hzh-hzh commented Aug 18, 2021

C:\script>miiocli plugv3 --ip 192.168.3.25 --token xxxxxxxxxx info
Usage: miiocli plugv3 [OPTIONS] COMMAND [ARGS]...

Error: Invalid value for '--token': Token length != 32 chars: 35

@hzh-hzh
Copy link
Author

hzh-hzh commented Aug 18, 2021

直接用Python 脚本跑 也fail

myplug.status()
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\C950R_V18_Athena\AppData\Local\Programs\Python\Python39\lib\site-packages\miio\chuangmi_plug.py", line 121, in status
values = self.get_properties(properties)
File "C:\Users\C950R_V18_Athena\AppData\Local\Programs\Python\Python39\lib\site-packages\miio\device.py", line 188, in get_properties
values.extend(self.send(property_getter, _props[:max_properties]))
File "C:\Users\C950R_V18_Athena\AppData\Local\Programs\Python\Python39\lib\site-packages\miio\device.py", line 97, in send
return self._protocol.send(
File "C:\Users\C950R_V18_Athena\AppData\Local\Programs\Python\Python39\lib\site-packages\miio\miioprotocol.py", line 214, in send
self._handle_error(payload["error"])
File "C:\Users\C950R_V18_Athena\AppData\Local\Programs\Python\Python39\lib\site-packages\miio\miioprotocol.py", line 274, in _handle_error
raise DeviceError(error)
miio.exceptions.DeviceError: {'code': -9999, 'message': 'user ack timeout'}

@ha0y
Copy link
Owner

ha0y commented Aug 18, 2021

Token length != 32 确认使用了正确的token吗?token是如何获取的?

第二个报错是执行了什么命令?如果info都报-9999的话,一般是token不对。

@hzh-hzh
Copy link
Author

hzh-hzh commented Aug 18, 2021

token是通过这个软件得到的。https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor

@ha0y
Copy link
Owner

ha0y commented Aug 18, 2021

尝试使用 miiocli device 而非 miiocli plugv3 。确认复制时没有丢掉字符,没有引入多余空格。

@hzh-hzh
Copy link
Author

hzh-hzh commented Aug 18, 2021

试了,一样的错误,说token 不是32, 看了一下,的确是35个字符,没有多也没有少

@ha0y
Copy link
Owner

ha0y commented Aug 18, 2021

token是通过这个软件得到的。https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor

已下载该脚本最新版本测试,未发现获取到35位token的问题。若该软件显示token为35位,考虑米家中重新配对。我无法解释此问题。

@hzh-hzh
Copy link
Author

hzh-hzh commented Aug 18, 2021

token是通过这个软件得到的。https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor

已下载该脚本最新版本测试,未发现获取到35位token的问题。若该软件显示token为35位,考虑米家中重新配对。我无法解释此问题。

重新生成的还是35位的。介意远程帮我看看吗?不知道是不是小米把token位数改了。我是上周才买的。智能插座2 蓝牙网关版

@ha0y
Copy link
Owner

ha0y commented Aug 18, 2021

可以。请加首页QQ群

@ha0y
Copy link
Owner

ha0y commented Aug 19, 2021

问题已解决,非本插件问题。

@ha0y ha0y closed this as completed Aug 19, 2021
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

2 participants