TL;DR - The power up sequence of ASUS AiMesh is what F*k's things up
Note: This may require Merlin, you need a custom boot script
cat << 'EOF' > /jffs/scripts/services-start
#!/bin/sh
# --- Schedule nightly WiFi reset at 3:00 AM ---
cru a WiFiReset "0 3 * * * /jffs/scripts/wifi_reset.sh"
# --- Run once 2 minutes after boot ---
(
sleep 120
/jffs/scripts/wifi_reset.sh
) &
EOF
==============
cat << 'EOF' > /jffs/scripts/wifi_reset.sh
#!/bin/sh
logger -t wifi_reset "Starting WiFi reset sequence"
logger -t wifi_reset "Restart #1 initiated"
/sbin/service restart_wireless
sleep 60
logger -t wifi_reset "Restart #2 initiated"
/sbin/service restart_wireless
logger -t wifi_reset "WiFi reset sequence complete"
EOF
==============
drwxr-xr-x 2 admin root 0 Nov 13 22:50 .
drwxr-xr-x 19 admin root 0 Nov 15 00:22 ..
-rwxr-xr-x 1 admin root 206 Nov 13 23:11 services-start
-rwxr-xr-x 1 admin root 279 Nov 13 23:02 wifi_reset.sh
cat << 'EOF' > /jffs/scripts/services-start
#!/bin/sh
# Run everything inside a background subshell
(
# Wait 2 minutes after boot
sleep 120
logger -t wifi_reset "Starting WiFi reset sequence"
# First wireless restart
logger -t wifi_reset "Restart #1 initiated"
/sbin/service restart_wireless
# Wait 60 seconds
sleep 60
# Second wireless restart
logger -t wifi_reset "Restart #2 initiated"
/sbin/service restart_wireless
logger -t wifi_reset "WiFi reset sequence complete"
) &
EOF
===============
After (5 min after boot WITH work around)
My setup & Issue:
- I run with a hardwired Backhaul (this is required for the work around unfortunately)
- I have about 50 clients with two AX88U's running Merlin
- I do run with split SSID's (2.4Ghz and 5.0Ghz)
- All the problems exist with "Smart Connect" on or off (one SSID for both)
- I'd have situations where I'd see clients on absolutely the wrong node
- It's mainly due to boot up order
- The main AX88U comes up first
- A whole bunch of clients end up on that router
- then the Slave AiMesh node comes up a few minutes later
- So I end up with like 45 devices on Main AX88U and 5 on the Slave AX88U
- The smarter devices (e.g. phones and computers) will migrate quickly to the best node, but a lot of dumb devices will stick to the wrong node.
- So next day it might be, 40 on primary and 10 on slave, still very lopsided
- I have, lot's of smart devices, smart appliances, echo shows, 4 macs and many other iDevices, and a boat load of phones (I'm a mobile developer)
- Oh and a Tesla that needs good wifi in the garage which is what started this whole mess
- I hardwire as much as I can
- Router locations:
- AX88U is in the cellar in the ceiling in the corner closest to the Garage
- AX88U is on main floor in a closet almost on the extreme the end of the house about 45 ft away (away from the garage)
Experimenting
- For grins, I turned off Hardwired Backhaul and instantly everything was like 20 devices on Primary and 30 on slave (as they should be) and all the closest clients were on the correct node.
- OMG, the back haul is broken. So I turn it back on, and every thing was still good
- So it's not the hardwire Backhaul, it "Fixed it" from flipping the switch, that causes it to drop all wifi clients and let everything reconnect with both nodes fully up
- That's the trick we want to automate
- Easy peasy
- It's really not hard, I'm just being very detailed
Unrelated learnings
- Binding works like SH*T (it just stops things from rebalancing)
- I didn't retry binding after I came up with the work around below
- If you do use binding and want to move a client to another node, ignore the low power warning message, which is bogus
- Optimize seemed useless too
- If you ran Optimize (hardwired backhaul off) it ran a lot like a fresh boot that everything would connect to the primary first.
- Flipping the hardwired backhaul switch was the best "Optimization" I could do
- Pretty disappointed that ASUS does this and I may look elsewhere next time around
Solution
How can I automate simulating flipping that hardwired backhaul switch?Note: This may require Merlin, you need a custom boot script
Summary
- Setup a boot script that does /sbin/service restart_wireless a couple minutes after router boots
- It needs to be done TWICE, it partially optimizes the first time, but the 2nd time it seems to be fully optimized
- So there are two scripts, one to restart wireless twice and another to run that script 2 minutes after boot and set up a cron job to run that script once a day
- The cron job might be overkill, but won't hurt
- I have another option at the bottom to only do it on boot
- Scheduled Reboot will NOT solve this
- If anything it will make it worse and make you regularly unbalanced (i.e. unoptimized)
- Because Primary boots up first and everything tries to connect to it and some stay on a weak slow connection
- You can manually test this out first see below
Detailed Steps
- In Administration (not sure if these are available on OEM ASUS firmware)
- Enable jffs
- Enabled ssh
- In a terminal (user name and IP address may differ)
- ssh [email protected]
- <router password>
- Now you are in a terminal in the router
- Copy everything between the ===== lines and paste it in the terminal in the router
- That will create a file /jffs/scripts/services-start
- If you screw anything up or want to change it, you can redo the paste (cat command)
- It will overwrite the file
- This is easier than learning vi

