Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xiaomi gateway 3 ethernet #22

Open
DrArut opened this issue Jan 26, 2023 · 4 comments
Open

Xiaomi gateway 3 ethernet #22

DrArut opened this issue Jan 26, 2023 · 4 comments

Comments

@DrArut
Copy link

DrArut commented Jan 26, 2023

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
Copy link

image

@szymucha94
Copy link

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
Copy link

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
Copy link

szymucha94 commented Jun 23, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants