WISPr Wireless ISP Autologin

Automated hotspot login
WISPr is a protocol used for automated login to WiFi hotspots operated by FON, BTWiFi, SFR, Netia and others. A "smart client" (such as the WiFi apps produced by the hotspot operators) interrogates the captive portal, receives from it the portal's login URL and supplies the user's (stored) login credentials for authentication.

As of 2013, BtWiFi hotspots are everywhere, my FON login credentials are valid, and auto-login with WISPr (subject to having the right client) just works. Symbian, iOS, Android have been doing this for years and I'm really surprised to find no standard implementation for Linux, much less for the N900. But, there's a way to hack it together.

You will need:


 * 1) Perl WISPr code from https://raw.github.com/matsuu/auwifispotclient/master/wispr_login.pl
 * 2) libssl-dev installed
 * 3) via CPAN (which may need to be fixed to work with busybox gzip) you'll want Crypt::SSLeay, LWP::UserAgent and XML::Simple.

When that's all installed correctly, you should be able to connect to a WISPr-enabled SSID and run "wispr_login.pl -u user@domain.tld -p password". You may need to specify your user as BTFON/user@domain.tld, if you're a FON customer accessing a BTWiFi hotspot. Make sure that this works manually, I suggest, before you go any further, then copy it to /usr/local/bin/wispr_login.

Once you achieve a successful login to a WISPr-enabled hotspot, all you need is a way to automate the WISPr login script on connecting to a suitable SSID. I have favoured doing this in bash script for extensibility; I want to be able to support using two or three different sets of login credentials across various different hotspot networks.

Let's throw together a bash wrapper, to be run from dbus-scripts on connection to a WiFi network. This will check the SSID against a list of known SSIDs for which we have login credentials, fetch the credentials for the current SSID, and launch an invocation of the wispr_login client if it finds them. Obviously, this can and should be extended to support as many hotspot networks as you like.

SSID=`iwgetid|cut -d \" -f 2`; case "$SSID" in    "BTWiFi") CREDENTIALS=`cat /root/.wispr/credentials/btwifi` ;;      *"BTOpenzone"* ) CREDENTIALS=`cat /root/.wispr/credentials/vodafone`;;    *"_The Cloud"* ) CREDENTIALS=`cat /root/.wispr/credentials/thecloud`;;    *"FON_"* ) CREDENTIALS=`cat /root/.wispr/credentials/fon`;; esac [ -z "$CREDENTIALS" ] && echo "No credentials for SSID: $SSID" && exit; # OK, we're still here echo "Matched SSID: $SSID" echo "Trying WISPr login" /usr/local/bin/wispr_login $CREDENTIALS
 * 1) !/bin/bash
 * 1) Designed to be run from dbus-scripts on connect to WLAN
 * 2) Requires wireless-tools to check the SSID
 * 3) Requires Matsuu Takuto's wispr_login.pl, https://github.com/matsuu/auwifispot-client/blob/master/wispr_login.pl
 * 4) Requires XML::Simple, LWP::UserAgent, Crypt::SSLeay
 * 1) Fetch the current SSID
 * 1) Determine if we have login credentials for the current SSID
 * 2) The credentials files are simple text files containing the arguments to wispr_login.pl, -u -p
 * 1) If we didn't match the SSID and find some credentials, abort

Save it as /usr/local/bin/wispr, and test it by logging onto an appropriate SSID and running it manually. Create your credentials file(s) first, containing just the arguments to wispr_login. All being well, it will identify the SSID and run wispr_login with the desired login credentials. Again, make sure that this works manually before you automate it.

When it does, add it to dbus-scripts:

/usr/local/bin/wispr * * com.nokia.icd status_changed * WLAN_INFRA CONNECTED

and try connecting to a supported network. Dbus-scripts will run your bash wrapper, which, if it matches the SSID, will launch the wispr_login. So far this is tested on a single network, and there's still room to figure out how to use it across Europe.

Networks tested
Please add to this section as appropriate.

FON
FON hotspots in the United Kingdom are a moveable feast; some are too old to support WISPr, some use proprietary software, but it is my understanding that some newer ones do. However, the vast majority of UK FON hotspots are provided through their tie-up with BT, and Foneros are able to use their Fon logins via WISPR at BTWiFi hotspots, just prefix your username with "BTFON/". So, WISPr does work for FON users in the UK, just not automatically at FON_FREE_INTERNET hotspots on older Foneras.

BTWiFi
BTWiFi hotspots are hosted (in the main) by newer BT Home Hubs, and are now plentiful in populated areas. These do support WISPr, although I have only tested it with BTFON credentials.