Main page

Command line gnokii FAQ


What is command line gnokii ?


It was first our testing tool. Now it can be used for making almost all things possible with gnokii package (and this is the only available tool for win32).

Some general commands...


gnokii --help
Displays GNOKII list of parameters:
c:\> gnokii --help
   usage: gnokii [--help|--monitor|--version]
          gnokii --getmemory memory_type start [end] [-d]
          gnokii --writephonebook [-i]
          gnokii --getspeeddial number
          gnokii --setspeeddial number memory_type location
          gnokii --getsms memory_type start [end] [-f file]
          gnokii --deletesms memory_type start [end]
          gnokii --sendsms destination [--smsc message_center_number |
                 --smscno message_center_index] [--long n] [-s] [-C n]
                 [-8] [-v n] [-d]
          ........
gnokii --version
Displays GNOKII version and copyright information:
c:\> gnokii --version      
GNOKII Version 0.3.3-pre8-gold
Copyright (C) Hugh Blemings , 1999, 2000
Copyright (C) Pavel Janík ml. , 1999, 2000
Built 10:36:05 Dec 10 2000 for 6110 on com2: 

Managing phonebook and other (dialed, misssed, answered, own, etc.) memories


gnokii --getmemory memory_type start [end] [-d]
Reads specificed memory location from phone..

You can specify such memories:

With memories DC, EC, MC you will see assigned date (yes, with all Dialled, Received, Missed numbers phone saves date and time too !). If you don't want it, use -d option

Note: Locations start from 0 !

Usage examples:

tfuj:~$ gnokii --getmemory SM 1 5
Maja ERA;+48604xxxxxx;SM;1;1
Dom;+4822xxxxxxx;SM;2;5
Maja;+4822xxxxxxx;SM;3;1
Iza;+48601xxxxxx;SM;4;5
Ania;+48501xxxxxx;SM;5;0

tfuj:~$ gnokii --getmemory ON 1 5
DOM;+4822xxxxxxx;ON;1;5
;;ON;2;5
;;ON;3;5
;;ON;4;5
ON|5|Bad location or other error!(22)

tfuj:~$ gnokii --getmemory EN 1 5
Memory type EN not supported!

tfuj:~$ gnokii --getmemory MC 1 5
Maja IDEA;501xxxxxx;MC;1;5
21.06.2000 21:32:52
Maja IDEA;0501xxxxxx;MC;2;5
21.06.2000 18:06:02
;;MC;3;5
11.06.2000 15:09:33
;;MC;4;5
11.06.2000 12:44:55
;;MC;5;5
10.06.2000 16:59:13

The meaning of the fields in the output:

Possible errors:

  1. Bad location or other error!(22)
  2. Memory type XX not supported!
gnokii --writephonebook [-i]
Reads the data from the standard input and saves it in the SIM Card/phone memory. The input data is in the format as described above (in desciption for --getmemory parameter).

Usage examples:

tfuj:~$ gnokii --writephonebook

Girlfriend;+48501000000;ME;1;1
Write Succeeded: memory type: int, loc: 1, name: Girlfriend, number: +48501000000

tfuj:~$ echo "Very_long_name_longer_then_the_phone_can_save;some_string;ME;2;1" | gnokii --writephonebook
Write Succeeded: memory type: int, loc: 2, name: Very_long_name_longer_then_the_phone_can_some_string, number: some_string

tfuj:~$ echo "Girlfriend;+48501000000;ME;200;1" | gnokii --writephonebook
Write FAILED(22): memory type: int, loc: 200, name: Girlfriend, number: +48501000000

tfuj:~$ echo "Girlfriend;+48501000000;ME;3;10" | gnokii --writephonebook
Write Succeeded: memory type: int, loc: 3, name: Girlfriend, number: +48501000000

tfuj:~$ gnokii --getmemory ME 1 5
Girlfriend;+48501000000;ME;1;1
Very_long_name_l;//3/////2#4;ME;2;1
Girlfriend;+48501000000;ME;3;10
;;ME;4;5
;;ME;5;5

tfuj:~$ echo "Girlfriend;+48501000000;PP;3;10" | gnokii --writephonebook
Format problem on line 1 [Girlfriend;+48501000000;PP;3;10]

