TODO forever when life runs faster than you can afford

Configuring

Notice: This page provides links and instructions referring to an old version of Sakis3G script. Page is still available only for historical reasons.
Please visit www.sakis3g.org for latest Sakis3G script version.

Αυτή η σελίδα υπάρχει και στα Ελληνικά.

This page is meant to be a configuration manual to Sakis3G script.

Contents

How to configure

You need to edit this script to permanently alter its configuration, since it comes with no external configuration file. Within script you also will find information per configuration value, more suitable to your version.

Alternatively, if you are not using alwayssudo variable, you can temporarily set disabled configuration variables, on command line. As an example, if DEBUG variable is not set as a permanent settings, you can use this syntax:

DEBUG=on sakis3g connect

IMPORTANT: Those variables that are flags (that is, having their value equal to "1", or "yes", or "on"), their value is not really checked, just their presence. This means, if you want them to be toggled false, you should not use "0", or "no", or "off". Instead, you should completely comment them out. This script only checks if they were set or not, not their actual contents. As an example: alwayssudo=no, is considered a yes because alwayssudo variable is set.
(Back to contents)

SIM PIN

If your SIM card requires PIN, you can enter it here to avoid providing it over and over.

e.g.
SIM_PIN="1234"

ATTENTION: Entering the wrong PIN for a couple of times will render your SIM unusable, until PUK is supplied. This script does not provide a way to provide PUK. You may plug blocked SIM into a cellular phone to enter PUK.

If exists a file named .3gpin inside calling user's home directory, it overrides this value. This can be useful in cases where each user provides his/her own modem. You can create PIN file by issueing:

echo "1234" > "$HOME/.3gpin"

If exists file /etc/3gpin, it overrides everything. This can be useful in cases where you don't want to reveal PIN to users, and in order to prevent them from blocking SIM by subsequent wrong PIN requests.

BEWARE: if DEBUG configuration value is on, PIN is revealed.

If this field is empty, and none of the files above exists, this script never attempts to unlock SIM, and finally aborts against locked SIM cards.

e.g.
SIM_PIN=""

If you can take the risk, you can increase SIM card's integrity (and decrease time required for establishing connection and SIM security) by completely removing PIN from SIM. The easy way to do it, is inserting the SIM card to a cellular phone and permanently unlock it.

Last, but not least, if instead of PIN, this variable, or /home/dir/.3gpin, or /etc/3gpin contains the word "prompt", user is prompted to enter PIN. However, this may be risky on systems with many X displays, with the prompt window appearing on the wrong DISPLAY, wrong user entering wrong PIN and SIM finally getting blocked.

e.g.
SIM_PIN="prompt"

BEWARE: If you use multiple SIM cards/modems, it may happen that PIN is sent to the wrong SIM. If you intend using more than one SIM cards, you should have set SIM_PIN option to "prompt".
(Back to contents)

Force specific APN: FORCE_APN

Some operators (see list of supported networks) offer multiple APNs (APNs are specified by issuing AT+CGDCONT command to modem). They usually refer to different billing plans, or to support Virtual Operators served from within the same Real network. Thus, choosing the corrent APN is crucial for your billing. Script cannot decide for you, and will prompt you to specify it yourself.

If you specify it within script, users will be unable to change it. This may lead connection impossible if a SIM card from another network is inserted. User-friendlier way is to leave this entry commented, and let users specify it by using environment variables. Both ways below do the same:


$ FORCE_APN=internet::web:web /usr/sbin/sakis3g connect

or,

$ export FORCE_APN=internet::web:web
$ /usr/sbin/sakis3g connect

NOTE: Some operators require subscriber number (that is your phone number) be included as (part of the) username or as (part of the) password. If this is the case for you, then you really need to use this variable.

NOTE: If you use alwayssudo option below, the only way to specify APN is by including it to this script.

NOTE: If 9menu interface is installed on your system, you only need to specify this value to avoid selecting it each time, or to prevent users from selecting it themselves. If you don't specify it, you will be prompt to select it, each time you attempt connect.

Each APN should consist of four colon-separated fields. 1st is actual APN that should be sent to modem, second is a friendlier title (spaces should be replaced with undescores), third is username and fourth is password required by APN.

e.g.

internet.myoperator.com:My_Operator_(Internet):wap:wap

If your operator offers multiple APNs, you can get a list of possible values by executing this script from command line. 9menu users can see it within brackets from menu interface.

Example:

FORCE_APN=internet:My_Connection:mynumber:mypassword

As a last note, by specifying this variable, you can utilize an APN unknown to Sakis3G script.

(Back to contents)

Force specific ISP code: FORCE_ISP

If your modem does not support AT+COPS commands, which is required for autodetecting your operator, you can still guide this script to use your operator. Assign Numeric ID of your operator to this variable (see list of supported operators).

ATTENTION: This option *should* (is not tested, and it also depends on modem) prevent your modem from roaming. However, if you are out of country, you may be unable to connect.

e.g. to force using GR Cosmote add:
FORCE_ISP=20201

(Back to contents)

3G over bluetooth phone: BLUETOOTH_PHONE_rfcomm

If you have a bluetooth phone, already set up, with its dial up interface binded to a /dev/rfcomm node, you can enter this port here. Bluetooth phone will only be used in case no other supported modem is connected.

e.g.
BLUETOOTH_PHONE_rfcomm="/dev/rfcomm0"

(Back to contents)

Custom DNS servers: dnsserver1 / dnsserver2

You can request from this script to set specific DNS servers, overriding those that may be supplied by your ISP. Assign values to both dnsserver1 and dnsserver2 if you don't want to use ISP supplied list.

e.g. A good choice for fast surfing are google DNS servers:

dnsserver1="8.8.8.8"
dnsserver2="8.8.4.4"

(Back to contents)

Sick connections: sick_are_ok (boolean)

Some modems have trouble getting the IPs of remote peer and DNS servers, leading into default values:

Peer: 10.64.64.64
DNS #1: 10.11.12.13
DNS #2: 10.11.12.14

It is generally safe to leave sick connections alone if you have selected your own DNS servers (see above). If your connection works ok, even when a sick connection is made, you can safely set sick_are_ok. This can also save time durign connection if your modem makes sick connections often enough.

e.g.
sick_are_ok=yes
(Back to contents)

Root priviledges claiming method: alwayssudo (boolean)

This script needs root priviledges for some of its functionalities. If X DISPLAY is found, it attempts to get root priviledges using gksu/kdesu popup functionality, if those are not found, refers to "su".

If you want this script to always use sudo, instead of gksu/kdesu/su, use the following line. This has the added bonus that you don't need to reveal root password to users.

e.g.
alwayssudo=yes

For sudo to succeed, you need to add to sudo file the following line, and users that should be able to establish 3G connections to dialout group:

%dialout ALL=(root) NOPASSWD: /absolute/path/to/script

All users belonging to dialout group will be able to properly execute this script (dialout group is used as an example, you can use whatever is convinient for you).

(Back to contents)

DEBUG: DEBUG (boolean)

Set DEBUG configuration variable to enable debug messages to appear on calling tty. This is essentially useful when troubleshouting.

e.g.
DEBUG=on

BEWARE: Too much spamming will occur and you may see errors that are actually intended, or handled. Don't panic. PIN is revealed if DEBUG is used.

NOTE: Up to version 0.1.2 this variable used to be "debug". Since 0.1.3 it has been renamed to "DEBUG".

(Back to contents)

Verbose mode: VERBOSE (boolean)

Enable this option to utilize verbose mode. This enables messages displaying in terminal. Not that much detailed as in debug mode, but helps understand what script is currently doing.

If verbose mode is enabled, xosd (osd-cat) is installed and this script is running through an X session, osd-cat is used to present a progress bar while performing actions.

e.g.
VERBOSE=yes

(Back to contents)

Display log console: log_connection (boolean)

Set log_connection to enable connection console to appear on your X display. Closing console, cancels connection. This option allows you to observe what wvdial and pppd are doing and is useless if this script is already running on a terminal.

e.g.
log_connection=on
(Back to contents)

Force script to ignore X displays of the system: stick_to_console (boolean)

Set this variable to force this script to remain in console and do not attempt to use an X-session. Do not use it if you intend to use this script from your desktop.

e.g.
stick_to_console=yes

(Back to contents)

Notification method preference: prefer_osd (boolean)

If an X display is found, script attempts to locate 9menu for creating a little window to guide you through connection with your ISP. If 9menu is not found, it attempts to locate aosd_cat or osd_cat, for displaying OSD messages on X display instead.

Use this variable if you have both 9menu and aosd-cat/xosd installed but you prefer OSD. This allows different users of the system to utilize different behaviour, by having each, his own copy of this script (this however needs multiple entries in sudoers file).

e.g.
prefer_osd=1

This variable is useless if stick_to_console is used.
(Back to contents)

Specifies font used when displaying 9menu. For a list of values that may work, on a debian system do:

cat /var/lib/defome/xfont.font-cache | cut -d\ -f1 | sort | more

Or use traditional way of constructing a valid string:


xfontsel
xlsfonts

Examples:

menufont="-unknown-freesans-medium-r-normal-*-17-*-*-*-*-*-*-*"
menufont="-monotype-arial-medium-r-normal-*-18-*-*-*-*-*-*-*"
menufont="-dejavu-sans-medium-r-normal-*-18-*-*-*-*-*-*-*"

(Back to contents)

Specifies font used when using xosd to display OSD messages. For a list of values that may work, on a debian system do:

cat /var/lib/defome/xfont.font-cache | cut -d\ -f1 | sort | more

Or use traditional way of constructing a valid string:


xfontsel
xlsfonts

Examples:

menufont="-unknown-freesans-medium-r-normal-*-17-*-*-*-*-*-*-*"
menufont="-monotype-arial-medium-r-normal-*-18-*-*-*-*-*-*-*"
menufont="-dejavu-sans-medium-r-normal-*-18-*-*-*-*-*-*-*"

(Back to contents)

OSD Font: OSDFONT

Defines font name and size used when displaying OSD text using aosd_cat.

e.g.
OSDFONT='DejaVuSans 36'
(Back to contents)

Wvdial/pppd attempts: wvdialattempts

Number of subsequent wvdial/pppd tries that will be performed before calling the connection attempt failed.

e.g.
wvdialattempts=3

(Back to contents)

Wvdial/pppd wait interval: wait_interval

Amount of time (in seconds) given to wvdial/pppd in order to establish connection. This time depends, among others, on your hardware, signal reception strength, band available, bluetooth overhead and SIM lock.

Ten seconds should be enough for good signaled 3G USB connections. You may need to increase it if wvdial/pppd needs more time (i.e. this script kills wvdial/pppd while it is in the middle of negotiation).

e.g.
wait_interval=10
(Back to contents)

Connection hook: connection_hook

This option defines command to be executed after connection is established. Whenever connection is succesful, this command will be block-executed (use setsid to avoid it). This is useful if, for example, you want to setup NAT for sharing your ppp connection. Make sure your command does not contain syntax errors and that you \ escape double quotes.

All internal variables of this script are exported to that command e.g. $pppint will contain ppp interface. If you want to see variables use "set" as connection_hook.

e.g.
connection_hook="set"

ATTENTION: Whatever you enter here, will be executed as root. You are warned.
(Back to contents)

PPP interface: pppint

This should match the interface name that your version of pppd is creating. Chances are that this needs to be ppp0.

e.g.
pppint="ppp0"

BEWARE: This script will kill all pppd instances when "disconnect" is selected, thus eliminating any other ppp connections you might have running. If you have a complex setup (i.e. bridging accross ppp connections), you should NOT (need to) use this script, as it also messes up with your routing tables: you were warned.
(Back to contents)

Communication backend: direct_pppd (boolean)

This option allows directly using pppd instead of going through wvdial. This allows less dependencies, by relying only to pppd. This option is automatically set if wvdial is not installed. However, it may make it impossible for you to connect, if logic embedded inside wvdial is required. After all, this is just a shell script :)

e.g.
direct_pppd=yes
(Back to contents)

Log file: logposition

This variable should be set to the full path name of log file that should be used by Sakis3G script. Currently, this variable is only utilized when this script is executed as a child process to udevd. If left empty, default value "/var/log/sakis3g.log" is used.

e.g.
logposition=/var/log/sakis3g.log
(Back to contents)

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.