Correction of faulty data sessions via SMS

Cellular communication, especially roaming networks, are complex network infrastructures. Within these structures, it can happen time and again that individual components are disrupted.

This can start with the network provider's radio cell and extend to roaming servers such as the GRX servers. Almost all components are redundant so that backups take effect in the event of a failure. If the data stream is routed via other paths, the data session must be renewed in some cases - end devices should therefore have a routine stored that automatically detects that a data session is no longer functioning, i.e. that no more data can be exchanged. This can be done, for example, via a keep-alive ping that is sent to the Google DNS server 8.8.8.8 at regular intervals. If this ping was not successful a certain number of times, the connection should then be renewed by the end device.

We observe that some devices have not implemented such a mechanism. Therefore, it may happen that the devices are in a data session, but no data exchange is possible. 

When resetting connections via our online portal, a "Cancel Location" command is transmitted to the device. If the command is processed correctly and the device is actively registered in the mobile network, the device is triggered to renew the data session. In most cases, this will restore data connectivity. You can see how to reset the connection on an endpoint here:


Reset Connectivity Englisch

Reset via SMS commands

The basic mobile connection, which is also required to send and receive SMS, is independent of the data sessions. This means that SMS can be delivered even if there is no data connection. With very many devices, it is possible to reset the data connection via SMS commands. The best way to find out how this works is to consult the manufacturer's documentation. An example for Teltonika RUT240 routers can be found in this section. If you still have questions, our support team will be happy to help you. SMS can be sent directly to the device, for example, manually via the SMS console in the online portal. You can find instructions on how to do this in this help article. In addition, SMS can also be sent to end devices via API. With a tool such as Postman, batch processing can be carried out. We explain how this works in the following section.

Example of an SMS command for the Teltonika RUT240

The possible SMS commands for the Teltonika RUT240 LTE Router are explained in detail in the corresponding Teltonika Wiki. To do this, go to the section "SMS Utilities". The most suitable command is "Reboot" to restart the router. This will also reload any buffered parameters. If you have defined "reboot" as the SMS text for the command and "admin01" as the password, then the SMS to be sent to the device would look like this: "admin01 reboot".

Mass sending of SMS for resetting

In order to send SMS to all your devices via batch processing, you need our API. The request available to you for this is /api/v1/endpoint/{endpoint_id}/sms. You need the "endpoint_id" to execute the command for the devices. The easiest way to obtain this is via the "Device list" report:


Get Endpoint IDs englisch


You also need an authentication token to be able to execute API requests. You can create this under "Integrations" ⇒ "Application token". Please save the generated key, as you will need it.


In this example, the Postman tool is used to execute the API requests. If you do not already have an account, you can set one up here. However, you can of course also use other comparable tools, as the REST API follows common conventions. It is best to create your own workspace in Postman to create the command. Then create a new POST request for authentication under Collections. Please enter https://portal.whereversim.com/api/v1/authenticate as the URL. Define "raw" as the body and enter the following body:


2022-03-02_12h08_00

Instead of "", please insert the application token that you have previously generated in the online portal. Please make sure that it is within double inverted commas.


Please also add the following attribute under Headers:

2022-03-02_12h09_36


The following code must also be under tests so that the return value (authentication token) is saved:


This completes the request for authentication. Next, create a new "Collection" with any name, e.g. "Send SMS". This is needed to enable batch processing. Within the collection, create a request of the type "POST" to the URL shown below and with the headers shown:

2022-03-02_12h20_32


In the body of the type "raw" you then store the following content:


2022-03-02_12h21_40


You can define a sender number at source_address. For some devices, a sender is defined who may send SMS to the device. You would have to store this here. Please make sure that you specify the country code in advance. For Germany, for example, this is "+49". In the payload, enter the command that is to be sent to the device. Save the request. The preparations in Postman are now complete so that batch processing can be carried out.

Run the batch processing

First execute the request for authentication. Then click on the collection you have created. A "Run" button appears at the top right. Click this to start the batch processing and then select the request to run the batch processing. Then select the previously exported CSV file that contains the endpoints to which an SMS is to be sent. Please enter a value of approx. 200ms for Delay so that the limit of the maximum permitted API requests per time is not exceeded. You can then start the batch processing by clicking the "Run" button. The process can also be seen in the following gif:


Batch Request Postman


The batch processing is now started. You can see from the displayed return codes whether the commands were executed successfully. By the way, you can also view the sent SMS in the SMS console in the online portal after the API requests have been executed.