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

mirobo cli Error #150

Closed
cissusnar opened this issue Dec 27, 2017 · 3 comments
Closed

mirobo cli Error #150

cissusnar opened this issue Dec 27, 2017 · 3 comments

Comments

@cissusnar
Copy link

INFO:miio.vacuum_cli:Debug mode active
DEBUG:miio.vacuum_cli:Read stored sequence ids: {'seq': 3, 'manual_seq': 0}
DEBUG:miio.vacuum_cli:Connecting to 192.168.2.204 with token xxx
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\x03;\x01\xbf\x00\x1e\x19# (total 16)
        value = Container:
            length = 32
            unknown = 0
            device_id = 033b01bf (total 8)
            ts = 1970-01-23 19:55:15
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = n\xc9\x9cX(\xff\xc7\xf4\xbd\x19M\xa6\x0fn7\x02 (total 16)
DEBUG:miio.device:Discovered b'033b01bf' with ts: 1970-01-23 19:55:15, token: b'xxx'
DEBUG:miio.device:192.168.2.204:54321 >>: {'id': 4, 'method': 'get_status'}
DEBUG:miio.device:192.168.2.204:54321 (ts: 1970-01-23 19:55:15, id: 4) << {'id': 4, 'error': {'code': -32600, 'message': 'Req object invalid.'}}
Traceback (most recent call last):
  File "/home/user/.pyenv/versions/3.6.0/bin/mirobo", line 11, in <module>
    sys.exit(cli())
  File "/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/miio/vacuum_cli.py", line 86, in cli
    ctx.invoke(status)
  File "/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/miio/vacuum_cli.py", line 116, in status
    res = vac.status()
  File "/home/user/.pyenv/versions/3.6.0/lib/python3.6/site-packages/miio/vacuum.py", line 107, in status
    return VacuumStatus(self.send("get_status")[0])
KeyError: 0

ip addr & token are right, then export ip and token to bash env.
run :
mirobo

return error

@rytilahti
Copy link
Owner

What's the device in question? For some reason the device responds with an error, see:

DEBUG:miio.device:192.168.2.204:54321 (ts: 1970-01-23 19:55:15, id: 4) << {'id': 4, 'error': {'code': -32600, 'message': 'Req object invalid.'}}

Maybe this is not a vacuum, but something else?

@rytilahti
Copy link
Owner

Just a thought, the errors from the devices (responses containing 'error' key) should be handled inside device.py and raised as some sort of custom exceptions for users to handle them how they want.

@rytilahti
Copy link
Owner

Fixed by #180.

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