Skip to content

Draft: wifi: Add QR code scanning

It is common practice to share access to WiFi networks using QR codes and the option to display a QR code for a known WiFi connection is already present. The next step is to allow the user to scan QR codes to connect to WiFi networks using the camera of their PC or laptop.

To allow scanning of QR codes, a new dialog will be added by this commit. This dialog shows the video feed of the camera and will try to detect a QR code in each frame of the video feed. If a QR code is detected, it is parsed for the relevant connection information. The user can then connect to the WiFi network by clicking on the "Connect" button.

This MR is meant as a first draft on how something like this might look like. There are still quite a few open questions that need to be answered, before this can be merged.

Open Questions:

  • Detect invalid configurations
    • invalid characters present
    • missing password for WEP or WPA security
    • password present for network without security
  • What should happen if QR-Code is not a valid Wifi QR-Code?
  • Implement WEP connection as well
  • Should this be integrated into snapshot as well? (connect to wifi network button, if wifi QR-Code is detected) -> no, having it in Settings and maybe in the shells Quicksettings is enough
  • Camera handling
    • no camera -> maybe hide the button to open this dialog completely? -> current implementation hides the "Scan QR-Code" button from the wifi menu
    • multiple cameras -> use GstDeviceMonitor to handle camera device changes
  • Should it be possible to just add the wifi network without connecting to it right away? (current behavior is to add and connect right away, connection might fail, but the new network is still added)
  • Where should the button for opening the dialog be placed? (Currently it's next to the "Saved Networks" and "Connect to Hidden Network" buttons)

The wifi panel with the added "Scan QR-Code" button: image

The dialog with the camera feed: image

After scanning a QR-Code: image

Closes #1537

Edited by Hendrik Müller

Merge request reports