GSMCTL(8)

πŸ“¦
version 2017-10 Β· 2 versions
, in nixos 26.05

πŸ’… GSMCTL(8) β€” System Manager's Manual πŸ’…

okay bestie, this is the manual for gsmctl and gsmsiectl, aka the GSM mobile phone control program. part one, no signing off, we’re just getting into the lore. ✨

🌈 NAME 🌈

gsmctl, gsmsiectl β€” GSM mobile phone control program

πŸŽ€ SYNOPSIS πŸŽ€

gsmctl [-b baudrate] [--baudrate baudrate] [-d device] [--device device]
[-h] [--help] [-I init string] [--init init string] [-v] [--version]
[-X] [--xonxoff] -o operation | --operation operation | parameters
gsmsiectl [-b baudrate] [--baudrate baudrate] [-d device] [--device
device] [-h] [--help] [-I init string] [--init init string] [-v]
[--version] [-X] [--xonxoff] -o operation | --operation operation |
parameters

πŸ¦‹ DESCRIPTION πŸ¦‹

so gsmctl can request information from or perform operations on an GSM mobile phone. literally a whole phone whisperer. πŸ“±

it attaches itself to the device given on the command line (usually an GSM modem) using the specified baudrate. if no device is given, the device /dev/mobilephone is used. if no baudrate is given, a default baud rate of 38400 is used. no cap. πŸ’…

gsmctl can be used in two modes: if no --operation option is given, the parameters specify the status information to be retrieved from the mobile phone. see the section STATUS INFORMATION for more details. if an --operation option is given, the requested operation is performed on the mobile using the parameters. see the section OPERATIONS for more details. periodt. ✨

gsmsiectl is the same program with some extension for Siemens mobile phones. some extra OPERATIONS are available in this case. Siemens girlies stay winning. 🫢

error messages are printed to the standard error output. if the program terminates on error the error code 1 is returned. so yeah, exit status 1 is the error vibe check. 😭


✨ OPTIONS ✨

okay so here’s the flag menu, bestie. every single one, no skipping. πŸ‘‘

  • -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 is /dev/mobilephone.
  • -h, --help β€” Prints an option summary. your little help bestie.
  • -I init string, --init init string β€” Initialization string to send to the TA (default: "E0"). Note that the sequence "ATZ" is sent first.
  • -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 operation.
  • -v, --version β€” Prints the program version.
  • -X, --xonxoff β€” Uses software handshaking (XON/XOFF) for accessing the device.

πŸ’– STATUS INFORMATION πŸ’–

If called without the --operation option gsmctl prints out default mobile phone status information as specified by the parameters described below:

  • ALL β€” Prints all available information. the whole tea, basically. πŸ“
  • BATT β€” 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. battery lore, iconic. πŸ”‹
  • BITERR β€” 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).
  • CLIP β€” This option prints a line of the form <CLIP0> on if caller line identification is turned on in the network, <CLIP0> off otherwise.
  • CSET β€” Display info about charsets. The output is in the form <CSET0> available and <CSET1> current, which describes the charsets available and which is current.
  • CURROP β€” Prints information about the current operator. The output line has the form <CURROP0> Long name: Β΄xxxxΒ΄ Short name: Β΄yyyyΒ΄ Numeric Name: zzzz.
  • FLCAP β€” Prints out the two-letter names of available facility locks. The meaning of standardized facility lock names is as follows:
    • CS β€” Lock control surface (eg. phone keyboard)
    • PS β€” Lock phone to SIM card (mobile phone asks password when other than current SIM card inserted)
    • SC β€” Lock SIM card (SIM asks password in mobile phone power-up and when this lock command issued)
    • AO β€” Barr all outgoing calls
    • OI β€” Barr outgoing international calls
    • OX β€” Barr outgoing international calls except to home country
    • AI β€” Barr all incoming calls
    • IR β€” Barr incoming calls when roaming outside the home country
    • NT β€” Barr incoming calls from numbers not stored to TA memory
    • NM β€” Barr incoming calls from numbers not stored to mobile phone memory
    • NS β€” Barr incoming calls from numbers not stored to SIM memory
    • NA β€” Barr incoming calls from numbers not stored in Any memory
    • AB β€” All Barring services (FIXME)
    • AG β€” All outGoing barring services (FIXME)
    • AC β€” All inComing barring services (FIXME)
    • FD β€” SIM fixed dialling memory feature (if PIN2 authentication has not been done during the current session, PIN2 is required as <passwd>)

Note that mobile phones may implement facility locks not documented here. the audacity, honestly. 😭

  • FLSTAT β€” 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.
  • FORW β€” 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.
  • ME β€” Prints manufacturer, model, revision, and serial number of the mobile phone (ME = mobile equipment). Output lines are numbered from <ME0> to <ME3>. main character energy, fr fr. πŸ‘‘
  • OP β€” 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 be of:
    • unknown β€” The status of the operator is unknown.
    • current β€” This is the currently selected operator.
    • available β€” This operator is available for selection.
    • forbidden β€” This operator is not available for selection, ie. not accessible with this SIM card.
  • PIN β€” Prints information about the current PIN status. The output is of form <PIN0> status. Where status can be one of the following lines:
    • READY β€” 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 given.
    • PH/-FSIM PIN β€” ME is waiting phone/-to/-very first SIM card password to be given.
    • 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 given.
    • 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 given.
  • PW β€” 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.
  • SCA β€” Reports the default SMS service centre address currently set in the mobile phone.
  • SIG β€” Prints information about the current network signal strength. The output is of the form <SIG0> value. Following values are possible:
    • 0 β€” -113 dBm or less
    • 1 β€” -111 dBm
    • 2...30 β€” -109... -53 dBm (in steps of 2 dBm)
    • 31 β€” -51 dBm or greater
    • 99 β€” not known or not detectable

πŸ”₯ OPERATIONS πŸ”₯

okay so these are the actual verbs of the gsmctl universe β€” the stuff you're actually here to do, bestie. let's go πŸ’…

  • dial number β€” Dials number. After dialling, gsmctl literally just vibes there waiting for a <CR> keypress to terminate. so hit enter when you're done, yeah? ✨
  • forw mode reason number [facilityclass] [forwardtime] β€” changes the call forwarding behaviour in the network. mode can be any of:
    • disable β€” Call forwarding is disabled.
    • enable β€” Call forwarding is enabled. The call forwarding reason, number, and (optionally) forwardtime must be registered beforehand.
    • register β€” This registers the call forwarding reason, number, and forwardtime in the network.
    • erase β€” This is the counterpart to register. It erases the call forwarding info in the network.

and reason can be any of:

  • unconditional β€” This applies to every call.
  • mobilebusy β€” The mobile phone is busy.
  • noreply β€” The call is not answered in forwardtime seconds.
  • notreachable β€” Mobile phone cannot be reached (ie. switched off).
  • all β€” This refers to all forwarding reasons.
  • allconditional β€” This refers to all conditional forward reasons (mobilebusy, noreply, notreachable).

number is the number the incoming call is forwarded to. See the explanation for the lock operation for the meaning of facilityclass. The default for forwardtime is 20 seconds if omitted. forwardtime can be in the range 1..30. 🫢

  • off β€” Sets functionality level of the phone to 0 (low functionality). The effects of this command depend on the phone (eg. sets low power consumption). πŸ’€
  • on β€” 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. (yes, same word twice, she contains multitudes πŸŽ€)
  • lock facility [facilityclass] [passwd] β€” Locks the named facility. Use gsmctl flcap to get a list of supported facilities. The facilityclass can be any of:
    • all β€” Voice, data, and fax.
    • v vf vd f fd d β€” Any combination of voice, data and fax.

The default is all if facilityclass is omitted. The passwd is password for the facility. If no password is given this parameter can be omitted. πŸ”

  • setop opmode numericname β€” Sets the current operator to numericname. Use gsmctl op to get a list of operators with their numeric codes. opmode can be any of:
    • automatic
    • manual
    • deregister β€” Deregister from network.
    • manualautomatic β€” If manual selection fails, automatic mode is entered.
  • setpw facility [oldpasswd] [newpasswd] β€” 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. πŸ“¨
  • unlock facility [facilityclass] [passwd] β€” This is the reverse operation to lock. See above for a description of the parameters.

Extra operators for gsmsiectl: (yes, exactly how it's spelled, no i will not be fixing it, it's iconic ✨)

  • cset β€” Charset info.
  • pbook β€” Phone book info.
  • signal β€” Signal tone info.
  • ring β€” Ringing tone info.
  • binary β€” Binary info.

🌸 EXAMPLES 🌸

okay so the following invocation of gsmctl prints out all available status information for the mobile phone connected to /dev/mobilephone:

gsmctl all

The output could look like (lines edited to fit) β€” brace yourself, she's long:

<ME0>  Manufacturer: SIEMENS
<ME1>  Model: S10
<ME2>  Revision: 06
<ME3>  Serial Number: 448058511817585
<OP0>  Status: available  Long name: 'D1/-TELEKOM' Short name: ''
       Numeric name: 26201
<OP1>  Status: forbidden  Long name: 'D2  PRIVAT' Short name: ''
       Numeric name: 26202
<CURROP0>  Long name: 'D1/-TELEKOM'   Short name: '' Numeric name:
       26201 Mode: automatic
<FLSTAT0>  'CS'
<FLSTAT1>  'PS'
<FLSTAT2>  'SC'  Voice  Data  Fax
<FLSTAT3>  'AO'
<FLSTAT4>  'OI'
<FLSTAT5>  'OX'
<FLSTAT6>  'AI'
<FLSTAT7>  'IR'
<FLCAP0>  'CS' 'PS' 'SC' 'AO' 'OI' 'OX' 'AI' 'IR' 'AB' 'AG' 'AC'
<PW0>  'PS' 8
<PW1>  'SC' 8
<PW2>  'AO' 4
<PW3>  'OI' 4
<PW4>  'OX' 4
<PW5>  'AI' 4
<PW6>  'IR' 4
<PW7>  'AB' 4
<PW8>  'AG' 4
<PW9>  'AC' 4
<CLIP0>  on
<FORW0.0>  UnconditionalReason  Voice  inactive number:   subaddr:
       time: -1
<FORW0.1>  UnconditionalReason  Data  inactive number:   subaddr:
       time: -1
<FORW0.2>  UnconditionalReason  Fax  inactive number:   subaddr:
       time: -1
<FORW1.0>  MobileBusyReason  Voice  active number: +494012345678
       subaddr:   time: -1
<FORW1.1>  MobileBusyReason  Data  inactive number:   subaddr:  time:
       -1
<FORW1.2>  MobileBusyReason  Fax  inactive number:   subaddr:  time:
       -1
<FORW2.0>  NoReplyReason  Voice  active number: +494012345678
       subaddr:   time: 20
<FORW2.1>  NoReplyReason  Data  inactive number:   subaddr:  time: -1

<FORW2.2>  NoReplyReason  Fax  inactive number:   subaddr:  time: -1
<FORW3.0>  NotReachableReason  Voice  active number: +494012345678
       subaddr:  time: -1
<FORW3.1>  NotReachableReason  Data  inactive number:  subaddr:
       time: -1
<FORW3.2>  NotReachableReason  Fax  inactive number:  subaddr:  time:
       -1
<BATT0>   0 ME is powered by the battery
<BATT1>  100
<BITERR0>  0
<SIG0>  19

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

πŸŽ€ FILES πŸŽ€

  • /dev/mobilephone β€” Default mobile phone device. that's the one, bestie πŸ’–

πŸ’œ AUTHOR πŸ’œ

Peter Hofmann <software@pxh.de>


πŸ™ˆ BUGS πŸ™ˆ

Report bugs to software@pxh.de. Include a complete, self-ncontained example that will allow the bug to be reproduced, and say which version of gsmctl you are using. (yes β€” "self-ncontained", that's the original spelling, no cap, type it exactly like that 🫢)


Copyright Β© 1999 Peter Hofmann

gsmctl 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.

gsmctl 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 details.

You should have received a copy of the GNU Library General Public License along with gsmctl; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.


🌈 SEE ALSO 🌈

gsminfo(7), gsmpb(1), gsmsendsms(1), gsmsmsd(8), gsmsmsstore(1).


and that's the whole page, bestie!! you slayed it πŸ’…βœ¨ this absolutely iconic piece of documentation is gsmctl v1.10, stamped Sat Oct 24 19:18:56 UTC 2026 β€” screenshot it, frame it, put it on your wall πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from