A Wi-Fi QR code is a short line of text in a fixed format. A phone that scans it offers to join the network, so your guests never have to type the password.
What the code holds
WIFI:T:WPA;S:Home;P:correct horse;;
| Part | Meaning |
|---|---|
T: |
Security: WPA, WEP or nopass for an open network |
S: |
The network name (SSID) |
P: |
The password; left out for an open network |
H:true |
Only for a hidden network |
;; |
The end |
The characters \ ; , : " have a meaning in this format, so in a name or a
password each one gets a backslash in front. A network called Cafe;Bar with the
password p:ss becomes:
WIFI:T:WPA;S:Cafe\;Bar;P:p\:ss;;
Forget an escape and the phone reads a different password, which is the most common reason a Wi-Fi code "does not work".
On the command line
Put the whole line in single quotes, so the shell leaves the semicolons and backslashes alone:
qrencode -o wifi.png -s 10 'WIFI:T:WPA;S:Cafe\;Bar;P:p\:ss;;'
zbarimg --raw wifi.png
zbarimg prints the line back exactly, escapes included.
- Make the code with the exact name and password, upper and lower case included.
- Scan it with your own phone first, with Wi-Fi off, and check it joins.
- Print it with a short label, such as "Wi-Fi", so people know to scan it.
- When you change the password, make a new code.