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

Can control but not get info from the vacuum #912

Closed
faaafo opened this issue Jan 18, 2021 · 3 comments
Closed

Can control but not get info from the vacuum #912

faaafo opened this issue Jan 18, 2021 · 3 comments
Labels

Comments

@faaafo
Copy link

faaafo commented Jan 18, 2021

While commands like start or stop work

e.g.

mirobo --ip 192.168.188.23 --token 66xyz start

Getting info throws an error

bash-5.0# mirobo --ip 192.168.188.23 --token 66xyz info

Error: Unable to request miIO.info from the device

bash-5.0# mirobo --ip 192.168.188.23 --token 66xyz -d info
INFO:miio.vacuum_cli:Debug mode active
DEBUG:miio.vacuum_cli:Read stored sequence ids: {'seq': 30, 'manual_seq': 0}
DEBUG:miio.vacuum_cli:Connecting to 192.168.188.23 with token 66xyz
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.miioprotocol:Got a response: Container: 
    data = Container: 
        data = b'' (total 0)
        value = b'' (total 0)
        offset1 = 32
        offset2 = 32
        length = 0
    header = Container: 
        data = b'!1\x00 \x00\x00\x00\x00\x03L\x83x\x00\x01G\xfb' (total 16)
        value = Container: 
            length = 32
            unknown = 0
            device_id = unhexlify('034c8378')
            ts = 1970-01-01 23:19:23
        offset1 = 0
        offset2 = 16
        length = 16
    checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
DEBUG:miio.miioprotocol:Discovered 034c8378 with ts: 1970-01-01 23:19:23, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.miioprotocol:192.168.188.23:54321 >>: {'id': 31, 'method': 'miIO.info', 'params': []}
DEBUG:miio.protocol:Unable to parse json '': Expecting value: line 1 column 1 (char 0)
DEBUG:miio.click_common:Exception: Unable to request miIO.info from the device
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/miio/protocol.py", line 193, in _decode
    return json.loads(decoded)
  File "/usr/local/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/miio/device.py", line 177, in info
    return DeviceInfo(self.send("miIO.info"))
  File "/usr/local/lib/python3.8/site-packages/miio/device.py", line 143, in send
    return self._protocol.send(
  File "/usr/local/lib/python3.8/site-packages/miio/miioprotocol.py", line 193, in send
    m = Message.parse(data, token=self.token)
  File "/usr/local/lib/python3.8/site-packages/construct/core.py", line 288, in parse
    return self.parse_stream(io.BytesIO(data), **contextkw)
  File "/usr/local/lib/python3.8/site-packages/construct/core.py", line 300, in parse_stream
    return self._parsereport(stream, context, "(parsing)")
  File "/usr/local/lib/python3.8/site-packages/construct/core.py", line 312, in _parsereport
    obj = self._parse(stream, context, path)
  File "/usr/local/lib/python3.8/site-packages/construct/core.py", line 1981, in _parse
    subobj = sc._parsereport(stream, context, path)
  File "/usr/local/lib/python3.8/site-packages/construct/core.py", line 312, in _parsereport
    obj = self._parse(stream, context, path)
  File "/usr/local/lib/python3.8/site-packages/construct/core.py", line 2439, in _parse
    return self.subcon._parsereport(stream, context, path)
  File "/usr/local/lib/python3.8/site-packages/construct/core.py", line 312, in _parsereport
    obj = self._parse(stream, context, path)
  File "/usr/local/lib/python3.8/site-packages/construct/core.py", line 3987, in _parse
    obj = self.subcon._parsereport(stream, context, path)
  File "/usr/local/lib/python3.8/site-packages/construct/core.py", line 312, in _parsereport
    obj = self._parse(stream, context, path)
  File "/usr/local/lib/python3.8/site-packages/construct/core.py", line 4265, in _parse
    obj = self.subcon._parsereport(stream, context, path)
  File "/usr/local/lib/python3.8/site-packages/construct/core.py", line 312, in _parsereport
    obj = self._parse(stream, context, path)
  File "/usr/local/lib/python3.8/site-packages/construct/core.py", line 698, in _parse
    return self._decode(obj, context, path)
  File "/usr/local/lib/python3.8/site-packages/miio/protocol.py", line 199, in _decode
    raise PayloadDecodeException(
miio.exceptions.PayloadDecodeException: Unable to parse message payload

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/miio/click_common.py", line 59, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/miio/vacuum_cli.py", line 423, in info
    res = vac.info()
  File "/usr/local/lib/python3.8/site-packages/miio/device.py", line 179, in info
    raise DeviceInfoUnavailableException(
miio.exceptions.DeviceInfoUnavailableException: Unable to request miIO.info from the device

Environment:
: Docker on Raspberry Pi 3 Model B Plus Rev 1.3\0
: 4.19.66-v7+

Further related issue: home-assistant/core#43836

@faaafo faaafo added the bug label Jan 18, 2021
@rytilahti
Copy link
Owner

I presume you are using gen 1 rockrobo vacuum and blocking access to the Internet, am I correct? If yes, that is a common problem with those devices, and is the reason why a separated exception was added in #685. The error message for mirobo should be improved to avoid the stacktrace printout, so this issue should remain open until that's done.

The linked PR is irrelevant for this issue.

@faaafo
Copy link
Author

faaafo commented Jan 19, 2021

Indeed, you're correct: 1st gen vacuum; blocked internet access.

Will open another issue for the linked --d timezone issue

@rytilahti
Copy link
Owner

The error message should now be cleaner (was part of changes in #915).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants