rytilahti / python-miio

Python library & console tool for controlling Xiaomi smart appliances
https://python-miio.readthedocs.io
GNU General Public License v3.0
3.74k stars 562 forks source link

Philip Eye Care Lamp Got error when receiving: timed out #146

Closed PRROY closed 6 years ago

PRROY commented 6 years ago

Hi, I'm testing this great library on a mi philip eye care lamp. I successfully got the same token from IOS backup and discover handshake and managed to connect to the lamp. However it's timed out right before it should power on.

`mieye --ip=192.168.31.211 --token=244d68f9710b3badc1c73d502426ce24 -dd INFO:miio.philips_eyecare_cli:Debug mode active DEBUG:miio.philips_eyecare_cli:Connecting to 192.168.31.211 with token 244d68f9710b3badc1c73d502426ce24 DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b'' DEBUG:miio.device:Got a response: Container: data = Container: data = (total 0) value = (total 0) offset1 = 32 offset2 = 32 length = 0 header = Container: data = !1\x00 \x00\x00\x00\x00\x02\xf5\x17\xa3\x00\x00'5 (total 16) value = Container: length = 32 unknown = 0 devtype = default (total 7) serial = 6051 ts = 1970-01-01 02:47:17 offset1 = 0 offset2 = 16 length = 16 checksum = $Mh\xf9q\x0b;\xad\xc1\xc7=P$&\xce$ (total 16) DEBUG:miio.device:Discovered default 6051 with ts: 1970-01-01 02:47:17, token: b'244d68f9710b3badc1c73d502426ce24' DEBUG:miio.device:192.168.31.211:54321 >>: {'id': 306, 'method': 'get_prop', 'params': ['power', 'bright', 'notifystatus', 'ambstatus', 'ambvalue', 'eyecare', 'scene_num', 'bls', 'dvalue']} ERROR:miio.device:Got error when receiving: timed out Traceback (most recent call last): File "d:\software\anaconda\envs\miio\lib\site-packages\miio\device.py", line 236, in send data, addr = s.recvfrom(1024) socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "d:\software\anaconda\envs\miio\lib\site-packages\miio\device.py", line 236, in send data, addr = s.recvfrom(1024) socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "d:\software\anaconda\envs\miio\lib\site-packages\miio\device.py", line 236, in send data, addr = s.recvfrom(1024) socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "d:\software\anaconda\envs\miio\lib\site-packages\miio\device.py", line 236, in send data, addr = s.recvfrom(1024) socket.timeout: timed out`

Could you please help to spot what's the problem here? Thanks!

rytilahti commented 6 years ago

Could this be related to #142? Please post output from pip freeze|grep construct - if it's 2.8.17, then you either need to wait for a new release, downgrade construct to 2.8.16, or run python-miio from git.

PRROY commented 6 years ago

Yes the output is 2.8.17. Run python-miio from git solved this problem. Really appreciate the help and thanks for the nice library!

rytilahti commented 6 years ago

Glad to hear that, a new release of python-miio will come soon with that fix included so I'm closing this.