How comes my modem gets switched when plugged during boot?
This post is inspired by a similar question made by a Linux user. Exact question answered by this post is:
When my USB modem is plugged during boot, it gets switched, although modem-modeswitch, Usb-ModeSwitch and Sakis3G are not installed on my system. How is that possible?
Some modems automatically switch mode (and, most of them, their product ID along the way), on their own (without the need for Usb-ModeSwitch), when they are simply "ejected". Reason we call it "eject" is that they indeed actually "fool" computer/operating system into presenting themselves as USB CD-ROMs (their commercial name now turns relative: "ZeroCD"). When those pseudo-CD-ROM devices receive the "eject-your-media" SCSI command, they instead switch mode, and become usable as modems.
Some others, switch mode (again, on their own), if being plugged on computer for some seconds (e.g. modem might switch on its own after 60 seconds of inactivity have expired). This one case is self-explained and we will not bother more on this post.
Sakis3G: 0.2.0 Unleashed
After a severe networking problem which resulted into:
- extended downtime during 2010-04-28 (problem persists, resulting in network being dropped for 1-2 minutes, be patient and try again), and
- three days of delay against scheduled release date:
I am finally proud to announce version 0.2.0 of Sakis3G All-in-one script!!! Sakis3G script now has:
- Its own mini-site: http://www.sakis3g.org/.
- And its own Wiki, to get documentation out of my blog: http://wiki.sakis3g.org/.
- And its own forum for supporting users: http://forum.sakis3g.org/.
- Sakis3G.org is also affected by fore mentioned network problem.
- If you provide links on your site, referring to Sakis3G script, please update your site so it now points to www.sakis3g.org.
I really hope that you enjoy new version (especially those disappointed by previous versions)!!!
- By the way, if you are one of those who prefer legacy version's interface, use "--legacy" command line switch.
Release notes:
Version 0.2.0 is written from scratch and is not derived from 0.1.3 (now called legacy) series.
- Examples, user guides, instructions and documentation for legacy version, are not applicable to 0.2.0 series.
- Modified functionality:
- Drastically improved workflow and device selection procedure, allowing even more USB modems to work with Sakis3G script.
- Permanently dropped dependency to sharutils/uudecode. Script now depends on bunzip2 and tar instead.
- 9menu binary is not anymore embedded in script, still can be used if "--9menu" or "--legacy" switches are specified.
- Menu, presented by user interface, now has more options.
- Removed "replacedefaultroute" from pppd arguments since several pppd versions do not recognize it. Script anyway fixes routing table, unless newly introduced "--nofix" switch is set.
- You no longer need to again provide connection details, when using "reconnect" argument, while already connected.
- Several command line arguments and variables are now obsolete or replaced. Consult documentation for more details.
- Setting environment variables, before invoking script, is not anymore encouraged. Instead, they can now be supplied as arguments or within configuration files. Consult documentation for more details.
- Employed a workaround for "gksu" versions which do not respect arguments containing whitespace characters.
- Employed a workaround for modems not properly displaying operator's name. Name is read from operator's database, if an entry exists.
- Improved method of acquiring access to a running X session, when invoked with root privileges.
- Kernel module loading/unloading is now safer and cleaner. Script now attempts to unload module only when it refuses to unbind from device.
- Script should now be able to utilize even more USB modems (and not just option.ko handled ones).
- Modems can now be recognized and setup according to the model name they report, and not by their USB IDs.
- Script can now understand whether pppd or wvdial succeeded, or failed, into getting connected, and success is not determined upon timeouts.
- Improved desktop shortcut creation method.
- Several, less important, modifications.
- New functionality:
- A more sophisticated concept for command line arguments has been introduced for those wishing to max out possibilities.
- Command line arguments, environment variables and user input are now sanitized before being used. This should reduce risk of a malicious user passing specially crafted values.
- Several new configuration variables are now introduced, allowing better overall control over performed actions.
- Connection information is now available, while connection is still running.
- Configurations file(s) are now possible. Consult documentation for more information.
- Script can now discover available/best fitted kernel module(s) for a USB modem.
- Script can now create character device nodes, within /dev directory, when system did not already.
- Script now takes care of not becoming "stalled" when a broken USB device blocks access to USB bus.
- Script now exclusively locks "org.freedesktop.Hal.Device.Storage" before switching a device, unless "--nohal" switch is set. This improves stability by reducing simultaneous operations to storage and modem interfaces of a USB device.
- Script now utilizes "avoid_reset_quirk" available in recent kernels.
- Script now checks for mandatory dependencies being present in PATH, before proceeding with execution.
- Script now instructs pppd to use file /etc/ppp/peers/sakis3g, if file exists and pppd is used for connection.
- Script now offers a UI for selecting and setting up nearby Bluetooth devices, to be used as modems.
- When operator is not found within embedded operators' database, script attempts to fetch last APN, modem was used with, by querying modem.
- Subscribers to virtual operators are now presented their operator's name instead of network's name. This is possible by reading service provider's name from SIM card, if modem permits it.
- Script can now use "zenity", for becoming a "background process" reachable through an icon in notification area, when "helper" command line argument is used.
- It is now possible to keep "secret" a modem from HAL by using "--nohalinform" switch.
- It is now possible to request for storage part of a USB device being "eliminated", using "--nostorage" switch, which might improve stability on some devices.
- It is now possible to construct a binary free version of script, suitable for all architects. However, binary free version depends on a working Usb-ModeSwitch installation, for setting up switchable USB devices.
- It is now possible to disassemble script, back to its ingredients, by using "disassemble" command line argument.
- Script can now switch devices, not found within embedded Usb-ModeSwitch device database, if appropriate file is found within /etc/usb_modeswitch.d directory.
- Script now embeds man pages, accessible using "man" command line argument.
- Script now allows UTF-8 translations, so that localized versions appear in the future. A translation is currently available only for Greek language.
- Several, less important, newly introduced functionality.
- User interface:
- Sakis3G now has its own Tux icon. Icon is used when creating desktop shortcut, unless an operator logo is available and user selects that one instead.
- Script can now use anyone of "kdialog", "zenity", "Xdialog", "9menu", "whiptail" and "dialog" for displaying user interface.
- If none of them is available, script can resemble an elementary text-mode user interface through shell builtin functions, if "--interactive" switch is set.
- Balloon notifications can now appear, when "--balloons" switch is set, using libnotify.
- All options available through user interface, are available as command line arguments as well. The opposite statement is not true.
- Translations are not used when:
- using "Xdialog" or "9menu" as user interface.
- displaying OSD messages.
- Switch "--notranslate" is set.
- Embedded Usb-ModeSwitch:
- Upgraded to version 1.1.2alpha.
- Device database upgraded to 2010-04-18 version.
- It is now possible to compile it for your platform, by using "recompile" command line argument, or by selecting equivalent UI option.
- It is now possible to directly reach embedded Usb-ModeSwitch binary, by using "usb_modeswitch" command line argument.
- Operators' database:
- Entries available in legacy version were migrated to 0.2.0 version.
- You can now connect to any operator, even if not found within operators' database. You just need to know APN details.
- It is not anymore possible/required to add operators by modifying script.
- Modified following networks:
- 20201: Cosmote (Greece): Included an extra APN.
- 20209: Wind (Greece): Added "Q" APN.
- 20210: Wind (Greece): Added "Q" APN.
- 26202: Vodafone (Germany): Added "1und1" APN.
- 26204: Vodafone (Germany): Added "1und1" APN.
- 26209: Vodafone (Germany): Added "1und1" APN.
- 26801: Vodafone (Portugal): Added "ZON" APN.
- Added the following operators:
- 23430: T-Mobile (United Kingdom)
- 23802: Telenor (Denmark)
- 34001: Orange (French Caraibes)
Sakis3G as a udev rule
| Notice: This post 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. |
Question: What is the fastest way to get connected with your 3G network?
Answer: Have Sakis3G script setup as a udev rule! This way Sakis3G script will be executed immediately upon physical connection.
If managed to trigger your interest, check teaser videos below (external link) to further motivate yourself and proceed with this guide:
Sakis3G: 0.1.2 Released
Version 0.1.2 of Sakis3G script is now released, being larger scale update so far.
At a glance, more important changes are:
- Drastically improved workflow: Overall operation is now faster.
- Several changes so that even more unsupported USB modems work out-of-box.
Sakis3G: 0.1.1 Released
Version 0.1.1 of Sakis3G script is released, in accordance with 1.1.0 update of Usb-ModeSwitch. Script now waits for network logon even when SIM card does not require PIN number. Progress bar indication, if xosd (osd_cat) is installed, is now turned off by default. Added support for Italian, Portugish, Hondurian and more German operators.
Read change log.
Sakis3G: 0.1.0 Released
Version 0.1.0 of Sakis3G script is out. Script now waits for network logon after supplying PIN number, before is proceeds with internet connection. This should eliminate problems with modems that need more time. Adds progress indication if xosd (osd_cat) is installed and support for several German and Austrian operators. Fixes KDE integration issues and a driver reload problem.
Read change log.
Sakis3G: 0.0.9 Released
Version 0.0.9 is now released fixing bugs, issues with non-Debian distributions and introducing experimental support for Huawei E220 family of USB modems. Establish a 3G/GSM connection with your operator within 20 seconds, no installation/compilation required, just download and execute.
- Download
- Supported architects: i386, amd64
- Supported modems
- Supported operators
- Confirmed distributions: Debian GNU/Linux, Ubuntu, openSUSE
- Official page
Sakis3G: All-in-one script
My 1st trick to share with readers: Sakis3G. A shell script that can make your 3G connection work without setting up anything. It touches nothing on your system, while giving you a fully functional connection. It even handles PIN unlocking your SIM if required. Forget setting up wvdial, pppd, udev, hal, usb_modeswitch. No installation required. Although being a shell script, it also provides graphical interface for connecting. Download and execute.
Official page of script is here.
Official page of script is now on www.sakis3g.org.
- 9menu interface while connected to Cosmote
- 9menu interface with Vodafone Live!
- 9menu interface while connected to Wind


