|
|
Line 1: |
Line 1: |
− | ==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.).
| + | <span style="color: red;">The information in this page is shown in accordance with legacy firmware versions, updated page for new firmware can be found [[RUTX gsmctl Commands|here]].</span> |
| | | |
− | This article provides a complete overview on ''gsmctl'' commands available in RUTxxx routers.
| + | {{Template: Gsmctl_commands |
− | | + | <!------------------------DEVICE-----------------------> |
− | ==Prerequisites==
| + | | series = RUT9XX |
− | | + | | name = RUT |
− | ''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 interfaces|command line interface]]'''
| |
− | | |
− | ==gsmctl options==
| |
− | | |
− | ''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" feature ('''Control + F''').
| |
− | | |
− | 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:
| |
− | | |
− | *<span style="color:blue;">options</span> are highlighted in blue
| |
− | *<span style="color:red;">responses</span> are highlighted in red
| |
− | *<span style="color:purple;">additional parameters</span> 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'''''
| |
− | | |
− | In both cases, you just type the desired command and press the "Enter" key on your keyboard to execute that command. The response will be printed out as a '''standard output''' ('''stdout''') string in your terminal window.
| |
− | ----
| |
− | '''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 section overviews basic ''gsmctl'' options, usually related to obtaining certain modem related information.
| |
− | | |
− | ===Get IP address of logical interface===
| |
− | ----
| |
− | To obtain the IP address of a network interface, use '''''-p''''' or '''''--ip''''' options.
| |
− |
| |
− | '''Usage syntax''':
| |
− |
| |
− | gsmctl <span style="color:blue;">-p</span>, <span style="color:blue;">--ip</span> <span style="color:purple;"><INTERFACE></span>
| |
− | | |
− | Where ''<INTERFACE>'' is the name of a network interface.
| |
− | | |
− | '''Example''': obtaining the IP address of the mobile connection interface:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-p</span> <span style="color:purple;">mob1s1a1</span>
| |
− | <span style="color:red;">10.139.75.221</span>
| |
− | | |
− | Where '''''mob1s1a1''''' is the name of the mobile interface when the connection type is set to QMI (default). You can get names of existing interfaces from '''''/etc/config/network''''' file.
| |
− | | |
− | '''Example''':
| |
− | root@Teltonika:~# cat /etc/config/network
| |
− | config interface '<span style="color:purple;">mob1s1a1</span>'
| |
− | option proto 'wwan'
| |
− | option modem '1-1.4'
| |
− | option metric '1'
| |
− | option sim '1'
| |
− | option pdp '1'
| |
− | option auth 'none'
| |
− |
| |
− | config interface '<span style="color:purple;">mob1s2a1</span>'
| |
− | option proto 'wwan'
| |
− | option modem '1-1.4'
| |
− | option metric '1'
| |
− | option sim '2'
| |
− | option pdp '1'
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *IP address (32-bit numeric address written as four numbers separated by periods)
| |
− | | |
− | | |
− | ===Get number of bytes sent===
| |
− | ----
| |
− | To obtain the number of bytes sent (TX bytes) by a network interface, use '''''-e''''' or '''''--bsent''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-e</span>, <span style="color:blue;">--bsent</span> <span style="color:purple;"><INTERFACE></span>
| |
− | | |
− | Where ''<INTERFACE>'' is the name of a network interface.
| |
− | | |
− | '''Example''': obtaining the number of bytes sent (TX bytes) by the mobile connection interface:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-e</span> <span style="color:purple;">wwan0</span>
| |
− | <span style="color:red;">36335</span>
| |
− | | |
− | 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.
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *An integer number representing '''bytes''' (not bits) sent
| |
− | | |
− | | |
− | ===Get number of bytes received===
| |
− | ----
| |
− | To obtain the number of bytes received (RX bytes) by a network interface, use '''''-r''''' or '''''--brecv''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-b</span>, <span style="color:blue;">--brecv</span> <span style="color:purple;"><INTERFACE></span>
| |
− | | |
− | Where ''<INTERFACE>'' is the name of a network interface.
| |
− | | |
− | '''Example''': obtaining the number of bytes received (RX bytes) by the mobile connection interface:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-r</span> <span style="color:purple;">wwan0</span>
| |
− | <span style="color:red;">92551</span>
| |
− | | |
− | 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.
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *An integer number representing '''bytes''' (not bits) received
| |
− | | |
− | | |
− | ===Get network connection state===
| |
− | ---- | |
− | To obtain the network connection state, use '''''-j''''' or '''''--connstate''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-j</span>, <span style="color:blue;">--connstate</span>
| |
− | | |
− | '''Example''': obtaining the current network connection state:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-j</span>
| |
− | <span style="color:red;">connected</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *connected
| |
− | *disconnected
| |
− | | |
− | | |
− | ===Get network link state===
| |
− | ----
| |
− | To obtain the registration state of the mobile network, use '''''-g''''' or '''''--netstate''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-g</span>, <span style="color:blue;">--netstate</span>
| |
− | | |
− | '''Example''': obtaining the registration state of the mobile network:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-g</span>
| |
− | <span style="color:red;">registered (home)</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *registered (home)
| |
− | *registered (roaming)
| |
− | *unregistered
| |
− | *searching
| |
− | *unknown
| |
− | | |
− | | |
− | ===Get device IMEI===
| |
− | ----
| |
− | To obtain the modem's International Mobile Equipment Identity (IMEI), use '''''-i''''' or '''''--imei''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-i</span>, <span style="color:blue;">--imei</span>
| |
− | | |
− | '''Example''': obtaining the modem's IMEI:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-i</span>
| |
− | <span style="color:red;">990000862471854</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *a 15 digit sequence of decimal numbers
| |
− | | |
− | | |
− | ===Get SIM ICCID===
| |
− | ---- | |
− | To obtain the Integrated Circuit Card Identifier (ICCID) of the SIM card that is currently in use, use '''''-J''''' or '''''--iccid''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-J</span>, <span style="color:blue;">--iccid</span>
| |
− | | |
− | '''Example''': obtaining the ICCID of the SIM card in use:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-J</span>
| |
− | <span style="color:red;">89310410106543789301</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *a 19 or 20 digit sequence of decimal numbers
| |
− | | |
− | | |
− | ===Get device model===
| |
− | ---- | |
− | To obtain the modem's model name, use '''''-m''''' or '''''--model''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-m</span>, <span style="color:blue;">--model</span>
| |
− | | |
− | '''Example''': obtaining the modem's model name
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-m</span>
| |
− | <span style="color:red;">model_name</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *a string of letters and digits representing the model name
| |
− | | |
− | | |
− | ===Get device manufacturer===
| |
− | ---- | |
− | To obtain the modem's manufacturer's name, use '''''-w''''' or '''''--manuf''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-w</span>, <span style="color:blue;">--manuf</span>
| |
− | | |
− | '''Example''': obtaining the modem's manufacturer's name:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-w</span>
| |
− | <span style="color:red;">manufacturers_name</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *a string of letters and digits representing the manufacturer's name
| |
− | | |
− | | |
− | ===Get device serial number===
| |
− | ----
| |
− | To obtain the modem's serial number, use '''''-a''''' or '''''--serial''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-a</span>, <span style="color:blue;">--serial</span>
| |
− | | |
− | '''Example''': obtaining the modem's serial number:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-a</span>
| |
− | <span style="color:red;">990000862471854</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *a 15 digit sequence of decimal numbers
| |
− | | |
− | | |
− | ===Get device revision number===
| |
− | ----
| |
− | To obtain the modem's revision number (firmware version), use '''''-y''''' or '''''--revision''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-y</span>, <span style="color:blue;">--revision</span>
| |
− | | |
− | '''Example''': obtaining the modem's revision number:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-y</span>
| |
− | <span style="color:red;">EC25EFAR02A08M4G</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *a string of letters and digits representing the revision number (firmware version)
| |
− | | |
− | | |
− | ===Get IMSI===
| |
− | ----
| |
− | To obtain the International Mobile Subscriber Identity (IMSI), use '''''-x''''' or '''''--imsi''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-x</span>, <span style="color:blue;">--imsi</span>
| |
− | | |
− | '''Example''': obtaining IMSI:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-x</span>
| |
− | <span style="color:red;">246029999999999</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *a 15 digit (or less) sequence of decimal numbers
| |
− | | |
− | | |
− | ===Get SIM card state===
| |
− | ----
| |
− | To obtain the state of the SIM card currently in use, use '''''-z''''' or '''''--simstate''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-z</span>, <span style="color:blue;">--simstate</span>
| |
− | | |
− | '''Example''': obtaining the current SIM state:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-z</span>
| |
− | <span style="color:red;">inserted</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *inserted
| |
− | *not inserted
| |
− | | |
− | | |
− | ===Get GSM signal (RSSI) level===
| |
− | ----
| |
− | To obtain the router's current signal strength ([[RSSI]]) value, use '''''-q''''' or '''''--signal''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-q</span>, <span style="color:blue;">--signal</span>
| |
− | | |
− | '''Example''': obtaining the router's current signal strength:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-q</span>
| |
− | <span style="color:red;">-55</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *an integer number ranging from -113 to -51 (in dBm)
| |
− | | |
− | | |
− | ===Get WCDMA RSCP level===
| |
− | ----
| |
− | To obtain the router's current WCDMA [[RSCP]] level, use '''''-X''''' or '''''--rscp''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-X</span>, <span style="color:blue;">--rscp</span>
| |
− | | |
− | '''Example''': obtaining the RSCP level:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-X</span>
| |
− | <span style="color:red;">-77</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *an integer number ranging from -124 to 0
| |
− | *service mode not supported (this response is returned when the router's current service mode is not WCDMA)
| |
− | | |
− | | |
− | ===Get WCDMA EC/IO level===
| |
− | ----
| |
− | To obtain the router's current WCDMA [[EC/IO]] level, use '''''-E''''' or '''''--ecio''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-E</span>, <span style="color:blue;">--ecio</span>
| |
− | | |
− | '''Example''': obtaining the EC/IO level:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-E</span>
| |
− | <span style="color:red;">-4.000000</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *an integer number ranging from -20 to 0
| |
− | *service mode not supported (this response is returned when the router's current service mode is not WCDMA)
| |
− | | |
− | | |
− | ===Get LTE RSRP level===
| |
− | ----
| |
− | To obtain the router's current LTE [[RSRP_and_RSRQ|RSRP]] level, use '''''-W''''' or '''''--rsrp''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-W</span>, <span style="color:blue;">--rsrp</span> | |
− | | |
− | '''Example''': obtaining the RSRP level:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-W</span>
| |
− | <span style="color:red;">-103</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *an integer number ranging from >= -80 to <= -100 (dBm)
| |
− | *service mode not supported (this response is returned when the router's current service mode is not LTE)
| |
− | | |
− | | |
− | ===Get LTE SINR level===
| |
− | ----
| |
− | To obtain the router's current [[SINR]] level, use '''''-Z''''' or '''''--sinr''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-Z</span>, <span style="color:blue;">--sinr</span>
| |
− | | |
− | '''Example''': obtaining the SINR level:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-Z</span>
| |
− | <span style="color:red;">16.9</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *a real number ranging from 0.0 to 20.0 (dB)
| |
− | *service mode not supported (this response is returned when the router's current service mode is not LTE)
| |
− | | |
− | | |
− | ===Get LTE RSRQ level===
| |
− | ----
| |
− | To obtain the router's current [[RSRP and RSRQ|RSRQ]] level, use '''''-M''''' or '''''--rsrq''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-M</span>, <span style="color:blue;">--rsrq</span>
| |
− | | |
− | '''Example''': obtaining the RSRQ level:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-M</span>
| |
− | <span style="color:red;">-8.000000</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *an integer number ranging from <= - 20 to >= -10 (dB)
| |
− | *service mode not supported (this response is returned when the router's current service mode is not LTE)
| |
− | | |
− | | |
− | ===Get cell ID parameter===
| |
− | ----
| |
− | To obtain the ID of the cell that the SIM card is connected to, use '''''-C''''' or '''''--cellid''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-C</span>, <span style="color:blue;">--cellid</span>
| |
− | | |
− | '''Example''': obtaining the cell ID:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-C</span>
| |
− | <span style="color:red;">1037089</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *a 7 digit sequence of decimal numbers indicating the cell ID
| |
− | *N/A - returned when the SIM card is not inserted or unregistered
| |
− | | |
− | | |
− | ===Get name of operator used===
| |
− | ----
| |
− | To obtain the name of the operator used, use '''''-o''''' or '''''--operator''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-o</span>, <span style="color:blue;">--operator</span>
| |
− | | |
− | '''Example''': obtaining the operator name:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-o</span>
| |
− | <span style="color:red;">LT BITE GSMC</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *a string of text representing the network operator's name
| |
− | *N/A - returned when the SIM card is not connected to any operator
| |
− | | |
− | | |
− | ===Get operator number===
| |
− | ----
| |
− | To obtain the network operator's number, use '''''-f''''' or '''''--opernum''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-f</span>, <span style="color:blue;">--opernum</span>
| |
− | | |
− | '''Example''': obtaining the network operator's number:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-f</span>
| |
− | <span style="color:red;">24602</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *a 6 digit sequence of decimal numbers
| |
− | *N/A - returned when the SIM card is not connected to any operator
| |
− | | |
− | | |
− | ===Get data carrier type===
| |
− | ----
| |
− | To obtain the connection type, use '''''-t''''' or '''''--conntype''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-t</span>, <span style="color:blue;">--conntype</span>
| |
− | | |
− | '''Example''': obtaining the connection type:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-t</span>
| |
− | <span style="color:red;">LTE</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *NOSERVICE - NOSERVICE mode
| |
− | *GSM - GSM/GPRS/EDGE mode
| |
− | *WCDMA - WCDMA/HSDPA/HSPA mode
| |
− | *TDSCDMA - TDSCDMA mode
| |
− | *LTE - LTE mode
| |
− | *CDMA - CDMA mode
| |
− | *EVDO - EV-DO/eHRPD mode
| |
− | *CDMA-EVDO - CDMA/EV-DO(eHRPD) mode
| |
− | | |
− | ===Get module temperature===
| |
− | ----
| |
− | To obtain the module's temperature, use '''''-c''''' or '''''--temp''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-c</span>, <span style="color:blue;">--temp</span>
| |
− | | |
− | '''Example''': obtaining the module's temperature:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-c</span>
| |
− | <span style="color:red;">360</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *an integer number representing the module's current temperature (in 0.1 degrees Celsius (°C))
| |
− | | |
− | | |
− | ===Get PIN/PUK count===
| |
− | ----
| |
− | To obtain the PIN/PUK count, use '''''-B''''' or '''''--pincount''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-B</span>, <span style="color:blue;">--pincount</span>
| |
− | | |
− | '''Example''': obtaining the
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-B</span>
| |
− | <span style="color:red;">3</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *an integer number representing the amount of PIN/PUK attempts left
| |
− | *N/A - returned when the SIM card is not inserted
| |
− | | |
− | | |
− | ===Get network information===
| |
− | ----
| |
− | To obtain information related to the mobile network information, use '''''-F''''' or '''''--network''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-F</span>, <span style="color:blue;">--network</span>
| |
− | | |
− | '''Example''': obtaining mobile network information:
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-F</span>
| |
− | <span style="color:red;">+QNWINFO: "FDD LTE",46001,"LTE BAND 3",1650</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *response syntax: ''+QNWINFO: <Act>,<oper>,<band>,<channel>'' <br> Where:
| |
− | **'''''<Act>''''' - service mode
| |
− | **'''''<oper>''''' - operator number
| |
− | **'''''<band>''''' - frequency band used
| |
− | **'''''<channel>''''' - channel ID
| |
− | | |
− | | |
− | ===Get serving cell information===
| |
− | ----
| |
− | To obtain the , use '''''-''''' or '''''--''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-</span>, <span style="color:blue;">--</span>
| |
− | | |
− | '''Example''': obtaining the
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-</span>
| |
− | <span style="color:red;"></span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *
| |
− | | |
− | | |
− | ===Get neighbour cell information===
| |
− | ----
| |
− | To obtain the , use '''''-I''''' or '''''--neighbour''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-I</span>, <span style="color:blue;">--neighbour</span>
| |
− | | |
− | '''Example''': obtaining the
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-I</span>
| |
− | <span style="color:red;">+QENG: "neighbourcell intra","LTE",522,269,-9,-87,-58,0,-,-,-,-,-</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *
| |
− | | |
− | | |
− | ===Shutdown the modem===
| |
− | ----
| |
− | To shutdown the modem, use '''''-D''''' or '''''--shutdown''''' options. After the command is executed, the modem will stay shut off up to a '''maximum of 60 s.''' and will then start up again.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-D</span>, <span style="color:blue;">--shutdown</span>
| |
− | | |
− | '''Example''': shutting down the modem
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-D</span>
| |
− | <span style="color:red;">OK</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *OK
| |
− | | |
− | | |
− | ===List available options===
| |
− | ----
| |
− | Using '''''-h''''' or '''''--help''''' options prints of all available ''gsmctl'' options with descriptions and usage syntax examples.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-h</span>, <span style="color:blue;">--help</span>
| |
− | | |
− | '''Example''': printing a list of available ''gsmctl'' options
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-h</span>
| |
− | <span style="color:red;">usage: gsmctl OPTIONS
| |
− | -p, --ip <INTERFACE> Get IP of logical interface
| |
− | -e, --bsent <INTERFACE> Get number of bytes sent
| |
− | -r, --brecv <INTERFACE> Get number of bytes recieved</span>
| |
− | ...
| |
− | '''Possible responses''':
| |
− | | |
− | *a list of options that can be used with ''gsmctl''
| |
− | | |
− | | |
− | ===Print gsmctl version===
| |
− | ----
| |
− | To find out the current ''gsmctl'' version, use '''''-v''''' or '''''--version''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-h</span>, <span style="color:blue;">--help</span>
| |
− | | |
− | '''Example''': obtaining the ''gsmctl'' version
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-v</span>
| |
− | <span style="color:red;">GSMCTL version: 0.2b</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *a string type output indicating the ''gsmctl'' version
| |
− | | |
− | ==SMS management options==
| |
− | | |
− | This section overviews ''gsmctl'' options related to SMS management. Every SMS related command uses the '''''"-S"''''' or '''''"--sms"''''' along with another option.
| |
− | | |
− | ===Read SMS by index===
| |
− | ----
| |
− | | |
− | To read a single SMS message, use '''''-S -r''''' or '''''--sms --read''''' options. Additionally you have to specify the '''''<INDEX>''''' of the message that you wish to read. The ''<INDEX>'' is an integer number that defines the position of a message in the SMS message list. It can range from 1 to however many messages your SMS memory can store.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-S -r</span>, <span style="color:blue;">--sms --read</span> <span style="color:purple;"><INDEX></span>
| |
− | | |
− | '''Example''': reading the first message in the SMS list
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-S -r</span> <span style="color:purple;">1</span>
| |
− | <span style="color:red;">Index: 1
| |
− | Date: 2018-08-02 10:33:20
| |
− | Sender: +37061111111
| |
− | Status: read
| |
− | Text: Hello
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *five lines of string type output indicating the following information related to the SMS message:
| |
− | **Index - an integer number indicating the position of the message in the SMS message list
| |
− | **Date - the date the message was received
| |
− | **Sender - sender's phone number
| |
− | **Status - indicates whether the message has been previously read. (Possible values: ''read'' or ''new'')
| |
− | **Text - the body of the message
| |
− | *no message - indicates that an SMS message with the specified ''<INDEX>'' does not exist
| |
− | *out of range - indicates that the specified ''<INDEX>'' is out of range of the SMS message list
| |
− | | |
− | | |
− | ===List SMS by type===
| |
− | ----
| |
− | | |
− | To print a list of SMS messages, use '''''-S -l''''' or '''''--sms --list''''' options. Additionally you have to specify the '''''<TYPE>''''' of the list. ''<TYPE>'' can either '''''read''''', '''''new''''' or '''''all'''''
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-S -l</span>, <span style="color:blue;">--sms --list</span> <span style="color:purple;"><TYPE></span>
| |
− | | |
− | '''Example''': printing the list of all new (unread) SMS messages
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-S -l</span> <span style="color:purple;">new</span>
| |
− | <span style="color:red;">Index: 19
| |
− | Date: 2018-08-03 08:26:36
| |
− | Sender: +37061111111
| |
− | Text: status
| |
− | Status: new</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *multiple entries comprised of five lines of string type output indicating the following information related to an SMS message:
| |
− | **Index - an integer number indicating the position of the message in the SMS message list
| |
− | **Date - the date the message was received
| |
− | **Sender - sender's phone number
| |
− | **Text - the body of the message
| |
− | **Status - indicates whether the message has been previously read. (Possible values: ''read'' or ''new'')
| |
− | | |
− | | |
− | ===Print SMS memory usage===
| |
− | ----
| |
− | | |
− | To check the SMS memory usage, use '''''-S -t''''' or '''''--sms --total''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-S -t</span>, <span style="color:blue;">--sms --total</span>
| |
− | | |
− | '''Example''': checking the SMS memory usage
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-S -t</span>
| |
− | <span style="color:red;">Used: 28
| |
− | Total: 50 </span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *two lines of string type output
| |
− | **Used - used memory space (integer)
| |
− | **Total - total memory space (integer)
| |
− | | |
− | | |
− | ===Delete SMS by index===
| |
− | ----
| |
− | | |
− | To delete an SMS message, use '''''-S -d''''' or '''''--sms --delete''''' options. Additionally you have to specify the '''''<INDEX>''''' of the message that you wish to delete. The ''<INDEX>'' is an integer number that defines the position of a message in the SMS message list. It can range from 1 to however many messages your SMS memory can store.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-S -d</span>, <span style="color:blue;">--sms --delete</span> <span style="color:purple;"><INDEX></span>
| |
− | | |
− | '''Example''': deleting the first SMS message
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-S -d</span> <span style="color:purple;">1</span>
| |
− | <span style="color:red;">OK</span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *OK - indicates that the message with specified <INDEX> has been deleted successfully
| |
− | *out of range - indicates that the specified <INDEX> is out of range of the SMS message list
| |
− | | |
− | | |
− | ===Send SMS===
| |
− | ----
| |
− | | |
− | To send an SMS message, use '''''-S -s''''' or '''''--sms --send''''' options.
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">-S -s</span>, <span style="color:blue;">--sms --send</span> <span style="color:purple;">"<NUMBER> <TEXT>"</span>
| |
− | | |
− | '''Example''': sending a "Hello" message to the number +37011111111
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;">-S -s</span> <span style="color:purple;">"0037011111111 Hello"</span>
| |
− | <span style="color:red;"></span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *
| |
− | | |
− | | |
− | ===Send SMS encoded in base64===
| |
− | ----
| |
− | | |
− | To read a single SMS message, use '''''- -''''' or '''''-- --''''' options
| |
− | | |
− | '''Usage syntax''':
| |
− | | |
− | gsmctl <span style="color:blue;">- -</span>, <span style="color:blue;">-- --</span>
| |
− | | |
− | '''Example''':
| |
− | | |
− | root@Teltonika:~# gsmctl <span style="color:blue;"></span>
| |
− | <span style="color:red;"></span>
| |
− | | |
− | '''Possible responses''':
| |
− | | |
− | *
| |
− | | |
− | ==Auxiliary options==
| |
− | | |
− | | |
− | ===Send AT command to device===
| |
− | ----at
| |
− | at+csq
| |
− | | |
− | ===Enter shell mode===
| |
− | ----
| |
− | | |
− | ===Enable debug information===
| |
− | ----
| |
− | | |
− | ===Do not log the command===
| |
− | ----
| |
− | | |
− | ==See also==
| |
− | | |
− | *[[AT Commands]]
| |
The information in this page is shown in accordance with legacy firmware versions, updated page for new firmware can be found here.
The information in this page is shown in accordance with firmware versions {{{fw_version}}}.
Introduction
gsmctl is an SSH command used to communicate with a RUT 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 RUT routers.
Prerequisites
gsmctl commands can be used on all RUT routers via any type of command line interface (CLI) supported by the router. So all you need is:
gsmctl options
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" feature (Control + F).
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
In both cases, you just type the desired command and press the "Enter" key on your keyboard to execute that command. The response will be printed out as a standard output (stdout) string in your terminal window.
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 section overviews basic gsmctl options, usually related to obtaining certain modem related information.
Get IP address of logical interface
Note: From FW version R_00.07.03 this option is deprecated. IP addresses can be called with `ubus call network.interface.<interface> status`.
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
To obtain the number of bytes sent (TX bytes) by a network interface, use -e or --bsent options.
Usage syntax:
gsmctl -e, --bsent <INTERFACE>
Where <INTERFACE> is the name of a network interface.
Example: obtaining the number of bytes sent (TX bytes) by the mobile connection interface:
root@Teltonika:~# gsmctl -e wwan0
36335
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.
Possible responses:
- An integer number representing bytes (not bits) sent
Get number of bytes received
To obtain the number of bytes received (RX bytes) by a network interface, use -r or --brecv options.
Usage syntax:
gsmctl -r, --brecv <INTERFACE>
Where <INTERFACE> is the name of a network interface.
Example: obtaining the number of bytes received (RX bytes) by the mobile connection interface:
root@Teltonika:~# gsmctl -r wwan0
92551
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.
Possible responses:
- An integer number representing bytes (not bits) received
Get network connection state
To obtain the network connection state, use -j or --connstate options.
Usage syntax:
gsmctl -j, --connstate
Example: obtaining the current network connection state:
root@Teltonika:~# gsmctl -j
connected
Possible responses:
Get network link state
To obtain the registration state of the mobile network, use -g or --netstate options.
Usage syntax:
gsmctl -g, --netstate
Example: obtaining the registration state of the mobile network:
root@Teltonika:~# gsmctl -g
registered (home)
Possible responses:
- registered (home)
- registered (roaming)
- unregistered
- searching
- unknown
Get device IMEI
To obtain the modem's International Mobile Equipment Identity (IMEI), use -i or --imei options.
Usage syntax:
gsmctl -i, --imei
Example: obtaining the modem's IMEI:
root@Teltonika:~# gsmctl -i
990000862471854
Possible responses:
- a 15 digit sequence of decimal numbers
Get SIM ICCID
To obtain the Integrated Circuit Card Identifier (ICCID) of the SIM card that is currently in use, use -J or --iccid options.
Usage syntax:
gsmctl -J, --iccid
Example: obtaining the ICCID of the SIM card in use:
root@Teltonika:~# gsmctl -J
89310410106543789301
Possible responses:
- a 19 or 20 digit sequence of decimal numbers
Get device model
To obtain the modem's model name, use -m or --model options.
Usage syntax:
gsmctl -m, --model
Example: obtaining the modem's model name
root@Teltonika:~# gsmctl -m
model_name
Possible responses:
- a string of letters and digits representing the model name
Get device manufacturer
To obtain the modem's manufacturer's name, use -w or --manuf options.
Usage syntax:
gsmctl -w, --manuf
Example: obtaining the modem's manufacturer's name:
root@Teltonika:~# gsmctl -w
manufacturers_name
Possible responses:
- a string of letters and digits representing the manufacturer's name
Get device serial number
To obtain the modem's serial number, use -a or --serial options.
Usage syntax:
gsmctl -a, --serial
Example: obtaining the modem's serial number:
root@Teltonika:~# gsmctl -a
990000862471854
Possible responses:
Get device revision number
To obtain the modem's revision number (firmware version), use -y or --revision options.
Usage syntax:
gsmctl -y, --revision
Example: obtaining the modem's revision number:
root@Teltonika:~# gsmctl -y
EC25EFAR02A08M4G
Possible responses:
- a string of letters and digits representing the revision number (firmware version)
Get IMSI
To obtain the International Mobile Subscriber Identity (IMSI), use -x or --imsi options.
Usage syntax:
gsmctl -x, --imsi
Example: obtaining IMSI:
root@Teltonika:~# gsmctl -x
246029999999999
Possible responses:
- a 15 digit (or less) sequence of decimal numbers
Get SIM card state
To obtain the state of the SIM card currently in use, use -z or --simstate options.
Usage syntax:
gsmctl -z, --simstate
Example: obtaining the current SIM state:
root@Teltonika:~# gsmctl -z
inserted
Possible responses:
Get PIN state
To obtain the PIN state of the SIM card currently in use, use -u or --pinstate options.
Usage syntax:
gsmctl -u, --pinstate
Example: obtaining the PIN state:
root@Teltonika:~# gsmctl -u
OK
Possible responses:
To obtain the router's current signal strength (RSSI) value, use -q or --signal options.
Usage syntax:
gsmctl -q, --signal
Example: obtaining the router's current signal strength:
root@Teltonika:~# gsmctl -q
-55
Note: From FW version R_00.07.03 this argument returns all signal related values.
- Example for 3G network type:
root@Teltonika:~# gsmctl -q
RSSI: -67
RSCP: -68
ECIO: -5
- Example for 4G network type:
root@Teltonika:~# gsmctl -q
RSSI: -60
RSRP: -103
SINR: 2
RSRQ: -16
- Example for 5G network type:
root@RUTC50:~# gsmctl -q
RSSI: -74
RSRP: -100
SINR: 17
RSRQ: -6
Possible responses:
- an integer number ranging from -113 to -51 (in dBm)
Get WCDMA RSCP level
To obtain the router's current WCDMA RSCP level, use -X or --rscp options.
Note: From FW version R_00.07.03 this value has been moved under -q argument.
Usage syntax:
gsmctl -X, --rscp
Example: obtaining the RSCP level:
root@Teltonika:~# gsmctl -X
-77
Possible responses:
- an integer number ranging from -124 to 0
- service mode not supported (this response is returned when the router's current service mode is not WCDMA)
Get WCDMA EC/IO level
To obtain the router's current WCDMA EC/IO level, use -E or --ecio options.
Note: From FW version R_00.07.03 this value has been moved under -q argument.
Usage syntax:
gsmctl -E, --ecio
Example: obtaining the EC/IO level:
root@Teltonika:~# gsmctl -E
-4.000000
Possible responses:
- an integer number ranging from -20 to 0
- service mode not supported (this response is returned when the router's current service mode is not WCDMA)
Get LTE RSRP level
To obtain the router's current LTE RSRP level, use -W or --rsrp options.
Note: From FW version R_00.07.03 this value has been moved under -q argument.
Usage syntax:
gsmctl -W, --rsrp
Example: obtaining the RSRP level:
root@Teltonika:~# gsmctl -W
-103
Possible responses:
- an integer number ranging from >= -80 to <= -100 (dBm)
- service mode not supported (this response is returned when the router's current service mode is not LTE)
Get LTE SINR level
To obtain the router's current SINR level, use -Z or --sinr options.
Note: From FW version R_00.07.03 this value has been moved under -q argument.
Usage syntax:
gsmctl -Z, --sinr
Example: obtaining the SINR level:
root@Teltonika:~# gsmctl -Z
16.9
Possible responses:
- a real number ranging from 0.0 to 20.0 (dB)
- service mode not supported (this response is returned when the router's current service mode is not LTE)
Get LTE RSRQ level
To obtain the router's current RSRQ level, use -M or --rsrq options.
Note: From FW version R_00.07.03 this value has been moved under -q argument.
Usage syntax:
gsmctl -M, --rsrq
Example: obtaining the RSRQ level:
root@Teltonika:~# gsmctl -M
-8.000000
Possible responses:
- an integer number ranging from <= - 20 to >= -10 (dB)
- service mode not supported (this response is returned when the router's current service mode is not LTE)
Get cell ID parameter
To obtain the ID of the cell that the SIM card is connected to, use -C or --cellid options.
Usage syntax:
gsmctl -C, --cellid
Example: obtaining the cell ID:
root@Teltonika:~# gsmctl -C
1037089
Possible responses:
- a 7 digit sequence of decimal numbers indicating the cell ID
- N/A - returned when the SIM card is not inserted or unregistered
Get name of operator used
To obtain the name of the operator used, use -o or --operator options.
Usage syntax:
gsmctl -o, --operator
Example: obtaining the operator name:
root@Teltonika:~# gsmctl -o
LT BITE GSMC
Possible responses:
- a string of text representing the network operator's name
- N/A - returned when the SIM card is not connected to any operator
Get operator number
To obtain the network operator's number, use -f or --opernum options.
Usage syntax:
gsmctl -f, --opernum
Example: obtaining the network operator's number:
root@Teltonika:~# gsmctl -f
24602
Possible responses:
- a 6 digit sequence of decimal numbers
- N/A - returned when the SIM card is not connected to any operator
Get data carrier type
To obtain the connection type, use -t or --conntype options.
Usage syntax:
gsmctl -t, --conntype
Example: obtaining the connection type:
root@Teltonika:~# gsmctl -t
LTE
Possible responses:
- NOSERVICE - NOSERVICE mode
- GSM - GSM/GPRS/EDGE mode
- WCDMA - WCDMA/HSDPA/HSPA mode
- TDSCDMA - TDSCDMA mode
- LTE - LTE mode
- 5G-NSA - 5G mode
- 5G-SA - 5G mode
- CDMA - CDMA mode
- EVDO - EV-DO/eHRPD mode
- CDMA-EVDO - CDMA/EV-DO(eHRPD) mode
Get module temperature
To obtain the module's temperature, use -c or --temp options.
Usage syntax:
gsmctl -c, --temp
Example: obtaining the module's temperature:
root@Teltonika:~# gsmctl -c
360
Possible responses:
- an integer number representing the module's current temperature (in 0.1 degrees Celsius (°C))
Get PIN/PUK count
To obtain the PIN/PUK count, use -B or --pincount options.
Usage syntax:
gsmctl -B, --pincount
Example: obtaining the
root@Teltonika:~# gsmctl -B
3
Possible responses:
- an integer number representing the amount of PIN/PUK attempts left
- N/A - returned when the SIM card is not inserted
Get network information
To obtain information related to the mobile network information, use -F or --network options.
Usage syntax:
gsmctl -F, --network
Example: obtaining mobile network information:
root@Teltonika:~# gsmctl -F
+QNWINFO: "FDD LTE",46001,"LTE BAND 3",1650
Possible responses:
- response syntax: +QNWINFO: <Act>,<oper>,<band>,<channel>
Where:
- <Act> - service mode
- <oper> - operator number
- <band> - frequency band used
- <channel> - channel ID
Get serving cell information
To obtain the serving cell information, use -K or --serving options.
Usage syntax:
gsmctl -K, --serving
Example: obtaining the serving cell information
root@Teltonika:~# gsmctl -K
+QENG: "servingcell","NOCONN","LTE","FDD",246,02,FD317,109,1850,3,5,5,92,-108,-12,-76,14,-
MEIG modem output:
+SGCELLINFOEX:LTE,FDD LTE,246,02,1037079,109,4051,23,146,3,100,1850,19850,-63,-99,-13,199,19,4,255,-,-,4,-,0,-,0,0,0
Note: From FW version R_00.07.03 the values are returned in a different format. Example:
root@Teltonika:~# gsmctl -K
Access tech: LTE | TDD mode: FDD | MCC: 246 | MNC: 2 | UE state: 3
Get neighbour cell information
To obtain the neighbor cell information, use -I or --neighbour options.
Usage syntax:
gsmctl -I, --neighbour
Example: obtaining the neighbour cell information
root@Teltonika:~# gsmctl -I
+QENG: "neighbourcell intra","LTE",522,269,-9,-87,-58,0,-,-,-,-,-
Print gsmctl version
To find out the current gsmctl version, use -v or --version options.
Usage syntax:
gsmctl -v, --version
Example: obtaining the gsmctl version
root@Teltonika:~# gsmctl -v
GSMCTL version: 0.2b
Possible responses:
- a string type output indicating the gsmctl version
Get operator station time
To obtain the operator station, use -H or --modemtime options with time argument (1 - GMT, 2 - local).
Usage syntax:
gsmctl -H, --modemtime <1/2>
Example: obtaining the operator time
root@Teltonika:~# gsmctl -H 1
22/12/01,12:27:14
Get modem info in json format
To obtain the full modem information in JSON format, use -E or --info options.
Note: This argument is supported from FW version R_00.07.03.
Usage syntax:
gsmctl -E, --info
Example: obtaining the modem information
root@Teltonika:~# gsmctl -E
{
"name": "Quectel EG06-E",
"model": "EG06-E",
"manuf": "Quectel",
"driver": "Quectel EG06 AT",
"usb_id": "3-1",
...
Reboot the modem
To reboot the modem, use -Q or --reboot options. After the command is executed, the modem will start rebooting.
Usage syntax:
gsmctl -Q, --reboot
Example: rebooting the modem
root@Teltonika:~# gsmctl -Q
Modem was reset
Possible responses:
Shutdown the modem
To shutdown the modem, use -D or --shutdown options. After the command is executed, the modem will stay shut off up to a maximum of 60 s. and will then start up again.
Usage syntax:
gsmctl -D, --shutdown
Example: shutting down the modem
root@Teltonika:~# gsmctl -D
OK
Possible responses:
List available options
Using -h or --help options prints of all available gsmctl options with descriptions and usage syntax examples.
Usage syntax:
gsmctl -h, --help
Example: printing a list of available gsmctl options
root@Teltonika:~# gsmctl -h
usage: gsmctl OPTIONS
-F, --network Get network information
-e, --bsent <INTERFACE> Get number of bytes sent
-r, --brecv <INTERFACE> Get number of bytes recieved
...
Possible responses:
- a list of options that can be used with gsmctl
SMS management options
This section overviews gsmctl options related to SMS management. Every SMS related command uses the "-S" or "--sms" along with another option.
Read SMS by index
To read a single SMS message, use -S -r or --sms --read options. Additionally you have to specify the <INDEX> of the message that you wish to read. The <INDEX> is an integer number that defines the position of a message in the SMS message list. It can range from 1 to however many messages your SMS memory can store.
Usage syntax:
gsmctl -S -r, --sms --read <INDEX>
Example: reading the first message in the SMS list
root@Teltonika:~# gsmctl -S -r 1
Index: 1
Date: 2018-08-02 10:33:20
Sender: +37061111111
Status: read
Text: Hello
Possible responses:
- five lines of string type output indicating the following information related to the SMS message:
- Index - an integer number indicating the position of the message in the SMS message list
- Date - the date the message was received
- Sender - sender's phone number
- Status - indicates whether the message has been previously read. (Possible values: read or new)
- Text - the body of the message
- no message - indicates that an SMS message with the specified <INDEX> does not exist
- out of range - indicates that the specified <INDEX> is out of range of the SMS message list
List SMS by type
To print a list of SMS messages, use -S -l or --sms --list options. Additionally you have to specify the <TYPE> of the list. <TYPE> can either read, new or all
Usage syntax:
gsmctl -S -l, --sms --list <TYPE>
Example: printing the list of all new (unread) SMS messages
root@Teltonika:~# gsmctl -S -l new
Index: 19
Date: 2018-08-03 08:26:36
Sender: +37061111111
Text: status
Status: new
Possible responses:
- multiple entries comprised of five lines of string type output indicating the following information related to an SMS message:
- Index - an integer number indicating the position of the message in the SMS message list
- Date - the date the message was received
- Sender - sender's phone number
- Text - the body of the message
- Status - indicates whether the message has been previously read. (Possible values: read or new)
Print SMS memory usage
To check the SMS memory usage, use -S -t or --sms --total options.
Usage syntax:
gsmctl -S -t, --sms --total
Example: checking the SMS memory usage
root@Teltonika:~# gsmctl -S -t
Used: 28
Total: 50
Possible responses:
- two lines of string type output
- Used - used memory space (integer)
- Total - total memory space (integer)
Delete SMS by index
To delete an SMS message, use -S -d or --sms --delete options. Additionally you have to specify the <INDEX> of the message that you wish to delete. The <INDEX> is an integer number that defines the position of a message in the SMS message list. It can range from 1 to however many messages your SMS memory can store.
Usage syntax:
gsmctl -S -d, --sms --delete <INDEX>
Example: deleting the first SMS message
root@Teltonika:~# gsmctl -S -d 1
OK
Possible responses:
- OK - indicates that the message with specified <INDEX> has been deleted successfully
- out of range - indicates that the specified <INDEX> is out of range of the SMS message list
Send SMS
To send an SMS message, use -S -s or --sms --send options.
Usage syntax:
gsmctl -S -s, --sms --send "<NUMBER> <TEXT>"
Example: sending a "Hello" message to the number +37011111111
root@Teltonika:~# gsmctl -S -s "0037011111111 Hello"
Possible responses:
- If response in terminal "OK", SMS was sent successfully.
Send SMS encoded in base64
First you need to create a /tmp/.smstext file and append some text you want to send
Note: From FW version R_00.07.03 this argument has been removed.
To send a base64 SMS message, use -S -b or --sms --send-b64 options
Usage syntax:
gsmctl -S -b,--sms --send-b64 <NUMBER>
Example:
root@Teltonika:~# gsmctl -S -b +37061234567
Possible responses:
- If response in terminal "OK", SMS was sent successfully.
Auxiliary options
Send AT command to device
To send AT command to device, use -A or --at options.
Usage syntax:
gsmctl -A, --at 'AT+command'
Example:
root@Teltonika:~# gsmctl -A 'AT+CLCK="SC",2'
Possible responses:
- This example will return SIM card pin lock state ("+CLCK: 0" - pin lock disabled).
See also