Gsmctl commands
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:
- a RUTxxx router
- knowledge on how to login via a command line interface
gsmctl options
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.
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:
shorter version: gsmctl -i
longer version: gsmctl --imei
Get IP address of logical interface
To obtain the IP address of a network interface, use -p or --ip options.
Usage:
-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
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.
Basic options
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