24 April 2021
QR code is a matrix barcode based that contains some information and could be used also to setup your smartphone wifi.
This functionality is very handy if you have a public wifi, you have several devices to setup or if you sometimes lost your settings.
In order to setup a qrcode for your wifi, following these steps:
1. Create QR-code as described in containerized environment
2. Print on a paper the output image
3. Add Wi-Fi to your smartphone scanning the qr-code image
$ mkdir /tmp/wifi-qrcode && docker run -it -v /tmp/wifi-qrcode:/tmp -w /tmp python:3.9.4-alpine3.13 sh
# apk add build-base jpeg-dev zlib-dev
# pip install wifi-qrcode-generator==0.1
# python
>>> import wifi_qrcode_generator
>>> wifi_qrcode_generator.wifi_qrcode(ssid='Home wifi', hidden=False, authentication_type='WPA', password='very complicated password').save('output.png')
You will find qrcode generated in /tmp/wifi-qrcode/output.png