GSMCTL(8)

πŸ’– GSMCTL(8) πŸ’–

from the System Manager's Manual β€” okay bestie, this is the manual page for gsmctl(8), and it's a whole vibe. Buckle up. πŸŽ€


✨ 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 basically, gsmctl can ask an actual GSM mobile phone for info, or make it do stuff. It's giving remote control for your phone, periodt. πŸ‘‘

The way it works: gsmctl attaches itself to whatever device you hand it on the command line β€” usually a GSM modem β€” using the baudrate you specified. If you don't give it a device, it just goes with /dev/mobilephone. And if you skip the baudrate? It lowkey defaults to 38400. Simple as that. ✨

gsmctl has two modes, and this is the part where you gotta pay attention:

  • If you don't pass the --operation option, then your parameters are just telling it what status info to pull back from the phone. Head to the STATUS INFORMATION section for the deets. πŸ”
  • If you do pass an --operation option, then it goes and actually performs that operation on the mobile, using your parameters. See the OPERATIONS section for all of that. πŸ› οΈ

Now, gsmsiectl is literally the same program, except it's got extra features for Siemens mobile phones. Some extra OPERATIONS are available when you use it. Iconic, honestly. 🌈

Error messages get printed to the standard error output. And if the program bails out on an error, it returns the error code 1. No cap. πŸ’€


πŸŽ€ OPTIONS πŸŽ€

  • -b baudrate, --baudrate baudrate β€” the baud rate you wanna use. Defaults to 38400. ⚑
  • -d device, --device device β€” the device your GSM modem is plugged into. The default is /dev/mobilephone. πŸ”Œ
  • -h, --help β€” prints an option summary. Your lil cheat sheet. πŸ“‹
  • -I init string, --init init string β€” the initialization string to send to the TA (default: "E0"). Note that the sequence "ATZ" is sent first. 🫢
  • -o operation, --operation operation β€” this one is for performing an operation on the mobile phone. Go check the OPERATIONS section for which operations exist and what parameters each one needs. 🎯
  • -v, --version β€” prints the program version. 🏷️
  • -X, --xonxoff β€” uses software handshaking (XON/XOFF) for accessing the device. 🀝

πŸ¦‹ STATUS INFORMATION πŸ¦‹

If you call it without the --operation option, gsmctl prints out the default mobile phone status info, as specified by the parameters down below. Let's go through them one by one, bestie. πŸ’–

  • ALL β€” prints all available information. The whole buffet. πŸ“
  • BATT β€” prints out info about the current battery status. Two lines get printed, shaped like "<BATT0> text" and "<BATT1> charge". The text can be one of these: "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". And charge is a number in the range 0..100, where 0 means the battery is empty or not connected, and 100 means full charge. πŸ”‹
  • BITERR β€” prints info about the current bit error rate. The output looks like "<BITERR0> value", where value can be 0..7, or 99 (and 99 means not available or not detectable). πŸ“‰
  • CLIP β€” prints a line shaped like "<CLIP0> on" if caller line identification is turned on in the network, and "<CLIP0> off" otherwise. πŸ“ž
  • CSET β€” displays info about charsets. The output is shaped like "<CSET0> available" and "<CSET1> current", which tells you the charsets available and which one is current. πŸ”€
  • CURROP β€” prints info about the current operator. The output line looks like "<CURROP0> Long name: Β΄xxxxΒ΄ Short name: Β΄yyyyΒ΄ Numeric Name: zzzz". πŸ“‘
  • FLCAP β€” prints out the two-letter names of available facility locks. The meaning of the standardized facility lock names goes like this:
    • 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>)
Heads up: mobile phones may implement facility locks that aren't documented here. So don't come for the list if your phone's got extra ones. πŸ™ˆ
  • FLSTAT β€” prints info about the status of facility locking in the mobile phone. For each facility, a line shaped like "<FLSTATn> Β΄facilitynameΒ΄ classes" gets printed. The classes may be "Voice", "Data", and/or "Fax", depending on the class the facility is enabled for. If "unknown" comes out, that means the TA can't report the status. And if the facility isn't enabled for any class, no class identifier gets printed at all. Peep FLCAP for info about the available two-letter names of facility locks. πŸ”
  • FORW β€” prints info about call forwarding that's enabled in the mobile phone. For each combo of reason (UnconditionalReason, MobileBusyReason, NoReplyReason, and NotReachableReason) and class (Voice, Data, and Fax), a line shaped like "<FORWn.m> reason class number: xxx subaddr: yyy time: zzz" gets printed. That time is the number of seconds to wait before forwarding in the 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>". πŸ“±
  • OP β€” prints info about the currently available mobile network operators. For each operator, an output line shaped like "<OPn> status Long name: Β΄xxxxΒ΄ Short name: Β΄yyyyΒ΄ Numeric name: zzz" gets returned, where status may be one 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 info about the current PIN status. The output is shaped like "<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 shaped like "<PWn> Β΄facilitynameΒ΄ len" for each facility that has a facility lock password. See FLCAP for info 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 info about the current network signal strength. The output is shaped like "<SIG0> value". These 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

okay bestie that's part 1, and there is so much more coming β€” the operations, the examples, the whole thing. stay tuned. πŸ’œ


πŸ”₯ OPERATIONS πŸ”₯

okay bestie this is the part where stuff actually happens. like, this is the doing-stuff section. main character energy fr fr πŸ’…

  • dial number β€” Dials number. Then gsmctl just... sits there waiting for a <CR> keypress to terminate. yes really. it's waiting on you. type the enter key and it lets go 🫢
  • forw mode reason number [facilityclass] [forwardtime] β€” changes how call forwarding behaves in the network. mode can be any of these:
    • disable β€” call forwarding is off. cancelled. blocked. we don't know her πŸ’€
    • enable β€” call forwarding is on. the call forwarding reason, number, and (optionally) forwardtime have to be registered beforehand tho, so don't skip that step bestie.
    • register β€” this is what registers the call forwarding reason, number, and forwardtime in the network. the paperwork. the admin. the ✨bureaucracy✨.
    • erase β€” the counterpart to register. it erases the call forwarding info in the network. poof. gone. no notes.

reason can be any of these:

  • unconditional β€” this applies to every call. every single one. no exceptions.
  • mobilebusy β€” the mobile phone is busy πŸ₯²
  • noreply β€” the call is not answered in forwardtime seconds
  • notreachable β€” mobile phone cannot be reached (ie. switched off). ghosting behaviour honestly πŸ™ˆ
  • 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 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). nap mode 😴
  • on β€” Sets functionality level of the phone to 1 (high functionality). The effects of this command depend on the phone. and she's UP β˜€οΈ
  • pin pin β€” Sets PIN code. Use gsmctl pin to get the current pin status. yes the argument is also called pin, it's giving "who's on first" energy and we're rolling with it 🌸
  • 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. it's got a backup plan, we love a resilient queen πŸ‘‘
  • 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:

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

✨ EXAMPLES ✨

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):

<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 her home address 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.

okay so real talk: give them an example that stands on its own and tell them your version. no "it doesn't work" and nothing else. they cannot read your mind, bestie, they're not psychic 🫢

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, babe πŸ’– this one is gsmctl v1.10, dated Sun Mar 31 18:20:52 UTC 2024, and it's GSMCTL(8) β€” go forth and control some phones, you've got this, i'm so proud of you πŸ¦‹βœ¨

πŸ“¦ where this page comes from