bndw / wifi-card

📶 Print a QR code for connecting to your WiFi (wificard.io)
https://wificard.io
MIT License
6.58k stars 460 forks source link

Auto Identify wifi #216

Closed rpradosilva closed 2 years ago

rpradosilva commented 2 years ago

Hi everyone,

The app is really cool!!!

I suggest improving the experience by automating wi-fi identification via browser permissions, but manual configuration is still an alternative.

Example: https://www.speedtest.net/

What do you think?

olekstomek commented 2 years ago

Is it possible? The informations on speedtest.net are non-local network information.

rpradosilva commented 2 years ago

I researching npm libs, this is an initial idea:

const wifiscanner = require("wifiscanner");
const wifiName = require("wifi-name");
const scanner = wifiscanner();
const wifiPassword = require("wifi-password");

let networkName = wifiName.sync();

scanner.scan((error, networks) => {
  if (error) {
    console.error(error);
  } else {
    for (const network of networks) {
      if (network.ssid == networkName) {
        console.info(
          `------------------------------------\nWifi Name: ${network.ssid}\nSecurity: ${network.security}`
        );
      }
    }
  }
});

wifiPassword().then(function (password) {
  return console.log(`Password: ${password}`);
});

What do you think?

Baoyuantop commented 2 years ago

What is the effect of this?

rpradosilva commented 2 years ago

Automatically identify the wi-fi name, security type and password, the main information to create the wi-fi card...

Test the suggestion:

  1. Create folder
  2. Start node npm init
  3. Install these dependencies: npm i wifiscanner wifi-name wifi-password
  4. Create file index.js and paste this code:
    
    const wifiscanner = require("wifiscanner");
    const wifiName = require("wifi-name");
    const scanner = wifiscanner();
    const wifiPassword = require("wifi-password");

let networkName = wifiName.sync();

scanner.scan((error, networks) => { if (error) { console.error(error); } else { for (const network of networks) { if (network.ssid == networkName) { console.info( ------------------------------------\nWifi Name: ${network.ssid}\nSecurity: ${network.security} ); } } } });

wifiPassword().then(function (password) { return console.log(Password: ${password}); });


5. Run `node index.js`
olekstomek commented 2 years ago

It's a convenient solution. The user can click the button/checkbox to automatically complete the data about the network to which he is currently connected. This saves time and the possibility of mistakes. A very good idea for me.

bndw commented 2 years ago

This is a cool idea, but I don't think it's a good fit for this project. I want to keep the experience simple and expected. If a website like wificard.io automatically displayed my home wifi network details, I'd be caught off guard.

Again, I think this is a really cool idea but not a good fit for this project.