python-miio icon indicating copy to clipboard operation
python-miio copied to clipboard

no response from aqara ac companion p3

Open xquyan opened this issue 3 years ago • 8 comments

Describe the bug I was trying to open telnet for aqara ac companion p3 (which should be supported) but got "Error: No response from the device"

Version information (please complete the following information):

  • OS: Win11
  • python-miio: 0.5.11

Device information:

  • Model: lumi.aircondition.acn05
  • Hardware version: Linux
  • Firmware version: 4.0.1_0001

To Reproduce this is the command that I used. I also tried 'airconditioningcompanion' and 'device', and the results were similar

miiocli -d gateway --ip 192.168.18.53 --token xxxxxx raw_command set_ip_info '{"ssid":"\"\"","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}'

Expected behavior Enabling telnet on the device

Console output I changed the retry count to 20 so the debug was really long, and here's some of it

INFO:miio.cli:Debug mode active Running command raw_command DEBUG:miio.click_common:Unknown model, trying autodetection. None None 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\x1b\x9exhbD\xb4:' (total 16) value = Container: length = 32 unknown = 0 device_id = unhexlify('1b9e7868') ts = 2022-03-30 19:49:14 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 1b9e7868 with ts: 2022-03-30 19:49:14, token: b'ffffffffffffffffffffffffffffffff' DEBUG:miio.miioprotocol:192.168.18.53:54321 >>: {'id': 1, 'method': 'miIO.info', 'params': []} DEBUG:miio.miioprotocol:Retrying with incremented id, retries left: 20 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\x1b\x9exhbD\xb4;' (total 16) value = Container: length = 32 unknown = 0 device_id = unhexlify('1b9e7868') ts = 2022-03-30 19:49:15 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 1b9e7868 with ts: 2022-03-30 19:49:15, token: b'ffffffffffffffffffffffffffffffff' DEBUG:miio.miioprotocol:192.168.18.53:54321 >>: {'id': 102, 'method': 'miIO.info', 'params': []} DEBUG:miio.miioprotocol:Retrying with incremented id, retries left: 19 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\x1b\x9exhbD\xb4;' (total 16) value = Container: length = 32 unknown = 0 device_id = unhexlify('1b9e7868') ts = 2022-03-30 19:49:15 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 1b9e7868 with ts: 2022-03-30 19:49:15, token: b'ffffffffffffffffffffffffffffffff' DEBUG:miio.miioprotocol:192.168.18.53:54321 >>: {'id': 203, 'method': 'miIO.info', 'params': []} DEBUG:miio.miioprotocol:192.168.18.53:54321 (ts: 2022-03-30 19:49:15, id: 203) << {'partner_id': '', 'id': 203, 'code': 0, 'message': 'ok', 'result': {'hw_ver': 'Linux', 'fw_ver': '4.0.1_0001', 'mcu_fw_ver': '0616', 'ap': {'ssid': '11-1804', 'bssid': '5c:02:14:9c:45:50', 'rssi': '-39', 'freq': '2412'}, 'netif': {'localIp': '192.168.18.53', 'mask': '255.255.255.0', 'gw': '192.168.18.2'}, 'model': 'lumi.aircondition.acn05', 'mac': '54:EF:44:32:7B:1F', 'token': 'xxxxxx', 'life': 2062}} DEBUG:miio.device:Detected model lumi.aircondition.acn05 WARNING:miio.device:Found an unsupported model 'lumi.aircondition.acn05' for class 'Gateway'. If this is working for you, please open an issue at https://github.com/rytilahti/python-miio/ DEBUG:miio.miioprotocol:192.168.18.53:54321 >>: {'id': 204, 'method': 'set_ip_info', 'params': '{ssid:"",pswd:123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd}'} DEBUG:miio.miioprotocol:Retrying with incremented id, retries left: 20 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\x1b\x9exhbD\xb4<' (total 16) value = Container: length = 32 unknown = 0 device_id = unhexlify('1b9e7868') ts = 2022-03-30 19:49:16 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 1b9e7868 with ts: 2022-03-30 19:49:16, token: b'ffffffffffffffffffffffffffffffff' DEBUG:miio.miioprotocol:192.168.18.53:54321 >>: {'id': 305, 'method': 'set_ip_info', 'params': '{ssid:"",pswd:123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd}'} DEBUG:miio.miioprotocol:Retrying with incremented id, retries left: 19

...........

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\x1b\x9exhbD\xb4E' (total 16) value = Container: length = 32 unknown = 0 device_id = unhexlify('1b9e7868') ts = 2022-03-30 19:49:25 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 1b9e7868 with ts: 2022-03-30 19:49:25, token: b'ffffffffffffffffffffffffffffffff' DEBUG:miio.miioprotocol:192.168.18.53:54321 >>: {'id': 2224, 'method': 'set_ip_info', 'params': '{ssid:"",pswd:123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd}'} ERROR:miio.miioprotocol:Got error when receiving: timed out DEBUG:miio.click_common:Exception: No response from the device Traceback (most recent call last): File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\miio\miioprotocol.py", line 193, in send data, addr = s.recvfrom(4096) TimeoutError: timed out
During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\miio\miioprotocol.py", line 193, in send data, addr = s.recvfrom(4096) TimeoutError: timed out

(repeated many times)

