TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Print a WiFi Login Card

305 点作者 bndw将近 5 年前

22 条评论

graton将近 5 年前
I just did this the other day using the newest version (6.4.4) of LibreOffice Writer. It has a QR Code generator built in.<p>As mentioned by someone else it uses the form of:<p><pre><code> WIFI:T:WPA;S:{ssid};P:{password};; </code></pre> Wikipedia has information on this <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;QR_code#Joining_a_Wi%E2%80%91Fi_network" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;QR_code#Joining_a_Wi%E2%80%91F...</a><p>Section of the Wikipedia article:<p><i>Joining a Wi‑Fi network</i><p>By specifying the SSID, encryption type, password&#x2F;passphrase, and if the SSID is hidden or not, mobile device users can quickly scan and join networks without having to manually enter the data. Note that this technique is valid for specifying only static SSID passwords (i.e. PSK); dynamic user credentials (i.e. Enterprise&#x2F;802.1x) cannot be encoded in this manner.<p>The format of the encoded string is:<p><pre><code> WIFI:S:&lt;SSID&gt;;T:&lt;WPA|WEP|&gt;;P:&lt;password&gt;;H:&lt;true|false|&gt;; </code></pre> Order of fields does not matter. Special characters &quot;&quot;&quot; (quotation mark), &quot;;&quot; (semicolon), &quot;,&quot; (comma), &quot;:&quot; (colon) and &quot;\&quot; (backslash) should be escaped with a backslash (&quot;\&quot;) as in MECARD encoding. For example, if an SSID were &quot;foo;bar\baz&quot;, with quotation marks part of the literal SSID name itself, this would be encoded as: WIFI:S:\&quot;foo\;bar\\baz\&quot;;;<p>As of January 2018, iPhones have this feature built into the camera app under iOS 11.x. Android users may have the feature built into one of the device&#x27;s stock apps (e.g. Samsung Galaxy S8&#x2F;S8+&#x2F;Note8 users can launch the stock browser, tap the browser&#x27;s 3-dot menu, then choose &quot;Scan QR code&quot;) or can install one of several available free apps such as &quot;Barcode Scanner&quot; or &quot;QR Droid&quot; to perform the QR Wi-Fi join.
评论 #23372338 未加载
评论 #23372369 未加载
chrismorgan将近 5 年前
Per <a href="https:&#x2F;&#x2F;github.com&#x2F;bndw&#x2F;wifi-card&#x2F;blob&#x2F;5d7fbbda1e8eac5802c8d7b4a9644e8f37a4e041&#x2F;src&#x2F;components&#x2F;Card.js#L22" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;bndw&#x2F;wifi-card&#x2F;blob&#x2F;5d7fbbda1e8eac5802c8d...</a>, the QR code text is of this form:<p><pre><code> WIFI:T:WPA;S:{ssid};P:{password};; </code></pre> <a href="https:&#x2F;&#x2F;github.com&#x2F;zxing&#x2F;zxing&#x2F;wiki&#x2F;Barcode-Contents#wi-fi-network-config-android-ios-11" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;zxing&#x2F;zxing&#x2F;wiki&#x2F;Barcode-Contents#wi-fi-n...</a> seems to be where this format came from. (That page describes various other forms of QR codes too.)<p>bndw: looks like some characters need escaping: backslash, semicolon, comma and colon. Maybe more too, given the treatment of double quotes in that last link (I’ve filed <a href="https:&#x2F;&#x2F;github.com&#x2F;zxing&#x2F;zxing&#x2F;issues&#x2F;1292" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;zxing&#x2F;zxing&#x2F;issues&#x2F;1292</a> about that inconsistency).
评论 #23376075 未加载
chrismorgan将近 5 年前
Another fun bug report: I entered <i>lots</i> of input, and the page suddenly went blank. In the console:<p><pre><code> Error: code length overflow. (28252&gt;23648) </code></pre> So yeah, seems like all you have to do is paste 24KB of data in and it blows up. :)<p>I see this failure mode in React apps a <i>lot</i>, where a bug causes an exception to be thrown, and the page just vanishes in a puff of smoke, as though it never was.<p>Half the time I’ve seen this failure mode it’s also been combined with <i>persisting the bad value</i>, so that the site is permanently broken until you can unpersist the value (e.g. clear localStorage or IndexedDB or cookie; but if the bad value is stored on a server you’re truly stuck).<p>The impression I’ve taken away is that it’s entirely unacceptable for a React component to throw an exception, because it will immediately destroy <i>everything</i>. Wonder how common such failures actually are, and whether there’s anything React itself could do about it (my guess is not).
评论 #23371475 未加载
评论 #23372277 未加载
CapriciousCptl将近 5 年前
Neat. You can find more supported QR codes for iOS here-- <a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;videos&#x2F;play&#x2F;tech-talks&#x2F;206&#x2F;" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;videos&#x2F;play&#x2F;tech-talks&#x2F;206&#x2F;</a> (I couldn&#x27;t find docs but you can skip around the video, starts at 1:11).
评论 #23371406 未加载
pathseeker将近 5 年前
Woah, do not get into the habit of putting your wifi network password into a website if you care about security. This particular site might or might not collect it now but it&#x27;s a terrible habit to put your sensitive data into another site.<p>Imagine if this was a web-based password strength meter.
评论 #23372884 未加载
评论 #23377518 未加载
评论 #23372497 未加载
评论 #23375687 未加载
wiml将近 5 年前
An idea that&#x27;s been kicking around in my head is a widget with an e-ink display for hackerspaces, cafés, and other multi-user spaces that displays the a password-of-the-day along with a qrcode for easy login. Heck, include an NFC chip that hands out application&#x2F;vnd.wfa.wsc objects as well.<p>I&#x27;m not sure how useful it would be beyond the cool factor, of course … the cafés in my area don&#x27;t seem to change their wifi passwords often at all, so I assume they&#x27;re not very concerned about leeching. The typical practice of printing it on a receipt or writing it on the board next to the soup-of-the-day is probably hard to beat.
评论 #23372226 未加载
seesawtron将近 5 年前
Can someone give a short explaination as to how it works in the backend? The QR code contains username and password. But how does my phone&#x27;s QR scanner know that its an SSID&#x2F;pw and eventually connects to the network?
评论 #23371889 未加载
lucb1e将近 5 年前
I like the interface and that it doesn&#x27;t need a server to generate the QR image, but it doesn&#x27;t work for my network ¯\_(ツ)_&#x2F;¯<p>Edit: perhaps I should clarify that that&#x27;s my network&#x27;s name. In the qr code reader it shows up as ¯_(ツ)_&#x2F;¯ and it&#x27;s stored in wpa_supplicant.conf as c2af5f28e38384295f2fc2af (indeed missing the backslash).
评论 #23371321 未加载
toomuchtodo将近 5 年前
Lovely! Is it possible to inject SSID and passphrase parameters as env vars into the Docker container and have a png or pdf render without the web interface?<p>Edit: Thank you to those who replied!
评论 #23371653 未加载
评论 #23371576 未加载
canada_dry将近 5 年前
Combine this with a small&#x2F;cheap e-paper display and dd-wrt on your wifi router and you have the tools for auto generating and displaying a new daily guest password.<p>Be a decent solution for a business that wants to offer guest wifi with a little less risk of abuse.
评论 #23375217 未加载
jedberg将近 5 年前
I made one of these before a party and put it up by the door for the guest wifi. It was great because I didn&#x27;t have to tell anyone the wifi password during the party!
tzs将近 5 年前
This should be a feature of password managers, or at least password managers that have a separate item type for wireless networks.<p>Someone suggested it on the 1Password forums [1] and one of their employees said it it was a great idea and would pass it to the development team, but that was in September, 2017, so apparently it didn&#x27;t go anywhere.<p>About 18 months ago, someone suggested it on &#x2F;r&#x2F;1password [2], and again someone from 1Password liked it and said they would pass it on to the devs.<p>[1] <a href="https:&#x2F;&#x2F;discussions.agilebits.com&#x2F;discussion&#x2F;82070&#x2F;feature-request-wifi-qr-code-display" rel="nofollow">https:&#x2F;&#x2F;discussions.agilebits.com&#x2F;discussion&#x2F;82070&#x2F;feature-r...</a><p>[2] <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;1Password&#x2F;comments&#x2F;a1udg2&#x2F;feature_request_wifi_qr_codes&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;1Password&#x2F;comments&#x2F;a1udg2&#x2F;feature_r...</a>
评论 #23379063 未加载
encom将近 5 年前
I&#x27;ve tried to use these before, but since my SSID is [the poop emoji] (which i&#x27;ve just learned is verboten on HN) and the password is 64 characters of hex, I&#x27;ve never gotten it to work, and have exposed bugs in lots of shitty wifi hardware and software. 64 char hex is what a regular 8-63 char password is hashed to for encryption. Specifying it directly as 64 char hex is in spec, and should be supported in software or hardware that&#x27;s made properly.<p>Emoji SSID just kind of works in most cases, because an encoding was never specified for that string, afaik.<p>TL;DR: I shoot myself in the foot for entertainment.
评论 #23375105 未加载
srhngpr将近 5 年前
Recently came across a QR Coder [1] that can generate for a variety of different purposes, including Wifi (e.g., Bookmarks, Email, Contact, GeoLocation, SMS, URL link, etc.) - the same website also has a encoder&#x2F;decoder and an API [2], but I&#x27;ve not tried those features.<p>[1] <a href="http:&#x2F;&#x2F;niftypdf.com&#x2F;Barcoder&#x2F;QRCoder" rel="nofollow">http:&#x2F;&#x2F;niftypdf.com&#x2F;Barcoder&#x2F;QRCoder</a> [2] <a href="http:&#x2F;&#x2F;niftypdf.com&#x2F;Barcoder&#x2F;API" rel="nofollow">http:&#x2F;&#x2F;niftypdf.com&#x2F;Barcoder&#x2F;API</a>
groundpepper将近 5 年前
This is incredibly useful, I didn&#x27;t know our phones had this feature.
dheera将近 5 年前
Might be a dumb question but how do you scan a QR code like this on Android without a 3rd party app? The only way I&#x27;ve ever known to scan QR codes is by scanning from within WeChat.
评论 #23374217 未加载
评论 #23373710 未加载
评论 #23374910 未加载
thephyber将近 5 年前
Neat. I investigated doing something like this a few weeks ago, but it turned out there&#x27;s a site that has a variety of QR code tools:<p><a href="https:&#x2F;&#x2F;www.qr-code-generator.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.qr-code-generator.com&#x2F;</a><p>(not trying to advertise the site, just saying it wasn&#x27;t worth my time to reinvent something)
Flimm将近 5 年前
Do all Android and iOS devices support this feature?
评论 #23371672 未加载
评论 #23371511 未加载
hikari_techlab将近 5 年前
This is convenient and easy to use. It would be nice to be able to print multiple access points with one print.
castratikron将近 5 年前
Maybe someone will sell wifi routers with cute little LCD screens in them that show this QR code?
paddlesteamer将近 5 年前
I like how it ignores WEP. Don&#x27;t use WEP.
djronin47将近 5 年前
Looks pretty useful.