Locking Devices to a Mobile Cell

From Teltonika Networks Wiki
Main Page > General Information > Configuration Examples > Modem control > Locking Devices to a Mobile Cell

The information in this page is updated in accordance with 00.07.04 firmware version.

Introduction

This article contains instructions on how to lock your Teltonika device to a specific cell. All mobile carrier cells are assigned a unique ID, which is broadcasted to all connected devices. It is usually irrelevant information for the end user, as cell switching on mobile phones and routers has become very good. But sometimes in remote areas, it is beneficial to lock the LTE router to a single cell, as automatic mode may choose a cell with fewer or slower bands. For now, only some devices with Quectel modems support this feature.
Note: When the device is locked onto a single cell, it can still perform carrier aggregation (Cat 6 and higher modems only) with any other band/cell. The cell that you lock to will act as a primary band. The only way to circumvent this would be to also lock the router to a particular band.

Compatible modems

Not all modems support cell locking. To find out if your device is compatible, in your device WebUI, go to Status → System page. Under the Internal modem section, you'll see the Model row:

If the model starts with EG, EC (Quectel) or SLM (Meig), and not RG (5G devices), this feature should work. However to make sure it's supported, command gsmctl -A 'AT+QNWLOCK=?' (for Quectel modems) or gsmctl -A 'AT^CELLLOCK=?' (for Meig modems) should return these options when ran via SSH or CLI:

Quectel


root@Teltonika-RUTX11:~# gsmctl -A 'AT+QNWLOCK=?'
+QNWLOCK: "common/4g",<num of cells>,[[<freq>,<pci>],...]
+QNWLOCK: "common/lte"[,<action>[,<EARFCN>,<PCI>[,<status>]]]

Meig


root@Teltonika-RUT955:~# gsmctl -A 'AT^CELLLOCK=?'
^CELLLOCK: (0-1),("02","03"),(0-1),("arfcn"),("pci")

When to use cell locking

Let's say you're setting up RUTX14, which supports Carrier Aggregation of up to 3 bands, and you have two cell towers within a similar distance. Let's say Cell A transmits on bands 1, 7, and 20, while Cell B transmits on bands 3 and 20. Since the signal from Cell B is a little stronger, the router will connect to two bands, and the bandwidth will be lower than using three bands. This means much lower speeds and reduced throughput. If we lock the router into only using Cell A, we might get a little worse signal, but much better speeds due to using 3 bands at the same time.

Another use case could be to avoid overloaded cells. In some areas, even when the signal to a cell is great, speeds can be disappointing. This can be caused by lacking carrier infrastructure and overloaded cell towers. In this case, cell locking could be useful to connect to a cell tower with a worse signal, yet achieve better speeds.

Note: It is always recommended to use Band Lock and only resort to Cell locking if Band Lock does not resolve the issue.

Configuration

While we do not support this function via our WebUI just yet, it can quite easily be done using AT commands. AT commands are the "native language" for mobile modems, which the router uses to communicate with the modem.

A few notes before we get started:

  • The described method works with Teltonika RUT/RUTX/TCR/TRB series devices, that contain Quectel modems;
  • Using this command will lock the device into LTE-only mode;
  • Rebooting the device might remove the cell lock on Quectel modems;
  • It is not recommended to perform these actions while the device is connected remotely as if it loses connection, it will not be recoverable!

Quectel


Configuring LTE-only mode


To start, we'll set the router to LTE-only mode, by using the command:

gsmctl -A 'AT+QCFG="NWSCANMODE",3,1'

Where:

  • 3 - LTE-only mode;
  • 1 - Take effect immediately after executing the command.

The gsmctl module is responsible for communication with the modem using AT commands. By using the argument -A we can directly send the AT commands to the modem.

This may cause the router to lose connection for a few seconds, so before continuing to the next step, please make sure the router is connected to the network.

Note: Do not use WebUI to change this setting. It has to be done via AT commands.

Finding the serving cell details


To know if our changes will have any effect, we'll check the current cell we're connected to, by using a command:

gsmctl -A 'AT+QENG="SERVINGCELL"'

The output should look something like this:

root@Teltonika-RUTX11:~# gsmctl -A 'AT+QENG="SERVINGCELL"'
+QENG: "servingcell","NOCONN","LTE","FDD",246,02,139B15,459,1850,3,5,5,90,-74,-4,-50,20,0,-32768,-

We're mostly interested only in the highlighted parts:

  • 139B15 - currently serving cell ID in hexadecimal form. This ID is unique to each cell. It is only used as a reference point in this configuration.
  • 459 - PCI or Physical Cell Identity. PCI is necessary for a modem to communicate with a cell tower. This is one of the variables we will use when setting up cell locking.
  • 1850 - LTE EARFCN stands for E-UTRA Absolute Radio Frequency Channel Number. This will be the second variable when setting up cell locking.

Finding the neighbouring cells details


To check the neighboring cells, that we can connect to, this command should be used:

gsmctl -A 'AT+QENG="NEIGHBOURCELL"'

And the output should look like this:

root@Teltonika-RUTX11:~# gsmctl -A 'AT+QENG="NEIGHBOURCELL"'
+QENG: "neighbourcell intra","LTE",1850,459,-6,-71,-43,0,-,-,-,-,-
+QENG: "neighbourcell intra","LTE",1850,451,-20,-96,-63,0,-,-,-,-,-

Here's an explanation of the first line for each value:

  • LTE - network generation;
  • 1850 - EARFCN value. EARFCN is used to determine the channel frequency and bandwidth, thus it can be useful to determine the band of neighbouring cell. This can be achieved using EARFCN calculator;
  • 459 - PCI;
  • -6 - RSRQ (dB);
  • -71 - RSRP (dBm);
  • -45 - Signal Strength - RSSI (dBm).

The explanation for the last 3 measurements can be found on our Mobile signal strength recommendations page. From these outputs, the most fitting cell should be picked, and its EARFCN and PCI value should be noted.

Locking to a selected cell


Once we pick out the cell that we prefer, we can execute this command, with <EARFCN> and <PCID> replaced with desired variables from the previous commands (< and > are not needed):

gsmctl -A 'AT+QNWLOCK="common/lte",2,<EARFCN>,<PCI>'

Output from the command should be OK, if it's not, please double-check the spelling.

Meig


Configuring LTE-only mode


To start, we'll set the router to LTE-only mode, by using the command:

gsmctl -A 'AT^SYSCFGEX="03"'

The gsmctl module is responsible for communication with the modem using AT commands. By using the argument -A we can directly send the AT commands to the modem.

This may cause the router to lose connection for a few seconds, so before continuing to the next step, please make sure the router is connected to the network.

Note: Do not use WebUI to change this setting. It has to be done via AT commands.

Finding the serving cell details


To know if our changes will have any effect, we'll check the current cell we're connected to, by using a command:

gsmctl -A 'AT+CELLINFO=1'

The output should look something like this:

root@Teltonika-RUT955:~# gsmctl -A 'AT+CELLINFO=1'
+CELLINFO:LTE,FDD LTE,246,02,1284885,459,5019,21,144,3,100,1850,19850,-47,-77,-5,164,12,4,255,-,-,1,-,1,-,0,0,0

We're mostly interested only in the highlighted parts:

  • 1284885 - currently serving cell ID. This ID is unique to each cell. It is only used as a reference point in this configuration.
  • 459 - PCI or Physical Cell Identity. PCI is necessary for a modem to communicate with a cell tower. This is one of the variables we will use when setting up cell locking.
  • 1850 - LTE EARFCN stands for E-UTRA Absolute Radio Frequency Channel Number. This will be the second variable when setting up cell locking.

Finding the neighbouring cells details



To check the neighboring cells, that we can connect to, this command should be used:

gsmctl -A 'AT+CELLINFO=2'

And the output should look like this:

root@Teltonika-RUT955:~# gsmctl -A 'AT+CELLINFO=2'
+CELLINFO: "intra","LTE",1850,451,-5,-72,-59,-,0,0,-,-,0,0,0,0,0,0,0,0,-2080444074,-2080444074

Here's an explanation of the first line for each value:

  • LTE - network generation;
  • 1850 - EARFCN value. EARFCN is used to determine the channel frequency and bandwidth, thus it can be useful to determine the band of neighbouring cell. This can be achieved using EARFCN calculator;
  • 451 - PCI;
  • -5 - RSRQ (dB);
  • -72 - RSRP (dBm);
  • -59 - Signal Strength - RSSI (dBm).

The explanation for the last 3 measurements can be found on our Mobile signal strength recommendations page. From these outputs, the most fitting cell should be picked, and its EARFCN and PCI value should be noted.

Setting the device to the airplane mode


To set the device to the airplane mode, run this command:

gsmctl -A 'AT+CFUN=0'

This process may take up to one minute, and when it's done, the modem will reply OK in the terminal.

Locking to a selected cell


Once we pick out the cell that we prefer, we can execute this command, with <EARFCN> and <PCID> replaced with desired variables from the previous commands (< and > are not needed):

gsmctl -A 'AT^CELLLOCK=<0-disable / 1-enable>,<2-WCDMA / 3-LTE>,1,<EARFCN>,<PCID>'

So an example command would look like this:

gsmctl -A 'AT^CELLLOCK=1,3,1,1850,451'

Output from the command should be OK, if it's not, please double-check the spelling.

Disabling the airplane mode


To disable the airplane mode after the configuration is done, run this command:

gsmctl -A 'AT+CFUN=1'

It can take up to around 5 minutes for the modem to reconnect to the desired cell, thus the modem status should be monitored in the WebUI by navigating to Status → Network → Mobile until the Data connection state changes to Connected.

Results

To verify that the cell change occurred, wait around 30 seconds and again run the command from the Finding the serving cell details section. The output values for PCI and EARFCN should now match the ones used in the previous command. If not, please double check, that you have not set the same cell as the router was connected to before.

Note: After changing SIM card settings, please verify that the cell lock is still in place, as some settings could cause the cell lock to reset.

Cell ID value can also be checked by going to Status → Network → Mobile in the router's WebUI:
Please keep in mind that Cell ID is displayed in its decimal form on WebUI.

Reverting to an automatic cell selection

If you decide that this feature is no longer needed, it can always be reverted back to automatic cell selection.

Quectel


First, let's set cell selection back to auto using this command:

gsmctl -A 'AT+QNWLOCK="common/lte",0'

Then, we need to bring the device service mode back to Auto, by using this command:

gsmctl -A 'AT+QCFG="NWSCANMODE",0,1'

And that's it! Your router should be back to fully automatic mode.

Meig


First, let's set cell selection back to auto using this command:

gsmctl -A 'AT^CELLLOCK=0'

Then, we need to bring the device service mode back to Auto, by using this command:

gsmctl -A 'AT^SYSCFGEX="00"'

And that's it! Your router should be back to fully automatic mode.

See also/References

OpenCellid - database of cells and their locations;
CellMapper - database of cells, their locations as well as EARFCN and PCI data;