Rutx14 Sim 1 and SIM 2 settings

Hi All,

We have a Rutx14 we have just purchased a new Sky sim (with limited data) for sim 2 and have a Three sim (unlimited data but rubbish in an evening).

We are trying to get the settings correct to switch between SIM 1 and SIM 2 so that we are not getting constant buffering. Essentially between 7pm and 11pm we need SIM 2 to take over is there a way to make the settings less sensitive because whats happening now is its just jumping from SIM 1 to SIM 2 as SIM 1 Dbs fluxtuates so much.

Would appreciate any feedback and someone to talk us through like idiots step by step.

Cheers H x

Hello,

Thanks for contacting Teltonika Networks’ technical support team.

Teltonika Network’s devices give you the ability to adjust their settings at scheduled times. Though not natively, it can be done. To do this, you’ll need to connect to the router’s Command Line Interface (CLI). Don’t be intimidated. We are here to guide you through the process.

Firstly, we will need to change the NTP server’s parameters for more accurate time data.

  • Connect to router’s WebUI. Make sure you are in advanced mode.

  • Go to System → Administration. Go to the NTP section.

  • Enable Timezone synchronization.

  • Press Save & Apply.

Now we will create a new folder called automation, then create a script file in /etc/automation and create two cronjobs to automate the SIM switching. This way SIM1 will switch to SIM2 at 7 pm. Then at 11 pm, it will switch back.

  • Go to System → Maintenance → CLI.

  • As login name write: root

  • Type in your password and press enter. Note: when you enter the password you will not see any characters.

  • Execute these commands in the CLI window (after each command press enter):

mkdir /etc/automation

echo “/etc/automation” >> /etc/sysupgrade.conf

cd /etc/automation

touch switching.sh

chmod +x switching.sh

vi switching.sh

Press i and type/copy this text. When typing/copying the script’s text spaces will matter. Especially in the if statements.

#!/bin/ash

current_hour=$(date +%H)
current_min=$(date +%M)
current_sim=$(gsmctl -T)


echo "Current time - $current_hour:$current_min"
if [[ $current_hour -ge 19 ]] && [[ $current_hour -le 22 && $current_min -le 59 ]]
then
       if [[ $current_sim -eq 1 ]]
       then
              gsmctl -Y
              echo "SIM2 activated"
              logger "Custom SIM switching: SIM2 activated."
       else
              echo "SIM2 already active"
              logger "Custom SIM switching: SIM2 already active."
       fi

else
       if [[ $current_sim -eq 2 ]]
       then
              gsmctl -Y
              echo "SIM1 activated"
              logger "Custom SIM switching: SIM1 activated."
       else
              echo "SIM1 already active"
              logger "Custom SIM switching: SIM2 already active."
       fi
fi

Press esc and type :(colon)wq
Execute these commands:

./switching 
crontab -l | { cat; echo "* 19 * * * /etc/automation/switching.sh >/dev/null 2>&1"; } | crontab -
crontab -l | { cat; echo "* 23 * * * /etc/automation/switching.sh >/dev/null 2>&1"; } | crontab -

After completing these steps, you will create a script file which should run at 7 pm and 23 pm to switch SIMs. In addition, the file will not be deleted after a firmware upgrade. However, if the router is reset to its factory settings the file and directory “automation” will be deleted and you will need to redo these steps.

As an alternative way to write the script file’s text, you could write the text on your computer via Notepad++, or another text editor. Then using WinSCP upload that script to the router catalog /etc/automation. Instructions on how to upload the file can be found in this wiki page: https://wiki.teltonika-networks.com/view/Upload_%26_Download_Files_from_RutOS . In this scenario, if you ever need to restore the device back to its factory settings, then the script would be on your computer and you would not need to rewrite the script again. You would only need to execute the commands listed above and below the text.

Keep in mind, since RUTX14 has only 1 modem. Then during the SIM switch for a couple of seconds, the router will lose its mobile connection.

If you have more questions, feel free to ask.

Best regards,

Tautvydas

This topic was automatically closed after 15 days. New replies are no longer allowed.