2020版M1S网关在米家APP升级了最新版4.0.2_0006固件后,Aqara gateway只要一连接网关就会造成网关立即异常离线,只能断电重启才恢复。
2020版M1S网关在米家APP升级了最新版4.0.2_0006固件后,Aqara gateway插件只要一加载,M1S网关就会立即异常从所有地方离线(HA,米家app,homekit,ping命令测试断开),只能手动把M1S断电重启才能恢复。
- 米家app在8月为M1S网关推出 最新版4.0.2_0006固件 。新老硬件架构的M1S网关均可升级。
- 升级完成后,依然能按原来方式打开telnet服务,手动测试admin成功登录
- 但正常加载或者手动重载aqara gateway插件后,约5秒后m1s 网关就会离线(在HA,米家,HOMEKIT 均离线),ping中断,无法自动恢复正常,需要人工断电重启。
- 重启后telnet状态丢失,需要重新开启。如果重复步骤3或者重启整个HA,将依然导致M1S网关离线。
- 详细截图见附件
- aqara gateway日志报错如下: 2022-08-24 19:21:58 DEBUG main SysInfo: {'installation_type': 'Home Assistant OS', 'version': '2022.8.6', 'dev': False, 'hassio': True, 'virtualenv': False, 'python_version': '3.10.5', 'docker': True, 'arch': 'x86_64', 'os_name': 'Linux', 'os_version': '5.15.60', 'user': 'root', 'supervisor': '2022.08.3', 'host_os': 'Home Assistant OS 8.5', 'docker_version': '20.10.14', 'chassis': 'vm'} 2022-08-24 19:21:58 ERROR gateway Failed to connect to MQTT server 192.168.1.100 due to exception: [Errno 111] Connection refused 2022-08-24 19:22:08 DEBUG gateway 192.168.1.100: mosquitto is not running as public! 2022-08-24 19:23:06 WARNING gateway Unsupported cmd: %s 2022-08-24 19:23:06 WARNING gateway Unsupported cmd: %s 2022-08-24 19:23:06 WARNING gateway Unsupported cmd: %s 2022-08-24 19:23:06 WARNING gateway Unsupported cmd: %s 2022-08-24 19:23:06 WARNING gateway Unsupported cmd: %s 2022-08-24 19:23:08 WARNING gateway Unsupported cmd: %s
After the 2020 M1S gateway has been upgraded to the latest version 4.0.2_0006 firmware in the Mijia APP, as long as the Aqara gateway plugin is loading and connected to the M1S gateway, the M1S gateway will be abnormally offline immediately, and it can only be restored after power off and restart.
- Mijia app launched the latest version 4.0.2_0006 firmware for M1S gateway in August. M1S gateways with new 2022 and old 2020 hardware architectures can be upgraded.
- After the upgrade is completed, telnet service can still be opened in the original way, and the manual test can be successfully logged in.
- But after the aqara gateway service is reloaded, the m1s gateway will be offline in about 5 seconds (in HA, Mijia app, and HOMEKIT are all offline), the ping is interrupted, and cannot be automatically restored to normal. It needs to be manually powered off and restarted.
- The telnet service is lost after restarting and needs to be restored by me. Repeating step 3 or restarting the entire HA will still cause the M1S gateway to go offline as same.
- The aqara gateway log reports the following error: 2022-08-24 19:21:58 DEBUG main SysInfo: {'installation_type': 'Home Assistant OS', 'version': '2022.8.6', 'dev': False, 'hassio': True, 'virtualenv': False, 'python_version': '3.10.5', 'docker': True, 'arch': 'x86_64', 'os_name': 'Linux', 'os_version': '5.15.60', 'user': 'root', 'supervisor': '2022.08.3', 'host_os': 'Home Assistant OS 8.5', 'docker_version': '20.10.14', 'chassis': 'vm'} 2022-08-24 19:21:58 ERROR gateway Failed to connect to MQTT server 192.168.1.100 due to exception: [Errno 111] Connection refused 2022-08-24 19:22:08 DEBUG gateway 192.168.1.100: mosquitto is not running as public! 2022-08-24 19:23:06 WARNING gateway Unsupported cmd: %s 2022-08-24 19:23:06 WARNING gateway Unsupported cmd: %s 2022-08-24 19:23:06 WARNING gateway Unsupported cmd: %s 2022-08-24 19:23:06 WARNING gateway Unsupported cmd: %s 2022-08-24 19:23:06 WARNING gateway Unsupported cmd: %s 2022-08-24 19:23:08 WARNING gateway Unsupported cmd: %s
我有完全一样的问题,我在这个页面说了,目前还是无办法解决。
i do have excact the same issue which I posted on this page, so far there is no workaround or solution.
https://github.com/niceboygithub/AqaraGateway/issues/112
我问了aqara 的工程师,他们答复是 米家 4.0.2_0006版本修改了认证及安全方面的风险,同时修改了少量命令接口。估计这是造成不兼容的地方。但更主要是,这个版本固件不稳定,接口不兼容不能执行也就算了,居然会直接导致M1S网关在所有地方离线,应该是网关的操作系统崩溃了。希望 aqara插件能判别和兼容一下。
我问了aqara 的工程师,他们答复是 米家 4.0.2_0006版本修改了认证及安全方面的风险,同时修改了少量命令接口。估计这是造成不兼容的地方。但更主要是,这个版本固件不稳定,接口不兼容不能执行也就算了,居然会直接导致M1S网关在所有地方离线,应该是网关的操作系统崩溃了。希望 aqara插件能判别和兼容一下。
这个问题已经解决了,我现在在外,回家后才把方法放上来。
This issue has been resolved, basically have to use HA to enter the commands as well as flash the firmware.
I tried using my Mac, Linux vm and windows, all failed. Using HA no issue.
Use the below to flash you M1S CN with Home Assistant
-
Command to temporary install python-miio for miiocli command in HomeAssistant
pip3 install python-miio -
Command to check Firmware version on M1S
miiocli device --ip xxx.xxx.xxx.xxx --token xxxxxxxxxxxxxxxxxxxxxxxxxxx info -
Command to temporary install Telnet in Home Assistant
apk update; apk add busybox-extras -
Command to enable Telnet on M1S
miiocli device --ip xxx.xxx.xxx.xxx --token xxxxxxxxxxxxxxxxxxxxxxxxxxx raw_command set_ip_info '{"ssid":"\"\"","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}' -
Command to connect to M1S in Home Assistant
telnet m1s IP -
Command to enable Telnet and Public MQTT; Update M1S ti work with Home Assistant
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
请问你是重刷了定制版的固件吗?那相当于规避了新版本固件的不兼容问题,如果想用新版4.0.2_0006 固件,应该还是得修改aqara gateway插件代码才行哦。我也是通过回滚到上一个版本的 4.0.1_0026来恢复使用的。
Hi, Did you mean that it was re-flashed to the custom firmware? That is equivalent to avoiding the incompatibility of the new version of the firmware. If we want to use the new version of the 4.0.2_0006 firmware, we should still have to modify the aqara gateway plug-in source code. I also got back to normal by rolling back to the previous version: 4.0.1_0026.
I launched it in My Home App and the version stated 4.0.2_0006 + I didn't receive any notification for the firmware update as well :-)
Iit could be due to @niceboygithub had the custom firmware updated with version 4.0.2_0006, can confirm? thanks.
I launched it in My Home App and the version stated 4.0.2_0006 + I didn't receive any notification for the firmware update as well :-)
Iit could be due to @niceboygithub had the custom firmware updated with version 4.0.2_0006, can confirm? thanks.
It seems to be rolled back to VERSION="3.4.4_0008.0616" ?
In my case, I checked in both Mi Home APP and Telnet command, it is running 4.0.2_0006. So I think you could just update it to latest firmware, and do the same as what I mention above, good luck :-)

