AT Commands: Difference between revisions

From Teltonika Networks Wiki
No edit summary
No edit summary
Line 7: Line 7:
==gsmctl commands==
==gsmctl commands==


'''gsmctl''' is a set of shell commands that can request information from or perform operations on a modem. In other words, gsmctl is a way to use AT commands in shell form.  
'''gsmctl''' is a set of shell commands that can request information from or perform operations on a modem. In other words, gsmctl is a way to use AT commands in shell form. You can use them via SSH or '''[[CLI]]''', the command line interface that can be used via the router's WebUI.  


===SSH===
To log in to a RUT router via SSH, download the free '''PuTTY''' app if you're using Windows; if you're using a Linux based OS, just use the Terminal app. In both cases you will need to know three things: the router's LAN IP address, user name and password. The default LAN IP address for all RUT routers is '''192.168.1.1'''; the default log in information is username: '''root'''; password: '''admin01''' (NOTE: the user name used for SSH connections (i.e., root) is not the same as the user name used to log in to the router's WebUI (i.e., admin)).
If you're using PuTTY, enter the router's LAN IP address into the '''Host Name (or IP address)''' field, select SSH Connection type and click '''Open'''. After this you will be prompted to enter the user name and password.
If you're using Linux, open a Terminal and type this command:
If you made changes to LAN IP address or log in name, replace the relevant data in the command above so that it is correct for your specific case. After executing this command you will prompted to enter the router's admin password.
===Usage===
The syntax for a gsmctl command is ''gsmctl OPTIONS''. A list possible ''gsmctl'' options is provided below:
   -p, --ip <INTERFACE> Get IP of logical interface
   -p, --ip <INTERFACE> Get IP of logical interface
   -e, --bsent <INTERFACE> Get number of bytes sent
   -e, --bsent <INTERFACE> Get number of bytes sent
   -r, --brecv <INTERFACE> Get number of bytes recieved
   -r, --brecv <INTERFACE> Get number of bytes recieved
   -j, --connstate Get 3G connection state
   -j, --connstate Get 3G connection state
  -g, --netstate Get network link state
  -i, --imei Get device IMEI
  -J, --iccid Get SIM ICCID
  -m, --model Get device model
  -w, --manuf Get device manufacturer
  -a, --serial Get device serial number
  -y, --revision Get device revision number
  -x, --imsi Get IMSI
  -z, --simstate Get SIM card state
  -u, --pinstate Get PIN state
  -q, --signal Get GSM signal level
  -X, --rscp    Get WCDMA rscp level
  -E, --ecio    Get WCDMA ec/io level
  -W, --rsrp  Get LTE rsrp level
  -Z, --sinr  Get LTE sinr level
  -M, --rsrq Get LTE rsrq level
  -C, --cellid Get cell id parameter
  -o, --operator Get name of operator used
  -f, --opernum  Get operator number
  -t, --conntype Get data carrier type
  -c, --temp Get module temperature in 0.1 degrees Celcius
  -B, --pincount Get pin/puk count
  -F  --network Get network information
  -K  --serving Get serving cell information
  -I  --neighbour Get neighbour cell information
  -D, --shutdown Shutdown the modem
  -h, --help Prints this information
  -v, --version  Print version
sms managing options:
  -S -r, --sms --read <INDEX> Read SMS by index
  -S -l, --sms --list <TYPE> List SMS by type [all, read, new]
  -S -t, --sms --total Print SMS memory usage
  -S -d, --sms --delete <INDEX> Delete SMS by index
  -S -s, --sms --send "<NUMBER> <TEXT>" Send SMS. IMPORTANT! Number and text must be within quotes
  -S -b, --sms --send-b64 <NUMBER> Send SMS encoded in base64 from /tmp/.smstext
compatibility options:
  -N, --he910 Support for Telit HE910-EUD
  -R, --em820w Support for Huawei EM820W
  -U, --me909u Support for Huawei LTE ME909u
  -V, --le910 Support for Telit LE910
auxiliary options:
  -A, --at <COMMAND> Send AT command to device
  -H, --shell Enter shell mode
  -k, --debug Enable debug information
  -n, --nolog Do not log the command
You can view this list via terminal by typing ''gsmctl -h'' or ''gsmctl --help''.
For example, try using ''gsmctl -q'' to get the current RSSI value in dBm


==AT command usage==
==AT command usage==


To use a specific AT command via SSH, you can use the ''gsmctl -H''. After this your console will enter shell mode where you can then just type AT commands in their regular format. Or you can use ''gsmctl -A <AT_COMMAND>'' to execute AT commands one at a time.
To use a specific AT command via SSH, you can use the ''gsmctl -H''. After this your console will enter shell mode where you can then just type AT commands in their regular format. Or you can use ''gsmctl -A <AT_COMMAND>'' to execute AT commands one at a time.
==External links==
PuTTY download - '''https://www.putty.org/'''

Revision as of 13:18, 21 February 2018

Main Page > General Information > Configuration Examples > Modem control > AT Commands

AT commands ("AT" meaning 'attention') are instructions used to control a modem.

Summary

The command set consists of a series of short text strings which can be combined to produce commands for operations such as dialing, managing SMS functions, and changing the parameters of the connection. Many of the commands that are used to control wired dial-up modems, such as ATD (Dial), ATA (Answer), ATH (Hook control) and ATO (Return to online data state), are also supported by GSM/GPRS modems and mobile phones. This section is an overview of some AT commands that can be used with RUT routers.

gsmctl commands

gsmctl is a set of shell commands that can request information from or perform operations on a modem. In other words, gsmctl is a way to use AT commands in shell form. You can use them via SSH or CLI, the command line interface that can be used via the router's WebUI.

SSH

To log in to a RUT router via SSH, download the free PuTTY app if you're using Windows; if you're using a Linux based OS, just use the Terminal app. In both cases you will need to know three things: the router's LAN IP address, user name and password. The default LAN IP address for all RUT routers is 192.168.1.1; the default log in information is username: root; password: admin01 (NOTE: the user name used for SSH connections (i.e., root) is not the same as the user name used to log in to the router's WebUI (i.e., admin)).

If you're using PuTTY, enter the router's LAN IP address into the Host Name (or IP address) field, select SSH Connection type and click Open. After this you will be prompted to enter the user name and password.

If you're using Linux, open a Terminal and type this command:

# ssh [email protected]

If you made changes to LAN IP address or log in name, replace the relevant data in the command above so that it is correct for your specific case. After executing this command you will prompted to enter the router's admin password.

Usage

The syntax for a gsmctl command is gsmctl OPTIONS. A list possible gsmctl options is provided below:

 -p, --ip <INTERFACE>		Get IP of logical interface
 -e, --bsent <INTERFACE>	Get number of bytes sent
 -r, --brecv <INTERFACE>	Get number of bytes recieved
 -j, --connstate		Get 3G connection state
 -g, --netstate		Get network link state
 -i, --imei			Get device IMEI
 -J, --iccid			Get SIM ICCID
 -m, --model			Get device model
 -w, --manuf			Get device manufacturer
 -a, --serial			Get device serial number
 -y, --revision		Get device revision number
 -x, --imsi			Get IMSI
 -z, --simstate		Get SIM card state
 -u, --pinstate		Get PIN state
 -q, --signal			Get GSM signal level
 -X, --rscp    		Get WCDMA rscp level
 -E, --ecio    		Get WCDMA ec/io level
 -W, --rsrp   		Get LTE rsrp level
 -Z, --sinr  			Get LTE sinr level
 -M, --rsrq 			Get LTE rsrq level
 -C, --cellid 		Get cell id parameter
 -o, --operator		Get name of operator used
 -f, --opernum  		Get operator number
 -t, --conntype		Get data carrier type
 -c, --temp			Get module temperature in 0.1 degrees Celcius
 -B, --pincount		Get pin/puk count
 -F  --network		Get network information
 -K  --serving		Get serving cell information
 -I  --neighbour		Get neighbour cell information
 -D, --shutdown		Shutdown the modem
 -h, --help			Prints this information
 -v, --version  		Print version
sms managing options:
 -S -r, --sms --read		<INDEX>	Read SMS by index
 -S -l, --sms --list		<TYPE>	List SMS by type [all, read, new]
 -S -t, --sms --total		Print SMS memory usage
 -S -d, --sms --delete	<INDEX>	Delete SMS by index
 -S -s, --sms --send "<NUMBER> <TEXT>"	Send SMS. IMPORTANT! Number and text must be within quotes
 -S -b, --sms --send-b64 <NUMBER>	Send SMS encoded in base64 from /tmp/.smstext
compatibility options:
 -N, --he910			Support for Telit HE910-EUD
 -R, --em820w			Support for Huawei EM820W
 -U, --me909u			Support for Huawei LTE ME909u
 -V, --le910			Support for Telit LE910
auxiliary options:
 -A, --at <COMMAND>		Send AT command to device
 -H, --shell			Enter shell mode
 -k, --debug			Enable debug information
 -n, --nolog			Do not log the command

You can view this list via terminal by typing gsmctl -h or gsmctl --help.

For example, try using gsmctl -q to get the current RSSI value in dBm

AT command usage

To use a specific AT command via SSH, you can use the gsmctl -H. After this your console will enter shell mode where you can then just type AT commands in their regular format. Or you can use gsmctl -A <AT_COMMAND> to execute AT commands one at a time.

External links

PuTTY download - https://www.putty.org/