Difference between revisions of "Gsmctl commands"

From Teltonika Networks Wiki
Line 11: Line 11:
 
* knowledge on how to login via a '''[[Command line interfaces|command line interface]]'''
 
* knowledge on how to login via a '''[[Command line interfaces|command line interface]]'''
  
==gsmctl options==
+
==gsmctl options overview==
  
''gsmctl'' commands are used in tandem with various options that specify what type of action should be executed. This section overviews all of the available ''gsmctl'' options.
+
''gsmctl'' commands are used in tandem with various options that specify what type of action should be executed.
 
----
 
----
 
'''Example structure'''
 
'''Example structure'''
Line 38: Line 38:
 
Note that in the shorter version multiple options can be used together with one hyphen (-) symbol with no spacing, while in the longer version different options must be separated by spaces and before each option a double hyphen (--) is required.
 
Note that in the shorter version multiple options can be used together with one hyphen (-) symbol with no spacing, while in the longer version different options must be separated by spaces and before each option a double hyphen (--) is required.
 
    
 
    
===Basic options===
+
==Basic options==
----
+
 
 
This subsection overviews basic ''gsmctl'' options, usually related to obtaining  
 
This subsection overviews basic ''gsmctl'' options, usually related to obtaining  
  
====Get IP address of logical interface====
+
===Get IP address of logical interface===
 
----
 
----
 
To obtain the IP address of a network interface, use '''''-p''''' or '''''--ip''''' options.
 
To obtain the IP address of a network interface, use '''''-p''''' or '''''--ip''''' options.
Line 59: Line 59:
 
Where '''''wwan0''''' is the name of the mobile interface when the connection type is set to QMI (default). You can use the '''''ifconfig''''' command to check the names of existing network interfaces.
 
Where '''''wwan0''''' is the name of the mobile interface when the connection type is set to QMI (default). You can use the '''''ifconfig''''' command to check the names of existing network interfaces.
  
====Get number of bytes sent====
+
===Get number of bytes sent===
 
----
 
----
  
  
====Get number of bytes received====
+
===Get number of bytes received===
 
----
 
----
  
  
====Get 3G connection state====
+
===Get 3G connection state===
 
----
 
----
  
  
===SMS management options===
+
==SMS management options==
 
----
 
----
  
====Read SMS by index====
+
===Read SMS by index===
 
----
 
----
  
  
====List SMS by type====
+
===List SMS by type===
 
----
 
----
  
  
====Print SMS memory usage====
+
===Print SMS memory usage===
 
----
 
----
  
  
====Delete SMS by index====
+
===Delete SMS by index===
 
----
 
----
  
  
====Send SMS====
+
===Send SMS===
 
----
 
----
  
  
====Send SMS encoded in base64====
+
===Send SMS encoded in base64===
 
----
 
----
  
===Auxiliary options===
+
==Auxiliary options==
----
+
 
  
====Send AT command to device====
+
===Send AT command to device===
 
----
 
----
  
====Enter shell mode====
+
===Enter shell mode===
 
----
 
----
  
====Enable debug information====
+
===Enable debug information===
 
----
 
----
  
====Do not log the command====
+
===Do not log the command===
 
----
 
----

Revision as of 11:28, 30 July 2018

Introduction

gsmctl is an SSH command used to communicate with a RUTxxx router's modem. In other words, gsmctl relays AT commands (a set of instructions used to control a modem) to the router's modem; thus, providing the user with a way to control and obtain information from the modem via SSH. This can be used to either obtain certain modem related variables (signal strength, operator, connection state, etc.) or to execute certain actions (sending SMS messages, changing the frequency band, etc.).

This article provides a complete overview on gsmctl commands available in RUTxxx routers.

Prerequisites

gsmctl commands can be used on all RUTxxx routers via any type of command line interface (CLI) supported by the router. So all you need is:

gsmctl options overview

gsmctl commands are used in tandem with various options that specify what type of action should be executed.


Example structure

Individual options are described in separate subsections of this article. To find the information you are looking for faster, refer to the table of contents at the top of the page or use your browser's "Find in page" (Control + F) feature.

Each option is presented with its usage syntax and an example command. For easier differentiation of the different elements that make up the examples, different colors are used:

  • options are highlighted in blue
  • responses are highlighted in red
  • additional parameters are highlighted in purple

Two execution methods

Each option can be executed in two distinct ways. One is shorter, the other is longer and more descriptive. For example, to obtain the modem's IMEI you can either use:

  • short version: gsmctl -i
  • long version: gsmctl --imei

Combined options

Multiple options can be combined together to obtain more than one parameter at a time. For example, to obtain the name of the operator used, signal strength and connection type with one command you can use one of the following:

  • short version: gsmctl -oqt
  • long version: gsmctl --operator --signal --conntype

Note that in the shorter version multiple options can be used together with one hyphen (-) symbol with no spacing, while in the longer version different options must be separated by spaces and before each option a double hyphen (--) is required.

Basic options

This subsection overviews basic gsmctl options, usually related to obtaining

Get IP address of logical interface


To obtain the IP address of a network interface, use -p or --ip options.

Usage syntax:

gsmctl -p, --ip <INTERFACE>

Where <INTERFACE> is the name of a network interface.

Example: obtaining the IP address of the mobile connection interface:

root@Teltonika:~# gsmctl -p wwan0
10.139.75.221

Where wwan0 is the name of the mobile interface when the connection type is set to QMI (default). You can use the ifconfig command to check the names of existing network interfaces.

Get number of bytes sent



Get number of bytes received



Get 3G connection state



SMS management options


Read SMS by index



List SMS by type



Print SMS memory usage



Delete SMS by index



Send SMS



Send SMS encoded in base64


Auxiliary options

Send AT command to device


Enter shell mode


Enable debug information


Do not log the command