whm also known as wifi-heat-mapper is a Python library for benchmarking Wi-Fi networks and gather useful metrics that can be converted into meaningful easy-to-understand heatmaps.

Overview

whm

whm aka wifi-heat-mapper

whm also known as wifi-heat-mapper is a Python library for benchmarking Wi-Fi networks and gather useful metrics that can be converted into meaningful easy-to-understand heatmaps. The tool aims to assist network engineers, admins and homelabbers in figuring out the performance of their Access Points and Routers.

This tool is heavily inspired by python-wifi-survey-heatmap by Jason Antman.

Supported Platform

  • Operating System
    • Linux x86_64 (64 bit)

Dependencies

Required

  • Python version: 3.7 - 3.9 (with Tkinter)
  • iperf3 >= 0.1.11
  • matplotlib >= 3.4.0
  • tqdm >= 4.55.0
  • Pillow >= 8.2.0
  • scipy >= 1.6.0
  • numpy >= 1.20.0
  • PySimpleGUI >= 4.34.0

Optional

Tkinter Dependency

By default Tkinter is not installed with Python. Users are requested to install Tkinter using their respective package managers.

Arch Linux and Manjaro

$ pacman -S tk

Fedora, CentOS, RHEL and RockyLinux

$ dnf install python3-tkinter

Debian and Ubuntu

$ apt install python3-tk

openSUSE and SUSE Linux Enterprise

$ zypper install python3-tk

Gentoo

Official Wiki instructions

Installation

The easiest way to install whm is via pip.

$ pip install whm

Alternatively, you can clone the repository and compile it.

$ git clone https://github.com/Nischay-Pro/wifi-heat-mapper.git
$ cd wifi-heat-mapper
$ python3 setup.py install

Usage

Server Configuration

whm requires connecting to an iperf3 instance running in server mode. On a machine which is available in your LAN run iperf3 -s to start iperf3 in server mode in foreground. I strongly recommend running the iperf3 instance on a wired computer or virtual machine instance.

By default, iperf3 will use TCP and UDP ports 5201.

Client Configuration

Configuration Bootstrapping

Initially, you need to bootstrap your configuration specifying the graphs you would like to view, the number of times you want to repeat benchmarking, the wireless interface you will be using to profile, and the SSID configured. In case you are using librespeed-cli you will be asked if you prefer it over speedtest and optionally provide a path to your custom libre server list.

whm supports multiple graphs allowing users to select one, more, or all graphs. The tool will automatically gather the appropriate metrics to generate the graphs.

$ whm bootstrap

NOTE: To profile metrics from Ookla speedtest, the user needs to ensure that they have installed the binary provided by Ookla and is accessible from $PATH environment variable.

After completing the process, a file called config.json will be available in the directory you have executed the command from.

To specify a save path and file name use the --config option, including the path and the filename for storing the configuration details.

For example:

$ whm bootstrap --config /home/example/whm/test.json

Benchmarking

Once you have generated the configuration file you can start benchmarking.

$ whm benchmark -m examples/sample_floor_map.jpg -s 192.168.1.100 -c config.json 

Command-line options used:

  • -m or --map is the path to the floop map.
  • -s or --server is the IP address(:port) of the iperf3 server. You can specify a port using IPADDRESS:PORT, like 192.168.1.100:5123. If no port is specified the default port 5201 is used.
  • -c or --config is the path to the configuration file you bootstrapped earlier.

After specifying the appropriate options a GUI window will open up.

You will be presented with a canvas with your floor map loaded.

GUI-1

  • Exit: To quit benchmarking
  • Save Results: Save the results you have captured till now. Results are stored in the same configuration file you have used earlier.
  • Plot: To plot the results you have captured.
  • Clean All: Wipes the canvas clean, removing all captured metrics.

Gathering metrics

  1. Start by Left-clicking on the canvas roughly at a position where you are capturing the metrics from. A gray circle with a blue outline should appear now.

GUI-2

  1. Now right-click on the circle. You will be presented with a drop-down menu having 3 options.
    • Benchmark: whm will start capturing metrics at this position.
    • Delete: whm will delete the point and metrics (if any) at this point.
    • Mark / Un-Mark as Station: whm will mark this point as a Base station. Useful if you want to have a heatmap displaying the position of one or more base stations. You would still need to benchmark at this point. The border color will change from black to red, indicating a base station point.

GUI-3

  1. Select Benchmark and wait for a few seconds (or minutes) depending on the graphs you have requested and the number of times benchmarks are repeated. Once benchmarking is done, the circle's fill color changes from gray to light blue.
    • Benchmark results are automatically saved when they complete successfully.
    • Alternatively, if you would like to rerun benchmarking, simply select any point using the cursor; the black border becomes blue. You can now right-click and select Benchmark to recapture metrics.

GUI-4

  1. Now move to a new position you want to benchmark from and select the rough position in the canvas.

  2. whm requires at least 4 points to generate plots. I strongly recommend profiling as many points as possible to increase the accuracy of the heatmap.

  3. Once completed click on Save Results to save the metrics to file. You can then plot your metrics by pressing Plot.

Resuming from a previous state

To resume from a previous benchmarking state, simply repeat the command you used to run the benchmarking initially. All results are stored in the configuration file the user has specified originally.

Plotting

whm also offers the user additional command-line arguments when plotting.

To generate plots with custom flags, you can specify them using the whm plot command.

$ whm plot -m ./examples/sample_floor_map.jpg -c config.json -l 100 -d 300 -f png 

Command-line options used:

  • -m or --map is the path to the floop map.
  • -c or --config is the path to the configuration file you bootstrapped earlier.
  • -l or --levels (optional) is the number and positions of the contour lines / regions. Default (100)
  • -d or --dpi (optional) is the resolution of the figure in dots-per-inch. Default (300)
  • -f or --format (optional) is used to specify the export file format for generated plots. Default (png). Supported options include (png, pdf, ps, eps, svg)

The directory from which the user has run the command will contain the graphs that the user requested during bootstrap.

Examples

A sample configuration, including benchmark results and plots generated is provided in the examples folder.

Contributing

Pull requests are welcome. For significant changes, please open an issue first to discuss what you would like to change.

Please make sure to run tests as appropriate.

License

GPLv3

You might also like...
TorchMetrics is a collection of 25+ PyTorch metrics implementations and an easy-to-use API to create custom metrics. Detect the mathematical formula from the given picture and the same formula is extracted and converted into the latex code
Detect the mathematical formula from the given picture and the same formula is extracted and converted into the latex code

Mathematical formulae extractor The goal of this project is to create a learning based system that takes an image of a math formula and returns corres

Scripts to convert the Ted-MDB corpora into the formats for DISRPT shared task and the converted corpora

Scripts to convert the Ted-MDB corpora into the formats for DISRPT shared task and the converted corpora.

HeatNet is a python package that provides tools to build, train and evaluate neural networks designed to predict extreme heat wave events globally on daily to subseasonal timescales.

HeatNet HeatNet is a python package that provides tools to build, train and evaluate neural networks designed to predict extreme heat wave events glob

Convert Pytorch model to onnx or tflite, and the converted model can be visualized by Netron
Convert Pytorch model to onnx or tflite, and the converted model can be visualized by Netron

Convert Pytorch model to onnx or tflite, and the converted model can be visualized by Netron

Calendar heatmaps from Pandas time series data
Calendar heatmaps from Pandas time series data

Note: See MarvinT/calmap for the maintained version of the project. That is also the version that gets published to PyPI and it has received several f

A list of papers about point cloud based place recognition, also known as loop closure detection in SLAM (processing)

A list of papers about point cloud based place recognition, also known as loop closure detection in SLAM (processing)

Custom component for Home Assistant that integrates Candy/Haier Wi-Fi washing machines (also known as Simply-Fi).

Candy Home Assistant component Custom component for Home Assistant that integrates Candy/Haier Wi-Fi washing machines (also known as Simply-Fi). This

Updated for TTS(CE) = Also Known as TTN V3. The code requires the first server to be 'ttn' protocol.

Updated Updated for TTS(CE) = Also Known as TTN V3. The code requires the first server to be 'ttn' protocol. Introduction This balenaCloud (previously

Metrics-advisor - Analyze reshaped metrics from TiDB cluster Prometheus and give some advice about anomalies and correlation.

metrics-advisor Analyze reshaped metrics from TiDB cluster Prometheus and give some advice about anomalies and correlation. Team freedeaths mashenjun

FAIR Enough Metrics is an API for various FAIR Metrics Tests, written in python

☑️ FAIR Enough metrics for research FAIR Enough Metrics is an API for various FAIR Metrics Tests, written in python, conforming to the specifications

Heat transfer problemas solved using python
Heat transfer problemas solved using python

heat-transfer Heat transfer problems solved using python isolation-convection.py compares the temperature distribution on the problem as shown in the

GET-ACQ is a python tool used to gather all companies acquired by a given company domain name.

get-acq 🏢 GET-ACQ is a python tool used to gather all companies acquired by a given company domain name. It is done by calling SecurityTrails API. Us

This tool for beginner and help those people they gather information about Email Header Analysis, Instagram Information, Instagram Username Check, Ip Information, Phone Number Information, Port Scan

This tool for beginner and help those people they gather information about Email Header Analysis, Instagram Information, Instagram Username Check, Ip Information, Phone Number Information, Port Scan. This tool shows your hostname and public IP first, then user give input and according to option this tool work. This tool work diffrent Oprating system.

BlackIP-Rep is a tool designed to gather the reputation and information of Bulk IP's.

BlackIP-Rep is a tool designed to gather the reputation and information of Bulk IP's. Focused on increasing the workflow of Security Operations(SOC) team during investigation.

Nest Protect integration for Home Assistant. This will allow you to integrate your smoke, heat, co and occupancy status real-time in HA.
Nest Protect integration for Home Assistant. This will allow you to integrate your smoke, heat, co and occupancy status real-time in HA.

Nest Protect integration for Home Assistant Custom component for Home Assistant to interact with Nest Protect devices via an undocumented and unoffici

Comments
  • Application crashes during benchmark when iperf3 is being used

    Application crashes during benchmark when iperf3 is being used

    Application will crash with following trace:

    Running benchmark 0%| | 0/15 [00:00<?, ?it/s]Traceback (most recent call last): File "/usr/local/bin/whm", line 33, in sys.exit(load_entry_point('whm==0.2.2', 'console_scripts', 'whm')()) File "/usr/local/lib/python3.9/site-packages/wifi_heat_mapper/main.py", line 72, in driver start_gui(args.floor_map, args.iperf_server, args.config_file) File "/usr/local/lib/python3.9/site-packages/wifi_heat_mapper/gui.py", line 190, in start_gui results = run_benchmarks(benchmark_modes, benchmark_iterations, iperf_ip, iperf_port, File "/usr/local/lib/python3.9/site-packages/wifi_heat_mapper/gui.py", line 437, in run_benchmarks iperf_download = run_iperf(iperf_ip, iperf_port, bind_address, download=True, protocol="tcp") File "/usr/local/lib/python3.9/site-packages/wifi_heat_mapper/misc.py", line 246, in run_iperf run_iperf(ip, port, bind_address, download, protocol, retry + 1) File "/usr/local/lib/python3.9/site-packages/wifi_heat_mapper/misc.py", line 246, in run_iperf run_iperf(ip, port, bind_address, download, protocol, retry + 1) File "/usr/local/lib/python3.9/site-packages/wifi_heat_mapper/misc.py", line 244, in run_iperf raise err File "/usr/local/lib/python3.9/site-packages/wifi_heat_mapper/misc.py", line 240, in run_iperf get_property_from(iperf_result_json, "start") File "/usr/local/lib/python3.9/site-packages/wifi_heat_mapper/misc.py", line 403, in get_property_from raise ValueError("Could not retrieve property {0}".format(key)) from None ValueError: Could not retrieve property start

    $ iperf3 --version iperf 3.9 (cJSON 1.7.13) Linux fedora 5.11.20-300.fc34.x86_64 #1 SMP Wed May 12 12:45:10 UTC 2021 x86_64 Optional features available: CPU affinity setting, IPv6 flow label, SCTP, TCP congestion algorithm setting, sendfile / zerocopy, socket pacing, authentication

    Application won't crash if only graphs 1 2 3 are selected.

    bug 
    opened by marvn23 19
  • Unable to parse IW

    Unable to parse IW

    Hello I am trying to run it on a raspberry pi 400 running ubuntu desktop 64bit. I get this error where it's not detecting wlan0 but wlan0 is up.

    whm bootstrap Detecting benchmarking capabilities. Supported Modes: iperf3 Please enter the target wireless interface to run benchmark on (example: wlan0): wlan0 Traceback (most recent call last): File "/usr/local/bin/whm", line 8, in sys.exit(driver()) File "/usr/local/lib/python3.9/dist-packages/wifi_heat_mapper/main.py", line 81, in driver start_config(args.config_file) File "/usr/local/lib/python3.9/dist-packages/wifi_heat_mapper/debugger.py", line 12, in new_func return func(*args, **kwargs) File "/usr/local/lib/python3.9/dist-packages/wifi_heat_mapper/config.py", line 228, in start_config ssid = process_iw(target_interface)["ssid"] File "/usr/local/lib/python3.9/dist-packages/wifi_heat_mapper/misc.py", line 186, in process_iw raise ParseError("Unable to parse iw.") from None wifi_heat_mapper.misc.ParseError: Unable to parse iw.

    opened by eclc1924 10
  • Add feature to differentiate between multiple access points

    Add feature to differentiate between multiple access points

    Currently, we can detect multiple access points but while generating graphs the APs are shown without any differentiating label or color.

    Modify the graphing function to generate unique labels for each AP.

    enhancement good first issue 
    opened by Nischay-Pro 0
  • Refactor get_application_output

    Refactor get_application_output

    Currently get_application_output exception handling returns strings instead of an exception. This needs to be rewritten to properly return proper exceptions.

    good first issue refactor 
    opened by Nischay-Pro 0
Owner
Nischay Mamidi
Nischay Mamidi
Emulator for rapid prototyping of Software Defined Networks

Mininet: Rapid Prototyping for Software Defined Networks The best way to emulate almost any network on your laptop! Mininet 2.3.0b2 What is Mininet? M

Mininet 4.7k Jan 5, 2023
α-Indirect Control in Onion-like Networks

α-Indirect Control in Onion-like Networks

European University at St. Petersburg (EUSP) 150 Jul 7, 2022
Network Automation and Programmability Abstraction Layer with Multivendor support

NAPALM NAPALM (Network Automation and Programmability Abstraction Layer with Multivendor support) is a Python library that implements a set of functio

napalm-automation 2k Dec 31, 2022
This project calculates current internet upload and download speeds.

Internet-Speed-Calculator Project Description: In this project, are creating an internet speed calculator. Requirements: Following modules need to be

Hassan Shahzad 4 Oct 26, 2021
Quickly fetch your WiFi password and if needed, generate a QR code of your WiFi to allow phones to easily connect

wifi-password Quickly fetch your WiFi password and if needed, generate a QR code of your WiFi to allow phones to easily connect. Works on macOS and Li

Siddharth Dushantha 2.6k Jan 5, 2023
Python library for serializing any arbitrary object graph into JSON. It can take almost any Python object and turn the object into JSON. Additionally, it can reconstitute the object back into Python.

jsonpickle jsonpickle is a library for the two-way conversion of complex Python objects and JSON. jsonpickle builds upon the existing JSON encoders, s

null 1.1k Jan 2, 2023
LSO, also known as Linux Swap Operator, is a software with both GUI and terminal versions that you can manage the Swap area for Linux operating systems.

LSO - Linux Swap Operator Türkçe - LSO Nedir? LSO, diğer adıyla Linux Swap Operator Linux işletim sistemleri için Swap alanını yönetebileceğiniz hem G

Eren İnce 4 Feb 9, 2022