zvldz / mgl03_fw

Xiaomi Gateway v3 firmwares and update manuals
224 stars 42 forks source link

Xiaomi gateway 3 ethernet #22

Open DrArut opened 1 year ago

DrArut commented 1 year ago

Hello. Thank you for your work. I soldered the rj45 connector to Xiaomi Gateway 3. But I can’t figure out how to make the gateway automatically connect to ethernet instead of wifi. There is only one way on the ethernet using telnet, but it does not suit me, because after each restart I need to enter this command. How can I change the firmware of the gateway so that it automatically turns on ethernet? Thanks

Nicols07 commented 1 year ago

image

szymucha94 commented 8 months ago

image

Don't do just that :) One of the daemons will sooner or later detect that wlan0 is down and will reenable it... causing both wlan0 and eth0 to be active. If set to the same MAC and/or IP to both (and you will, because both are under br0) it will loop packets and paralyze your network, or at least the gateway. My take on that was to modify the daemon to never touch wlan0, also to get rid of all unnecessary xiaomi processes as I was using z2m anyway.

Tom-Jojo commented 2 months ago

Don't do just that :) One of the daemons will sooner or later detect that wlan0 is down and will reenable it... causing both wlan0 and eth0 to be active. If set to the same MAC and/or IP to both (and you will, because both are under br0) it will loop packets and paralyze your network, or at least the gateway. My take on that was to modify the daemon to never touch wlan0, also to get rid of all unnecessary xiaomi processes as I was using z2m anyway.

Hello @szymucha94, could you share your settings for stable Ethernet connectivity?

szymucha94 commented 2 months ago

Don't do just that :) One of the daemons will sooner or later detect that wlan0 is down and will reenable it... causing both wlan0 and eth0 to be active. If set to the same MAC and/or IP to both (and you will, because both are under br0) it will loop packets and paralyze your network, or at least the gateway. My take on that was to modify the daemon to never touch wlan0, also to get rid of all unnecessary xiaomi processes as I was using z2m anyway.

Hello @szymucha94, could you share your settings for stable Ethernet connectivity?

by settings you mean my script? This is the run.sh script I have in my notes. Do note that I don't own this hardware since long time, mostly because of instability of zigbee chipset, old and unsupported ezsp firmware, low capabilities of the chipset and lack of stable ethernet.

/bin/dropbear -R -B
sleep 10
ifconfig eth0 hw ether <mac>
ifconfig eth0 up | ifconfig wlan0 down
sleep 5
if ping -c 1 <ip_of_router> -W 2 > /dev/null; then
    echo "eth0 is up and working, leaving wlan0 disabled" > /tmp/eth0enable.log
    touch /tmp/dont_need_monitor_wpa_supplicant
    /data/wifi_start.sh &
else
    echo "eth0 is not working, re-enabling wlan0" >> /tmp/eth0enable.log
    ifconfig wlan0 up | ifconfig eth0 down
fi

Do not use script above if you don't know what you're doing.

You also need to modify the daemon bash script that checks wlan0 status every 15(?) minutes, copy it into /data and delete the whole if statement. Then if you run it in backround it should prevent startup of original script from ROM.

Also ethernet is unstable on these units and should not be used for extended periods of time. And it's not just bash daemon that restarts wlan, it's also miio_agent itself. So unless you're ready to de-cloud the gateway and use z2m only (without alexxit integration) just stick to wifi.