Same issue ......
How do I enable M1S to enter Telnet mode in HA?
How do I enable M1S to enter Telnet mode in HA?
miiocli device --ip 192.168.1.11(Just example, Fill in the real IP of your own gateway here) --token 5742633sd3234234fsfse(Just example, Fill in the real token of your own gateway here) raw_command set_ip_info '{"ssid":"""","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}'
the solution is already posted here. you need to use custom firmware :-)
Could master (@niceboygithub ) upgrade the Aqara Gateway integration to adapt to the new version firmware(4.0.2_0006) of the m1s gateway API & interface?
I change the m1s to aqara mode,and it update to 3.4.4._0008.0616. And When I back to mi home mode, it still 4.0.2_0006.= =
楼上方法正解,我通过 docker安装的ha,然后通过docker的 安装了上述, 然后命令执行不会重启,一直显示 get packing,please wait.... 然后真的等很久,实在不行 改一下命令,放到自己的 ha 路径下,查看下命令。
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 Connecting to master.dl.sourceforge.net (216.105.38.12:80) curl 100% |***********************************************************************| 2271k 0:00:00 ETA chmod: /tmp/m1s_update.sh: No such file or directory
哪里出错了? 没有下载update.sh 命令粘贴过来的
没有下下来 m1s_update.sh 导致的。
你可以参照本地的方式来。
https://bbs.hassbian.com/forum.php?mod=viewthread&tid=13733&highlight=%E5%A4%9A%E6%A8%A1
通过github下下来 到本地。
error
/tmp/m1s_update.sh
/tmp/m1s_update.sh: line 1: syntax error: unexpected redirection
解决了 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/linux.bin https://ghproxy.com/https://raw.githubusercontent.com/niceboygithub/AqaraM1SM2fw/main/modified/M1S/3.4.4_0008.0616/rootfs_3.4.4_0008.0616_modified.bin fw_update /tmp/linux.bin /tmp/curl -s -k -L -o /tmp/rootfs.bin https://ghproxy.com/https://raw.githubusercontent.com/niceboygithub/AqaraM1SM2fw/main/modified/M1S/3.4.4_0008.0616/rootfs_3.4.4_0008.0616_modified.bin fw_update /tmp/rootfs.bin
我这边遇到同样问题, 4.0.2_0006 固件在开启telnet服务后,大概10s 左右设备就卡死了。 需要修改 m1s_update.sh 内容,把从外网下载文件的几个步骤调整成从局域网文件服务器下载,同时把 m1s_update.sh 文件本身也丢局域网文件服务器,这样可以在卡死前完成固件更新。
局域网内 HTTP 文件服务器,可以用 python -m http.server 8090
我遇到了同样的问题,但是我的版本号与你们不同为什么? 我的是4.0.1.0002,我买来就是这个版本并没有升级,难道新出的默认就做了修改??我的是2023年3月生产的。不是2022版的 同时米家版本添加设备很多homekit控制器都识别不到,只有Aqarahome模式下才能正确识别,真的是很烦