{"id":13456796,"url":"https://github.com/shajen/rtl-sdr-scanner-cpp","last_synced_at":"2025-03-24T11:31:24.129Z","repository":{"id":37409184,"uuid":"399784772","full_name":"shajen/rtl-sdr-scanner-cpp","owner":"shajen","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-22T16:38:27.000Z","size":12949,"stargazers_count":641,"open_issues_count":54,"forks_count":68,"subscribers_count":35,"default_branch":"master","last_synced_at":"2024-11-22T17:31:50.867Z","etag":null,"topics":["hackrf","rtl-sdr","rtlsdr","sdr"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shajen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-08-25T10:52:52.000Z","updated_at":"2024-11-13T20:01:01.000Z","dependencies_parsed_at":"2023-10-27T23:45:12.231Z","dependency_job_id":"30464a2c-a19d-42ac-84f8-d0476656ec25","html_url":"https://github.com/shajen/rtl-sdr-scanner-cpp","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shajen%2Frtl-sdr-scanner-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shajen%2Frtl-sdr-scanner-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shajen%2Frtl-sdr-scanner-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shajen%2Frtl-sdr-scanner-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shajen","download_url":"https://codeload.github.com/shajen/rtl-sdr-scanner-cpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245260870,"owners_count":20586489,"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":["hackrf","rtl-sdr","rtlsdr","sdr"],"created_at":"2024-07-31T08:01:27.911Z","updated_at":"2025-03-24T11:31:23.046Z","avatar_url":"https://github.com/shajen.png","language":"C++","readme":"# Introduction\n\nThis project contains sdr scanner written in `c++` to **scan and record multiple interesting frequencies bandwidth in the same time** (eg. 108 MHz, 144 MHz, 440 Mhz,  etc). This is possible by switching quickly between frequencies bandwidth.\n\nSdr scanner also allows you to record multiple transmissions simultaneously (if they are transmitted on the same band). For example, if one transmission is on 145.200 MHz and the other is on 145.600 MHz, the scanner will record and save both!\n\nIt also provides easy but very powerful **web panel** to explore recordings and spectrograms.\n\n# Supported devices\n\n- `rtl-sdr`\n- `HackRF`\n\n# Supported modulation\n\n- `FM`\n- `AM`\n\n# YouTube\n\n[introduction video](https://www.youtube.com/watch?v=YzQ2N0VkKvE) - thanks to **Tech Minds**!\n\n[introduction video](http://www.youtube.com/watch?v=TSDbcb7wSjs) - old version\n\n# Sample data collected\n\n| Spectrogram | Transmission |\n| - | - |\n| ![](images/spectrograms.png?raw=1) | ![](images/transmissions.png?raw=1) |\n| ![](images/spectrogram.png?raw=1) | ![](images/transmission.png?raw=1) |\n\n# Quickstart\n\n## Install docker\n\nIf you do not have `docker` installed, follow the instructions available at [https://docs.docker.com/desktop/](https://docs.docker.com/desktop/) to install `docker` and `docker compose`.\n\n## Run\n\nDownload sample configuration and docker file, then run it. Customize `config.json` to your needs.\n```\nmkdir -p sdr\ncd sdr\nwget https://github.com/shajen/rtl-sdr-scanner-cpp/raw/master/config.json\nwget https://github.com/shajen/rtl-sdr-scanner-cpp/raw/master/docker-compose.yml\ndocker compose up\n```\n\nTo update docker images to latest version type:\n```\ndocker compose pull\n```\n\nAlso remember to update `docker-compose.yml` and `config.json`.\n\n## Panel\n\nOpen [http://localhost:8000/sdr/spectrograms/](http://localhost:8000/sdr/spectrograms/) and wait for data to collect.\n\nAdmin panel available at [http://localhost:8000/admin/](http://localhost:8000/admin/). Username: `admin`, password: `password`.\n\n# Important\n\n### Blacklist kernel modules\n\nIf you use `rtl-sdr` remember to blacklist `rtl2832` modules so that the host operating system doesn't attach the devices and instead allows the devices to be claimed by the docker guest instance.\n\nCopy and run this entire section of script at once. Note that one may need to explicitly press enter after pasting to get it to run.\n```\nsudo tee /etc/modprobe.d/blacklist-rtlsdr.conf \u003e /dev/null \u003c\u003cTEXT1\n# Blacklist host from loading modules for RTL-SDRs to ensure they\n# are left available for the Docker guest\nblacklist dvb_core\nblacklist dvb_usb_rtl2832u\nblacklist dvb_usb_rtl28xxu\nblacklist dvb_usb_v2\nblacklist r820t\nblacklist rtl2830\nblacklist rtl2832\nblacklist rtl2832_sdr\nblacklist rtl2838\nblacklist rtl8192cu\nblacklist rtl8xxxu\nTEXT1\n\n```\n\n### Unload any RTL-SDR modules that may have been loaded\n```\nsudo rmmod dvb_core\nsudo rmmod dvb_usb_rtl2832u\nsudo rmmod dvb_usb_rtl28xxu\nsudo rmmod dvb_usb_v2\nsudo rmmod r820t\nsudo rmmod rtl2830\nsudo rmmod rtl2832\nsudo rmmod rtl2832_sdr\nsudo rmmod rtl2838\nsudo rmmod rtl8192cu\nsudo rmmod rtl8xxxu\n\n```\n\n## RaspberryPi\n\nDocker version should work on `RaspberryPi`, but keep in mind that `RaspberryPi` is **not a powerful machine** and is **not good** for sdr data processing. `sdr` device can produce **40 megabytes per second**! It's a lot of data for `RaspberryPi` to processing in real time. It's a lot of data even for some desktop computers.\n\nIf you still want to do this, please replace the `SD` card with a fast one and make sure you have a strong version of `RaspberryPi`.\n\nBetter idea is to build `sdr-scanner` from sources via `cmake` and run natively on `RaspberryPi`. Next run `sdr-monitor` and `mqtt-broker` on any other machine (even in the cloud) and connect `sdr-scanner` to them (you have to set valid mqtt data in `config.json` and maybe manipulate in `docker-compose.yml`).\n\n## Noise learner\n\nTo auto-detect transmissions, sdr scanner has to learn noise level every run. It takes first `n` seconds (defined in `config.json` as `noise_learning_time_seconds` default is `30` seconds). So if any transmission will appear in this period it's may not be detected by scanner later.\n\n## Torn transmissions detector\n\nSdr scanner has feature to avoid recording torn transmission like below.\n\n![](images/torn_transmission.png?raw=1)\n\nIt takes first `n` seconds (defined in `config.json` as `torn_transmission_learning_time_seconds` default is `60` seconds) seconds.\n\n## Auto-recording\n\nSo sdr scanner starts auto-recording transsmions after `noise_learning_time_seconds` + `torn_transmission_learning_time_seconds`.\n\n## Required resources\n\nUsing this software with `HackRF` and `sample rate` `10 MHz` and above needs strong PC. In most casies, `Raspberry Pi` will not be enough.\n\nFor example, `HackRF` with `sample rate` `20 Mhz` generates about `40 MB` of data every second, and processing it in real-time needs a strong CPU with multiple cores and some memory resources.\n\n# Config\n\nAll of the following examples should be used in the `config.json` file.\n\n## rtl-sdr\n\n### single frequency range\n\nTo scan single frequency range:\n```\n{\n  \"scanner_frequencies_ranges\": [\n    {\n      \"device_serial\": \"auto\",\n      \"ranges\": [\n        {\n          \"start\": 144000000,\n          \"stop\": 146000000,\n          \"sample_rate\": 2048000\n        }\n      ]\n    }\n  }\n}\n```\n\n### ppm and gain\n\nTo set `ppm` to `5` and `gain` to `49.6`:\n```\n{\n  \"devices\": {\n    \"rtl_sdr\": {\n      \"ppm_error\": 5,\n      \"tuner_gain\": 49.6,\n      \"offset\": 0\n    }\n  }\n}\n```\n\n## HackRF\n\n### single frequency range\n\nTo scan single frequency range:\n```\n{\n  \"scanner_frequencies_ranges\": [\n    {\n      \"device_serial\": \"auto\",\n      \"ranges\": [\n        {\n          \"start\": 430000000,\n          \"stop\": 450000000,\n          \"sample_rate\": 20480000\n        }\n      ]\n    }\n  }\n}\n```\n\n### gain\n\nTo set `lna` to `16` and `gain` to `42`:\n```\n{\n  \"devices\": {\n    \"hack_rf\": {\n      \"lna_gain\": 16,\n      \"vga_gain\": 42,\n      \"offset\": 0\n    }\n  }\n}\n```\n\n## Ignored frequencies\n\nTo ignore annoying frequency that you are not interested use `ignored_frequencies`. For example to ignore frequency `144 Mhz` with width `20 kHz` and `145.350 Mhz` with width `50 kHz` use:\n```\n{\n  \"ignored_frequencies\": [\n    {\n      \"frequency\": 144000000,\n      \"bandwidth\": 20000\n    },\n    {\n      \"frequency\": 145350000,\n      \"bandwidth\": 50000\n    }\n  ]\n}\n```\n\n## Use multiple devices\n\nTo use two dongles with serials `11111111` and `22222222`:\n```\n{\n  \"scanner_frequencies_ranges\": [\n    {\n      \"device_serial\": \"11111111\",\n      \"ranges\": [\n        {\n          \"start\": 144000000,\n          \"stop\": 146000000,\n          \"sample_rate\": 2048000\n        }\n      ]\n    },\n    {\n      \"device_serial\": \"22222222\",\n      \"ranges\": [\n        {\n          \"start\": 440000000,\n          \"stop\": 442000000,\n          \"sample_rate\": 2048000\n        }\n      ]\n    }\n  ]\n}\n```\n\nIf you have multiple `rtl-sdr` dongles with the same serial you can change it with `rtl_eeprom -s 12345678`.\n\n## Scan multiple frequencies ranges\n\nTo scan `144 Mhz - 146 Mhz` and `440 Mhz - 442 Mhz` in the same time:\n```\n{\n  \"scanner_frequencies_ranges\": [\n    {\n      \"device_serial\": \"auto\",\n      \"ranges\": [\n        {\n          \"start\": 144000000,\n          \"stop\": 146000000,\n          \"sample_rate\": 2048000\n        },\n        {\n          \"start\": 440000000,\n          \"stop\": 442000000,\n          \"sample_rate\": 2048000\n        }\n      ]\n    }\n  ]\n}\n```\n\n## Custom fft\n\nIt is possible to set custom fft on spectrogram.\n```\n{\n  \"scanner_frequencies_ranges\": [\n    {\n      \"device_serial\": \"auto\",\n      \"ranges\": [\n        {\n          \"start\": 144000000,\n          \"stop\": 146000000,\n          \"sample_rate\": 2048000,\n          \"fft\": 16384\n        }\n      ]\n    }\n  ]\n}\n```\n\n# Debugging\n\nIf you have some problems with this software follow the steps to get debug log.\n\nSet `\"console_log_level\": \"trace\"` in `config.json`.\n\nThen run app normally by `docker compose up`. After the error run `docker compose logs \u003e logs.txt`. Please attach `logs.txt` if you create a new issue. Do not paste logs directly to issue. Upload it to any file host service ([https://file.io/](https://file.io/), [https://pastebin.com/](https://pastebin.com/) or any you like).\n\n# Timezone\n\nIf timezone detection not work correctly and it seems to use `UTC` instead your timezone please set timezone in host system. To set `Europe/Warsaw` type:\n```\necho \"Europe/Warsaw\" | sudo tee /etc/timezone\n```\n\n# Advanced usage\n\n## Build from sources\n\n### CMake\n\nBuild\n\n```\nsudo apt-get install build-essential cmake ccache libfftw3-dev libspdlog-dev librtlsdr-dev libhackrf-dev libliquid-dev nlohmann-json3-dev libmosquitto-dev libgtest-dev libgmock-dev libboost-all-dev\ngit clone https://github.com/shajen/rtl-sdr-scanner-cpp sdr-scanner\ncd sdr-scanner\ncmake -B build -DCMAKE_BUILD_TYPE=Release .\ncmake --build build -j$(nproc)\n```\n\nRun\n\n```\n./build/auto-sdr config.json\n```\n\n### Docker\n\nBuild\n\n```\ngit clone https://github.com/shajen/rtl-sdr-scanner-cpp sdr-scanner\ncd sdr-scanner\ndocker build -t shajen/sdr-scanner -f Dockerfile .\n```\n\nRun\n\n```\ndocker run --rm -it -v ${PWD}/config.json:/config.json --device /dev/bus/usb:/dev/bus/usb shajen/sdr-scanner\n```\n\n## Distributed application system\n\nIt is possible to run every module (`sdr-broker`, `sdr-scanner` and `sdr-monitor`) on different machines and connect them. Please familiar with [docker-compose.yml](docker-compose.yml) to do it.\n\n# Contributing\n\nIn general don't be afraid to send pull request. Use the \"fork-and-pull\" Git workflow.\n\n1. **Fork** the repo\n2. **Clone** the project to your own machine\n3. **Commit** changes to your own branch\n4. **Push** your work back up to your fork\n5. Submit a **Pull request** so that we can review your changes\n\nNOTE: Be sure to merge the **latest** from **upstream** before making a pull request!\n\n# Donations\n\nIf you enjoy this project and want to thanks, please use follow link:\n\n- [Revolut](https://revolut.me/borysm2b) (best way)\n\n- [PayPal](https://www.paypal.com/donate/?hosted_button_id=6JQ963AU688QN)\n\n# License\n\n[![License](https://img.shields.io/:license-GPLv3-blue.svg?style=flat-square)](https://www.gnu.org/licenses/gpl.html)\n\n- *[GPLv3 license](https://www.gnu.org/licenses/gpl.html)*\n","funding_links":["https://www.paypal.com/donate/?hosted_button_id=6JQ963AU688QN"],"categories":["\u003ca name=\"cpp\"\u003e\u003c/a\u003eC++","C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshajen%2Frtl-sdr-scanner-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshajen%2Frtl-sdr-scanner-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshajen%2Frtl-sdr-scanner-cpp/lists"}