I have hAP ac² running Routeros v6.42.6, and I want to reduce Wi-Fi transmitter power on schedule/at night because the router is located in a bed room.
I've found this: https://tushev.org/articles/linux-bsd/2 ... k-routeros
The script there is only for wlan1. my hAP ac² has wlan1 & wlan2.
I don't know how to edit the script so it would reduce WI-FI transmitter power on both wlan1 & wlan2.
If someone can help editing the script to fit hAP ac² v6.42.6 it would be really appreciated
Thank you all!
Here is the script
# Script to turn down radio power based on a schedule
# Schedule this script to run every 15-30 minutes to make
# certain the changeover has occurred.
# User variables are listed below:
#####################################
## Set the Radio NormalPower and LowPower times here ##
:local RadioNormalPowerTime "08:00";
:local RadioLowPowerTime "00:30";
:local LowPower 6;
:local NormalPower 17;
:local RadioName "wlan1";
:local RadioPowerState;
:local RadioPower;
#####################################
:local CurrentTime [/system clock get time];
:set RadioPower [:put [/interface wireless get value-name=tx-power $RadioName]];
:if ($RadioPower = $LowPower) do {
:set RadioPowerState 0;
} else {
:if ($RadioPower > $NormalPower) do {
:set RadioPowerState 2;
} else {
:set RadioPowerState 1;
}
}
# Where the NormalPower time is set earlier than the LowPower time #
:if ($RadioNormalPowerTime < $RadioLowPowerTime) do {
# NormalPower interval #
:if (($CurrentTime > $RadioNormalPowerTime) and ($CurrentTime < $RadioLowPowerTime)) do {
:if ($RadioPowerState=0) do {
:log info "[$CurrentTime] Switching to NormalPower";
:put [/interface wireless set $RadioName tx-power=$NormalPower];
}
# LowPower interval #
} else {
# We should go to LowPower in any case at LowPower interval #
:if ($RadioPowerState!=0) do {
:log info "[$CurrentTime] Switching to LowPower";
:put [/interface wireless set $RadioName tx-power=$LowPower];
}
}
}
# Where the NormalPower time is set later than the LowPower time #
:if ($RadioNormalPowerTime > $RadioLowPowerTime) do {
# LowPower interval #
:if (($CurrentTime < $RadioNormalPowerTime) and ($CurrentTime > $RadioLowPowerTime)) do {
# We should go to LowPower in any case at LowPower interval #
:if ($RadioPowerState!=0) do {
:log info "[$CurrentTime] Switching to LowPower";
:put [/interface wireless set $RadioName tx-power=$LowPower];
}
# NormalPower interval #
} else {
:if ($RadioPowerState=0) do {
:log info "[$CurrentTime] Switching to NormalPower";
:put [/interface wireless set $RadioName tx-power=$NormalPower];
}
}
}