03-13-2015 06:20 AM
Our 819 4G routers have dual sim cards, but the units don't seem to always failover to the 2nd sim once the data allowance on the first is used.
I am after a script to failover to the alternative sim if a ping times out for 5 minutes.
So if the unit is currently running on sim0 it will fail to sim1 or vise versa, or if the unit is already on sim1 to fail to sim0
I cant work out the commands to run to find out the current sim and to start an if command
expected replies from command : show cellular 0 security
Active SIM = 0
or
Active SIM = 1
track 1 ip sla 10 reachability
delay down 10 up 10
!
ip sla 10
icmp-echo 8.8.8.8 source-interface Vlan1
frequency 300
ip sla schedule 10 life forever start-time now
!
event manager applet SimFailover
event track 1 state down
action 0.1 ##### work out value of active sim
action 0.2 ##### save value
action 0.3 ##### if value equals 0
action 0.4 cli command "cellular 0 lte sim activate slot 1"
action 1.1 else
action 1.2 cli command "cellular 0 lte sim activate slot 0"
Solved! Go to Solution.
03-13-2015 09:05 PM
This should work:
action 0.1 cli command "enable"
action 0.2 cli command "show cellular0 security"
action 0.3 regexp "Active SIM = ([0-9])" $_cli_result match sim
action 0.4 if $sim eq 0
...
action 1.3 end
03-13-2015 09:05 PM
This should work:
action 0.1 cli command "enable"
action 0.2 cli command "show cellular0 security"
action 0.3 regexp "Active SIM = ([0-9])" $_cli_result match sim
action 0.4 if $sim eq 0
...
action 1.3 end
03-16-2015 08:58 PM
sim 1 and sim 2
different chat script ?!
how realise ?
03-17-2015 08:56 AM
I don't understand the question. If you have different SIM numbers, just change the "if" statement to reflect the desired numbers.
03-26-2015 05:33 AM
hi!
sim 1, 2 - different:
apn,
username,
password...
03-27-2015 02:36 AM
Hi Kuat
Sorry I don't understand the question.
Both our sims are different providers (on this unit the sims are 0 and 1)
I have marked Joseph reply as correct
03-30-2015 08:44 PM
HI! ok....
eg.:
1) sim 1, slot 1, provider - "myGSMprovider1"
apn - "internet"
other parameter not need.
2) sim 2, slot 2, provider - "myGSMprovider2"
apn - "internet.provadername.countrycode"
username- "@internet.providername"
password- "providername.countrycode"
eg. if change active slot, provider1, not work with other setting (sett.for sim2)
how change active sim, and chat script?
how rollback?
04-16-2015 03:08 AM
Hello Kuat,
You should only have one chat script with no profile defined.
Example:
chat-script gsm "" "AT!SCACT=1" TIMEOUT 60 "OK"
instead this,
chat-script gsm "" "AT!SCACT=1,4" TIMEOUT 60 "OK"
chat-script gsm "" "AT!SCACT=1,5" TIMEOUT 60 "OK"
Then you should specify on controller cellular 0, what profile should be used for each sim:
controller Cellular 0
gsm sim profile 4 slot 1
gsm sim profile 5 slot 0
Now you sould be able to use both profiles depending on what SIM is active.
Hope that helps,
Bruno Petrónio
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide