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

Roborock S6 - only reachable from different subnet #640

Closed
DomiStyle opened this issue Mar 5, 2020 · 1 comment
Closed

Roborock S6 - only reachable from different subnet #640

DomiStyle opened this issue Mar 5, 2020 · 1 comment

Comments

@DomiStyle
Copy link

So, this is a strange one.

I recently bought a Roborock S6 and I'm trying to query it locally with this library. I extracted the token and confirmed it works from my PC, which is on a different subnet than the Roborock.

After running the same commands on the same subnet as the Roborock it doesn't respond anymore. Is there some Xiaomi thing going on where it only talks to the gateway or what is going on? I disabled all firewall rules just to be sure and the device now has full internet access.

Here's what happens from the same subnet (from 192.168.150.161):

root@test:~# mirobo --debug discover --handshake 1
INFO:miio.vacuum_cli:Debug mode active
INFO:miio.device:Sending discovery to <broadcast> with timeout of 5s..
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.device: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\x0f\x96\xf2\xdc^`\xc9\xeb' (total 16)
        value = Container: 
            length = 32
            unknown = 0
            device_id = unhexlify('<ID>')
            ts = 2020-03-05 09:44:11
        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)
INFO:miio.device:  IP 192.168.150.160 (ID: <ID>) - token: b'ffffffffffffffffffffffffffffffff'
INFO:miio.device:Discovery done

After a successful discovery the request itself fails:

root@test:~# mirobo --debug --ip 192.168.150.160 --token <TOKEN>
INFO:miio.vacuum_cli:Debug mode active
DEBUG:miio.vacuum_cli:Read stored sequence ids: {'seq': 9, 'manual_seq': 0}
DEBUG:miio.vacuum_cli:Connecting to 192.168.150.160 with token <TOKEN>
ERROR:miio.device:Unable to discover a device at address 192.168.150.160
DEBUG:miio.click_common:Exception: Unable to discover the device 192.168.150.160
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/miio/click_common.py", line 59, in __call__
    return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1114, in invoke
    return Command.invoke(self, ctx)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/miio/vacuum_cli.py", line 76, in cli
    ctx.invoke(status)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/miio/vacuum_cli.py", line 112, in status
    res = vac.status()
File "/usr/local/lib/python3.6/dist-packages/miio/vacuum.py", line 176, in status
    return VacuumStatus(self.send("get_status")[0])
File "/usr/local/lib/python3.6/dist-packages/miio/device.py", line 235, in send
    self.do_discover()
File "/usr/local/lib/python3.6/dist-packages/miio/device.py", line 171, in do_discover
    raise DeviceException("Unable to discover the device %s" % self.ip)
miio.exceptions.DeviceException: Unable to discover the device 192.168.150.160
Error: Unable to discover the device 192.168.150.160

Here's the same thing from a different subnet (192.168.1.161):

root@test:~# mirobo --debug --ip 192.168.150.160 --token <TOKEN>
INFO:miio.vacuum_cli:Debug mode active
DEBUG:miio.vacuum_cli:Read stored sequence ids: {'seq': 9, 'manual_seq': 0}
DEBUG:miio.vacuum_cli:Connecting to 192.168.150.160 with token <TOKEN>
DEBUG:miio.protocol:Unable to decrypt, returning raw bytes: b''
DEBUG:miio.device: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\x0f\x96\xf2\xdc^`\xcb\x06' (total 16)
        value = Container: 
            length = 32
            unknown = 0
            device_id = unhexlify('<ID>')
            ts = 2020-03-05 09:48:54
        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.device:Discovered <ID> with ts: 2020-03-05 09:48:54, token: b'ffffffffffffffffffffffffffffffff'
DEBUG:miio.device:192.168.150.160:54321 >>: {'id': 10, 'method': 'get_status', 'params': []}
DEBUG:miio.device:192.168.150.160:54321 (ts: 2020-03-05 09:48:54, id: 10) << {'result': [{'msg_ver': 2, 'msg_seq': 964, 'state': 8, 'battery': 100, 'clean_time': 4104, 'clean_area': 55312500, 'error_code': 0, 'map_present': 1, 'in_cleaning': 0, 'in_returning': 0, 'in_fresh_state': 1, 'lab_status': 1, 'water_box_status': 0, 'fan_power': 102, 'dnd_enabled': 0, 'map_status': 3, 'lock_status': 0}], 'id': 10}
State: Charging
Battery: 100 %
Fanspeed: 102 %
Cleaning since: 1:08:24
Cleaned area: 55.3125 m²
DEBUG:miio.vacuum_cli:Writing {'seq': 10, 'manual_seq': 0} to /root/.cache/python-miio/python-mirobo.seq

Is this a known issue for the S6 with the latest firmware or is something else going on here?

@DomiStyle
Copy link
Author

Update: Was able to fix it by disconnecting the device from my wifi and assigning a different IP, hopefully won't happen again now.

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

1 participant