niceboygithub / AqaraGateway

Aqara Gateway/Hub integration for Home Assistant
495 stars 65 forks source link

Aqara_gateway can't read device.info #112

Closed ouyangjingqian closed 1 year ago

ouyangjingqian commented 2 years ago

My M2 can't load all device. All device are offline.

ouyangjingqian commented 2 years ago

I have updated custom_component but all devices are still offline

niceboygithub commented 2 years ago

which version you are using?

ouyangjingqian commented 2 years ago

I have updated to the latest version

niceboygithub commented 2 years ago

Can you provide the logs?

ouyangjingqian commented 2 years ago

Where can i get the logs?

ouyangjingqian commented 2 years ago

Can you provide the logs?

Where can i get the logs?

terenceng81 commented 2 years ago

I have the same issue, after accidentally upgrading the firmware to version 4.0.2_0006, all child devices went offline.

I tried to enable telnet and it was working, however, it last only less than 10 sec then the connection dropped, no longer able to ping and i have to restart the m1s CN to make it back to pingable.

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

I suspect Aqara enable some blockage with the latest firmware, can anyone help with this issue?

I can telnet in but it last for 10 sec only and i have no time to enter the command below for Update M1S to work with Home Assistant, please help, thanks millions

kdir /data/bin cd /data/bin wget -O /data/bin/curl "http://master.dl.sourceforge.net/project/mgl03/bin/curl?viasf=1" chmod +x /data/bin/curl /data/bin/curl -s -k -L -o /data/bin/mosquitto https://raw.githubusercontent.com/niceboygithub/AqaraM1SM2fw/main/binutils/mosquitto chmod a+x /data/bin/mosquitto

mkdir /data/scripts cd /data/scripts /data/bin/curl -s -k -L -o /data/scripts/post_init.sh https://raw.githubusercontent.com/niceboygithub/AqaraM1SM2fw/main/binutils/post_init.sh chmod +x /data/scripts/post_init.sh

terenceng81 commented 2 years ago

@niceboygithub dont mind to take a look? i will online for the next few hours just in case u need my input, thanks.

I am using M1S CN version

niceboygithub commented 2 years ago

What can I look into without any logs?

The version of my M1S CN is 4.0.2_0006 and have no problem to enable telnet. After enabled telnet, it still works.

Another method, you can try to flash custom firmware to M1S.

terenceng81 commented 2 years ago

My

What can I look into without any logs?

The version of my M1S CN is 4.0.2_0006 and have no problem to enable telnet. After enabled telnet, it still works.

Another method, you can try to flash custom firmware to M1S.

Hi niceboy,

Yes, I can enable telnet, however once I enabled it, the device will drop the connection and I no longer able to ping it.

the connection last for about 10sec only after the telnet is enabled.

terenceng81 commented 2 years ago

Error log as shown below:

Failed to connect to MQTT server 192.168.5.4 due to exception: [Errno 111] Connection refused Failed to connect to MQTT server 192.168.5.4 due to exception: [Errno 113] Host is unreachable Failed to connect to MQTT server 192.168.5.4 due to exception: timed out

terenceng81 commented 2 years ago

i tried several time, no luck :=/

Can help? I may order a new M1S or I could actually downgrade to the lower version?

Any hyperlink to brief me how to downgrade or flash the firmware? thanks.

terenceng81 commented 2 years ago

still not working

niceboygithub commented 2 years ago

Can you try enter the command after telnet?

setprop persist.app.tty_enable true; setprop persist.app.debug_log true
terenceng81 commented 2 years ago

Can you try enter the command after telnet?

setprop persist.app.tty_enable true; setprop persist.app.debug_log true

The behaviour is strange.

The first time I tried with the command to stop the freeze seems working, and I then perform what I supposed to perform with commands below:

mkdir /data/bin cd /data/bin wget -O /data/bin/curl "http://master.dl.sourceforge.net/project/mgl03/bin/curl?viasf=1"; chmod +x /data/bin/curl /data/bin/curl -s -k -L -o /data/bin/mosquitto https://raw.githubusercontent.com/niceboygithub/AqaraM1SM2fw/main/binutils/mosquitto; chmod a+x /data/bin/mosquitto

mkdir /data/scripts cd /data/scripts /data/bin/curl -s -k -L -o /data/scripts/post_init.sh https://raw.githubusercontent.com/niceboygithub/AqaraM1SM2fw/main/binutils/post_init.sh chmod +x /data/scripts/post_init.sh

and I enter 'reboot' to reboot it.

terenceng81 commented 2 years ago

@niceboygithub

After it rebooted, the Aqara component in HomeAssistant is still not working, and I realize that telnet is still not enabled by default.

I perform a second try to enable telnet with the 'Stop Freeze' command and no longer working, where I did it wrong? :-/

The firmware seems doesn't be flashed.

terenceng81 commented 2 years ago

any idea? the firmware seems unable to flash to custom.

niceboygithub commented 2 years ago

I have a friend who have the same problem on two M1S CN. He flashed the cfw before telnet drop and have no problem to use AqaraGateway in HA. Maybe you have to enter the command faster before telnet drop.

cd /tmp && wget -O /tmp/curl "http://master.dl.sourceforge.net/project/mgl03/bin/curl?viasf=1" && chmod a+x /tmp/curl; /tmp/curl -s -k -L -o /tmp/m1s_update.sh https://raw.githubusercontent.com/niceboygithub/AqaraM1SM2fw/main/modified/M1S/m1s_update.sh; chmod a+x /tmp/m1s_update.sh && /tmp/m1s_update.sh
terenceng81 commented 2 years ago

`BusyBox v1.22.1 (2022-06-24 14:47:35 CST) built-in shell (ash) Enter 'help' for a list of built-in commands.

cd /tmp && wget -O /tmp/curl "http://master.dl.sourceforge.net/project/mgl03/b

in/curl?viasf=1" && chmod a+x /tmp/curl Connecting to master.dl.sourceforge.net (216.105.38.12:80)

curl 100% |***| 2271k 0:00:00 ETA

/tmp/curl -s -k -L -o /tmp/m1s_update.sh; https://raw.githubusercontent.com/ni

ceboygithub/AqaraM1SM2fw/main/modified/M1S/m1s_update.sh; chmod a+x /tmp/m1s_upd ate.sh && /tmp/m1s_update.sh curl: no URL specified! curl: try 'curl --help' for more information -sh: https://raw.githubusercontent.com/niceboygithub/AqaraM1SM2fw/main/modified/M1S/m1s_update.sh: not found chmod: /tmp/m1s_update.sh: No such file or directory`

terenceng81 commented 2 years ago

i tried several times, still no luck

niceboygithub commented 2 years ago

sorry there is a typo, try again.

terenceng81 commented 2 years ago

sorry there is a typo, try again.

sigh, I need at least 10 sec but the telnet drop within 6-8 secs...

no matter how fast I can complete it, the time is still not enough

Screenshot 2022-08-25 at 10 13 40 PM