niceboygithub / AqaraM1SM2fw

Aqara Gateway M1S (ZHWG15LM) , P3(KTBL12LM), H1(QBCZWG11LM), M2 (ZHWG12LM) Firmwares
164 stars 27 forks source link

Firmware Region #41

Closed aminhusni closed 2 years ago

aminhusni commented 2 years ago

Hi,

I have an Aqara M1S CN region. I am wondering if flashing the original firmware provided here will change it to use US/Others region when using the Aqara Home app. So far I had to deal with slow CN servers :(

rezmus commented 2 years ago

get root (in mijia mode without need to solder), change model to lumi.gateway.aeu01 and connect to global region (dont update hub after).

aminhusni commented 2 years ago

get root (in mijia mode without need to solder), change model to lumi.gateway.aeu01 and connect to global region (dont update hub after).

Which file specifically do I need to change?

rezmus commented 2 years ago

telnet to hub and send

setprop persist.sys.model "lumi.gateway.aeu01"

then reset hub wifi by pressing button for 10s. after reboot it should have lumi-gateway-aeu01* ssid and app will let you bind to global region.

if you use solderless/temp root in mijia mode you must flash custom firmware for acn01 with permanent root or make root via post_init.sh and lock it with chattr (custom busybox), because during factory reset (while switching to aiot mode) it will wipe root and any config changes.

aminhusni commented 2 years ago

lock it with chattr (custom busybox)

Do you have a guide on how to proceed with this last part about locking it with Chattr? I got everything done up to that point but I can't switch to Aqara mode (aiot mode?) without resetting everything and locking back telnet into factory state.

rezmus commented 2 years ago

post_init.sh call was removed in last aiot fw 3.4.2 so it will only work if you did not update in aqara app in last 2 weeks and have fw 3.4.0 or lower (check ro.sys.fw_ver in /etc/build.prop).

follow https://github.com/niceboygithub/AqaraGateway section "Not Flash modified firmware method (NOT for G2H, E1 hub, G3)". you can skip mosquitto download.

it will install curl and post_init.sh. before reboot make sure script is OK same as on repo. after reboot you should have telnet access without need to send miio command.

now you can download busybox and lock post_init.sh with chattr cmd

/data/bin/curl -s -k -L -o /data/bin/busybox https://busybox.net/downloads/binaries/1.21.1/busybox-mipsel
chmod +x /data/bin/busybox
/data/bin/busybox chattr +i /data/scripts/post_init.sh

after you switch mode to aiot telnet access should remain so last thing to do is gw model change and wifi reset.

aminhusni commented 2 years ago

Thank you @rezmus for the excellent help! Works like a charm :)