niceboygithub / AqaraGateway

Aqara Gateway/Hub integration for Home Assistant
517 stars 66 forks source link

Timeout Error: when trying to open telnetd in Aqara Hub M1S #148

Open xorxorxorxor opened 1 year ago

xorxorxorxor commented 1 year ago

Error Infomation

Error: No response from the device

Device Information

Model: lumi.gateway.acn01 Hardware version: Linux Firmware version: 4.0.1_0002

How it happens?

  1. use miiocli to open the telnetd. miiocli -d device --ip 192.168.2.105 --token TOKEN raw_command set_ip_info '{"ssid":"\"\"","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}'
  2. the result is below:

    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\x1d\xbd\xc7\xe1c\xc0\n\xbd' (total 16) value = Container: length = 32 unknown = 0 device_id = unhexlify('1dbdc7e1') ts = 2023-01-12 13:27: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 1dbdc7e1 with ts: 2023-01-12 13:27:25, token: b'ffffffffffffffffffffffffffffffff' DEBUG:miio.miioprotocol:192.168.2.105:54321 >>: {'id': 1, 'method': 'miIO.info', 'params': []} DEBUG:miio.miioprotocol:Retrying with incremented id, retries left: 3 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\x1d\xbd\xc7\xe1c\xc0\n\xc2' (total 16) value = Container: length = 32 unknown = 0 device_id = unhexlify('1dbdc7e1') ts = 2023-01-12 13:27:30 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 1dbdc7e1 with ts: 2023-01-12 13:27:30, token: b'ffffffffffffffffffffffffffffffff' DEBUG:miio.miioprotocol:192.168.2.105:54321 >>: {'id': 102, 'method': 'miIO.info', 'params': []} DEBUG:miio.miioprotocol:Retrying with incremented id, retries left: 2 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\x1d\xbd\xc7\xe1c\xc0\n\xc7' (total 16) value = Container: length = 32 unknown = 0 device_id = unhexlify('1dbdc7e1') ts = 2023-01-12 13:27:35 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 1dbdc7e1 with ts: 2023-01-12 13:27:35, token: b'ffffffffffffffffffffffffffffffff' DEBUG:miio.miioprotocol:192.168.2.105:54321 >>: {'id': 203, 'method': 'miIO.info', 'params': []} DEBUG:miio.miioprotocol:192.168.2.105:54321 (ts: 2023-01-12 13:27:35, id: 203) << {'partner_id': '', 'id': 203, 'code': 0, 'message': 'ok', 'result': {'hw_ver': 'Linux', 'fw_ver': '4.0.1_0002', 'mcu_fw_ver': '0616', 'ap': {'ssid': 'TP-LINK_774A', 'bssid': '60:45:3b:68:4a:93', 'rssi': '-32', 'freq': '2432'}, 'netif': {'localIp': '192.168.2.105', 'mask': '255.255.255.0', 'gw': '192.168.2.1'}, 'model': 'lumi.gateway.acn01', 'mac': '54:EF:43:40:D5:13', 'token': 'TOKEN', 'life': 4473}} DEBUG:miio.device:Detected model lumi.gateway.acn01 DEBUG:miio.miioprotocol:192.168.2.105: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: 3 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\x1d\xbd\xc7\xe1c\xc0\n\xcc' (total 16) value = Container: length = 32 unknown = 0 device_id = unhexlify('1dbdc7e1') ts = 2023-01-12 13:27:40 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 1dbdc7e1 with ts: 2023-01-12 13:27:40, token: b'ffffffffffffffffffffffffffffffff' DEBUG:miio.miioprotocol:192.168.2.105: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: 2 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\x1d\xbd\xc7\xe1c\xc0\n\xd1' (total 16) value = Container: length = 32 unknown = 0 device_id = unhexlify('1dbdc7e1') ts = 2023-01-12 13:27:45 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 1dbdc7e1 with ts: 2023-01-12 13:27:45, token: b'ffffffffffffffffffffffffffffffff' DEBUG:miio.miioprotocol:192.168.2.105:54321 >>: {'id': 406, '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: 1 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\x1d\xbd\xc7\xe1c\xc0\n\xd6' (total 16) value = Container: length = 32 unknown = 0 device_id = unhexlify('1dbdc7e1') ts = 2023-01-12 13:27:50 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 1dbdc7e1 with ts: 2023-01-12 13:27:50, token: b'ffffffffffffffffffffffffffffffff' DEBUG:miio.miioprotocol:192.168.2.105:54321 >>: {'id': 507, '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 "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\miio\miioprotocol.py", line 193, in send data, addr = s.recvfrom(4096) socket.timeout: timed out

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\miio\miioprotocol.py", line 193, in send data, addr = s.recvfrom(4096) socket.timeout: timed out

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\miio\miioprotocol.py", line 193, in send data, addr = s.recvfrom(4096) socket.timeout: timed out

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\miio\miioprotocol.py", line 193, in send data, addr = s.recvfrom(4096) socket.timeout: timed out

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

    Traceback (most recent call last): File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\miio\click_common.py", line 51, in call return self.main(args, kwargs) File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\click\core.py", line 1055, in main rv = self.invoke(ctx) File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\click\core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\click\core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\click\core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\click\core.py", line 760, in invoke return __callback(args, kwargs) File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\miio\click_common.py", line 305, in wrap kwargs["result"] = func(*args, *kwargs) File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\click\decorators.py", line 84, in new_func return ctx.invoke(f, obj, args, kwargs) File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\click\core.py", line 760, in invoke return __callback(*args, kwargs) File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\miio\click_common.py", line 270, in command_callback return miio_command.call(miio_device, *args, *kwargs) File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\miio\click_common.py", line 217, in call return method(args, kwargs) File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\miio\click_common.py", line 184, in _wrap return func(self, *args, kwargs) File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\miio\device.py", line 126, in raw_command return self.send(command, parameters) File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\miio\device.py", line 108, in send command, parameters, retry_count, extra_parameters=extra_parameters File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\miio\miioprotocol.py", line 237, in send extra_parameters=extra_parameters, File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\miio\miioprotocol.py", line 237, in send extra_parameters=extra_parameters, File "D:\ProgramFiles\anaconda\envs\miio\lib\site-packages\miio\miioprotocol.py", line 237, in send extra_parameters=extra_parameters, File "D:\ProgramFiles\anaconda\envs\miio\lib\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**

niceboygithub commented 1 year ago

If you are using Windows to enable telnet, please check your firewall in Windows settings.

daydy16 commented 1 year ago

For me enabling telnet manually worked perfectly. https://github.com/niceboygithub/AqaraGateway#manually-enable-telnet

I had to click no as fast as the guy in the video, but afterwards it blinked green two times and telnet was enabled with username admin and no password.

I also couldn't get it to work with miio cli. It seems that a new firmware is blocking changes like these

niceboygithub commented 1 year ago

Since you already enable the telnet. Remove the token inputting while configuring