Configure Wlan with a QR code

The other day I mentioned in a chatroom that my phone had lost its Wifi settings due to an upgrade, and how stupid it was that I had generated a difficult max-length passphrase. I was immediately informed that there is a qr code specification for wireless config. Interesting. A quick google later I had it. You just need to encode the string of the format:

WIFI:S:<essid>;T:<WEP/WPA>;P:<passphrase>;H:<true/false>

S is obviously the essid, T is the encryption type, P the passphrase and H is used to indicate whether the essid is hidden or not. Now we just need to encode it. The quickest way is to install qrencode and ImageMagick (most distros have these as packages as far as I know), and use the one-liner:

qrencode "WIFI:S:myessid;T:WPA;P:mypass;H:true;" -o - | display -

…which displays this:

qrexample

Then you can just scan it off the screen (of course after generating one with your proper data instead of an example), or you could set the parametre to -o to a filename and save it as an image, or print it out and stick it somewhere for the benefit of your visitors – in case they are using Android, this apparently does not work on iPhones.

Of course you will also need a barcode scanning app. I tested this with the aptly named “Barcode Scanner” from ZXing Team, which recognises the type and offers you an option to automatically configure your wireless. Probably other scanners offer a similar functionality.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: