Scroll to navigation

gnokii(1) gnokii gnokii(1)

NAME

gnokii - tool suite for mobile phones

SYNOPSIS

gnokii [CONFIG OPTIONS] [OPTIONS]

DESCRIPTION

gnokii is a multiple systems tool suite and driver for mobile phones.

gnokii supports the AT protocol defined by the GSM standard (with workarounds for some vendor's quirks), some proprietary protocols of Nokia phones (the so called FBUS and FBUS2) and SIM cards in PC/SC compatible Smart Card readers. Limited support for the older and slow Nokia MBUS protocol is also available.

You can assume that your phone will work with gnokii when using the AT protocol, however some phones implement only a subset of the protocol and in those cases you will get very limited functionality. The recommended model setting for your config file are:
- model = series40, if you have a fairly recent Nokia phone except Symbian phones prior to Series60 3rd Edition
- model = gnapplet, if you have a Nokia Symbian Series60 prior to 3rd Edition phone
- model = AT, for all other phones of any brand
- if you have some older Nokia phone that doesn't work with model = series40 you may try using its brand name, eg. for Nokia 6210 use model = 6210.

The recommended connection and port settings for your config file are:
- connection = bluetooth and port = phone address, for Bluetooth connections
- connection = dku2libusb and port = 1, for most Nokia USB cables
- connection = serial and port = /dev/..., for all other cables

See also the sample gnokiirc for a description of all configuration parameters and our <http://wiki.gnokii.org/index.php/Config> for configurations known to work.

Symbian series60 3rd edition and later (most Nokia N and E series) are not supported by the gnapplet driver due to changes in Symbian API. For now you can get some functionality using the AT driver (with all connection types supported by the phone) or using the series40 driver (only with connection = dku2libusb).

Please note that currently there are Nokia models with almost the same names as the old ones, like 6110c vs 6110 or 3110c vs 3110. They are completly incompatible. DO NOT use model = 6110 or model = 3110 setting for them, use model = series40 instead.

CONFIG OPTIONS

reads configuration from filename instead of trying default locations. Normally gnokii looks for config file in $XDG_CONFIG_HOME/gnokii/config (which is usually $HOME/.config/gnokii/config), $HOME/.gnokiirc (legacy), $XDG_CONFIG_DIRS/gnokii/config (which is usually /etc/xdg/gnokii/config) and /etc/gnokiirc (legacy).
usees parameters from the given phone section of your config file. A phone section named 'foo' starts with [phone_foo] and is used as --phone foo

OPTIONS

The options that are recognized by gnokii can be divided into several different groups.

GENERAL

displays usage information.
displays version and copyright information.
continually updates phone status to stderr. Optional delay parameter sets the refresh interval to delay seconds. Default is 1. once means the output will be printed only once.
runs interactive session that will allow to run sequent gnokii commands without a need to reconnect for the sequent commands.

DIALING

reads speed dial from the specified location.
specify speed dial. location number 1 is usually reserved for voice mailbox number and it is unavailable as speed dial.
initiate voice call. On success print the callid identifier to be used with the --hangup command. The --monitor command can be used to show the callid.

With model = AT direct dialing from phonebooks is supported with careful use of shell quoting, for example:
gnokii --dialvoice ">SM42" # dial the number in location 42 of SM memory
gnokii --dialvoice '>"Home"' # dial the number if string matches exactly a contact name (note the use of single and double quotes)

send DTMF sequence.
answer an incoming call. callid is a small integer number used to identify one of the incoming calls. The --monitor command can be used to show the callid.
hangup an incoming call or an already established call. callid is a small integer number used to identify one of the incoming calls. If you initiated the call with --dialvoice this is the number printed by that command. The --monitor command can be used to show the callid.
Manage call diverting/forwarding.

--op specifies one of the operations: register enable query disable erasure

--type specifies one of the event types: busy noans outofreach notavail unconditional all

--call specifies one of the call types: voice fax data all

--timeout is the number of seconds an incoming call will ring before being forwarded to the registered number (use with --type noans)

--number is the phone number to which calls are to be forwarded

PHONE SETTINGS

shows what icons are displayed.
show texts displayed in phone's screen.
show settings for selected(all) profile(s).
sets settings for selected(all) profile(s).
reads the active profile.
sets active profile to the profile number profile_no.
setting/querying netmonitor mode.
resets the phone. By default a soft reset is performed. Depending on phone, the hard option also deletes everything in the internal memory and restores the factory settings.

TODO

get the notes with numbers from start_number to end_number from ToDo list. end is a keyword that denotes 'everything till the end'.

-v | --vCal - output in vCalendar 1.0 format

write the notes with numbers from start_number to end_number from vCalendar file vcalfile to ToDo list. More than one note a time can be saved. end is a keyword that denotes 'everything till the end'.

number - location of the note in the vCalendar file

delete all notes from the ToDo list.

CALENDAR

get the notes with numbers from start_number to end_number from calendar. end is a keyword that denotes 'everything till the end'.

-v | --vCal - output in vCalendar 1.0 format

write the notes with numbers from start_number to end_number from vCalendar file vcalfile to a phone calendar. More than one note a time can be saved. end is a keyword that denotes 'everything till the end'.

number - location of the note in the vCalendar file

delete the notes with numbers from start_number to end_number from calendar. end is a keyword that denotes 'everything till the end'.

SMS

gets SMS messages from specified memory type starting at entry start and ending at end and print them to stdout by default. end can be a number or the string 'end'. If end is not specified only one location - start is read.
For the memory types you usually use IN (Inbox) and OU (Outbox) for Nokias and SM (SIM card) and ME (phone memory) for other brands, except for modern Motorolas that prefer MT (combined SIM and phone memory); in any case the --showsmsfolderstatus command shows the list of memory types available in your phone with their descriptions and message counts (each part of multipart messages is counted separately).
-f | --file file - save messages to file in mbox format. If file already exists, user is prompted whether to overwrite it
-F | --force-file file - save messages to file in mbox format. If file already exists, it is overwritten without asking
-a | --append-file file - save messages to file in mbox format. If file already exists, messages are added to the end
-d | --delete - delete message after reading.
deletes SMS messages from specified memory type starting at entry start and ending at end. If end is not specified only one location - start is deleted.
sends an SMS message to destination via message_center_number or SMSC number taken from phone memory from address message_center_index. If this argument is omitted SMSC number is taken from phone memory from location 1. Message text is taken from STDIN. Meaning of other optional parameters:

-r | --report - request for delivery report

-8 | --8bit - set 8bit coding

-C | --class n - Class Message n, where n can be 0..3

-v | --validity n - validity in minutes

-i | --imelody - send iMelody within SMS

-a | --animation file;file;file;file - send animation message

-o | --concat this;total;serial - send this part of all total parts identified by serial

-w | --wappush url - send wappush to the given url

echo "This is a test message" | gnokii --sendsms +48501123456 -r

saves SMS messages to phone. Messages are read from STDIN. You can specify the following optional arguments:

--sender - set the sender number (only --deliver)

--smsc message_center_number - set the SMSC number (only --deliver)

--smscno message_center_index - SMSC number taken from phone memory from address message_center_index (only --deliver)

--folder folder_id - folder ID where to save the SMS to (only valid for newer phones, i.e. 6210/6510 series). For legal values see --getsms.

--location number - save the message to location number

--sent | --read - mark the message saved/read depending on --deliver

--deliver - set the message type to SMS_Deliver

--datetime YYMMDDHHMMSS - sets datetime of delivery, i.e. 031123185713 would set message delivery time to 23rd November 2003, 6:57:13 PM

show the SMSC parameters from specified location(s) or for all locations.

-r | --raw - output in a format suitable for --setsmsc

set SMSC parameters read from STDIN. See --raw output of --getsmsc for syntax.

create SMS folder with name name.

delete folder # number of 'My Folders'.

list SMS folder names with memory types and total number of messages available.

keeps reading incoming SMS and saves them into the mailbox.

MMS

gets MMS messages from specified memory type starting at entry start and ending at end. Default output format is human readable, alternative output formats are --pdu which is the binary format of MMS as received by the phone from the network and --raw which saves the data as read from the phone.

When the -o or --overwrite option is used, existing files are overwritten without asking.

deletes MMS messages from specified memory type starting at entry start and ending at end. If end is not specified only one location - start is deleted.

LOGOS

send the logofile to destination as operator or CLI logo.
set or clear operator, startup or caller logo.
set or clear welcome note.
get operator, startup or caller logo.
get welcome note.
print the logofile as ASCII art. Formats that are automatically detected are: NOL, NGG, NSM, NLM, BMP, I61, GGP, XPM. The OTA format can be used only if the filename ends with the .otb extension.

Format of network_code parameter is 3 digits MCC, a space, 2 digits MNC surrounded by single or double quotes, eg. "123 45".

RINGTONES

send the rtttlfile to destination as ringtone.
set the rtttlfile as ringtone (on 6110).

PHONEBOOK

reads specified memory location from phone. If end_number is not specified only one location - start is read. If instead of end_number the text end is specified then gnokii will read from start_number until it encounters a non-existant location. Valid memory types are ME, SM, FD, ON, EN, DC, RC, MC, LD:
ME Internal memory of the mobile equipment
SM SIM card memory
FD Fixed dial numbers
ON Own numbers
EN Emergency numbers
DC Dialled numbers
RC Received calls
MC Missed calls
LD Last dialed numbers

Normally you get human readable output. Please note, that it is not compatible with expected input by --writephonebook. You can use -v or --vcard switch to get output in vCard format or -l or --ldif switch to get output in ldif format or -r or --raw switch to get the raw output which is explained below. You can use it then with --writephonebook.

reads data from stdin and writes to phonebook. Uses the format as provided by the output of the getphonebook command using --raw or --vcard or --ldif. Default is raw format (see below for details) and alternate formats are vCard and ldif. Default --getphonebook output format is not compatible with --writephonebook.

With --memory-type memory_type and --memory-location number you can set a memory type and a location if the input data doesn't specify them.

When the -o or --overwrite option is used, existing entries at a given location are overwritten.

When the -f or --find-free option is given, gnokii tries to find a free location. In this case, you can omit the location field in the input data.

The raw phonebook format is very simple. Each line represents one entry. Fields are separated by semicolons. Semicolons aren't allowed inside a field. The fields have to be in this order (the subentries are optional, ie. you can repeat all subentry field multiple times, but they have to be alltogether in the given order):

name
number
memory_type
entry_location
caller_group_number
subentry_type
subentry_number_type
subentry_id
subentry_text

Possible values of caller_group_number and the corresponding caller groups are (these are defaults, you are able to change these manually in your phone):

0 Family
1 VIP
2 Friends
3 Colleagues
4 Other
5 No group

Possible subentry types are described in the gnokii/common.h file:

7 subentry is the name
8 subentry is the email address
9 subentry is the postal address (snail mail)
10 subentry is the note (text field)
11 subentry is the number
12 subentry is the ringtone
19 subentry is the date (used for DC, RD, LD)
26 subentry is the pointer (pointer to the other memory)
27 subentry is the logo (bitmap)
28 subentry is the logo switch
30 subentry is the group (octect)
44 subentry is the URL
47 subentry is the location (octect)
51 subentry is the image (file id)
55 subentry is the ringtoneadv (file id or ringtone)
56 subentry is the userid
63 subentry is the pttaddress
67 subentry is the extgroup
69 subentry is the video (file id)
70 subentry is the firstname
71 subentry is the lastname
74 subentry is the postaladdress
75 subentry is the extendedaddress
76 subentry is the street
77 subentry is the city
78 subentry is the stateprovince
79 subentry is the zipcode
50 subentry is the country
82 subentry is the formalname
84 subentry is the jobtitle
85 subentry is the company
86 subentry is the nickname
87 subentry is the birthday

Possible subentry number types are described in the gnokii/common.h file:

2 number is the home phone number
3 number is the mobile phone number
4 number is the fax number
6 number is the work phone number
10 number is the general number

For the subentry types that don't care about number type (as text files) this should be set to 0.

delete entries with start_number to end_number from the phone book in memory_type. end is a keyword that denotes 'everything till the end'.

WAP

reads the specified WAP bookmark from phone
write WAP bookmark to phone
delete WAP bookmark from phone
read WAP setting from phone
reads data from stdin and writes it to phone. Hint: see syntax from --getwapsetting -r option
activate WAP setting number

DATE, TIME AND ALARM

set the date and the time of the phone.
shows current date and time in the phone.
set the alarm of the phone.
shows current alarm.

SECURITY

get IMEI, manufacturer, model, product name and revision.
asks for the code and sends it to the phone. Code is read from terminal or from stdin.
shows the currently set security code.
show if a security code is needed.
show information about the (sim)locks of the phone: the lock data, whether a lock is open or closed, whether it is a user or factory lock and the number of unlock attempts.

FILE

Note that some phones (like Nokia 6610i) support only id based operations (gnokii options with "byid" suffix). Use gnokiifs for the transparent support.

lists files from the given directory. Use A:\* or B:\* to get the root directory from either phone memory or card memory.
lists file details or directory contents from the entry identified by id. If no identifier is given, list the root directory contents.
gets id of the file.
gets file identified by name and path from the phone and stores it at the local computer.
gets file identified by id from the phone and stores it at the local computer.
gets all files from the remote path.
stores the file in the phone memory or on the memory card.
removes the file from the phone.
removes the file from the phone.

MISC

emulates pressing keys on phone keyboard. Input is read from stdin.
Supported keys (any other char is ignored):
M menu
N names
P power
G green phone
R red phone
U up
D down
+ increase volume
- decrease volume
0123456789#* as is
Example: to increase volume

echo "+" | gnokii --keysequence
Note: this command isn't supported by all phones/drivers.

emulates typing a character on phone keyboard. By emulating multiple pressions of keys, it can input all characters supported by the phone in use, but to input an SMS predictive text should be disabled. Input is read from stdin, with newline interpreted as the "Menu" key and escape interpreted as the "Names" key.
Note: this command isn't supported by all phones/drivers.

prints a list of cellular network operators with their 3-digits MCC (Mobile country code) and 2-digits MNC (Mobile Network Code).
Note: this command doesn't need a valid config or a phone to work.

prints information about the network currently in use.

DIAGNOSTICS

Various error messages are printed to standard error. The exit code is 0 for correct functioning. Errors which appear to be caused by invalid or abused command line parameters cause an exit code of 2, and other errors cause an exit code of 1.

BUGS

We write quality software here ;) but see KNOWN_BUGS just in case. If you'd like to send us the bugreport please read the README and Bugs files.

AUTHOR

Hugh Blemings <hugh at blemings dot org>, Pavel Janik ml. <Pavel.Janik at suse dot cz> and Pawel Kot <gnokii at gmail dot com>.

Manual page written by Dag Wieers <dag at mind dot be>, Pawel Kot <gnokii at gmail dot com> and Daniele Forsi <daniele at forsi dot it>.

See also Docs/CREDITS from gnokii sources.

COPYING

This program is distributed under the GNU Public License Version 2, or (at your option) any later version.

SEE ALSO

gnokiid, xgnokii, mgnokiidev, ppm2nokia, sendsms, todologo

July 7, 2011 Dag Wieers, Pawel Kot