blinker-iot / blinker-py

Blinker python library for hardware. Works with Raspberry Pi, Banan Pi, Linux devices
MIT License
3.2k stars 29 forks source link

报错问题,求解答 #56

Closed hero258 closed 2 years ago

hero258 commented 4 years ago

官方例程Hello_WiFi.py,在仅修改auth情况下,报错 Exception in thread zeroconf-Engine-1968657504: Traceback (most recent call last): File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/local/lib/python3.6/dist-packages/zeroconf-0.27.1-py3.6.egg/zeroconf/init.py", line 1309, in run reader.handleread(socket) File "/usr/local/lib/python3.6/dist-packages/zeroconf-0.27.1-py3.6.egg/zeroconf/init.py", line 1391, in handle_read self.zc.handle_query(msg, None, _MDNS_PORT) File "/usr/local/lib/python3.6/dist-packages/zeroconf-0.27.1-py3.6.egg/zeroconf/init.py", line 2678, in handlequery service.server, File "/usr/local/lib/python3.6/dist-packages/zeroconf-0.27.1-py3.6.egg/zeroconf/init.py", line 652, in init DNSRecord.init(self, name, type, class_, ttl) File "/usr/local/lib/python3.6/dist-packages/zeroconf-0.27.1-py3.6.egg/zeroconf/init.py", line 457, in init self._expiration_time = self.get_expiration_time(100) File "/usr/local/lib/python3.6/dist-packages/zeroconf-0.27.1-py3.6.egg/zeroconf/init.py", line 484, in get_expiration_time return self.created + (percent self.ttl 10) TypeError: unsupported operand type(s) for +: 'float' and 'str'

Traceback (most recent call last): File "demo1.py", line 11, in Blinker.begin('1c6f493bb57f') File "/usr/local/lib/python3.6/dist-packages/Blinker-0.2.0-py3.6.egg/Blinker/Blinker.py", line 151, in begin bProto.conn2.start(bProto.conn1.bmqtt.deviceName) File "/usr/local/lib/python3.6/dist-packages/Blinker-0.2.0-py3.6.egg/BlinkerAdapters/BlinkerLinuxWS.py", line 86, in start mDNSinit(self.type , name) File "/usr/local/lib/python3.6/dist-packages/Blinker-0.2.0-py3.6.egg/BlinkerAdapters/BlinkerLinuxWS.py", line 40, in mDNSinit zeroconf.register_service(info) File "/usr/local/lib/python3.6/dist-packages/zeroconf-0.27.1-py3.6.egg/zeroconf/init.py", line 2385, in register_service self._broadcast_service(info) File "/usr/local/lib/python3.6/dist-packages/zeroconf-0.27.1-py3.6.egg/zeroconf/init.py", line 2419, in _broadcastservice info.server, File "/usr/local/lib/python3.6/dist-packages/zeroconf-0.27.1-py3.6.egg/zeroconf/init.py", line 652, in init DNSRecord.init(self, name, type, class_, ttl) File "/usr/local/lib/python3.6/dist-packages/zeroconf-0.27.1-py3.6.egg/zeroconf/init.py", line 457, in init self._expiration_time = self.get_expiration_time(100) File "/usr/local/lib/python3.6/dist-packages/zeroconf-0.27.1-py3.6.egg/zeroconf/init.py", line 484, in get_expiration_time return self.created + (percent self.ttl 10) TypeError: unsupported operand type(s) for +: 'float' and 'str'

BigAlex2018 commented 4 years ago

这个问题咋解决,我也遇到了

vicat47 commented 4 years ago

+1,同遇到

vicat47 commented 4 years ago

把这个库降到0.26.3就好了

hero258 commented 4 years ago

实测降低zeroconf版本号有效 步骤如下: 1.卸载最新版zeroconf sudo pip3 uninstall zeroconf 2.下载低版本zeroconf,采用0.26.3 wget https://files.pythonhosted.org/packages/5b/c3/02e8fe31c66334db2edba41aa73eca2348e058d6def00036d02851726c50/zeroconf-0.26.3-py3-none-any.whl 3.安装 在下载zeroconf-0.26.3-py3-none-any.whl路径使用:sudo pip3 install zeroconf-0.26.3-py3-none-any.whl

BigAlex2018 commented 4 years ago

好的,非常感谢您!------------------ 原始邮件 ------------------ 发件人: "hero258"<notifications@github.com> 发送时间: 2020年7月6日(星期一) 凌晨0:35 收件人: "blinker-iot/blinker-py"<blinker-py@noreply.github.com>; 抄送: "Noprint"<1838978242@qq.com>;"Comment"<comment@noreply.github.com>; 主题: Re: [blinker-iot/blinker-py] 报错问题,求解答 (#56)

i3water commented 4 years ago

已更新setup/requirments 已更新语音助手支持及小爱支持