- Сборка и установка GNURadio из GIT под Ubuntu и Debian
- Быстрый старт с RTL-SDR в Linux
- Похожие публикации по теме:
- Как запустить Guake из Double Commander?
- Сниффер Zigbee трафика в Linux
- LAUNCHXL-CC26x2R1 подготовка рабочего окружения в Linux
- Мой список программ для Linux (2 года спустя)
- 2 Ответов в “ Быстрый старт с RTL-SDR в Linux ”
- Добавить комментарий Отменить ответ
- Донец Антон
- A Good Quickstart Guide for RTL-SDR Linux Users
- Related posts:
- 30 comments
Сборка и установка GNURadio из GIT под Ubuntu и Debian
Добрый всем вечер, день или еще!
Тут как-то понадобилось установить программу GNURadio. Конечно я ее установил через «apt install . » и даже попробовал как советует автор GNURadio через PyBOMBS, но в первом случае, нет гарантии, что это будет последняя версия, а во втором возникали ошибки при установке.
Но в любом случае, мне хотелось всегда последнюю версию (хотя последнее, не всегда значит лучше!), да и вообще нравится мне этот фетиш с make )
В общем решил поставить из репозитория GitHub и собрать самостоятельно. Но естественно возникли проблемы со сборкой. То одно не хватает, то другое, то версии не те. В общем всё ругается и не компилируется. А в инете нет нормального описания (я не нашел) по установке.
Но потратив денек, я для себя накатал доку (дабы потом не забыть) и решил поделиться с Вами.
И так я расскажу, как установить и собрать GNURadio и модули для DVB-T USB приемника (у меня обычный приемник с али за 500 руб. и AirSpy R2)
Советы по установке:
1. Пишу по шагам, не пропускать ни одного шага, идем сверху вниз
2. Я скачивал всё в домашнюю папку! (cd
)
3. Где нужен root, там я пишу sudo
4. Проверяйте, что пишется в консоли после каждого шага (вдруг у Вас ошибка)
5. Процесс не быстрый! Нужно терпения и машинку по быстрее. Где-то час у вас уйдет на всё.
Весь процесс я поделил на 6 частей (установок)
1. Инсталлируем GNURadio — процесс долгий, сборка идет долго. Так, что терпения вам
2. Инсталлируем библиотеку RTL-SDR (DVB-T RTL2832U) для приемника
3. Инсталлируем библиотеку LibRtlSdr (Software to turn the RTL2832U into an SDR)
4. Инсталлируем библиотеку GR-OsmoSdr
5. Инсталлируем библиотеку Liquid DSP
6. Заблокировать загрузку стандартных файлов для нашего DVB-T RTL2832U
Часть 1. Инсталлируем GNURadio
Для начала устанавливаем необходимые пакеты (строка длинная)
и далее строчку за строчкой
после make test посмотрите, чтобы не было ошибок!
если нет, то далее…
сейчас мы установили GNURadio. Его можно уже запустить и пользоваться, но нам надо еще собрать и подключить модули для нашего DVB-T приемника.
Часть 2. Инсталлируем библиотеку RTL-SDR (DVB-T RTL2832U)
Тут не должно быть проблем. И библиотека RTL-SDR установлена.
Часть 3. Инсталлируем библиотеку LibRtlSdr
Сделано. Идем далее.
Часть 4. Инсталлируем библиотеку GR-OsmoSdr
Сделано. Идем далее.
Часть 5. Инсталлируем библиотеку Liquid DSP
Сделано. Идем далее.
Часть 6. Заблокировать загрузку стандартных файлов для нашего DVB-T RTL2832U
Открываем (или создаем) файл «/etc/modprobe.d/blacklist-dvb.conf»
и туда вставляем строчки
blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830
и ПЕРЕЗАПУСКАЕМ систему или проще говоря:
Ну вот, вроде процесс закончен и мы можем запустить и проверить наш GNURadio
для этого набираем в консоли:
Источник
Быстрый старт с RTL-SDR в Linux
Сегодня рассмотрим вариант быстрого старта с RTL-SDR донглами на базе RTL2832 в Linux, немного коснемся софта, сделаем проект простого FM приемника в GNU Radio Companion и рассмотрим некоторые варианты доработок и хаков данного приемника. Знаю, что таких статей в интернете немало, но большинство из них обрывочны или не касаются работы в Linux, так что пусть в блоге будет данный материал как напоминалка, если я что-то забуду со временем.
Небольшая ремарка, я пользуюсь дистрибутивом Elementary OS 5.0 Juno на базе Ubuntu 18.04.2 LTS, поэтому все ниже описываемое будет работать для любых Ubuntu-based дистрибутивов.
Для начала рассмотрим технические характеристики RTL-SDR приемника и как его заставить работать в Linux как можно быстрее. Начнем.
- Частоты приема от 24МГц до 1766МГц
- 8-битный АЦП
- Частота дискретизации 3.2MS/s
- Полоса пропускания 2.4МГц
Установка драйвера для работы RTL-SDR
- Открываем терминал и переходим в домашнюю директорию пользователя.
- Обновляем репозитории sudo apt update
- Устанавливаем необходимые утилиты для сборки драйвера
- Устанавливаем libusb-1.0-0-dev библиотека C, дающая общий доступ к USB устройствам
- Получаем и собираем драйвер RTL2832U Osmocom
- Далее нужно внести в blacklist драйвер по умолчанию, который загружается для TV устройства, т.к. он не работает как SDR и будет конфликтовать с новым драйвером. В директории /etc/modprobe.d создаем новый файл blacklist-rtl.conf с одной строкой blacklist dvb_usb_rtl28xxu . После чего необходимо перезагрузить компьютер.
- Теперь можно проверить работу донгла командой rtl_test -t и получим в терминале вот такую картинку:
Запускаем Gqrx для приема сигналов эфира
Установить программу весьма несложно, инструкция здесь. Настройки приемника максимально простые, я не буду подробно останавливаться на их назначении, потому что данная программа использовалась мной лишь для теста. Просто приложу здесь скриншот настроек:
Проверяем на FM диапазоне, если у вас все как на этой картинке, то приемник работает, только не забудьте подключить антенну 🙂
Интересный факт, Gqrx не работает с приемником, включенным через USB2.0 хаб, почему я не выяснил.
В общем то из интересного здесь то, что Gqrx работает на базе GNU Radio — open source инструментария для цифровой обработки сигналов.
Собираем FM приемник в gnuradio-companion
Gnuradio companion (GRC) это программа, которая позволяет в визуальном редакторе собрать схемы обработки сигналов с приемника и прикрутить к ним интерфейс на базе wxWidgets или Qt. Сборка схемы осуществляется базовыми блоками программы. На скриншоте ниже показана, собранная мной, схема обработки сигнала FM и его вывода на звуковую карту моего ноутбука:
Рассмотрим ее немного более подробно. Картинка кликабельна.
Первый блок, который следует добавить в любую схему обработки сигнала, это конечно источник сигнала, из которого будут выбираться отсчеты с определенной частотой дискретизации. Для радиосигнала, это конечно же I и Q квадратуры. В моем случае это RTL-SDR source из категории Sources в правой панели GRC. Настраивается блок двумя переменными samp_rate — частота выборок сигнала, равная 2MS/s, и freq — это частота несущей входного сигнала, я настроился на 102.8МГц.
Для того, чтобы звуковая карта могла что-то принять надо понижать частоту выборок до допустимого значения и делать мы это будем последовательно в нескольких блоках и начнем с блока Rational Resampler (передискретизация с рациональным коэффициентом, находится в разделе resamplers). Понижение частоты выборок осуществляется коэффициентом Decimation (Децимация).
Децима́ция (от лат. decimatio, от decem — «десять») — уменьшение частоты дискретизации дискретного во времени сигнала путём прореживания его отсчётов.
В данном случае будет использоваться коэффициент int(samp_rate/500e3) и в результате получим коэффициент 4. Значение 500e3 было выбрано, исходя из параметра Quadrature Rate демодулятора FM (который устанавливается далее), равного 500ks/s.
Далее в категории Filters ищем блок Low Pass Filter (фильтр нижних частот) и вставляем его в нашу схему. Устанавливаем частоту среза в 100кГц с помощью переменной cutoff.
Теперь подключаем демодулятор сигнала FM из категории modulators, который называется WBFM Receive. В нем по умолчанию параметр Quadrature Rate равен 500кГц, таким его и оставим. Также в этом блоке производится еще раз децимация с коэффициентом 10, что уменьшает частоту выборок до 50ks/s.
После демодулятора нужно передать поток данных в звуковую карту, для этого надо уменьшить частоту выборок сигнала до 48кГц, это тот поток, который может обработать любая современная звуковая карта. И снова для этого будем использовать блок Rational Resampler, только теперь также используем параметр Interpolation (интерполяция, предварительное умножение со сглаживанием) с коэффициентом 48.
Multiply Const (умножитель на константу, находится в разделе math operators) позволяет регулировать громкость, путем изменения параметра Constant, который будет связан с графическим элементом QT GUI Range через его id volume.
И последний блок это Audio Sink, принимает в себя поток данных с определенным Sample Rate и выдает их в звуковую карту компьютера.
Я сперва заметил, но не мог понять, почему некоторые коннекторы блоков синие, а некоторые оранжевые, после нашел почему. Синие относятся к комплексным данным (Complex data, которые имеют реальную и мнимую составляющие). Оранжевые коннекторы показывают тип данных Float. И что самое интересное, в настройках блоков можно явно преобразовывать типы данных.
После запуска схемы получаем вот такой интерфейс нашего приемника:
Максимально простой, но послушать радио уже можно.
Некоторые варианты доработок и хаков с RTL-SDR
Теперь хотел бы оставить несколько ссылок с интересными хаками и модификациями для RTL-SDR приемников, некоторые я уже проделал, некоторые нет, но это уже история для другой статьи.
http://superkuh.com/rtlsdr.html — большая подборка всевозможных доработок и хаков.
https://eax.me/r820t2-module/ — использование тюнера R820T2 в своих проектах.
https://eax.me/rtlsdr-spectrum-analyzer/ — используем RTL-SDR в качестве дешевого анализатора спектра.
https://eax.me/rtlsdr-mod/ — здесь описаны несколько очень простых модификаций приемника.
Думаю, что в ближайшее время будет больше статей по тематике SDR в блоге, так что подписывайтесь на мой канал в telegram и ждите скорых анонсов.
Похожие публикации по теме:
Как запустить Guake из Double Commander?
Сниффер Zigbee трафика в Linux
LAUNCHXL-CC26x2R1 подготовка рабочего окружения в Linux
Мой список программ для Linux (2 года спустя)
2 Ответов в “ Быстрый старт с RTL-SDR в Linux ”
Статья понравилась своей доходчивостью. Хотел подписаться в телеграмме — но не смог.
Добрый день. Канал открыт и доступен по ссылке https://t.me/blog_radiotechkz Чат для общения здесь https://t.me/radiotechkz
Добавить комментарий Отменить ответ
Донец Антон
автор блога, разработчик электроники и программист
Источник
A Good Quickstart Guide for RTL-SDR Linux Users
Recently we found this excellent quick start guide by Kenn Ranous which shows how to set up various RTL-SDR related software programs on (Debian) Linux. The guide shows how to install the drivers, how to install and set up GQRX, CubicSDR, dump1090, Virtual Radar Server, QSpectrum Analyzer and SDR Trunk.
If you are struggling with getting an RTL-SDR to work on a Linux system then this should be a very good starting point.
Related posts:
30 comments
…and yet in 2021 still no definitive simple instructions to make RTL-SDR run from first attempt. The only workable solution so far is to copy image and boot from it. So I guess, like it or not, but for majority of users, who don’t really care about intricacies of the programming Linux is nothing but necessary evil which need to be suffered through or ignored until someone ports code to windows.
Followed tutorial and installed on BunsenLabs Linux for my RTL-SDR dongle. Only snag was PkgConfig not found.
Fixed that by installing using command:
sudo apt-get install pkg-config
Worked fine after that.
Hi! Thank you for sharing this information. I followed the instructions on Linux Mint 20.1 and it worked perfectly the first try.
I’m a beginner both at radio stuff and Linux so I think that the current version of this guide was great!
So please consider trying and don’t be affected too much by the other comments here, as they are older and probably obsolete now.
(in comparison following the official Windows guide previously worked after a few attempts, because the driver didn’t want to do its thing and it was hard and frustrating for me to make it work).
This is for the gqrx
sudo apt-get purge –auto-remove gqrx
sudo apt-get purge –auto-remove gqrx-sdr
sudo apt-get purge –auto-remove libgnuradio*
sudo add-apt-repository -y ppa:bladerf/bladerf
sudo add-apt-repository -y ppa:myriadrf/drivers
sudo add-apt-repository -y ppa:myriadrf/gnuradio
sudo add-apt-repository -y ppa:gqrx/gqrx-sdr
sudo apt-get update
sudo apt-get install gqrx-sdr
sudo apt-get install libvolk1-bin
volk_profile
libvolk1 is now libvolk2, other than that the above can be scraped together and run as one collective script. Successfully done on three different machines and give or take a warning here or there, everything worked like magic
amus.. thats his shit.. jim and mark arent ready to comprehend they can create their own better system! you take it easy and its obvious it aint ‘terminal’ for them ha. good luck dude let go of their ways make your own sweet ride in life. plenty people on that wave now
Linux is a fine O/S. You do need a little techspertise but I find it much more flexible to install and use than Windows. But it all depends on what you’re doing. Either way, I’m hacking on a computer, which is all good by me. I’ve gone through Windows phases and Linux phases. Heck I even went through a BSD phase.
Well its good you’re a hacker Tom H. You’re obviously not very good because you also hab your face as your picture. Good luck getting caught.
How do you know it’s *his* face, clown?
It’s amazing that people complain that an OS that’s free, supported by 1000’s of people, are so dumb that they can’t seem to use a computer that doesn’t do everything for them. Windows does everything wrong for most of the idiots who use it.#( I supported and got paid for helping people to use windows for years, turn the brain off and it won’t work afterwards)
The instructions work fine and if you have a problem then use what Little brain you have to think what commands you are typing.
I have been using various versions of Linux for years because windows didn’t work….I have one machine that can dual boot as an emergency, i use it very occasionally to run something that i can’t do in linux. (so not very often)
UNSTABLE ha ha I can crash windows in seconds running simple programs, its a memory HOG that is crazy. (because the programming is lazy and needs loads of memory and capacity)
RTL-SDR as per the guide works extremely well, if you take the time to consider what and how you install, what hardware you have and the antenna. (you can’t get a radio signal on a piece of pasta)
The instructions work well (with tweaks for different versions of linux) I have used similar on three different installations and cannot complain.
Linux is not perfect NOR is windows. Everyone uses the internet these days and what does the internet run on…… certainly not windows IT RUNS ON LINUX.#
Enjoy using the RTL-SDR with what ever os you use it’s great fun.
John, PLEASE don’t look down your nose at those of us who don’t have computer science degrees. For MANY people the command line isn’t an option due to (A) lack of computer science training or many years of on-the-job IT experience, (B) The very real fear of royally screwing up, even totally “bricking,” your own Linux installation – this has happened to me MANY times over the years I have been a Linux user, (C) All the cryptic commands required to install new packages from the CL, for example, look like nonsense to many intelligent people. I now refuse to enter ANY command I that I don’t understand and can’t fix if something goes wrong. It should be noted by LInux “Gurus” that the CL represents a VERY, VERY STEEP learning curve for uninitiated users! Please think about this.
I am a retired Professor with 2 Doctoral degrees, I’m not a fool just because I CHOOSE to not spend AGES trying to learn and use the extremely cryptic CL! But, I could do it if I wanted to make the substantial effort required.
I have learned that when I exhibit an imperious attitude, I seldom make any useful contribution to solving any problem at hand. Different people simply have different skill sets that they can bring to the table.
You, John, might feel more at home commenting in the Ubuntu forums where the “Command Line Uber Alles” types seem to have taken over.
Now, back to trying to make my brand new SDR work!
Runbux, its really not that hard. You alluded to something important, which is that you choose not to learn. Your credentials are irrelevant.
You don’t need a comp sci degree. I am literally a high school dropout, yet I am the most experienced senior systems administrator in my large company. I have written scripts that my company of 6500+ users totally depends on to deal with company wide issues. The difference is that, while I am NOT a PHD like yourself, I choose to prioritize learning.
The problem isn’t Linux, its your attitude about Linux that limits your experience.
If you choose to change this attitude, the very best advice I can give you is to make linux your daily driver. Use it every day, and use the CLI for everything you can. Over time, you will notice a strange thing happening. First, the CLI will becomes easier to use. Then, you will start to realize its faster then screwing around with the gui. After a few years, you will realize that it is significantly more powerful.
Some things will still always piss you off, like vendors that require convoluted binary blobs to make their hardware work, or convoluted processes, but this is not the fault of Linux, it is the fault of the vendor. The same shit happens on any OS.
When I started using linux, you had to compile everything from source. Those days are so far gone, today my Mother prefers Linux over Windows. If she can do it…… anyone can.
I tried Linux on and off for years,each time I found you have to have ZERO Life to use it.Its a joke unless you like sitting in the same underwear for weeks at a time trying to pretend it is GREAT !
LOL. Thanks for this, Jim. I needed a chuckle today.
you must be doing it wrong. I have been using *nix since the late 90’s. Very anti M$
Ubuntu/Kubuntu is so easy to use nowdays, if it still feels impossible to use, maybe you should stick with your Xbox then and don’t touch a computer. 🙂
As usual, linux falls flat on its face and none of the tutorials end in a working SDR on A Debian / Ubuntu linux mix.
I just went through steps in the 2018 guide on that blog post and it all installed flawlessly on a fresh install of Linux Mint 19 (essentially Debian with some Ubuntu parts thrown in). The one thing I did differently from the guide was to begin with “sudo -i” to go to a root shell so that I didn’t have to type “sudo ” at the beginning of every command. So I ran all the commands as root except for “rtl_test”.
I D K but every install of software that is made through either synaptec or via manual fails, especially where you are expected to `make` the binary, which invariable, by experience of having tried this with about 40 programmes I would like to use, fails every time complaining that either `make` does not exist or it complains of compile errors and dependencies missing that the reported error is meaningless because trying to find an answer leasd to a rabbit hole of chasing your tail.
My philosophy is if you can’t be assed to do the job right (as in provide the binaries ready compiled) then you are only doing half a job.
I have had more success with all in one application images AppImage than installing manually.
I have said this all along that LINUX NEEDS TO GET ITS ACT TOGETHER and stop being cryptic and convoluted in having the end user jump through loopholes to get software working, this is where Microsoft basically shits all over Linux, no real p-roblems appart from when you have not got .net or the right .net but that a self installer away unlike LINUX.
Frankly, I will be ditching LINUX because I am fed up of it breaking constantly, apps that fail to run and also the issue of WINE which worked fist time I installed it from the command line, it worked, perfectly for months until… LINUX UPDATES when and gave it the royal bending over take it like a man routine and shafted it.
THAT IS WHAT IS WRONG WITH USING LINUX, it is TOO unstable and I am SICK OF FANBOYS running to the rescue of the operating system when it is totally flakey, there has not been a solid version of LINUX since 1994, since then it has been morphed in to BLOATWARE and also an OS that is ading FORCED OBSOLESCENCE of hardware that has still got use, just because they are not quad core 64 bit singing and blow job machines, doesn’t matter, LINUX needs to pick up that LEGACY FLAG AGAIN and stop this stupidity of forcing people in to buying more powerful machine because programmers these days can not program efficiently, I can show examples of what I am talking about easily, programming today is atrocious.
There needs to be a COMPLETE RETHINK about how LINUX PROGRAMS are released, the golden rule of KISS seems to have done an A380 on people (gone right over their heads) and KISS is a rule like DRY that happens a hell of a lot with script kiddies these days as thats the baseline, cut and past boiler plate and morph it till it works. NOT GOOD.
why not buy a mac? “it just works” sorry you’re not intelligent enough to do something for yourself.
Not likely, I wouldn’t buy a Mac if you held a gun to my head.
You’d have to shoot me dead before I am caught buying a Mac.
Mark, thanks for taking the time to write this diatribe about Linux. I don’t know how I’ll ever finish this message from my Linux machine, but I’ll try. Use what works for you and just get on.
How much did you pay for that distro of linux you are running? I’d switch to windows if I were you. The linux community who are thousands of individuals, most of whom probably don’t get paid for all their work and give it away for free, probably don’t care that you can’t get things to work.
fuck youl havea heart attack brah, hey its a learning thig and morphing it till it works is actually smart. sudo apt get goggle me that shit
kenn cheers man. great little easy to install run and enjoy,thankyou for your hard effort
well linux isnt perfect, but at least the “CEO” isnt actively trying to kill 1,350,000,000 and seeking dontations to help, like bill gates is, https://www.youtube.com/watch?v=iMl0ty6evhU
and there are many more he cant keep his mouth shiut about it.
at least linux doesnt activly tell people they are opeb source only to janm your device full of other open souce software they make, that you can neither delete or prevent it them from sucking each and ever piece of data up generated so they can make sure the CIA and NSA have a copy` cause they sold their soul before even exiting the whomb like google, https://medium.com/insurge-intelligence/how-the-cia-made-google-e836451a959e
at least they let the free market do its thing, insuring a diverse range of products instead of super high end, very expensive products only to suck people into the company while their prices rise, and specs fall, meanwhile the CEO that created all these things, knew that they were dangerous enough to never let his own children have one of the devices, while selling phones with instructions saying “dont not hold next to your head” and quietly pushing updates that make their products shitter and shitter with each passing day, because they need more of the money you work hard to prevent the goverment taking to build bombs to drop on mud houses of poor people.
and finaillly they arent actively working with other companies and all goverments to remove your rights, freedoms, privacy, and free access to information-all the things that were originally wonderfull about the tech revolution, like apple, google, microsoft and others are.
and the bonus is you can hold your head a little higher knowing your not actively funding these assholes and their power hungry agenda.
so yeah fuck linux
amus.. thats his shit.. jim and mark arent ready to comprehend they can create their own better system! you take it easy and its obvious it aint ‘terminal’ for them ha. good luck dude let go of their ways make your own sweet ride in life. plenty people on that wave now
Kristen, Obviously im partial to Linux now, but only after 21years of osx. But Apple’s planned obselence of their devices and anti repair attitude is what finally pushed me out the door, but only after having to sue them (And win) then later buying a $500 iPod touch only to learn 2 weeks later the newer version was 64bit, and so was their new iOS, making manufactures choose between a 64bit update-or nothing, throwing me out in the cold, especially as it was used as a wifi phone (via apps) and 2nd as an iPod. But to me it seems like most should know bill gates wants you dead, via vaccines or GMOs, well anyway possible as long as he can make some money off your rotting corpse-even if death hasn’t taken a hold of you yet.
This is a chance for the average person to take a stand against someone who is everything most people despise in the world. A thief for 1 as he stole windows from Xerox, 2 as someone who has intentionally maimed AT LEAST 49500 CHILDREN in india, AT LEAST, https://www.corbettreport.com/fact-check-polio-vaccines-tetanus-vaccines-and-the-gates-foundation/
And that doesn’t include his work in Africa of now the USA and the rest of the world.
He is a technocrat actively working to overthrow all the world’s governments for “the great reset” whos leader recently openly stated, in 10 years you will own nothing, you that is, they the select few will own everything, and you will rent anything and everything you need from them, provided you survive the vaccines. He is openly ecstatic about the lockdowns and the buisness, .ca,lilies, lives, economies being destroyed, he finds it hillarious that people are walking around wearing masks that have in the neighborhood of 50 peer reviewed studies all saying there are severe health risks associated with wearing them, I can go on and on. But this is a chance for the little guy (all of us) to put our money where our heart is, and I’m deeply saddened to see so few seem to give a shit, not only about their friends or families, but innocent strangers, mother earth, or if the personification of satan here on earth can continue to rake in the money he then uses to destroy all of us, regardless if we even use a computer of not. I feel let down by mankind.
wow mark im a linux girl love it. im completely new to it but had no problem setting this up in less than 20 mis now im enjoying the lovely warble of the local constabulary,, riveting listening, linux windows man its turning into a scene ffs people just great we all different ay how awful if we all had to sit around in our undies like jim.
That’s a well written guide, covering most of what an RTL-SDR user should do in Linux to get things running well. As to his next edition, perhaps he can dig deeper into using Gqrx and CubicSDR. In my own experience, the hardest tasks for Linux and RTL-SDRs are making sure the dependencies are met if not getting apps from the repositories.
Often, the apps in Linux require a string of startup arguments. Being one who is happy when complex things just work, I like to use scripts. A good script may ask a question or two about what you want to tune, then handle the long string of parameters the app needs.
Источник