Git Product home page Git Product logo

wifu's Introduction

Automatic WI-FI switcher

Config documentation

This is a Windows-only tool for automatic WI-FI switching. Basically, its functionality can be broken down into 3 steps:

  • Connect to the WI-FI network specified in the config
  • Ping websites with the most uptime (google.com, amazon.com, microsoft.com by default)
  • Switch WI-FI to the other one in the config, if it fails to reach the websites

Why

I had a weird infrastructure at work, where the main Windows server connects to a wireless modem by WI-FI and shares that internet by LAN with everyone else.

If currently working modem decides to fail, the only way to recover is to manually switch to other's modem WI-FI.

This tool does that automatically, giving much more uptime across the office, even without my presence.

Remarks

This app WILL NOT be maintained and improved further. It had served the functionality I needed, and I don't need it anymore. I WILL NOT accept your PR, create a fork instead.

How to run

  1. Install Windows 10 or 11 if still didn't
  2. Install memory-safe (!) Rust compiler
  3. Install Microsoft Visual Studio and Windows SDK
  4. If you have Git, clone this repository, or download it from GitHub, if not
git clone https://github.com/kerdl/wifu
  1. CD to it
cd wifu
  1. Run
cargo run --release

First startup will produce the following output:

o The app was initialized and a config file was created here: .\wifu-data\cfg.json
! Now, open the config file and fill in the networks you want to use with this app
? "How to" instructions can be found here: https://github.com/kerdl/wifu
  1. Now, open the config file located at the path. It should look like this:
{
  "ping": {
    "domains": {
      "list": [
        "google.com",
        "amazon.com",
        "microsoft.com"
      ],
      "mode": "firstIpFromEach"
    },
    "timeoutMs": 1500,
    "intervalMs": 1000,
    "maxErrors": 3
  },
  "interfaces": {
    "priority": []
  },
  "wifi": {
    "networks": [],
    "scan": {
      "timeoutMs": 3000
    },
    "connect": {
      "timeoutMs": 4000
    },
    "disconnect": {
      "timeoutMs": 4000
    }
  }
}
  1. Add a couple of networks to the wifi.networks list:
"networks": [
  {
    "ssid": "Home Wifi",
    "password": "amogUSSR",
  },
  {
    "ssid": "Unprotected WiFi",
  },
  {
    "ssid": "Unprotected WiFi 2",
    "password": null
  }
]

The final config would look like this:

{
  "ping": {
    "domains": {
      "list": [
        "google.com",
        "amazon.com",
        "microsoft.com"
      ],
      "mode": "firstIpFromEach"
    },
    "timeoutMs": 1500,
    "intervalMs": 1000,
    "maxErrors": 3
  },
  "interfaces": {
    "priority": []
  },
  "wifi": {
    "networks": [
      {
        "ssid": "Home Wifi",
        "password": "amogUSSR",
      },
      {
        "ssid": "Unprotected WiFi",
      },
      {
        "ssid": "Unprotected WiFi 2",
        "password": null
      }
    ],
    "scan": {
      "timeoutMs": 3000
    },
    "connect": {
      "timeoutMs": 4000
    },
    "disconnect": {
      "timeoutMs": 4000
    }
  }
}
  1. Run again
cargo run --release

The full config documentation can be found here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.