Gammu:Setting configuration file
From Gammu.org Wiki
Return to Main Page - Gammu:Main Page
|
Please refer to gammurc.5 man page for more up to date information.
[edit] Configuration file options
If you know, how to generally connect your phone to PC, it's time to write it into configuration file. For start here is a sample configuration file:
[gammu] port = com8: model = 6110 connection = fbusblue synchronizetime = yes logfile = gammulog logformat = textall use_locking = yes gammuloc = locfile startinfo = yes gammucoding = utf8
Configuration file can be located either in your home directory (this location is prefered) (~/.gammurc on Unixes, profile/Application Data/gammurc on Windows) or can be configured for whole system. The location of the global configuration file depends on which system you use.
Location of the Global Configuration File for Windows:
- Located in the directory where the gammu.exe file located. This is normally in the gammu installation directory.
- On Windows Vista, the command line appears to search the current directory for the gammurc file (not the gammu installation directory).
- The filename of the configuration file is gammurc. Note: there is no extension on the filename (i.e *.ini, *.cfg, and so on).
- Make a backup of the gammurc file (e.g. gammurc-bak) before making experimental changes.
Location of the Global Configuration File for Linux:
- Located in /etc/gammurc or ~/.gammurc
[edit] port
To find this parameter use this command (in linux)
dmesg | grep tty
The value of this parameter can be:
- it can be empty - for irda, dku2, dku5 connection in Windows
- 'COM*:' - for serial connection in Windows (eg. 'COM1:')
- '/dev/ttyS*' (or '/dev/tts/**' with DevFS) - for serial connection in Linux (eg. '/dev/ttyS0')
- '/dev/ircomm*' - for infrared connection in Linux (eg. '/dev/ircomm0')
- '/dev/ttyUSB*' or '/dev/ttyACM*' - for dku2 connection in Linux
- 'XX:XX:XX:XX:XX:XX' (bluetooth address) for bluetooth connection (eg. '00:0A:D9:15:AA:81')
[edit] model
Use only when Gammu doesn't recognize your phone model. Example values: "6110", "6150", "6210", "8210".
[edit] connection
For information on which connection parameter to use, see the Methods of connecting to phone page
Valid parameters are:
mbus, fbus, fbuspl2303, dlr3, fbusdlr3, dku5, dku5fbus, dku2,dku2phonet, fbusblue, phonetblue, mrouterblue, blueobex, bluephonet, blueat, bluerfobex, bluerffbus, bluerfphonet, bluerfat, infrared, fbusirda, irda, irdaphonet, irdaat, irdaobex, at*
You can find and exchange working configurations in our phone databases
[edit] synchronizetime
Use this if you want to set the phone's time from the computer's time when gammu first connects to the phone. Do not use this option when you want to reset the phone during the connection (some phones need the time set again after a restart)
[edit] logfile
Use this when you want gammu to keep a record of communication in a log file.
[edit] logformat
What debug info and format should be used:
- "nothing" - no debug level (default)
- "text" - transmission dump in text format
- "textall" - all possible info in text format
- "errors" - errors in text format
- "binary" - transmission dump in binary format
[edit] use_locking
Under Unix/Linux set this to "yes" if you want to lock the device being used, to prevent other applications trying to use it. (This is probably not important on a single-user system, unless you use the same serial port for a modem and some other program could try and dial out while you're using gammu.) Under win32 this option is ignored.
[edit] gammuloc
Name of localisation file. Localisation is chosen automatically if you have set locales and properly installed Gammu.
See How to make national version of Gammu
[edit] startinfo
This option allows you to set whether you want to see a message on the phone screen or if the phone's backlight should come on for a moment when gammu connects to it. Set this to "yes" to see a message on the phone. With this option set, the phone won't beep when the connection is initiated.
[edit] gammucoding
Forces use of a specified codepage (in win32 - for example "1250" will force CP1250) or UTF8 (in Linux - "utf8")
[edit] features
Custom features for phone. This can be used as override when values coded in common/gsmphones.c are bad or missing. Consult include/gammu-info.h for possible values (all Feature values without leading F_ prefix). Please report correct values to Gammu authors.
[edit] Working with multiple phones
You can create several section in configuration file:
[gammu] port = /dev/ttyS0 [gammu1] port = /dev/ttyS1 [gammu2] port = /dev/ttyS2 ...
And then just call
gammu N --any-command
Where N is section number you want to use.