tfuj:~$ echo "some_nonsense_string" | gnokii --writephonebook
tfuj:~$ 

Some notes:

  1. Remember that any existent entries in the phonebook will be overwritten (must use [-i] option, if you don't want it - you will be asked then, if you want overwrite or not)
  2. Names and numbers are truncated by the phone when saving.

Possible errors:

  1. Wrong location: Write FAILED(22)
  2. Wring memoty type: Format problem on line n
  3. Other errors: [no output] - this should be changed
gnokii --getvoicemailbox
Get voice mailbox number

Example:


Speed dials


gnokii --getspeeddial number
Reads from the phone a number assigned to a shotrcut key

Example:

tfuj:~$ gnokii --getspeeddial 1
SpeedDial nr. 1: 3:0
The output format: SpeedDial nr. key_number: memory_type:location.

On error output is empty.

gnokii --setspeeddial number memory_type location
Writes to the phone a number assigned to a shotrcut key. You can use memory SM or ME.

Example:

tfuj:~$ gnokii --setspeeddial 1 SM 1
Succesfully written!

tfuj:~$ gnokii --setspeeddial 1 PP 1    
Unknown memory type PP!

...but there are still some bugs:

tfuj:~$ gnokii --setspeeddial 1 SM 10000
Succesfully written!

tfuj:~$ gnokii --getspeeddial 1
SpeedDial nr. 1: 3:16

SMS (Smart Messaging System)


If you don't know anything about SMS, please read our SMS FAQ.

gnokii --getsms memory_type start [end] [-f file]
Reads SMS messages from the specified memory_type (it can be phone's internal memory - ME - or SIM card - SM memory) starting at start and ending at end. If end argument is not present only one location - start - is read.

Examples:

tfuj:~$ gnokii --getsms SM 11
11. Inbox Message (read)
Date/time: 29/6/0 13:41:22 +0100
Sender: 102 Msg Center: +48501200777
Text:
SMS OD: Mariusz, Wszystkiego najlepszego z okazji imienin! Mariusz

tfuj:~$ gnokii --getsms SM 3
3. Delivery Report (read)
Sending date/time: 25/5/0 13:58:24 +0100
Response date/time: 25/5/0 13:58:32 +0100
Receiver: +48605000000 Msg Center: +48501200777
Text: Delivered

tfuj:~$ gnokii --getsms SM 5
5. Outbox Message (not sent)
Text: UU0i7eec

tfuj:~$ gnokii --getsms SM 12
GetSMS SM 12 failed!(4)

tfuj:~$ gnokii --getsms SM 15
15. Delivery Report (read)
Sending date/time: 3/1/0 10:49:51 +0100
Response date/time: 6/1/0 10:51:06 +0100
Receiver: 1921681052342802 Msg Center: +48501200777
Text: Failed

tfuj:~$ gnokii --getsms SM 28
SMS location SM 28 empty.

tfuj:~$ gnokii --getsms SM 25 28
25. Inbox Message (read)
Date/time: 18/6/0 12:17:30 +0100
Sender: 501 Msg Center: +48501200777
Text:
Liczba wiadomosci:1,nowych:1,faksow:0

SMS location SM 26 empty.
27. Inbox Message (read)
Date/time: 21/6/0 19:45:11 +0100
Sender: 123 Msg Center: +48501200777
Text:
Informujemy, ze wyslalismy do Panstwa fakture z terminem platnosci do 28.06.00. Dziekujemy za wybranie sieci Idea.

SMS location SM 28 empty.

tfuj:~$ gnokii --getsms SM 31
Invalid location: SM 31

gnokii --deletesms memory_type start [end]
Deletes SMS messages from specified memory type (SM or ME) starting at entry start and ending at end

Examples:


gnokii --sendsms destination [--smsc message_center_number | --smscno message_center_index] [--long n] [-s] [-C n] [-8] [-v n] [-d] [--enablevoice|--disablevoice|--enablefax|--disablefax| --enableemail|--disableemail|--void] [--unicode]
Sends an SMS message to destination via SMSC number given in message_center_number or SMSC number taken from phone memory from address message_center_index. If arguments --smsc and --smscno is ommited SMSC number is taken from phone memory from location 1. Message text is taken from standard input.

Meaning of optional parameters:

Examples:

gnokii --sendsms "+48601601601" < file
Saves an SMS message in SIM. Message text is taken from stdin.
gnokii --savesms destination|\"\" [--smsc message_center_number] [--smscno message_center_index] [--long n] [-r] [-i] [-s] [-C n] [-8] [-a] [-l] [--enablevoice|--disablevoice|--enablefax|--disablefax| --enableemail|--disableemail|--void|--hang|--bug] [--unicode]

Meaning of optional parameters:

Examples:

gnokii --savesms "SavedSMS" -i < file
gnokii --getsmsc message_center_number
show the SMSC number from location message_center_number.

Usage examples:

tfuj:~$ gnokii --getsmsc 1
1. SMS center (CENTERTEL) number is +48501200777
Messages sent as Text
Message validity is 72 hours

tfuj:~$ gnokii --getsmsc 2
2. SMS center () number is 
Messages sent as Text
Message validity is Unknown

Date/time and alarm


gnokii --getdatetime
Shows current date and time in the phone.

Example:

tfuj:~$ gnokii --getdatetime
Date: 2000/07/06
Time: 23:50:43
gnokii --setdatetime [YYYY [MM [DD [HH [MM]]]]]
Set the date and the time of the phone.

Example:


gnokii --getalarm
Shows current alarm set in phone.

Example:


gnokii --setalarm HH MM
Set the alarm of the phone.

Example:


Calendar


gnokii --getcalendarnote index [-v]
Get the note with number index from calendar. It will be written in vCalendar 1.0 format, when use -v option.

Example:

tfuj:~$ gnokii --getcalendarnote 1
   Type of the note: Reminder
   Date: 2000-06-26
   Time: 23:59:59
   Text: GNOKII TEST

tfuj:~$ gnokii --getcalendarnote 2
The calendar note can not be read

tfuj:~$ gnokii --getcalendarnote 1 -v
BEGIN:VCALENDAR
VERSION:1.0
BEGIN:VEVENT
CATEGORIES:MISCELLANEOUS
SUMMARY:GNOKII TEST
DTSTART:20000626T235959
END:VEVENT
END:VCALENDAR
gnokii --writecalendarnote vcardfile number
Write the note to calendar.

Example:


gnokii --deletecalendarnote index
Delete the note with number index from calendar.

Example:


Netmonitor


If you don't know, what is this or how to use it, please read first our Netmonitor manual.

gnokii --netmonitor {reset|off|field|devel|next|nr}
Setting/querying netmonitor mode.

Example:

tfuj:~$ gnokii --netmonitor 0
TMSI46963A06
T321:  2/ 20
PRP:5   0  0
     0   784

tfuj:~$ gnokii --netmonitor 1    
 784 -72 xxx
 0  0 x xxxx
  29      29
    CBCH

tfuj:~$ gnokii --netmonitor 2
 NO 2    B35
 16   x

tfuj:~$ gnokii --netmonitor 3
784 28-73 28
781 19-82 19
809 19-82 19
     N  N

tfuj:~$ gnokii --netmonitor 4
778 12-89 12
794 11-90 11
774  8-93  8
   N  N  N

tfuj:~$ gnokii --netmonitor 5
800-99-99-99
xxxxxxxxxxxx
xxxxxxxxxxxx
   N xx xx

tfuj:~$ gnokii --netmonitor 6
26003  26002
20420  26001
26207  20810
26203  20416

tfuj:~$ gnokii --netmonitor 7
E A H C I BR
1 1 0 0 0 10

tfuj:~$ gnokii --netmonitor 1000

  NO TEST
gnokii --nm_collect [screen x] [screen y] [screen z]
This function is like --netmonitor, but:

Was originally developed for:

It's easier and has less options than --netmonitordata, but should work with every phone that has netmonitor enabled and don't need any parameter specifications (like --netmonitordata, which requires external file with info about parameters).

Author: Andrea Scopece

Example:


gnokii --netmonitordata [-S file] [-I file] [-h] [-n n] [-ts n] [-tm n] [-fs str] [-ls str] FLD1:FLD2:FLDn:...

Meaning of parameters is:

Here is also note from author:

Checks of all arguments, and eventually files contents, are made before start of data output.

Because of complexity of command line, phone spec, and eventually command file, on error, you have datailed description of any error,

Also I attached here an examples of commands-file (see /Docs/examples) that can run with: mygnokii --netmonitordata -S netmonitordata_6150_413 -I nmd_commands

Users of same model but with other firmware version probably should do very little work for an exact parameters specifications of theirs phones.

Users of 5110 and 6110 probably should remove some parameters not available, like parameters related to dual band.

Users of other phone models should write a new parameters-file: some hints are available in file netmonitordata_6150_413.

If help is needed, please dump the screen, (mygnokii --netmonitor 20 > screen_20.txt), and send an e-mail to my address.

If available, check help screen by pressing '*' on phone (during netmonitor session).

Scope of this work is monitoring some "user-interesting" parameters, coming from differents screen, like battery charging vs. time, cell ID and channel changes vs. signal strenght, ...

This is work in progress, so any input would be appreciated.

Author: Andrea Scopece

Example:

gnokii --netmonitordata -S file RxL:LAC:CID

gnokii --netmonitordata -S file -fs ";" RxL:LAC:CID

Logos and startup texts


If you don't know, what is logo, please read first our logos FAQ.

gnokii --bitmapconvert source destination
gnokii --bitmapconvert source destination op [network code]
gnokii --bitmapconvert source destination caller [caller group number]
gnokii --bitmapconvert source destination startup
Converts logo files. Supported formats: NOL, NGG, NSL, NLM, BMP, OTA, XPM. 3'rd parameter allow to specify, what type should be destination logo (when format allows for it).

Usage examples:


gnokii --sendlogo op destination logofile network_code [--smsc message_center_number] [--smscno message_center_index] [-s] [-v n] [-d]
gnokii --sendlogo caller destination logofile [--smsc message_center_number] [--smscno message_center_index] [-s] [-v n] [-d]
Send the logofile to destination as operator or CLI logo. Optional parameters:

Usage examples:


gnokii --savelogo op logofile network_code [--smsc message_center_number] [--smscno message_center_index] [-r] [-i] [-s] [-a] [-l] [--name name]
gnokii --savelogo caller logofile [--smsc message_center_number] [--smscno message_center_index] [-r] [-i] [-s] [-a] [-l] [--name name]
Saves the logofile on SIM as operator or CLI logo. Optional parameters:

Usage examples:


gnokii --setlogo op [logofile] [network code]
gnokii --setlogo startup [logofile]
gnokii --setlogo caller [logofile] [caller group number] [group name]
gnokii --setlogo {dealer|text} [text]
Set caller, startup or operator logo or set (Dealer) welcome note.

In Nokia 6110/6130/6150 you will see menu in phone after using it...

Usage examples:


gnokii --getlogo op [logofile] [network code]
gnokii --getlogo startup [logofile] [network code]
gnokii --getlogo caller [logofile][caller group number][network code]
gnokii --getlogo {dealer|text}
Get caller, startup or operator logo or get (Dealer) welcome note.

Usage examples:


Ringtones


gnokii --sendringtone destination ringtonefile [--smsc message_center_number] [--smscno message_center_index] [-s] [-v n] [-d] [--scale]
Send the RTTL/OTT file to destination as ringtone.

Usage examples:


gnokii --saveringtone ringtonefile [--smsc message_center_number] [--smscno message_center_index] [-r] [-i] [-s] [-a] [-l] [--name name] [--scale]
Saves ringtone on SIM.

Usage examples:


gnokii --setringtone ringtonefile [location]
Set the RTTL/OTT as ringtone

In Nokia 6110/6130/6150 you will see menu in phone after using it...

Usage examples:


gnokii --getbinringtone ringtonefile [location]
Gets downloadable ringtone and writes it in the special binary format (it's not yes decoded - after making it this function can be unavailable).

Usage examples:


gnokii --setbinringtone ringtonefile [location]
Sets downloadable ringtone. Ringtonefile is in format used by --getbinringtone. Mygnokii contains some default Nokia phones ringtones saved in this format.

Usage examples:


gnokii --ringtoneconvert source destination
Converts ringtone files (RTTL, OTT)

Usage examples:


gnokii --playringtone file
Plays ringtone in phone

Usage examples:


gnokii --composer ringtonefile
Shows, how ringtone will look in Composer in phone...and how to enter it there...

Usage examples:


gnokii --allringtones
Shows names of ringtones in your phone (to test, if they're put into source)

Usage examples:


Backup/restore tool


gnokii --backupsettings file [subformat]
Writes various settings into one file

Supported formats: LMB (Logo Manager Backup - full support for N61xx/51xx features; for N7110/6210 some things can be missed, when compare to files saved by LM), CSS (NCDS3 - only phonebook part), CSV (subformats: ncds2, lm, ncds3_pl - some things missed for N7110/6210), SCM (WinTesla)

Usage examples:


gnokii --restoresettings file

  1. restores various settings from one file
  2. allow to write phonebooks and logos into separate files.

Supported formats: LMB (Logo Manager Backup - full support for N61xx/51xx features; for N7110/6210 some things can be missed, when compare to files saved by LM), CSS (NCDS3 - only phonebook part), CSV (subformats: ncds2, lm, ncds3_pl - some things missed for N7110/6210), SCM (WinTesla)

Usage examples:


Profiles


gnokii --getprofile [number]
Show settings for selected(all) profile(s)

Usage examples:

tfuj:~$ gnokii --getprofile 1
1. "General"
Incoming call alert: Ringing
Ringtone number: 19
Ringing volume: Level 3
Message alert tone: Standard
Keypad tones: Off
Warning and game tones: On
Vibration: On
Caller groups: 0x00
gnokii --setprofile number feature value
Set profile feature

Possible features are:

Usage examples:


Security features


This functions are available ONLY, if gnokii was compiled with them !

gnokii --entersecuritycode PIN|PIN2|PUK|PUK2
Asks for the code and sends it to the phone

Usage examples:


gnokii --getsecuritycodestatus
Show if a security code is needed

Usage examples:


gnokii --getsecuritycode PIN|PIN2|PUK|PUK2|SecurityCode
Gets security code (only SecurityCode allowed !)

Usage examples:


Other functions


gnokii --monitor
Runs gnokii in persistent communication state - displays all data received from the phone to the stderr. Example session:
tfuj:~$ gnokii --monitor
Entering monitor mode...
Initialising GSM interface...
RFLevel: 4
Battery: 3
Power Source: battery
SIM: Used 42, Free 188
Phone: Used 4, Free 46
FD: Used 0, Free 20
ON: Used 2, Free 3
SMS Messages: UnRead 0, Number 26
Network: IDEA Centertel (Poland), LAC: 00c8, CellID: 1024
[...]
gnokii --dialvoice number
Initiate voice call from first number on SIM card.

Usage examples:


gnokii --getdisplaystatus
Shows what icons are displayed in phone's screen.

Usage examples:

tfuj:~$ gnokii --getdisplaystatus    
Call in progress: off
Unknown: off
Unread SMS: off
Voice call: off
Fax call active: off
Data call active: off
Keyboard lock: off
SMS storage full: off
gnokii --identify
Get IMEI, model and revision . In this moment doesn't work with MBUS connection and Unix...

Usage examples:

tfuj:~$ gnokii --identify    
IMEI:     495502202470000
Model:    NSK-3
Revision: SW 4.11, HW2460
gnokii --senddtmf string
Sends DTMF sequence . If you will start from "p" (Pause), phone will display menu before sending it...

Usage examples:


gnokii --presskeysequence sequence
presses some keys in phone keyboard

Available keys:

Usage examples:


gnokii --reset [soft|hard]
Resets the phone. You can use "soft" parameter (no question for PIN code - it's default) or "hard" (phone will ask for PIN - of course, if you have it enabled in your card; in some phones - for example N5110 - this type of reset will be like "soft")

Usage examples:


gnokii --getphoneprofile
Gets profile set normally with Product Profile Settings

Usage examples:


gnokii --setphoneprofile feature value
Set profile set normally with Product Profile Settings:

Features can be:

Usage examples:


gnokii --displayoutput
Show texts displayed in phone's screen

Usage examples:

tfuj:~$ gnokii --displayoutput
Entering display monitoring mode...
Accessory
connected
Names
Menu
23:59
Messages
Exit
Select
_
Messages
Exit
Select
_
Call register
Exit
Select
2
Missed
calls
Back
Select
2-1
Received
calls
Back
Select
2-2
Dialled
numbers
Back
Select
2-3
Erase recent
call lists
Back
Select
2-4
Show call
duration
Back
Select
2-5
Last call
duration
00:01:33
Back
2-5-1
All calls'
duration
06:45:02
Back
2-5-2
Received calls'
duration
02:49:38
Back
2-5-3
Names
Menu
23:59
...WAW... 
POCZTA ELE
...WAW... 
Leaving display monitor mode...
gnokii --getphoneprofile
Gets Product Profile Settings from phone

Usage examples:


gnokii --getoperatorname
Get info about downloaded operator name

Usage examples:


gnokii --setoperatorname code name
Set downloaded operator name

Usage examples:


How to send SMS to multiple recipients using gnokii ?


#!/bin/tcsh
 
if ( $# == 0 ) then
  echo "You must specify at least one recipient's number!"
  exit 1
endif
 
echo -n "Enter SMS:"
set sms="$<"
 
foreach i ( $* )
  echo "$sms" | gnokii --sendsms "$i"
end

Sending script...


Author: oxana [rasqua@t-online.de]

I use a simple perlscript to send sms from a daily generated file. The file is generated by another script.

The script contains only one line like this "send following data : +49179xxxxxxx Hallo Guillaume#Test#"

Where +49xxx the number, followed by text, # will be replaced with a carriage return (\n) the string "send sms:" is only to prevent errors

I've modified the comments for english language ... the programm is very simple (I'am perl-newbie too) but I hope you can read it. I use this to send a daily status-sms to my phone.

#!/usr/bin/perl
use strict;
while (1)                                               #example endlessloop
{
my ($strtosend, $valid, $rxnnummer, $smslaenge, $pid, $filename, $timeout);
# (nummer is german for number, laenge is german for length)
$filename = "/xxx/xxx/xxx/data/smstosend_data";                 # file with
data
$valid ="send sms:";
# to prevent errors
$timeout = 100;
# timeout
open(INPUT, "< $filename");                                              #
or die "error opening: $!\n";           # hope here are no errors
while()
# if ok
{
$strtosend = $_;
# copy input to strtosend
if ($strtosend =~ /\A$valid/)
# if $valid then
{
$strtosend = substr ($strtosend, index($strtosend,"+"));
# cut all befor number (send sms:)
if ($strtosend =~ /\+\d.*?\b/) {$rxnummer = $&} else {$rxnummer = 0};
# all following numbers are phone-number and copy it to rxnummer (nummer is
german for number)
$strtosend =~ s/\+49179\d.*?\b\s//g;                                    #
remove number
$strtosend =~ s/\#/\n/g;
# replace # by \n
$smslaenge = length($strtosend);
# check length
$pid = open(FileHandle, "|gnokii --sendsms $rxnummer --long $smslaenge");#
or die "Fehler bei fork: $!\n";     ### start gnokii and send sms
print FileHandle "$strtosend\n";
# send string to stdin
select(undef,undef,undef,15);
# i dont know
close (FileHandle); # or die "Fehler bei close: $!\n";                #
close gnokii
close(INPUT);
# close input-file
unlink($filename);
# remove input-file
open(INPUT, ">> /xxx/xxx/xxx/smshistory_data") or die "error opening: $!\n";
# open history for append
print INPUT "\n",'-' x 80,"\n";
# line with 80 "-"
print INPUT ("send succeeded to : $rxnummer \nat :
".localtime()."\n$strtosend \n");  # write text to file
print INPUT "\n",'-' x 80,"\n";
# line with 80 "-"
close INPUT;
# close file
}
else
# if impossible (open file)
{                                                                           
  # do nothing
}
}
select(undef,undef,undef,$timeout);
# dont know
}
exit(0);
# exit program