I have not forgotten to write up the issue in the first place btw just very busy at work but should have some time soon. @oorweeg as a quick explanation - the issue was hardware acceleration.
EDIT 1: Ah sorry i thought this was our other topic from here
Beryl 7 (GL-MT3600BE) - TX speeds unstable - Routers - GL.iNet Official Forum
But still same - working on it
Absolutely @alastor I am actually working on integrating it in the web interface for convenience so once done will upload it here but for now:
First you need to edit the file located in /etc/rc.button/switch to this code (it removes all the other fucntions in my case - but as i said working on it)
#!/bin/sh. /lib/functions/gl_util.sh
logger -t "gl-switch" "$BUTTON ${ACTION}"
PROFILE=""[ "$ACTION" = "pressed" ] && PROFILE="home"[ "$ACTION" = "released" ] && PROFILE="mobile"
if [ -n "$PROFILE" ] && [ -z "$SERVICE" ]; thenlogger -t "gl-switch-profile" "Switch to $PROFILE profile (ACTION=$ACTION)"/usr/bin/gl-apply-profile.sh "$PROFILE" &exit 0fi
action=off[ "$ACTION" = "pressed" ] && action=on
[ -e /proc/gl-hw-info/screen -a -z "$SERVICE" ] && {/usr/bin/screen_disp_switch $action}
func=$(uci -q get switch-button.@main[0].func) || {logger -t "gl-switch" "no config"exit 0}
Then make a script located at /usr/bin/gl-apply-profile.sh
#!/bin/sh
TMP_HOME=/tmp/home-gaming.tar.gzTMP_MOB=/tmp/mobile-default.tar.gzSTATE_FILE=/etc/gl-current-profile
[ -f "$TMP_HOME" ] || cp /root/config-profiles/home-gaming.tar.gz "$TMP_HOME" || { logger -t gl-profile "Cannot copy home tarball"; exit 1; }[ -f "$TMP_MOB" ] || cp /root/config-profiles/mobile-default.tar.gz "$TMP_MOB" || { logger -t gl-profile "Cannot copy mobile tarball"; exit 1; }
TARGET="$1"
[ "$TARGET" = "home" ] || [ "$TARGET" = "mobile" ] || {logger -t gl-profile "Unknown profile '$TARGET'"exit 1}
CURRENT=""[ -f "$STATE_FILE" ] && CURRENT=$(cat "$STATE_FILE")
if [ "$CURRENT" = "$TARGET" ]; thenlogger -t gl-profile "Profile '$TARGET' already active, skip"exit 0fi
if [ "$TARGET" = "home" ]; thenecho home > "$STATE_FILE"logger -t gl-profile "Applying HOME/GAMING profile from $TMP_HOME"sysupgrade -r "$TMP_HOME"sleep 3 # let restore completelogger -t gl-profile "HOME profile restore complete, rebooting"reboot &elif [ "$TARGET" = "mobile" ]; thenecho mobile > "$STATE_FILE"logger -t gl-profile "Applying MOBILE/DEFAULT profile from $TMP_MOB"sysupgrade -r "$TMP_MOB"sleep 3logger -t gl-profile "MOBILE profile restore complete, rebooting"reboot &fi
in my case the two configs are called mobile-default.tar.gz and home-gaming.tar.gz as the home one is connected to the gaming pc and the oter one is mobile but obviousely feel free to rename them.
One important thing - naturally you would be doing this via SSH and as root so remember to change the permissions on the files so they are executable!
chmod 755 /etc/rc.button/switch
chmod 755 /usr/bin/gl-apply-profile.sh
Then create the two archives before flipping the switch!
sysupgrade -b /root/config-profiles/home-gaming.tar.gz
sysupgrade -b /root/config-profiles/mobile-default.tar.gz
After you have both of them flip it make one of the configs, then flip it to the other side make the other config and you have it.
In the current script the “home“ config loads when you flip it to the “inwards”" position (i.e. closer to the reset button) and “mobile” is towards the dot (i.e. further away from the reset button)