luci icon indicating copy to clipboard operation
luci copied to clipboard

luci-mod-network: Share WiFi access credential with QRcode

Open pgaufillet opened this issue 5 years ago • 8 comments

Hi LuCI team!

It would be great if the Wifi module of LuCI could display a QRcode for sharing Wifi credentials. See Qifi for example.

Thanks for your great job!

pgaufillet avatar Jan 06 '19 10:01 pgaufillet

Interesting suggestion. Instead of Javascript, qrencode is currently used by 3 LuCI packages to generate QR codes:

  • luci-app-wireguard
  • luci-app-fwknopd
  • luci-app-travelmate

leonghui avatar Jan 15 '19 04:01 leonghui

This would be great. Android Q and above has joining wifi via qr code baked into the os in a prominent way.

greyltc avatar Mar 17 '19 17:03 greyltc

What format/config file should the QR-Code have?

WIFI:S:<ssid>;T:<encryption>;P:<password>;H:<hide>

feckert avatar Apr 23 '19 20:04 feckert

Travelmate has an example of the qrencode arguments required to generate a QR code for the Wifi credentials.

plm avatar Dec 31 '19 17:12 plm

This would be great. Android Q and above has joining wifi via qr code baked into the os in a prominent way.

Also iOS 11+, in the built-in camera application.

hmh avatar Mar 02 '21 19:03 hmh

I would also like to see this feature for the Wifi networks.

If we could add a QR Code on the line for every wifi like this and it pop when we click on it : image

@feckert : Are you working on this feature ? Thank you.

OW87 avatar Feb 13 '22 16:02 OW87

If it helps the luci developers, here is a simple page i wrote for creating QR codes (it uses a few libs - it's pure javascript, happens client side in browser )

you might need to host these on the router so i'm not sure if size constraints prevent using this approach.

I don't suggest you use it like this for security reasons but a working sample QR can be generated by appending a string to the url https://qr.1mb.site/?code= : sample link

To implement it in the luci ui, have a look at this source https://qr.1mb.site/index.js (it parses the passed in url as a string and displays it verbatim. wifi QR codes have a specific syntax, which you can see after "code=" in the url - which for simplity in this demo isn't urlencoded. as you'll be generating it locally in the browser url encoding is irrelevant, i mention it here as obviously complex passwords can't be demoed via this generic site without url ecoding)

the specific syntax for the qr to pass into the library function is documented here however for a wpa2 protected ssid it is basically WIFI:S:ssid;T:WPA;P:password;;

in a nutshell, i'm pulling in a few files via a cdn:

https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js - link - info - github

https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js - link - library used by qrcode - info

and calling them from index.js

jonathan-annett avatar Mar 19 '22 00:03 jonathan-annett

fwknock support already generates QRcodes from within Luci, whatever is done should be shared between the two packages for space savings.

hmh avatar Mar 21 '22 17:03 hmh