『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 2330|回复: 3

[求助] 小米的插座和插排连不上会是什么原因?

[复制链接]

4

主题

13

帖子

278

积分

中级会员

Rank: 3Rank: 3

积分
278
金钱
265
HASS币
0
发表于 2019-4-25 21:30:15 | 显示全部楼层 |阅读模式
小米的插座和插排连不上会是什么原因?token已经拿到
switch:
  - platform: xiaomi_miio
    name: xiaomi_tv_switch
    host: 我的ip
    token: 保密
  - platform: xiaomi_miio
    name: xiaomi_chufan_plug
    host: 我的ip
    token: 不写出来了
回复

使用道具 举报

23

主题

1338

帖子

6755

积分

超级版主

Rank: 8Rank: 8

积分
6755
金钱
5392
HASS币
100

教程狂人

发表于 2019-4-25 21:34:24 | 显示全部楼层
看下日志报错是什么,一般来说是token有问题
回复

使用道具 举报

4

主题

13

帖子

278

积分

中级会员

Rank: 3Rank: 3

积分
278
金钱
265
HASS币
0
 楼主| 发表于 2019-4-25 21:50:24 | 显示全部楼层
2019-04-25 13:34:13 INFO (MainThread) [homeassistant.components.xiaomi_miio.switch] Initializing with host 192.168.4.2 (token 39b80...)
2019-04-25 13:34:13 INFO (MainThread) [homeassistant.components.xiaomi_miio.switch] Initializing with host 192.168.4.9 (token 5b903...)
2019-04-25 13:34:14 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform xiaomi_miio
Traceback (most recent call last):
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/volume1/NAS/opt/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/homeassistant/components/xiaomi_miio/switch.py", line 119, in async_setup_platform
    device_info = miio_device.info()
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/miio/device.py", line 329, in info
    return DeviceInfo(self.send("miIO.info"))
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/miio/device.py", line 243, in send
    m = Message.build(msg, token=self.token)
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/construct/core.py", line 352, in build
    self.build_stream(obj, stream, **contextkw)
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/construct/core.py", line 364, in build_stream
    self._build(obj, stream, context, "(building)")
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/construct/core.py", line 2003, in _build
    buildret = sc._build(subobj, stream, context, path)
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/construct/core.py", line 2472, in _build
    return self.subcon._build(obj, stream, context, path)
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/construct/core.py", line 4078, in _build
    buildret = self.subcon._build(obj, stream, context, path)
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/construct/core.py", line 4365, in _build
    buildret = self.subcon._build(value, stream, context, path)
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/construct/core.py", line 718, in _build
    obj2 = self._encode(obj, context, path)
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/miio/protocol.py", line 144, in _encode
    context['_']['token'])
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/miio/protocol.py", line 71, in encrypt
    backend=default_backend())
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/cryptography/hazmat/backends/__init__.py", line 15, in default_backend
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 65, in <module>
    from cryptography.hazmat.bindings.openssl import binding
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 14, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /volume1/NAS/opt/local/lib/python3.7/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so: undefined symbol: pthread_atfork
2019-04-25 13:34:14 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform xiaomi_miio
Traceback (most recent call last):
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/volume1/NAS/opt/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/homeassistant/components/xiaomi_miio/switch.py", line 119, in async_setup_platform
    device_info = miio_device.info()
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/miio/device.py", line 329, in info
    return DeviceInfo(self.send("miIO.info"))
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/miio/device.py", line 243, in send
    m = Message.build(msg, token=self.token)
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/construct/core.py", line 352, in build
    self.build_stream(obj, stream, **contextkw)
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/construct/core.py", line 364, in build_stream
    self._build(obj, stream, context, "(building)")
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/construct/core.py", line 2003, in _build
    buildret = sc._build(subobj, stream, context, path)
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/construct/core.py", line 2472, in _build
    return self.subcon._build(obj, stream, context, path)
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/construct/core.py", line 4078, in _build
    buildret = self.subcon._build(obj, stream, context, path)
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/construct/core.py", line 4365, in _build
    buildret = self.subcon._build(value, stream, context, path)
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/construct/core.py", line 718, in _build
    obj2 = self._encode(obj, context, path)
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/miio/protocol.py", line 144, in _encode
    context['_']['token'])
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/miio/protocol.py", line 71, in encrypt
    backend=default_backend())
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/cryptography/hazmat/backends/__init__.py", line 15, in default_backend
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 65, in <module>
    from cryptography.hazmat.bindings.openssl import binding
  File "/volume1/NAS/opt/local/lib/python3.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 14, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /volume1/NAS/opt/local/lib/python3.7/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so: undefined symbol: pthread_atfork

回复

使用道具 举报

0

主题

2

帖子

18

积分

新手上路

Rank: 1

积分
18
金钱
16
HASS币
0
发表于 2020-1-29 19:34:48 | 显示全部楼层
本帖最后由 snakewqq 于 2020-1-29 19:36 编辑

遇到类似的错误,请大神解救
ImportError: /opt/lib/python3.7/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so: undefined symbol: ENGINE_get_name



Traceback (most recent call last):
  File "/opt/bin/mirobo", line 8, in <module>
    sys.exit(cli())
  File "/opt/lib/python3.7/site-packages/miio/click_common.py", line 59, in __call__
    return self.main(*args, **kwargs)
  File "/opt/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/opt/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/opt/lib/python3.7/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/opt/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/opt/lib/python3.7/site-packages/miio/vacuum_cli.py", line 415, in info
    res = vac.info()
  File "/opt/lib/python3.7/site-packages/miio/device.py", line 352, in info
    return DeviceInfo(self.send("miIO.info"))
  File "/opt/lib/python3.7/site-packages/miio/device.py", line 253, in send
    m = Message.build(msg, token=self.token)
  File "/opt/lib/python3.7/site-packages/construct/core.py", line 336, in build
    self.build_stream(obj, stream, **contextkw)
  File "/opt/lib/python3.7/site-packages/construct/core.py", line 348, in build_stream
    self._build(obj, stream, context, "(building)")
  File "/opt/lib/python3.7/site-packages/construct/core.py", line 2000, in _build
    buildret = sc._build(subobj, stream, context, path)
  File "/opt/lib/python3.7/site-packages/construct/core.py", line 2438, in _build
    return self.subcon._build(obj, stream, context, path)
  File "/opt/lib/python3.7/site-packages/construct/core.py", line 3991, in _build
    buildret = self.subcon._build(obj, stream, context, path)
  File "/opt/lib/python3.7/site-packages/construct/core.py", line 4278, in _build
    buildret = self.subcon._build(value, stream, context, path)
  File "/opt/lib/python3.7/site-packages/construct/core.py", line 701, in _build
    obj2 = self._encode(obj, context, path)
  File "/opt/lib/python3.7/site-packages/miio/protocol.py", line 156, in _encode
    json.dumps(obj).encode("utf-8") + b"\x00", context["_"]["token"]
  File "/opt/lib/python3.7/site-packages/miio/protocol.py", line 82, in encrypt
    cipher = Cipher(algorithms.AES(key), modes.CBC(iv), backend=default_backend())
  File "/opt/lib/python3.7/site-packages/cryptography/hazmat/backends/__init__.py", line 15, in default_backend
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/opt/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/opt/lib/python3.7/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 75, in <module>
    from cryptography.hazmat.bindings.openssl import binding
  File "/opt/lib/python3.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 15, in <module>
    from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: /opt/lib/python3.7/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so: undefined symbol: ENGINE_get_name

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-24 19:32 , Processed in 0.320378 second(s), 32 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表