cat << 'EOF' > /jffs/scripts/services-start
#!/bin/sh
# --- Schedule nightly WiFi reset at 3:00 AM ---
cru a WiFiReset "0 3 * * * /jffs/scripts/wifi_reset.sh"
# --- Run once 2 minutes after boot ---
(
sleep 120
/jffs/scripts/wifi_reset.sh
) &
EOF
==============
- Now we need to make the file runnable
- Enter next line in the terminal
- chmod 755 /jffs/scripts/services-start
- Now we need to make another file
- Do the same thing
cat << 'EOF' > /jffs/scripts/wifi_reset.sh
#!/bin/sh
logger -t wifi_reset "Starting WiFi reset sequence"
logger -t wifi_reset "Restart #1 initiated"
/sbin/service restart_wireless
sleep 60
logger -t wifi_reset "Restart #2 initiated"
/sbin/service restart_wireless
logger -t wifi_reset "WiFi reset sequence complete"
EOF
==============
- Now we need to make the file runnable
- Enter next line in the terminal
- chmod 755 /jffs/scripts/wifi_reset.sh
- Now check it
- Enter next line in terminal
- ls -la /jffs/scripts/
- It should look like this
drwxr-xr-x 2 admin root 0 Nov 13 22:50 .
drwxr-xr-x 19 admin root 0 Nov 15 00:22 ..
-rwxr-xr-x 1 admin root 206 Nov 13 23:11 services-start
-rwxr-xr-x 1 admin root 279 Nov 13 23:02 wifi_reset.sh
- Reboot your router
- Monitor the clients in each node
- Watch what happens around 3 minutes after boot
- Then notice where each client connected
This is an alternative to the above two scripts
- If you don't want the cron job, and just want this on boot, then
- Just do this and create this one boot script file
cat << 'EOF' > /jffs/scripts/services-start
#!/bin/sh
# Run everything inside a background subshell
(
# Wait 2 minutes after boot
sleep 120
logger -t wifi_reset "Starting WiFi reset sequence"
# First wireless restart
logger -t wifi_reset "Restart #1 initiated"
/sbin/service restart_wireless
# Wait 60 seconds
sleep 60
# Second wireless restart
logger -t wifi_reset "Restart #2 initiated"
/sbin/service restart_wireless
logger -t wifi_reset "WiFi reset sequence complete"
) &
EOF
===============
- and set it runnable
- chmod 755 /jffs/scripts/services-start
Removal
- ssh in and run these two commands
- rm -f /jffs/scripts/services-start
- rm -f /jffs/scripts/wifi_reset.sh
- reboot router
Try before you buy
- If you have a hardwired backhaul
- reboot, observe how messed up things are
- then flip the hardwired backhaul switch off/on
- then observe again clients and which nodes they are on
Or (no hardwired backhaul)
- reboot router
- observe how messed up things are
- In Administration
- Enabled ssh
- In a terminal
- ssh [email protected]
- <router password>
- Enter the following command
- /sbin/service restart_wireless
- <Physically wait 1 min>
- Enter the following command again
- /sbin/service restart_wireless
- Then observe clients and which nodes they are on
Conclusion
- Absolutely everything is connected where it should be
- Near immediately after every reboot
- This is just poor design on ASUS's it should be doing something like this
- Or offer as an option, like the daily reboot
- This just restarted wifi, while all nodes up so everything gets a clean shot at once.
- That's all this does
- Some nodes will eventually migrate, some just won't, some take forever
After (5 min after boot WITH work around)
Last edited:
