FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
585 views 17 comments
by anonymous
This is full output, then command hangs.
Both sims were fully functional in 00.06-release.
This is after fresh firmware upgrade without keeping config.
While logread shows some output at router-start, the below command does not show anything more from the log.

root@Teltonika-RUT955:~# sim_switch change sim2
Starting sim_switch...
Initializing uloop...
Connecting to ubus...
Reading configuration...
Running...

( Sending sms with switch_sim is working. )

And 2nd question: Which command I could use to get currently used sim-tray?

Many thx for your help,
Best regards,
Rainer
by anonymous
--- seems 2. question is fully misunderstood, please read comment below  ---

1 Answer

0 votes
by anonymous

Hello,


The command to see the status of the network interfaces is "cat /etc/config/network" and the one that the router is using to get a connection with the internet should be the one with the lowest metric. Also, you can use  "cat /etc/config/simcard" to see extra information about the simcard configuration, like which slot is configured as the primary one.

The issue with the sim switch command has been noted and a workaround to this command is to use the following command: "ubus call sim change". 

Also, you can use the command "ubus call network.interface.mobXs1a1 status" to get information about the network interfaces of the router. 


 

Best answer
by anonymous
I tested FW 07.01.2 right now - the same, the sim_change command prints above output after that nothing happens (system reacts as if nothing has been done).
So question: Is "sim_switch change sim2" still the correct command also in release7 ?
By when this important command would work again (when next FW-release is available)?

Regarding 2nd question: May be it was not that precise: I need to know WHICH sim-tray/slot (so sim1 or sim2) is currently in use by modem?

Thx, Rainer
by anonymous
Hello,

Sorry, I think we have a little miss understanding, the command should work on the release that you are using, what meant for "SIM issues" were connectivity issues, like not being able to connect to a certain network.

And again sorry for the second missed understanding, the correct commando for this would be "cat /etc/config/network", the information that you are looking for is located on the last lines of the output of this command, "mob1s1a1" corresponds to SIM1 and "mob1s2a1" to SIM2, the one being in used is the one with the lower metric. Also, you could use the command "cat /etc/config/simcard" and you can find specific configuration for each simcard, like which one is the primary and APN configuration.
by anonymous

Thx.

To first question (sim_switch change simX does not work):
>>> the command should work on the release that you are using
Well, command hanging in 7.01.4 and 7.01.2, so I did a sim_switch with -D for you to see at the very end of this comment.

For the 2nd question:
But both sim-cards have same metric, so how the WebUI gets the info about which sim is the one that is used right now?

>>> cat /etc/config/network:

...

config interface 'mob1s1a1'

        option proto 'wwan'
        option modem '1-1.4'
        option metric '2'
        option sim '1'
        option pdp '1'
        option apn 'web.vodafone.de'
        option auth 'none'

config interface 'mob1s2a1'

        option proto 'wwan'
        option modem '1-1.4'
        option metric '2'
        option sim '2'
        option pdp '1'
        option apn 'web.vodafone.de'
        option auth 'none'

Output of "sim_switch change simX" (remember, automatic sim-switch e.g. by sms is working fine):

root >>> /usr/bin/sim_switch -D change sim1

/usr/bin/sim_switch -D change sim1
Starting sim_switch...
Warning: debug messages will be shown!
Initializing uloop...
Connecting to ubus...
*** entry [config_read:330] ***
Reading configuration...
*** entry [read_entry:293] ***
*** entry [identify_modem:172] ***
Modem identified: 1-1.4 / 7
*** exit [identify_modem:233] ***
*** entry [set_sim_primary:128] ***
*** exit [set_sim_primary:167] ***
        @option: modem = 1-1.4
        @option: position = 1
        @option: enabled = 1
        @option: fail_flag = 1
        @option: interval = 10
        @option: retry_count = 3
        @option: data_fail = 1
*** entry [read_rule:270] ***
*** exit [read_rule:286] ***
Reading section `1` done.
*** exit [read_entry:325] ***
Found modem: 1-1.4 and sim 1
*** entry [read_entry:293] ***
*** entry [identify_modem:172] ***
Modem identified: 1-1.4 / 7
*** exit [identify_modem:233] ***
*** entry [set_sim_primary:128] ***
Section 2 is primary
*** exit [set_sim_primary:167] ***
        @option: modem = 1-1.4
        @option: position = 2
        @option: enabled = 1
        @option: fail_flag = 1
        @option: interval = 10
        @option: retry_count = 3
        @option: data_fail = 1
*** entry [read_rule:270] ***
*** exit [read_rule:286] ***
Reading section `2` done.
*** exit [read_entry:325] ***
Found modem: 1-1.4 and sim 2
*** exit [config_read:416] ***
Running...
*** entry [watcher_run:137] ***
*** entry [verify_rules:71] ***
Verifying rules...
Different sim is used
*** exit [verify_rules:132] ***
*** entry [verify_rules:71] ***
Verifying rules...
*** entry [rules_check_data_fail:252] ***
[rules_check_data_fail] - Received - Connected
*** exit [rules_check_data_fail:289] ***
*** exit [verify_rules:132] ***
*** exit [watcher_run:160] ***
*** entry [watcher_run:137] ***
*** entry [verify_rules:71] ***
Verifying rules...
Different sim is used
*** exit [verify_rules:132] ***
*** entry [verify_rules:71] ***
Verifying rules...
*** entry [rules_check_data_fail:252] ***
[rules_check_data_fail] - Received - Connected
*** exit [rules_check_data_fail:289] ***
*** exit [verify_rules:132] ***
*** exit [watcher_run:160] ***
*** entry [watcher_run:137] ***
*** entry [verify_rules:71] ***
Verifying rules...
Different sim is used
*** exit [verify_rules:132] ***
*** entry [verify_rules:71] ***
Verifying rules...
*** entry [rules_check_data_fail:252] ***
[rules_check_data_fail] - Received - Connected
*** exit [rules_check_data_fail:289] ***
*** exit [verify_rules:132] ***
*** exit [watcher_run:160] ***
^C
by anonymous

Hello, 

Thanks for the screenshot, of the output of the command "sim_switch change simX" we are going to look into it. 

About your second question. Using this command "cat /etc/config/simcard" you should be able to see which SIM card is configured as the primary one. It is not normal that if you are only using cellular data both SIMs have the same metric because there should be one that is the primary and is being used for the connection. It could show the same metric if you have another WAN connected, please confirm that this is or isn't the case, if it is not the case we could assume that is probably a bug and is something that would be needed to check with the development team.

by anonymous

Thx for sim_switch debug-output investigation.

/etc/config/simcard is properly configured from my pov:
position=1 and primary=0 for sim1, and
position=2 and primary=1 for sim2

Metric in /etc/config/network shows 2 for both cards, but there is also interface wan with metric 1. Note, I didn't change anything under menu "Interface" or "Failover", I just let the default after a fresh Firmware-Installation:

cat /etc/config/network | egrep "^config|metric"

config interface 'loopback'

config globals 'globals'

config interface 'wan'

        option metric '1'

config interface 'wan6'

        option metric '1'

config interface 'lan'

config switch

config switch_vlan

config interface 'mob1s1a1'

        option metric '2'

config interface 'mob1s2a1'

        option metric '2'

Mmmh, I think there must be an easy command checking /proc or /sys-FS or or to find out which sim is in use, the same that WebUI is doing to show me this.

by anonymous
Hello,

Yes, in this case, both SIMs have the same metric because you have a wired WAN, that is the one with the 1 metric. When you have a wired WAN by default configuration the router is always going to prefer that one over the others, so with the default configuration, you are not using any SIM at the moment.

If you want to use a SIM even when you have a wired WAN you have to change the hierarchy of the connections please follow the next instructions:

1. Go to the interfaces menu inside the Network tab on the web UI.

2. Drag and drop the interface that you want to have a lower or higher hierarchy.

3. Once you have ordered this in the desired way, click "Save and Apply" and the hierarchy of the interface would be changed.

Hope this was helpful.
by anonymous
May be FULL missunderstanding ;-)
I'm not interested in order of interface-usage...I'm also not interested in failover-order or so...my question SOO simple:
I start with the default configuration after fresh FW-Installation (as shown below). I insert 2 SIMs and both are working well incl. a sim-switch by SMS. But HOW could I get information (by CLI) WHICH SIM is the active one at a time?
(Of course I could get the latest info from logread and do some grep, but this will probably no more work in next release; Just ask RnD from which file user can see what is the active-sim, 1 or 2)

Btw, any news why sim_switch is not working from RnD ?

Many thx, Rainer
by anonymous

Hello, 

Sorry for my late response. The easiest way to check which SIM is being used is with the "cat /etc/config/simcard" command and "cat /etc/config/network" command. Using the option that you suggest of logread and grep should work just fine, and you don't have to worry about this feature not working in the future. The issue with the sim switch command has been noted and a workaround to this command is to use the following command: "ubus call sim change". 

by anonymous

Many thx, <<< ubus call sim change>>> does the job :-)

But I still have no possibility to see (via CLI) which sim-card is active, 1 or 2 (except grepping in logread).
/etc/config/simcard and /etc/config/network definitely does NOT change after a sim-switch (you could test on your own).
So, how to get this simple information?

Thx for your effort,
Best regards, Rainer

by anonymous
Hello,

Sorry for my late response. You could also use this command "ubus call network.interface.mob1s1a1 status" or "ubus call network.interface.mob2s1a1 status" depending on which SIM slot you want to check the status.
by anonymous

Great. That's it.

"ubus call network.interface.mob1sXa1 status" shows which sim is active :-)

Many thx :-)

by anonymous

Our experiments show that ubus call sim get work in both v6 and v7. 

root@VPN087:~# cat /etc/version

RUT9XX_R_00.06.07.3

root@VPN087:~# ubus call sim get

{

        "sim": 2

}

root@VPN087:~#

root@Teltonika-RUT955:~# cat /etc/version

RUT9_R_00.07.01.4

root@Teltonika-RUT955:~# ubus call sim get

{

        "sim": 1

}

root@Teltonika-RUT955:~#

However we are still trying to find a way to switch sim that works in both v6 and v7. Is this possible? 
For v6 this works:
sim_switch change sim1
But this fails in v7. And for v7 we can use:
ubus call sim change
But in v6 this takes the device offline for >10 minutes and sim is not switched, probably due to sim failover.
by anonymous

Hello, 

The bug that is causing the command "sim_switch change sim1" to not work has been noted by us and the R&D team, so this should be fixed by a future firmware release but at the moment there is no date for this. 

by anonymous
Many thx :-)
by anonymous
Is `sim_switch change sim2` etc working yet as of firmware RUTX_R_00.07.02.2 ?
by anonymous
"ubus call sim change" is working

just fyi: I prefix a "gsmctl --reboot; sleep 10; ..." (not really nice workaround) to resolve modem-hangs which I have from time to time. These cmds I checked in a loop out of a few hundreds switches and is working 100% well.