OK, User at forum Sebastii share code for me and I can share it for you.
He use it as
*) Check if Chateau have CA connected, if it's is then exit.
*) No CA then do a Bandwitch Test with one of Public BTest Servers, details here:
viewtopic.php?f=2&t=104266 who can restore CA
*) Still NO CA then if SPEED is wrong do again CellLock to his favourite BTS/SectorAntenna as ."at+qnwlock=\"common/4g\",1,
3350,
187"
You should do a Cell Monitor, or check what
EARFCN &
Phy-CellID you use and replace it at the end of scirpt.
This code can be paste into a scheduler like every 30minutes.
You should read details about Public BTest Servers to not do a speedtest to often.
:log warning "start CA Band 1"
:local caband [interface lte monitor lte1 duration=5 as-value]
:local SccBand ($caband->"ca-band")
:log warning "start CA Band 2"
:if ($SccBand) do={:error "CA OK bye!"}
:log warning "start CA Band 3"
:local speedtest [tool bandwidth-test 87.121.0.45 protocol=tcp user=neterra password=neterra direction=receive duration=10s as-value ];
:log warning "analyse bandwidth"
:local MyFuncDataToMKbps do={
:local DataOriginal $1
:set DataOriginal ($DataOriginal / 1000)
:local Mbps ($DataOriginal / 1000 * 1000)
:local Kbps ($DataOriginal - $Mbps)
:set Mbps ($Mbps / 1000)
:return ($Mbps."M ".$Kbps."K - bps")
}
:local Rx [$MyFuncDataToMKbps ($speedtest->"rx-current")]
:local Tx [$MyFuncDataToMKbps ($speedtest->"tx-current")]
:local Time ([/system clock get date]." ".[/system clock get time])
:put "$Time | Rx: $Rx | Tx: $Tx"
:log warning "$Time | Rx: $Rx | Tx: $Tx"
:local DLMb [pick $Rx 0 [:find $Rx "M"]]
:log warning "start CA Band 4"
:local caband [interface lte monitor lte1 duration=5 as-value]
:local SccBand ($caband->"ca-band")
:if (!$SccBand) do={/interface/lte/at-chat lte1 input="at+qnwlock=\"common/4g\",1,3350,187"}
:log warning "start CA Band Trigger"