related articles:
https://www.sohu.com/a/219944402_100048759
https://github.com/zxing/zxing/wiki/Barcode-Contents#wi-fi-network-config-android-ios-11
Web pages used:
http://www.zxing.appspot.com/generator
Description:
- On the iPhone, users only need to open the camera application and point it at the QR code. A "Wi-Fi QR code" notification will appear. If the user clicks on it, they can choose to join the WiFi network. All they have to do is click to join or connect .
- Some Android phones can also use the "Camera" application to scan the QR code. However, some Android users need to download the QR code scanning application to scan the QR code. These applications can be obtained from the Google Play Store.
Wi-Fi Network config (Android, iOS 11+)
Use a syntax similar to "MECARD" to specify the Wi-Fi configuration. After prompting the user, scanning such codes will configure the device's Wi-Fi accordingly. example:
WIFI:T:WPA;S:mynetwork;P:mypass;;
Parameter | Example | Description |
---|---|---|
T | WPA |
Authentication type; can be WEP or WPA or WPA2-EAP , or nopass for no password. Or, omit for no password. |
S | mynetwork |
Network SSID. Required. Enclose in double quotes if it is an ASCII name, but could be interpreted as hex (i.e. "ABCD" ) |
P | mypass |
Password, ignored if T is nopass (in which case it may be omitted). Enclose in double quotes if it is an ASCII name, but could be interpreted as hex (i.e. "ABCD" ) |
H | true |
Optional. True if the network SSID is hidden. Note this was mistakenly also used to specify phase 2 method in releases up to 4.7.8 / Barcode Scanner 3.4.0. If not a boolean, it will be interpreted as phase 2 method (see below) for backwards-compatibility |
E | TTLS |
(WPA2-EAP only) EAP method, like TTLS or PWD |
A | anon |
(WPA2-EAP only) Anonymous identity |
I | myidentity |
(WPA2-EAP only) Identity |
PH2 | MSCHAPV2 |
(WPA2-EAP only) Phase 2 method, like MSCHAPV2 |
Order of fields does not matter. Special characters \
, ;
, ,
, "
and :
should be escaped with a backslash (\
) as in MECARD encoding. For example, if an SSID was literally "foo;bar\baz"
(with double quotes part of the SSID name itself) then it would be encoded like: WIFI:S:\"foo\;bar\\baz\";;
格式:WIFI:S:<SSID>;T:<WPA|WEP|>;P:<password>;;
E.g:
WiFi signal SSID: AAA,
Encryption method: WPA/WPA2
Password: 12345678
Result: WIFI: S: AAA; T: WPA; P: 12345678;;