The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\miio\click_common.py", line 51, in call return self.main(*args, **kwargs) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 1055, in main rv = self.invoke(ctx) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 760, in invoke return __callback(*args, **kwargs) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\miio\click_common.py", line 300, in wrap kwargs["result"] = func(*args, **kwargs) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\decorators.py", line 84, in new_func return ctx.invoke(f, obj, *args, **kwargs) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 760, in invoke return __callback(*args, **kwargs) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\miio\click_common.py", line 265, in command_callback return miio_command.call(miio_device, *args, **kwargs) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\miio\click_common.py", line 212, in call return method(*args, **kwargs) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\miio\click_common.py", line 179, in _wrap return func(self, *args, **kwargs) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\miio\device.py", line 125, in raw_command return self.send(command, parameters) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\miio\device.py", line 106, in send return self._protocol.send( File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\miio\miioprotocol.py", line 233, in send return self.send( File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\miio\miioprotocol.py", line 233, in send return self.send( File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\miio\miioprotocol.py", line 233, in send return self.send( [Previous line repeated 17 more times] File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\miio\miioprotocol.py", line 241, in send raise DeviceException("No response from the device") from ex miio.exceptions.DeviceException: No response from the device Error: No response from the device

xquyan avatar Mar 30 '22 20:03 xquyan

Could you try a simple command first:

miiocli -d gateway --ip 192.168.18.53 --token xxxxxx info

If you device doesn't respond the token is probably wrong.

syssi avatar Mar 31 '22 06:03 syssi

I got response okay with info, but wtill no response from the previous command, getting pretty much the same result

C:\Users\Yanyan>miiocli -d gateway --ip 192.168.18.53 --token xxxxx info INFO:miio.cli:Debug mode active DEBUG:miio.click_common:Unknown model, trying autodetection. None None 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\x1b\x9exhbE\xa0\x9c' (total 16) value = Container: length = 32 unknown = 0 device_id = unhexlify('1b9e7868') ts = 2022-03-31 12:37:48 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 1b9e7868 with ts: 2022-03-31 12:37:48, token: b'ffffffffffffffffffffffffffffffff' DEBUG:miio.miioprotocol:192.168.18.53:54321 >>: {'id': 1, 'method': 'miIO.info', 'params': []} DEBUG:miio.miioprotocol:192.168.18.53:54321 (ts: 2022-03-31 12:37:48, id: 1) << {'partner_id': '', 'id': 1, 'code': 0, 'message': 'ok', 'result': {'hw_ver': 'Linux', 'fw_ver': '4.0.1_0001', 'mcu_fw_ver': '0616', 'ap': {'ssid': '11-1804', 'bssid': '5c:02:14:9c:45:50', 'rssi': '-39', 'freq': '2412'}, 'netif': {'localIp': '192.168.18.53', 'mask': '255.255.255.0', 'gw': '192.168.18.2'}, 'model': 'lumi.aircondition.acn05', 'mac': '54:EF:44:32:7B:1F', 'token': 'xxxxxx', 'life': 62575}} DEBUG:miio.device:Detected model lumi.aircondition.acn05 WARNING:miio.device:Found an unsupported model 'lumi.aircondition.acn05' for class 'Gateway'. If this is working for you, please open an issue at https://github.com/rytilahti/python-miio/ Model: lumi.aircondition.acn05 Hardware version: Linux Firmware version: 4.0.1_0001

C:\Users\Yanyan>miiocli device --ip 192.168.18.53 --token xxxxxx raw_command set_ip_info '{"ssid":"""","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}' Running command raw_command ERROR:miio.miioprotocol:Got error when receiving: timed out Error: No response from the device

xquyan avatar Mar 31 '22 12:03 xquyan

btw I had to change line 932 in \integrations\vacuum\roborock\vacuum.py from

@dg.resultcallback()

to

@dg.result_callback()

to get it working, and I still get bunch of errors when trying to run miiocli --version :

Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts\miiocli.exe_main.py", line 7, in File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\miio\cli.py", line 63, in create_cli return cli(auto_envvar_prefix="MIIO") File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\miio\click_common.py", line 51, in call return self.main(*args, **kwargs) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 1054, in main with self.make_context(prog_name, args, **extra) as ctx: File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 920, in make_context self.parse_args(ctx, args) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 1613, in parse_args rest = super().parse_args(ctx, args) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 1378, in parse_args value, args = param.handle_parse_result(ctx, opts, args) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 2334, in handle_parse_result value = self.process_value(ctx, value) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\core.py", line 2296, in process_value value = self.callback(ctx, self, value) File "C:\Users\Yanyan\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\click\decorators.py", line 449, in callback raise RuntimeError( RuntimeError: 'miio' is not installed. Try passing 'package_name' instead.

so I'm not reallly sure if this is even really working, but the info command gave the right feedback

xquyan avatar Mar 31 '22 14:03 xquyan

I had the same issue, with result_callback in miio/integrations/vacuum/roborock/vacuum.py line 932. Renaming it from resultcallback to result_callback fixed the issue

thomas-schwieters avatar Apr 01 '22 21:04 thomas-schwieters

I had the same issue, with result_callback in miio/integrations/vacuum/roborock/vacuum.py line 932. Renaming it from resultcallback to result_callback fixed the issue

yeah that was prompted when running it, but other than that was not so obvious on how to fix

xquyan avatar Apr 02 '22 03:04 xquyan

I had the same issue, Did you solve this problem please? i want enable P3‘s telnet

SongShigui avatar Jun 02 '22 09:06 SongShigui

I have same issue

bearlove87 avatar Oct 08 '22 14:10 bearlove87