gsmctl, gsmsiectl - GSM mobile phone control program
] [--baudrate baudrate
] [--device device
] [-I init string
] [--init init
] [--baudrate baudrate
] [--device device
] [-I init string
] [--init init
can request information from or perform operations on an GSM
attaches itself to the device
given on the command line
(usually an GSM modem) using the specified baudrate
. If no
is given, the device /dev/mobilephone
is used. If no
is given, a default baud rate of 38400 is used.
can be used in to modes: If no --operation
option is given
specify the status information to be retrieved from the
mobile phone. See the section STATUS INFORMATION
for more details. If
option is given the requested operation
performed on the mobile using the parameters
. See the section
for more details.
is the same program with some extension for Siemens mobile
phones. Some extra OPERATIONS
are available in this case.
Error messages are printed to the standard error output. If the program
terminates on error the error code 1 is returned.
- -b baudrate, --baudrate baudrate
- The baud rate to use. Defaults to 38400.
- -d device, --device device
- The device to which the GSM modem is connected. The default
- -h, --help
- Prints an option summary.
- -I init
string, --init init string
- Initialization string to send to the TA (default:
"E0"). Note that the sequence "ATZ" is sent
- -o operation, --operation operation
- This option is used to perform an operation on the mobile
phone. Refer to the section OPERATIONS for more information on the
available operations and the parameters required for each
- -v, --version
- Prints the program version.
- -X, --xonxoff
- Uses software handshaking (XON/XOFF) for accessing the
If called without the --operation
prints out default
mobile phone status information as specified by the parameters
- Prints all available information.
- Prints out information about the current battery status.
Two lines of the form "<BATT0> text" and
"<BATT1> charge" are printed. Text may be of "0 ME is
powered by the battery", "1 ME has a battery connected, but is
not powered by it", "2 ME does not have a battery
connected", or "3 Recognized power fault, calls inhibited".
Charge is a number in the range 0..100 where 0 means that the battery is
empty or not connected and 100 means full charge.
- Prints information about the current bit error rate. The
output is of form "<BITERR0> value" where value can be of
0..7, 99 (99 means not available or not detectable).
- This option prints a line of the form "<CLIP0>
on" if caller line identification is turned on in the network,
"<CLIP0> off" otherwise.
- Display info about charsets. The output is in the form
"<CSET0> available" and "<CSET1> current",
which describes the charsets available and which is current.
- Prints information about the current operator. The output
line has the form "<CURROP0> Long name: ´xxxx´
Short name: ´yyyy´ Numeric Name: zzzz".
- Prints out the two-letter names of available facility
locks. The meaning of standardized facility lock names is as follows:
- Lock control surface (eg. phone keyboard)
- Lock phone to SIM card (mobile phone asks password when
other than current SIM card inserted)
- Lock SIM card (SIM asks password in mobile phone power-up
and when this lock command issued)
- Barr all outgoing calls
- Barr outgoing international calls
- Barr outgoing international calls except to home
- Barr all incoming calls
- Barr incoming calls when roaming outside the home
- Barr incoming calls from numbers not stored to TA
- Barr incoming calls from numbers not stored to mobile phone
- Barr incoming calls from numbers not stored to SIM
- Barr incoming calls from numbers not stored in Any
- All Barring services (FIXME)
- All outGoing barring services (FIXME)
- All inComing barring services (FIXME)
- SIM fixed dialling memory feature (if PIN2 authentication
has not been done during the current session, PIN2 is required as
Note that mobile phones may implement facility locks not documented here.
- Prints information about the status of facility locking in
the mobile phone. For each facility a line of the form
"<FLSTATn> ´facilityname´ classes" is
printed. The classes may be "Voice", "Data", and/or
"Fax" depending on the class for which the facility is enabled.
If "unknown" is printed out this means that the TA is not able
to report the status. If the facility is not enabled for any class, no
class identifier is printed. See FLCAP for information about the
available two-letter names of facility locks.
- Prints information about call forwarding enabled in the
mobile phone. For each combination of reason (UnconditionalReason,
MobileBusyReason, NoReplyReason, and NotReachableReason) and class (Voice,
Data, and Fax) a line of the form "<FORWn.m> reason class
number: xxx subaddr: yyy time: zzz" is printed. The time is the
number of seconds to wait before forwarding in case of NoReplyReason.
- Prints manufacturer, model, revision, and serial number of
the mobile phone (ME = mobile equipment). Output lines are numbered from
"<ME0>" to "<ME3>".
- Prints information about the currently available mobile
network operators. For each operator an output line of the form
"<OPn> status Long name: ´xxxx´ Short name:
´yyyy´ Numeric name: zzz" is returned where status may
- The status of the operator is unknown.
- This is the currently selected operator.
- This operator is available for selection.
- This operator is not available for selection, ie. not
accessible with this SIM card.
- Prints information about the current PIN status. The output
is of form "<PIN0> status". Where status can be one of the
- ME is not pending for any password.
- SIM PIN
- ME is waiting SIM PIN to be given.
- SIM PUK
- ME is waiting SIM PUK to be given.
- PH-SIM PIN
- ME is waiting phone/-to/-SIM card password to be
- PH/-FSIM PIN
- ME is waiting phone/-to/-very first SIM card password to be
- PH/-FSIM PUK
- ME is waiting phone/-to/-very first SIM card unblocking
password to be given.
- SIM PIN2
- ME is waiting SIM PIN2 to be given.
- SIM PUK2
- ME is waiting SIM PUK2 to be given.
- PH/-NET PIN
- ME is waiting network personalisation password to be
- PH/-NET PUK
- ME is waiting network personalisation unblocking password
to be given.
- PH/-NETSUB PIN
- ME is waiting network subset personalisation password to be
- Facilities in the mobile phone may be protected by
passwords (ie. PINs or PUKs). This option prints out lines of the form
"<PWn> ´facilityname´ len" for each facility
for which a facility lock password exists. See FLCAP for
information about the available two-letter names of facility locks.
- Reports the default SMS service centre address currently
set in the mobile phone.
- Prints information about the current network signal
strength. The output is of the form "<SIG0> value".
Following values are possible:
- -113 dBm or less
- -111 dBm
- -109... -53 dBm (in steps of 2 dBm)
- -51 dBm or greater
- not known or not detectable
mode reason number
- dial number
- Dials number. After dialling gsmctl waits for
a <CR> keypress to terminate.
Changes the call forwarding behaviour in the
can be any of:
Call forwarding is disabled.
Call forwarding is enabled. The call forwarding reason, number,
and (optionally) forwardtime must be registered beforehand.
This registers the call forwarding reason, number, and
forwardtime in the network.
This is the counterpart to register. It erase the call forwarding
info in the network.
can be any of:
This applies to every
The mobile phone is busy.
The call is not answered in forwardtime
Mobile phone cannot be reached (ie. switched off).
This refers to all forwarding reasons.
This refers to all conditional forward reasons
is the number the incoming call is forwarded to. See the
explanation for lock
operation for the meaning of facilityclass
The default for forwardtime
is 20 seconds if omitted.
can be in the range 1..30.
- Sets functionality level of the phone to 0 (low
functionality). The effects of this command depend on the phone (eg. sets
low power consumption).
- Sets functionality level of the phone to 1 (high
functionality). The effects of this command depend on the phone.
- pin pin
- Sets PIN code. Use gsmctl pin to get the
current pin status.
setop opmode numericname
Locks the named facility. Use
to get a list of supported facilities. The
can be any of:
Voice, data, and fax.
v vf vd f fd d
Any combination of
voice, data and fax.
The default is all
is omitted. The passwd
is password for the facility. If no password is given this parameter can be
Sets the current operator to
. Use gsmctl op
to get a list of
operators with their numeric codes. opmode
can be any of:
Deregister from network.
If manual selection fails, automatic mode is
Sets the password for the facility. If one of
the passwords is omitted this means that the facility has no password
protection. Passwords are PIN1, PIN2, PUK etc.
- setsca service centre address
- Sets the default SMS service centre address.
This is the reverse operation to lock.
See above for a description of the parameters.
Extra operators for gsmsiectl:
Phone book info.
Signal tone info.
Ringing tone info.
The following invocation of gsmctl
prints out all available status
information for the mobile phone connected to /dev/mobilephone
The output could look like (lines edited to fit):
<ME0> Manufacturer: SIEMENS
Serial Number: 448058511817585
Status: available Long name: 'D1/-TELEKOM' Short name: '' Numeric name:
Status: forbidden Long name: 'D2 PRIVAT' Short name: '' Numeric name:
Long name: 'D1/-TELEKOM' Short name: '' Numeric name: 26201 Mode:
'SC' Voice Data Fax
'CS' 'PS' 'SC' 'AO' 'OI' 'OX' 'AI' 'IR' 'AB' 'AG' 'AC'
UnconditionalReason Voice inactive number: subaddr: time: -1
UnconditionalReason Data inactive number: subaddr: time: -1
UnconditionalReason Fax inactive number: subaddr: time: -1
MobileBusyReason Voice active number: +494012345678 subaddr: time: -1
MobileBusyReason Data inactive number: subaddr: time: -1
MobileBusyReason Fax inactive number: subaddr: time: -1
NoReplyReason Voice active number: +494012345678 subaddr: time: 20
NoReplyReason Data inactive number: subaddr: time: -1
NoReplyReason Fax inactive number: subaddr: time: -1
NotReachableReason Voice active number: +494012345678 subaddr: time: -1
NotReachableReason Data inactive number: subaddr: time: -1
NotReachableReason Fax inactive number: subaddr: time: -1
0 ME is powered by the battery
The following locks the keys on the mobile phone:
gsmctl -o lock cs
This changes the SIM card PIN from 1234 to 2345:
gsmctl -o setpw sc 1234 2345
Switch off all call forwarding (actually erase the numbers):
gsmctl -o forw erase all
Switch on call forwarding to German D1 voice box:
gsmctl -o forw register notreachable 3313
gsmctl -o forw enable notreachable
- Default mobile phone device.
Peter Hofmann <firstname.lastname@example.org>
Report bugs to email@example.com. Include a complete, self-ncontained example that
will allow the bug to be reproduced, and say which version of gsmctl
you are using.
Copyright © 1999 Peter Hofmann
is free software; you can redistribute it and/or modify it under
the terms of the GNU Library General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later version.
is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU Library General Public License for more
You should have received a copy of the GNU Library General Public License along
; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.