{"id":22366137,"url":"https://github.com/microsoft/wifi-telemetry","last_synced_at":"2025-07-30T16:32:34.747Z","repository":{"id":65976443,"uuid":"368251675","full_name":"microsoft/wifi-telemetry","owner":"microsoft","description":"Linux Wi-Fi Telemetry library and daemon.","archived":false,"fork":false,"pushed_at":"2021-06-11T18:33:00.000Z","size":76,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-12-04T17:49:48.883Z","etag":null,"topics":["linux","logging","lttng","telemetry","ubuntu","wi-fi","wifi"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null}},"created_at":"2021-05-17T16:24:49.000Z","updated_at":"2024-08-11T08:16:00.000Z","dependencies_parsed_at":"2023-02-19T19:10:13.538Z","dependency_job_id":null,"html_url":"https://github.com/microsoft/wifi-telemetry","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fwifi-telemetry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fwifi-telemetry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fwifi-telemetry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fwifi-telemetry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/wifi-telemetry/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228164525,"owners_count":17879084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux","logging","lttng","telemetry","ubuntu","wi-fi","wifi"],"created_at":"2024-12-04T18:07:49.258Z","updated_at":"2024-12-04T18:07:49.853Z","avatar_url":"https://github.com/microsoft.png","language":"C++","readme":"# Wi-Fi Telemetry\r\n\r\nThis project provides a Wi-Fi telemetry library and daemon. It enables realtime\r\ncollection and reporting of Wi-Fi related events. It can be used in conjunction\r\nwith the the [wifi-ztp](https://github.com/microsoft/wifi-ztp) project to\r\nanalyze and collect Wi-Fi zero touch provisioning telemetry as well.\r\n\r\n## Building\r\n\r\n### Ubuntu (focal)\r\n\r\n```bash\r\nsudo apt install build-essential cmake git liblttng-ust-dev libpci-dev libssl-dev libsystemd-dev pkg-config\r\n```\r\n\r\nCheckout and build:\r\n\r\n```bash\r\ngit clone git@github.com:microsoft/wifi-telemetry.git\r\ncd wifi-telemetry\r\nmkdir build \u0026\u0026 cd $_\r\ncmake ..\r\nmake -j $(nproc)\r\n```\r\n\r\n## Usage\r\n\r\nThe central concept is that of a telemetry monitor, represented as\r\n[`WifiTelemetryMonitor`](include/wifi-telemetry/wifi_telemetry_monitor.hpp).\r\nA monitor passively tracks one or more Wi-Fi telemetry sources, represented as\r\n[`WifiTelemetrySource`](include/wifi-telemetry/wifi_telemetry_source.hpp),\r\neach of which is optionally bound to a device interface (eg. `wlan0`) and Wi-Fi operational mode, either `station` or `access-point`. Event information is aggregated and translated to [lttng](https://lttng.org/) events. All telemetry is local and ***never leaves the device***.\r\n\r\nThe daemon accepts a series of flag tuples for each telemetry source:\r\n\r\n| Flag | Presence     | Description                  | Supported Values                       | Examples                 |\r\n|------|--------------|------------------------------|----------------------------------------|--------------------------|\r\n| `-s` | **Required** | telemetry source identifier  | `wpa`, `ztp`                           | `-s wpa`                 |\r\n| `-i` | Optional     | Wi-Fi device interface name  | Any valid Wi-Fi device name            | `-i wlan0`, `-i  wl01s9` |\r\n| `-o` | Optional     | Wi-Fi operational mode       | `sta`, `station`, `ap`, `access-point` | `-o station`, `-o ap`    |\r\n\r\n### Telemetry Sources\r\n\r\n#### Wi-Fi Protected Access (WPA) Supplicant (`wpa`)\r\n\r\nThis source passively monitors basic Wi-Fi connectivity and Device Provisioning Protocol (DPP aka [Wi-Fi EasyConnect](https://www.wi-fi.org/discover-wi-fi/wi-fi-easy-connect)) events originating from a wpa_supplicant control socket.\r\n\r\n#### Zero Touch Provisioning Daemon (`ztp`)\r\n\r\nThis source passively monitors zero touch provisioning daemon (ztpd) events\r\noriginating from the ztpd d-bus inteface. Some events are not bound to a\r\nspecific interface.\r\n\r\n### lttng Providers and Tracepoints\r\n\r\n  | Provider       | Tracepoint                  | Source | Description                                          |\r\n  |----------------|-----------------------------|--------|------------------------------------------------------|\r\n  | `wifi`         | `device_info`               | `wpa`  | Interface, model, driver, subsystem and vendor info. |\r\n  | `wifi-station` | `connection-attempt`        | `wpa`  | Result, bssid, signal, frequency, security, status.  |\r\n  | `wifi-station` | `connection-drop`           | `wpa`  | Reason, bssid, locally generated.                    |\r\n  | `wifi-dpp`     | `dpp_exchange_enrollee`     | `wpa`  | State, role, duration, failure details, frequencies. |\r\n  | `wifi-dpp`     | `dpp_exchange_configurator` | `wpa`  | State, role, duration, failure details, frequency.   |\r\n  | `wifi-dpp`     | `dpp_device_roles_changed`  | `ztp`  | Device role(s) changed.                              |\r\n\r\n### Examples\r\n\r\n#### Monitor basic Wi-Fi client connectivity on `wlan0`\r\n\r\n```shell\r\n$ wifi-telemetryd -s wpa -i wlan0 -o sta\r\nactivated telemetry source 'wpa'\r\ntelemetry monitor started with 1 of 1 telemetry sources\r\n```\r\n\r\n#### Monitor basic wifi-client connectivity and ztp events on `wlan1`\r\n\r\n```shell\r\n$ wifi-telemetryd -s wpa -i wlan1 -o station -s ztp\r\nactivated telemetry source 'wpa'\r\nactivated telemetry source 'ztpd'\r\ntelemetry monitor started with 2 of 2 telemetry sources\r\n```\r\n\r\n#### Monitor Wi-Fi client connectivity with systemd instantiated service unit on arbitrary interface (`%i`)\r\n\r\n[wifi-telemetryd-station@service.in](src/daemon/systemd/wifi-telemetryd-station@.service.in):\r\n\r\n```ini\r\n[Unit]\r\nDescription=Wi-Fi Telemetry Daemon (WPA Station)\r\nRequires=sys-subsystem-net-devices-%i.device\r\nAfter=sys-subsystem-net-devices-%i.device\r\n\r\n[Service]\r\nType=simple\r\nRestart=on-failure\r\nExecStart=/usr/sbin/wifi-telemetryd -s wpa -o station -i %i\r\n```\r\n\r\n#### View all Wi-Fi telemetry in real-time with lttng\r\n\r\n```shell\r\n$ lttng create --live\r\nLive session auto-20210610-220234 created.\r\nTraces will be output to tcp4://127.0.0.1:5342/ [data: 5343]\r\nLive timer interval set to 1000000 us\r\n$ lttng enable-event -u \"wifi:* wifi_station:* wifi_dpp:*\"\r\nUST event wifi:* wifi_station:* wifi_dpp:* created in channel channel0\r\n$ lttng start\r\nTracing started for session auto-20210610-220234\r\n$ lttng view\r\nTrace directory: net://localhost/host/apd-d8c0a65935ed/auto-20210610-220234$ lttng create --live\r\n\u003cWi-Fi tracepoint events...\u003e\r\n```\r\n\r\n## Contributing\r\n\r\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\r\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\r\nthe rights to use your contribution. For details, visit [https://cla.opensource.microsoft.com](https://cla.opensource.microsoft.com).\r\n\r\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\r\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\r\nprovided by the bot. You will only need to do this once across all repos using our CLA.\r\n\r\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\r\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\r\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\r\n\r\n## Trademarks\r\n\r\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft\r\ntrademarks or logos is subject to and must follow \r\n[Microsoft's Trademark \u0026 Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\r\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\r\nAny use of third-party trademarks or logos are subject to those third-party's policies.\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fwifi-telemetry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Fwifi-telemetry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fwifi-telemetry/lists"}