Sakis3G: All-in-one script
| 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 was last updated on 2010/02/24. Latest script version is 0.1.3g released on 2010/02/24.
Introduction
I run multiple personal computers at home. Some of them are normal PCs, some other laptops and netbooks. Some are only used by me, some others by family members. Whoever is on the go, grabs one 3G modem and leaves. Five laptops at home, you suddenly have a modem broken, you contact operator/ISP and you receive an other type of 3G modem. You now have to run through all PCs to set it up. While I was keep getting better and faster into doing it, I could not afford doing it forever.
My pain is "almost" over. I wrote a script that implements what I consider simplest solution for creating 3G connections in a newly installed system.
See more screenshots and videos here.
Contents
- Introduction
- Fitness
- Installing
- Configuring
- Known problems | Also read: Troubleshooting
- Contributing
- Latest release notes | Also read: Full change log
- F.A.Q.
About
So, this whole page is dedicated to a shell script. This shell script is supposed to work out-of-the-box for establishing a 3G connection with any combination of supported modem/operator. If both your modem and operator are supported, chances are that you can be connected 30 seconds after downloading script. See list of supported modems/operators below. Last legacy version is 0.1.3g (which is too close to earliest version). However, it serves me well.
| 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. |
My basic requirements were:
- As less as possible disk size requirements: 337 KB
- As few as possible third part dependencies: Nothing more than you should need if manually setting up.
- As fast as possible installation procedure: There is no installation, download and make it executable.
- As clean as possible installation procedure: No files are installed on your disk. Configuration is embedded. No need for wvdial, pppd, chat, udev, hal, usb_modeswitch configuration files.
- As good as possible user experience: "sakis3g connect" or "sakis3g disconnect", or no argument at all for having a simple X GUI.
This script comes to fill in the gap of no/partial support to some distributions for using USB modems, or to work around the "clumsy way" others do. While major distributions will gradually find their way into reliably, and in a unified way, support these devices, this script will end-up as a lightweight replacement to NetworkManager/ModemManager bundle, or gnome-ppp/wvdial bundle, or kppp for small footprint distributions.
License and Disclaimer
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program 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 General Public License for more details:
http://www.gnu.org/licenses/gpl.txt
Above statement includes additional charges you may receive from your operator by using this program, defects to your SIM card including but not limited to being PIN blocked, defects on your hardware, 3G service abuse ban etc. USE WITH CARE. Author has no responsibility for what may happen to you.
Author is not related in any way with any of the companies, being operators or modem manufacturers, other than being a customer to some of them. Logos and trademarks presented in this page belong to their respective owners.
Credits
This version is embedded with 1.1.0 version of Usb-ModeSwitch, which itself is made by Josua Dietze, available at:
http://www.draisberghof.de/usb_modeswitch/
under GNU GPL and contains device database as of 2010/02/21. For this reason, you should contact Josua Dietze only when your device is not properly switched. For problems other than that, you should contact Sakis3G author.
Whenever Usb-ModeSwitch or its database gets updated, you should expect an updated version of Sakis3G after a while. If your modem does not get switched (remains in storage mode), you should contact Usb-ModeSwitch forums, at is might be a new device:
http://www.draisberghof.de/usb_modeswitch/bb/
to receive further instructions for troubleshooting. If your modem gets switched, still it does not work, you should contact the author of Sakis3G.
This script is embedded with 1.8 version of 9menu. Source code is available at:
ftp://ftp.freefriends.org/arnold/Source/9menu.shar.gz
9menu is free software, and is Copyright (c) 1994 by David Hogan and
Arnold Robbins. Permission is granted to all sentient beings to use
this software, to make copies of it, and to distribute those copies,
provided that:
(1) the copyright and licence notices are left intact
(2) the recipients are aware that it is free software
(3) any unapproved changes in functionality are either
(i) only distributed as patches
or (ii) distributed as a new program which is not called 9menu
and whose documentation gives credit where it is due
(4) the authors are not held responsible for any defects
or shortcomings in the software, or damages caused by it.
There is no warranty for this software. Have a nice day.
Contributors
Following people have contributed in Sakis3G script:
- Dimitrios Tsolakis (wizarddim is the local part, on Greek yahoo)
Confirmed Huawei E170 modem works with version 0.0.9. - Jean-Pierre VAISSIERE (jpiebrig-nav is the local part, on French yahoo)
Confirmed GBC PL68 modem works with version 0.1.2.
Confirmed version 0.1.2 works with Tigo HR network. - Josua Dietze (Usb-ModeSwitch author)
Identified and fixed a regression issue, introduced by 0.1.2, that was preventing correct tty device detection on several (close to all) modems. Proposed fix was included in 0.1.3.
Installation procedure for impatient
This shell script only needs to be downloaded and be turned to an executable. Mind dependencies (see below).
Fastest way to install it on a typical Linux system is:
| 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. |
- Have a root terminal open.
- Install dependencies:
- [Debian GNU/Linux] "apt-get install ppp sharutils".
- [Ubuntu] "sudo apt-get install ppp sharutils".
- [openSUSE] "yast -i ppp sharutils".
- [Mandriva] "urpmi ppp sharutils".
- If you intend to use it from desktop, also consider:
- [Debian GNU/Linux] "apt-get install xterm 9menu xosd-bin".
- [Ubuntu] "sudo apt-get install xterm 9menu xosd-bin".
- [openSUSE] "yast -i xterm xosd".
- [Mandriva] "urpmi xterm".
- Switch to directory you want it installed, e.g. "cd /usr/bin"
- Download script: "wget 'http://sakis.tel4u.gr/sakis3g/legacy/sakis3g.gz'"
- Uncompress: "gunzip sakis3g.gz"
- Make script executable: "chmod +x sakis3g"
Debian GNU/Linux:
apt-get install ppp sharutils xterm 9menu xosd-bin wget
cd /usr/bin
wget 'http://sakis.tel4u.gr/sakis3g/legacy/sakis3g.gz'
gunzip sakis3g.gz
chmod +x sakis3g
Ubuntu:
sudo bash
apt-get install ppp sharutils xterm 9menu xosd-bin wget
cd /usr/bin
wget 'http://sakis.tel4u.gr/sakis3g/legacy/sakis3g.gz'
gunzip sakis3g.gz
chmod +x sakis3g
openSUSE:
yast -i ppp sharutils xterm xosd wget
cd /usr/bin
wget 'http://sakis.tel4u.gr/sakis3g/legacy/sakis3g.gz'
gunzip sakis3g.gz
chmod +x sakis3g
Mandriva:
urpmi ppp sharutils xterm wget
cd /usr/bin
wget 'http://sakis.tel4u.gr/sakis3g/legacy/sakis3g.gz'
gunzip sakis3g.gz
chmod +x sakis3g
Executing it from your desktop, you will be requested to provide root password, in order to setup connection. If you intend using your bluetooth enabled cellular phone as your modem, you also need to install bluez-utils package and properly setup rfcomm communication with phone. Then edit BLUETOOTH_PHONE_rfcomm configuration option within Sakis3G script.
Important: For SIM card safety reasons, this script does its best to only allow exactly 4-digit PIN numbers. If you use a shorter/longer than 4-digits PIN number, it will not work. Plug your SIM card to your cellular phone, and have PIN changed to exactly 4 digits.
Note: Subscribers to resellers of German Vistream (Solomo, GlobalSim etc.) my encounter problems using Sakis3G script since their SIM requires 5-digit PIN numbers.
Important: If 9menu is not available in your system, and your operator offers more than one APN, you need to set FORCE_APN variable for connection to succeed.
Features
- Hardware:
- Automatic detection of modem.
- Automatic mode switch, if modem is ZeroCD.
- Supports using a bluetooth enabled cellular phone, as fallback, when no supported modem found.
- Automatic load/unload of required driver with appropriate arguments.
- Automatic detection of appropriate modem device node.
- Communication:
- Able to provide PIN to SIM card if required.
- Automatic operator detection or manual operator selection to prevent roaming.
- Detects and drops connections with wrong DNS servers, or forces working DNS servers.
- Forces pppd peer to be the default gateway.
- Integration:
- Provides hooking mechanism to execute your own scripts whenever successfully connected.
- Ready to be used as an init.d script.
- Ready to be used as a udev rule.
- Allows each user to provide its own PIN number.
- Allows hidden system wide PIN to override user settings.
- Directly calls pppd, or uses wvdial if installed.
- Updates HAL about modem capabilities.
- Functionality:
- If modem is not supported by Sakis3G, still it exists in Usb_ModeSwitch device database, default initialization strings are sent to it.
- If not root already, prompts for root password, or can also use sudo.
- Able to create desktop shortcut for accelerating daily use.
- User is presented menu driven interface.
- If aosd_cat (common on Debian/GNU Linux running EeePCs) or xosd is installed, OSD messages appear on user's X session.
Known limitations
- For SIM card safety reasons, this script does its best to only allow exactly 4-digit PIN numbers. If you use a shorter/longer than 4-digits PIN number, it will not work.
- Unpredicted behavior if more than one modem units with identical USB IDs are connected.
- Due to the fundamental requirement that script should change nothing on filesystem(s), it does not store your network configuration prior into getting connected with your 3G/GSM provider. As a result, after being disconnect, it does not revert back /etc/resolv.conf to the configuration prior to making the connection nor it restores your previous default gateway to your routing table. If your existing infrastructure provides DNS servers and gateways from DHCP, you could/should try to disconnect and reconnect to those to get a working setup. If you were not connected to any other network while establishing 3G connection, this limitation does not apply.
- This script does not allow sending SMS and I do not intend to do it in the future.
- This script does not in any way interfere with your iptables configuration and does intend to do it in the future. If you want to manage your iptables configuration, use connection_hook option. As a note, if you encounter problems while sharing (do NAT through) your 3G ppp connection, consider using the following command:
iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
Supported modems
| 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. |
Sakis3G script is able/supposed to work with most 3G modems, being USB or even bluetooth. Modems are used with default initialization commands which are (supposed to be) working with most of them. However, some of them indeed require special handling to establish a (reliable) connection. If Sakis3G script is unable to automatically identify your modem, will ask you to indicate it. There are only two ways that Sakis3G script can automatically identify your modem, so don't panic if it does not:
- Your modem is indeed one of those "weird modems" that need special handling and Sakis3G knows how to handle it.
- Your modem is a known ZeroCD modem that exists within Usb-ModeSwitch device database. Sakis3G will have a look at that database before reporting failure to detect it.
As it turns out, if your modem is not automatically detected, possibly it just means that its not "weird" in any way, or it is just a too recent "weird" modem.
Modems below are confirmed to be working with Sakis3G:
- Alcatel One touch X200
- GBC PL68
- Huawei Ε170, E220, E230, E270, E870 (Experimental)
- ZTE MF636
If your modem is not working with default settings, please consider following trouble shooting guide. If it still does not work, email me output when running it with DEBUG variable set and I will have an updated version released immediately after.
(Back to contents)
Supported networks
| 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. |
Sakis3G script, currently supports major networks across 39 countries. Detailed information available here.

Sakis3G supports 146 networks across 39 countries (marked with green color).
Note: Some operators offer multiple APNs. Choosing the wrong APN, may even trigger additional (roaming) costs. If using 9menu interface, you will be prompted to select the correct one anytime you attempt to connect. If not using 9menu interface, you need to supply FORCE_APN variable.
Additional operators can be supported if provided with:
- Name and Network ID of operator.
- PDP context (that is AT+CGDCONT arguments).
- Username and password (if required by operator).
- Phone number that should be called.
You can find list of supported operators of your version by calling "sakis3g help". Instructions for adding your own operator can be found here.
Installation
While installing this script is indeed a matter of downloading and switching to executable, there are some dependencies that need to be resolved. Installation procedure described below refers to Debian GNU/Linux Lenny. Other distribution users may have to work out with package names used by their distribution.
| 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. |
- Install pppd and chat. They are used for contacting modem and establishing a DATA connection with your operator. This script will refuse to work if they are not installed.
apt-get install ppp
- If your modem needs mode switch, this script will utilize the embedded 1.1.0 version of Usb-ModeSwitch to switch it. Script will need uudecode, available from package sharutils, to decode embedded binary.
apt-get install sharutils
- If you are going to use this script from your desktop, xterm must (if not already) be installed. It is used by script to prompt you for PIN if SIM card requires it, and to display connection log if configured to do so.
apt-get install xterm
You may optionally add either menu driven interface, or OSD (On-Screen-Display) messages.- To add menu driven interface, install 9menu, (if on i386 architect, you can rely on "sharutils" for script to use its own 9menu version).
apt-get install 9menu
- To add fancy OSD messages, install aosd_cat or xosd-bin.
apt-get install aosd_cat
apt-get install xosd-bin
If both 9menu and aosd_cat/xosd are installed, 9menu is automatically used. This preference can be changed in configuration. If both 9menu and xosd are installed, 9menu is used to present UI and xosd to display progress information if VERBOSE variable is set.
- To add menu driven interface, install 9menu, (if on i386 architect, you can rely on "sharutils" for script to use its own 9menu version).
- If you intend using your bluetooth enabled cellular phone as a backup modem, you need bluez-utils.
apt-get install bluez-utils
- Download and install script.
- Switch to directory you want it installed
cd /usr/bin
- Download script
wget "http://sakis.tel4u.gr/sakis3g/legacy/sakis3g.gz"
- Uncompress
gunzip sakis3g.gz
- Fix script permissions.
chown root:dialout sakis3g
chmod 750 sakis3g
- If you are going to use this script along with alwayssudo configuration option, you need to setup sudo. Type:
visudo
Go at the end of file and add line:
%dialout ALL=(root) NOPASSWD: /usr/bin/sakis3g
Press Ctrl+X, answer Yes. - Add users that should be able to use create 3G connections to dialout group.
adduser john dialout
- Switch to directory you want it installed
Dependencies
If you need to install this script to a distribution other than Debian, you should be aware of its detailed dependencies:
- "/bin/sh" as it is a shell script.
- Various common utils that should anyway be available, such as: head, tail, cat, cut, wc, echo, printf, read, test, setsid, getent, ps, which, sort, uniq.
- The following super user utils: lsusb, modprobe, netstat, route.
- "chat" for negotiating with modem (supply PIN, manual operator selection etc).
- "pppd" for establishing ppp connection.
- "wget" for receiving operator icons from the internet.
- If you want to use this script from your desktop, the following are required:
- "xterm" for user to supply PIN if required, and for showing wvdial/pppd console if requested by configuration,
- "gksu"/"kdesu" (or plain "su" at worst case) is required unless option alwayssudo is specified, in which case "sudo" is required instead for getting root priviledges.
- If you want to use this script from your desktop, the following are recommended:
- "9menu" or "aosd_cat" or "osd_cat".
- If you execute this script from a terminal, the following are required:
- "su" or "sudo" for getting root priviledges.
- If your modem needs switching, the following are also required:
- "uudecode" for decoding embedded Usb-ModeSwitch binary,
- "libusb" for Usb-ModeSwitch to work.
- "wvdial" is NOT required. However, if it is installed, "wvdial" is by default used instead of directly calling pppd. Can be reverted back to directly using pppd by configuring.
- "rfcomm" if you intend using your bluetooth phone as modem.
File system modifications
Apart what files you may optionally create to hold PIN information, this script will create the following files on your file system, by itself:
- .3gnet inside calling user's home directory.
- Various files inside your /tmp directory, which are purged upon successful operation.
- /etc/ppp/peers/sakis3g while ppp negotiation is taking place.
Only $HOME/.3gnet and /tmp/sakis3g.3gnet should persist when this script is not running.
Known problems
Known problems should be fixed when I find time.
- If you use this script with 9menu interface for several connect/disconnect sessions without closing it, its memory footprint, process tree and CPU usage increase due to recursive shell calls. Upon connection, is safe to select "Close". Connection is not dropped.
- Unpredictable behaviour if /dev/tty* devices already exist from other devices attached, or from two modems connected at the same time, and they are both on the same USB bus, and HAL is not available. Issue "lsusb -t" to review what else devices exists on the same USB bus. You may try to connect your modem to another USB port to workaround this issue.
- Due to embedding a pre-compiled Usb_ModeSwitch binary for i386 architect, modems attached to architects other than i386/amd64 are not mode switched.
- If output method is xosd and font defined by XOSDFONT configuration variable does not exist, nothing appears on X screen, just an ABORT message on terminal. Use "xfontsel" to contruct a valid font string for your system.
Contributing
If you contribute in any way to this script, please, make sure you inform me whether you want your name and/or email, be written in next version or not. If you don't specify, I will include it by default.
I am interested for:
- Reports of success/failure on other distributions.
- More operators' information.
- More modems' information.
- Patches that should fix/accelerate functionality.
- More ideas. However, I cannot guarantee that I will be able to fulfil your expectations.
Latest release notes
Full Sakis3G change log is available here.
| 0.1.3g | 2010/02/24 |
| Upgraded to Usb-ModeSwitch device database that was released on 2010/02/21. | |
| 0.1.3f | 2010/02/14 |
| Added support for 85 networks across 25 counties. | |
| 0.1.3e | 2010/02/11 |
| Script now utilizes modems that while not advertising their GSM capabilities, they still provide their IMEI number (which indicates GSM functionality). | |
| 0.1.3d | 2010/02/10 |
|
|
| 0.1.3c | 2010/02/07 |
|
|
| 0.1.3b | 2010/02/05 |
|
|
| 0.1.3 | 2010/02/04 |
This version is an "emergency" release which fixes regression issues introduced by 0.1.2.
|
|
| 0.1.2 | 2010/02/01 |
|
|



2010-02-11
For whatever reason only half of the post has been displayed, could it be my browser or the site?
2010-02-11
I just checked with Firefox and Epiphany. Site renders properly. No server side error has been recorded for this page. I am sorry, I do not have an installation of your operating system to check if your browser works properly.
2010-03-21
Hello there!
Just wanted to ping back, your tool is awesome! I have an ZTE MF110, being recognized as ZTE MF 636,
but it’s working wonderfully. So kudos to you and thank your for this nice little piece of Open Source!
Regards
2010-03-22
Thank you very much for your feedback and your kind words. Names are actually determined by USB IDs. So either you see MF636, or someone with a MF636 will see MF110.
2010-04-09
Hi,
I use your script in French Guyana, and it works perfectly (i was desperate with network manager).
I have to add our local network (for French Guyana, Martinique and Guadeloupe) :
ISP_34001_name=”Orange Caraïbes”
ISP_34001_product=”Internet Everywhere 3G”
ISP_34001_apn=”orangeweb:Internet3G:orange:orange”
ISP_34001_phone=”*99#”
ISP_34001_menufgcolor=white
ISP_34001_menubgcolor=red
I don’t care about icon, but you may use an usual “orange” link.
Many, many, many thanks!
My config (AMD64, ubuntu 10.04, Alcatel Key One touch x200)
2010-04-10
Thank you very much for both your feedback and contribution. Orange settings you supplied will be introduced on the upcoming 0.2.0 version.
2010-04-10
Great job! Thank you very much. My ZTE MF100 (seen as MF636) works perfectly on Debian Lenny, now!
At first I tried the instruction on:
http://www.ubuntugeek.com/how-to-install-zte-mf626-hsdpa-modem-in-ubuntu-9-10-karmic.html
but couldn’t force Network Manager 0.7 to work. First steps of the instruction show how to set the modem via Windows hyperterminal before plugging it in Linux. I don’t know whether these steps were necessary or would your tool work anyway, but I mention it just in case.
Once again, thanks a lot!
2010-04-10
Thank you for your feedback.
Those steps were not necessary. However, now that you did those steps, your modem does not need to be switched any time it gets plugged, leading to less wait-time before connection is established.
2010-04-20
Thank you for this script. It worked form me with both a Huawei E220 and a ZTE MF636 (or 626) from T-Mobile in the UK.
The local UK info for T-Mobile was:-
ISP_23430_name=”T-Mobile UK”
ISP_23430_product=”T-Mobile mobile internet”
ISP_23430_apn=”internet::user:pass”
ISP_23430_phone=”*99#”
ISP_23430_menufgcolor=white
ISP_23430_menubgcolor=pink
ISP_23430_icon=”http://www.t-mobile.at/Tico.ico”
I’ve got an O2 stick somewhere. If I can get that working I’ll post the UK details for that too.
2010-04-20
Thank you both for your effort and information supplied.
Information you provided, will be available in the upcoming 0.2.0 version of script.
2010-04-23
Thanks!!
Acabo de instalar “sakis 3g” y me funciona muy bien con el modem zte mf626.
Gracias por tan valioso aporte…
saludos desde Guatemala.
2010-05-17
I just have to thank you. This is so great.
/From Sweden a thousand thank you´s
2010-06-12
I use a MicroTek Inc. ID 0e8d:0002 usb modem Airtel India, Kolkata, on a eeepc 701, ubuntu 10.04.
here is the modem though I don’t think this might help at all:
http://www.airtel.in/wps/wcm/connect/airtel.in/airtel.in/home/foryou/mobile/wireless+internet/
I guess bellow are the needed information to make it work:
[Dialer Defaults]
Init1 = AT+CGDCONT=1,”IP”,”airtelgprs.com”,”",0,0
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
stupid mode = 1
Modem Type = USB Modem
Baud = 460800
New PPPD = yes
Modem = /dev/ttyUSB1
ISDN = 0
Phone = *99#
Password =
Username =
there is no user or password needed when I plug it in Windows. But it needs to be connected.
I managed to see it listed when sakis3g window opens but when I click on connect nothing happens.
I also have to say that I know almost nothing about how to work on ununtu but I am trying to learn.
Thank you for putting up this site. Hope you could help as I got very tired on trying to fix it by myself.
2010-06-12
Related to my above info I found some more details here:
http://www.shantanubhadoria.com/techno-blab/configuring-micromax-mmx-300g-airtel-3g-data-card-in-ubuntu
thanks, hope you could help.