autowifi
Home Home Contact us Contact
home News Projects Tests Files Follow manatlan on Twitter Sign in
Last edition : 2010/11/30 20:42

AutoWifi is an application which try to login automatically on wifi hotspots with web-based authentification. This app stay in systray, and process secure login when a SSID is matched by AutoWifi. The goal is to remove the hassle of doing web-based authent for theses kinds of free hotspots, letting you surf as if you were on your lan. AutoWifi is a linux app, and it will never be released for others platforms. It's a pygtk application, and it's released under the GPL2 terms.

Supports for free hotspots (thru SSL, and server certificats validation):

It's an alpha release, but it works for me (for freewifi, neuf, and fon spots).

AutoWifi doesn't provide accounts for these free hotspots ;-). The first time you meet a SSID known by AutoWifi, it will prompt you to enter your account, if needed, thru a GUI. Accounts informations are saved according the XDG freedesktop specs. (in file ~/.config/autowifi/autowifi.conf). To modify your account, just edit this file.

States :

The AutoWifi Icon in your systray can take 3 forms :

  • : AutoWifi is running, but no known Wifi/SSID are matched.
  • : A matched SSID is well authentified. AutoWifi will try to keep the connection on, by fetching it each 60 seconds.
  • : A matched SSID is not well authentified. Put your mouse on the icon, to show the tooltip, to get more infos about the trouble. In this state, AutoWifi will try each 5 seconds to re-authent.

Todo

How it's working (for developpers)

Autowifi use the dbus of networkmanager to be aware about ssid changes. When a new ssid is set, Autowifi will match the newly ssid with its list of known plugins (thru a regex on ssid). If it founds one, it will run it, to process form authent with python-twill

Autowifi use a home made plugin system. Plugins are easy to implement (see the _virgin.py one).

Plugins are located in /usr/share/autowifi/plugins (for the main plugins) or in your home directory (in ~/.config/autowifi/plugins), for your local plugins.

A plugin is a python file (which doesn't start with an underscore), which should contain a Wifi class.

Here is a real example :

from twill.commands import *

class Wifi(object):

    match = "freewifi"  # regex re.I !

    def __init__(self):
        pass

    def connectWithAuthent(self,login,passwd):
        go("http://test-debit.free.fr/")

        if "Pour vous connecter au service FreeWiFi" in show():
            formclear("1")
            fv("1", "login", login)
            fv("1", "password", passwd)
            submit()

            if "CONNEXION AU SERVICE REUSSIE" in show():
                return True     # authent reached
            else:
                return False    # authent failed
        else:
            return True         # already authentified !

Notes :

  • match's attribut define the regular expression, to match the current SSID. It's case insensitive, and really needed ;-)
  • a plugin should have a connect() or a connectWithAuthent() method, but not both ! These methods should return a boolean (True=authent granted / false=authent failed), or an error string (for other reasons).
  • a plugin can use the python twill commands to mechanize http process.

The easiest way to start hacking, is to duplicate the _virgin.py template (in ~/.config/autowifi/plugins).

If you developp a plugin which could be interesting for the community. Feel free to send it to me, and I will package it in a future release.

Installation

IMPORTANT : my PPA is not up-to-date (due to quickly/launchpad trouble) you will find latest releases here

AutoWifi is available in manatlan's ppa

sudo add-apt-repository ppa:manatlan/ppa
sudo apt-get update
sudo apt-get install autowifi

The repository is here :

deb http://ppa.launchpad.net/manatlan/ppa/ubuntu lucid main 
deb-src http://ppa.launchpad.net/manatlan/ppa/ubuntu lucid main

Source Repository

Available on launchpad

RSS Python Powered Get Ubuntu
©opyleft 2008-2019 - manatlan