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 -
      

Options

programs.zwm-client
programs.zwm-client.enable

Whether to enable 0wm-client.

Type:
boolean
Default:
false
Declared in:
projects/0WM/programs/0wm-client/module.nix
programs.zwm-client.package

The _0wm-client package to use.

Type:
package
Default:
pkgs._0wm-client
Declared in:
projects/0WM/programs/0wm-client/module.nix
programs.zwm-client.settings

0WM config settings.

Type:
open submodule of (JSON value)
Default:
{ }
Declared in:
projects/0WM/programs/0wm-client/module.nix
programs.zwm-client.settings.api

0WM server address

Type:
string
Default:
"http://127.0.0.1:8000"
Declared in:
projects/0WM/programs/0wm-client/module.nix
services.zwm-server
services.zwm-server.enable

Whether to enable 0wm-server.

Type:
boolean
Default:
false
Declared in:
projects/0WM/services/0wm-server/module.nix
services.zwm-server.openFirewall

Whether to open the port specified in settings in the firewall.

Type:
boolean
Default:
false
Declared in:
projects/0WM/services/0wm-server/module.nix
services.zwm-server.package

The _0wm-server package to use.

Type:
package
Default:
pkgs._0wm-server
Declared in:
projects/0WM/services/0wm-server/module.nix
services.zwm-server.settings

0WM config settings.

Type:
open submodule of (JSON value)
Default:
{ }
Declared in:
projects/0WM/services/0wm-server/module.nix
services.zwm-server.settings.aps

0WM access point addresses

Type:
list of string
Default:
[ ]
Declared in:
projects/0WM/services/0wm-server/module.nix
services.zwm-server.settings.interface

0WM server address

Type:
string
Default:
"127.0.0.1"
Declared in:
projects/0WM/services/0wm-server/module.nix
services.zwm-server.settings.port

0WM server port

Type:
16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
8000
Declared in:
projects/0WM/services/0wm-server/module.nix
services.zwm-server.settings.ssids

WiFi SSIDs

Type:
list of string
Default:
[ ]
Declared in:
projects/0WM/services/0wm-server/module.nix

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: