Generate QR Codes for WiFi networks

This was all in vogue a few years ago to allow people to quickly join your guest network, but there was precious little information on how it all worked. You were expected to just bang your SSID and Password into a site and get a pretty picture back. Yeah, right; that sounds like a clever thing to do.

No need for that, this is super-simple to do for yourself with a bit of knowledge. Which I will now lay upon thee, or whatever the cool kids say these days.

First up, you need a way to generate a QR code. I used qrencode for this.

sudo apt-get install qrencode

Next, you need to know what to encode. The format is pretty simple:

WIFI:S:my-ssid;T:[WEP|WPA|WPA2];P:my-password;;

I know the documentation doesn’t mention “WPA2”, but it does seem to work.

Now you create the QR code with a simple command:

qrencode -t SVG -o WiFi.svg "WIFI:S:my-ssid;T:WPA2;P:my-password;;"

Be careful about special characters (e.g. \) that are in your SSID or Password. These need to be escape as in the docs linked above. I chose “SVG” here as it means I can scale the image to any size I want.

What next? Create a poster or sticker and place it on or near your router. A bit like this example:

WiFi details encoded into a QR Code

WiFi details encoded into a QR Code

Now when you have visitors they can easily get on to your guest network by simply snapping the QR code. This only works on Android due the mighty Zebra Crossing, maybe the other platforms will join Android in the future.

Obviously, don’t do this for your secure corporate network!

Leave a Reply