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

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

[已解决] mikrotik(ROS)通过集成插件报错

[复制链接]

12

主题

49

帖子

556

积分

高级会员

Rank: 4

积分
556
金钱
507
HASS币
0
发表于 2021-4-15 13:57:18 | 显示全部楼层 |阅读模式
本帖最后由 hasszhuang 于 2021-5-13 02:37 编辑

以下是报错内容,求大神解答,难道是我没装python3.8吗?

Logger: homeassistant.config_entries
Source: components/mikrotik/hub.py:258
First occurred: 下午1:55:25 (1 occurrences)
Last logged: 下午1:55:25

Error setting up entry Mikrotik for mikrotik
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 249, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/__init__.py", line 68, in async_setup_entry
    if not await hub.async_setup():
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 386, in async_setup
    await self.hass.async_add_executor_job(self._mk_data.update)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 282, in update
    self.update_devices()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 177, in update_devices
    self.all_devices = self.get_list_from_interface(DHCP)
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 164, in get_list_from_interface
    result = self.command(MIKROTIK_SERVICES[interface])
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 258, in command
    response = list(self.api(cmd=cmd))
  File "/usr/local/lib/python3.8/site-packages/librouteros/api.py", line 28, in __call__
    yield from self.readResponse()
  File "/usr/local/lib/python3.8/site-packages/librouteros/api.py", line 60, in readResponse
    reply_word, words = self.readSentence()
  File "/usr/local/lib/python3.8/site-packages/librouteros/api.py", line 46, in readSentence
    reply_word, words = self.protocol.readSentence()
  File "/usr/local/lib/python3.8/site-packages/librouteros/protocol.py", line 189, in readSentence
    sentence = tuple(word for word in iter(self.readWord, ''))
  File "/usr/local/lib/python3.8/site-packages/librouteros/protocol.py", line 189, in <genexpr>
    sentence = tuple(word for word in iter(self.readWord, ''))
  File "/usr/local/lib/python3.8/site-packages/librouteros/protocol.py", line 206, in readWord
    return word.decode(encoding=self.encoding, errors='strict')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbf in position 11: invalid start byte


回复

使用道具 举报

75

主题

1976

帖子

8181

积分

元老级技术达人

积分
8181
金钱
6155
HASS币
430

活跃会员教程狂人

发表于 2021-4-15 17:10:54 | 显示全部楼层
所有过往,皆为序章。
回复

使用道具 举报

73

主题

1165

帖子

6641

积分

论坛元老

Rank: 8Rank: 8

积分
6641
金钱
5471
HASS币
30
发表于 2021-4-16 18:26:02 | 显示全部楼层
回复

使用道具 举报

12

主题

49

帖子

556

积分

高级会员

Rank: 4

积分
556
金钱
507
HASS币
0
 楼主| 发表于 2021-4-17 12:19:50 | 显示全部楼层
感谢各位的回复,问题已经解决。
由于我是个小白,两位大神发的连接都是正确的。我一直在纠结什么是内置的,什么是集成的,最后请教了同事,才发现,我一直用的内置的,造成无法正常使用。
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-25 12:27 , Processed in 0.047568 second(s), 27 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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