0WM

Measure and visualize Wi-Fi coverage

Declared in: projects/0WM/default.nix

Try the service in a VM

  1. Install Nix
    Bash
    $ apt install --yes curl git jq nix
    Bash
    $ apt install --yes curl git jq nix
    Bash
    $ pacman --sync --refresh --noconfirm curl git jq nix
  2. Download a configuration file
    # default.nix
    {
      ngipkgs ? import (fetchTarball "https://github.com/ngi-nix/ngipkgs/tarball/main") { },
    }:
    ngipkgs.demo-vm (
      { lib, ... }:
    
      {
        programs.zwm-client.enable = true;
        services.zwm-server = {
          enable = true;
          openFirewall = true;
          settings = {
            port = 3000;
            aps = [
              "http://127.0.0.1:8003" # mock access point
            ];
            ssids = [
              "Production"
            ];
          };
        };
      }
    )
    
  3. Enable binary substituters
    Bash
    $ export NIX_CONFIG='substituters = https://cache.nixos.org/ https://ngi.cachix.org/
    trusted-public-keys = cache.nixos.org-1:6nchdd59x431o0gwypbmraurkbj16zpmqfgspcdshjy= ngi.cachix.org-1:n+cal72roc3qqulxihpv+tw5t42whxmmhpragkrsrow='
  4. Build and run a virtual machine
    Bash
    $ nix-build ./default.nix && ./result
    Bash
    $ nix-build ./default.nix && ./result
    Bash
    $ rev=$(nix-instantiate --eval --attr sources.nixpkgs.rev https://github.com/ngi-nix/ngipkgs/archive/master.tar.gz | jq --raw-output)
    $ nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/$rev.tar.gz --packages nix --run "nix-build ./default.nix && ./result"
    Bash
    $ nix-build ./default.nix && ./result
  5. Usage Instructions
    1. Click on the bottom left menu, Network, and open the Chromium browser

    2. Open a terminal and start the client, OpMode and mock access point programs:

      $ 0wm-client &
      $ 0wm-opmode &
      $ 0wm-ap-mock &
      

    3. Visit http://127.0.0.1:8002 in your browser

    4. Press the Click here to start button and give it location permissions, when asked.

      If the icons on the left are not green, you may have to restart the page for the permissions change to take effect.

    5. Press the SCAN button, on the right, which will scan the mock access point.

    6. If the scan was successful, the following will be printed in the terminal:

      "GET /cgi-bin/scan/radio0 HTTP/1.1" 200 -
      "GET /cgi-bin/scan/radio1 HTTP/1.1" 200 -
      

Examples

Enable 0WM client
{ ... }:

{
  programs.zwm-client.enable = true;
}

Declared in: projects/0WM/programs/0wm-client/examples/basic.nix

Enable 0WM server
{ ... }:

{
  services.zwm-server = {
    enable = true;
    openFirewall = true;
    settings = {
      port = 3000;
      aps = [
        "http://127.0.0.1:8003" # mock access point
      ];
      ssids = [
        "Production"
      ];
    };
  };
}

Declared in: projects/0WM/services/0wm-server/examples/basic.nix

This project is funded by NLnet through these subgrants:

Core
0WM

Related links: