Generate QR code to access the Wi-Fi network.
Introduction
At first read about Wi-Fi Network config (Android, iOS 11+) format.
The format is pretty simple, the connection string for HomeNetwork
with HomePassword
password will look like this.
WIFI:T:WPA;S:HomeNetwork;P:HomePassword;;"
Remember to use backslash () to escape special characters like \
, ;
, ,
, "
and :
.
Generate QR Code
You will need Qrencode utility to create QR Code.
$ sudo apt install qrencode
Encode Wi-Fi connection string into a QR Code.
$ qrencode --output QRCode-wifi-HomeNetwork.png \ --type PNG \ --size 10 \ --level L \ "WIFI:T:WPA;S:HomeNetwork;P:HomePassword;;"

Encode Wi-Fi connection string into a QR Code using reversed colors and increased correction level.
$ qrencode --output QRCode-wifi-HomeNetwork-dark.png \ --type PNG \ --size 10 \ --level Q \ --foreground=ffffff \ --background=000000 \ "WIFI:T:WPA;S:HomeNetwork;P:HomePassword;;"

Adjust the parameters to your liking.