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

Unable to discover the device #1965

Open
13werwolf13 opened this issue Aug 26, 2024 · 1 comment
Open

Unable to discover the device #1965

13werwolf13 opened this issue Aug 26, 2024 · 1 comment
Labels

Comments

@13werwolf13
Copy link

Describe the bug
after migrate homeassistant with python-miio to another server i get this error

Version information (please complete the following information):

  • OS: linux
  • python-miio: 0.5.12

Device information:
If the issue is specific to a device

  • Model: dreame.vacuum.r2211o
  • Hardware version: ?
  • Firmware version: ?

To Reproduce
Steps to reproduce the behavior:

  1. do pipenv run miiocli device --ip 192.168.196.246 --token XXXX info
  2. get Error: Unable to discover the device 192.168.196.246

Console output

gw:~/.homeassistant # pipenv run mirobo --debug --ip 192.168.196.246 --token XXXX info
INFO:miio.integrations.vacuum.roborock.vacuum_cli:Debug mode active
DEBUG:miio.integrations.vacuum.roborock.vacuum_cli:Using config: {'seq': 0, 'manual_seq': 0}
DEBUG:miio.integrations.vacuum.roborock.vacuum_cli:Connecting to 192.168.196.246 with token XXXX
DEBUG:miio.miioprotocol:Unable to discover a device at address 192.168.196.246
DEBUG:miio.click_common:Exception: Unable to discover the device 192.168.196.246
Traceback (most recent call last):
  File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/miio/click_common.py", line 51, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/click/decorators.py", line 92, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/miio/integrations/vacuum/roborock/vacuum_cli.py", line 431, in info
    res = vac.info()
          ^^^^^^^^^^
  File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/miio/click_common.py", line 184, in _wrap
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/miio/device.py", line 148, in info
    return self._fetch_info()
           ^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/miio/integrations/vacuum/roborock/vacuum.py", line 260, in _fetch_info
    info = super()._fetch_info()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/miio/device.py", line 153, in _fetch_info
    devinfo = DeviceInfo(self.send("miIO.info"))
                         ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/miio/device.py", line 107, in send
    return self._protocol.send(
           ^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/miio/miioprotocol.py", line 161, in send
    self.send_handshake()
  File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/miio/miioprotocol.py", line 74, in send_handshake
    raise DeviceException("Unable to discover the device %s" % self.ip)
miio.exceptions.DeviceException: Unable to discover the device 192.168.196.246

I checked several times, the ip address is correct and the firewall does not have any rules about the lan network segment

@13werwolf13
Copy link
Author

13werwolf13 commented Aug 26, 2024

i listen network traffic by tcpdump

i don't understand

20:43:59.204477 IP NOT_LAN_IP.39576 > 192.168.196.246.54321: UDP, length 32
20:43:59.204507 IP NOT_LAN_IP.39576 > 192.168.196.246.54321: UDP, length 32
20:43:59.204536 IP NOT_LAN_IP.39576 > 192.168.196.246.54321: UDP, length 32

NOT_LAN_IP - another server ip address from another interface & another network. if i ping 192.168.196.246 traffic going to right interface from right ip..

UPD: Apparently this is either an artifact of tcpdump display or something else, I noticed that there is a lot of such traffic with a seemingly incorrect outgoing ip but going without errors. I'll leave this comment because it may be useful, but I don't think it's relevant.

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

1 participant