https://wiki.gnuradio.org/api.php?action=feedcontributions&user=Argilo&feedformat=atomGNU Radio - User contributions [en]2024-03-29T15:36:05ZUser contributionsMediaWiki 1.39.5https://wiki.gnuradio.org/index.php?title=InstallingGR&diff=13541InstallingGR2023-10-31T19:59:27Z<p>Argilo: /* Quick Start */ Update to Ubuntu 23.10</p>
<hr />
<div><div style="float:right"><br />
{{Template:BeginnerTutorials}}<br />
</div><br />
= Quick Start =<br />
{| class="wikitable"<br />
|+<br />
! Platform !! Method !! GNU Radio version <br />
|- <br />
|rowspan=2 style="background-color:#eaecf0;"| [[File:Debian.png|32px|middle|link=]] '''Debian''' ≥12<br>[[File:Ubuntu.png|32px|middle|link=]] '''Ubuntu''' ≥22.04<br>[[File:LinuxMint.png|32px|middle|link=]] '''Linux Mint''' ≥21.1<br>[[File:RaspberryPi.png|32px|middle|link=]]'''Raspberry Pi OS'''<sub>64-bit</sub> ≥2021-10-30<br />
|rowspan=2| <syntaxhighlight lang="shell">sudo apt-get install gnuradio</syntaxhighlight><br />
||Ubuntu 22.04: v3.10.1.1<br />
|-<br />
||Ubuntu 23.10: v3.10.7.0<br />
|-<br />
|style="background-color:#eaecf0;"| [[File:Ubuntu.png|32px|middle|link=]] '''Ubuntu''' 20.04<br><small>Consider [https://ubuntu.com/tutorials/upgrading-ubuntu-desktop#1-before-you-start upgrading] your Ubuntu</small><br><br>[[File:Ubuntu.png|32px|middle|link=]] '''Ubuntu''' 22.04<br />
||<br />
<syntaxhighlight lang="shell"><br />
sudo add-apt-repository ppa:gnuradio/gnuradio-releases<br />
sudo apt-get update<br />
sudo apt-get install gnuradio python3-packaging<br />
</syntaxhighlight><br />
||v3.10.7.0<br />
|-<br />
|style="background-color:#eaecf0;"| [[File:Tux.png|32px|middle|link=]] '''Other Linux Distros'''<br />
||<br />
<syntaxhighlight lang="shell"><br />
sudo {apt,dnf,yay,emerge,…} install gnuradio<br />
</syntaxhighlight><br />
|| See [https://repology.org/project/gnuradio/badges this table]<br />
|-<br />
|style="background-color:#eaecf0;"| [[File:Windows.png|32px|middle|link=]] '''Windows'''<br />
||<br />
Run [https://github.com/ryanvolz/radioconda/releases/download/2023.07.26/radioconda-2023.07.26-Windows-x86_64.exe Windows Radioconda installer]<br><br />
and launch "GNU Radio Companion" from the Start menu<br />
|rowspan=3|v3.10.8.0<br />
|-<br />
|rowspan=2 style="background-color:#eaecf0;"| [[File:MacOS.png|32px|middle|link=]] '''macOS'''<br />
| Intel: Run [https://github.com/ryanvolz/radioconda/releases/download/2023.07.26/radioconda-2023.07.26-MacOSX-x86_64.pkg macOS Radioconda installer (x86_64)]<br />
|-<br />
| Apple Silicon: Run [https://github.com/ryanvolz/radioconda/releases/download/2023.07.26/radioconda-2023.07.26-MacOSX-arm64.pkg macOS Radioconda installer (aarch64)]<br />
|}<br />
<br />
= Other Installation Methods =<br />
<br />
== Platform-specific guides ==<br />
<br />
* [[LinuxInstall|Linux install guide]]<br />
* [[WindowsInstall|Windows install guide]]<br />
* [[MacInstall|Mac OS X install guide]]<br />
<br />
== Cross-platform guides ==<br />
<br />
* [[CondaInstall|Conda install guide]]<br />
* [https://github.com/gnuradio/pybombs#pybombs PyBOMBS] - Note: We are no longer including PyBOMBS as a recommended method of installing GNU Radio, unless you want to play around with old versions (e.g. GR 3.7, 3.8, and OOTs of matching version)<br />
<br />
== VMs and Live Images ==<br />
Over the years a number of Live Images and VMs have been created. There are currently no official versions but here are some current options:<br />
*[https://github.com/bastibl/instant-gnuradio Instant GNU Radio] A customizable, programmatically generated VM and live environment for GNU Radio. <br />
*[[UbuntuVM]] An Ubuntu 20.04 virtual machine image with GNU Radio 3.8.2.0, Fosphor, GQRX, and several other useful pieces of software. (Created using Instant GNU Radio)<br />
<br />
= OK, it's installed, what now? =<br />
<br />
If the installation worked without any trouble, you're ready to use GNU Radio! If you have no idea how to do that, the best place to start is with the [[Tutorials]].<br />
<br />
Optionally, you may run <code>volk_profile</code> on your terminal to help libvolk to determine the optimal kernels (may speed up GNU Radio). <br />
<br />
[[Category:Installation]]<br />
[[Category:Guide]]</div>Argilohttps://wiki.gnuradio.org/index.php?title=InstallingGR&diff=13540InstallingGR2023-10-31T19:57:27Z<p>Argilo: /* Quick Start */ Update conda version</p>
<hr />
<div><div style="float:right"><br />
{{Template:BeginnerTutorials}}<br />
</div><br />
= Quick Start =<br />
{| class="wikitable"<br />
|+<br />
! Platform !! Method !! GNU Radio version <br />
|- <br />
|rowspan=2 style="background-color:#eaecf0;"| [[File:Debian.png|32px|middle|link=]] '''Debian''' ≥12<br>[[File:Ubuntu.png|32px|middle|link=]] '''Ubuntu''' ≥22.04<br>[[File:LinuxMint.png|32px|middle|link=]] '''Linux Mint''' ≥21.1<br>[[File:RaspberryPi.png|32px|middle|link=]]'''Raspberry Pi OS'''<sub>64-bit</sub> ≥2021-10-30<br />
|rowspan=2| <syntaxhighlight lang="shell">sudo apt-get install gnuradio</syntaxhighlight><br />
||Ubuntu 22.04: v3.10.1.1<br />
|-<br />
||Ubuntu 23.04: v3.10.5.1<br />
|-<br />
|style="background-color:#eaecf0;"| [[File:Ubuntu.png|32px|middle|link=]] '''Ubuntu''' 20.04<br><small>Consider [https://ubuntu.com/tutorials/upgrading-ubuntu-desktop#1-before-you-start upgrading] your Ubuntu</small><br><br>[[File:Ubuntu.png|32px|middle|link=]] '''Ubuntu''' 22.04<br />
||<br />
<syntaxhighlight lang="shell"><br />
sudo add-apt-repository ppa:gnuradio/gnuradio-releases<br />
sudo apt-get update<br />
sudo apt-get install gnuradio python3-packaging<br />
</syntaxhighlight><br />
||v3.10.7.0<br />
|-<br />
|style="background-color:#eaecf0;"| [[File:Tux.png|32px|middle|link=]] '''Other Linux Distros'''<br />
||<br />
<syntaxhighlight lang="shell"><br />
sudo {apt,dnf,yay,emerge,…} install gnuradio<br />
</syntaxhighlight><br />
|| See [https://repology.org/project/gnuradio/badges this table]<br />
|-<br />
|style="background-color:#eaecf0;"| [[File:Windows.png|32px|middle|link=]] '''Windows'''<br />
||<br />
Run [https://github.com/ryanvolz/radioconda/releases/download/2023.07.26/radioconda-2023.07.26-Windows-x86_64.exe Windows Radioconda installer]<br><br />
and launch "GNU Radio Companion" from the Start menu<br />
|rowspan=3|v3.10.8.0<br />
|-<br />
|rowspan=2 style="background-color:#eaecf0;"| [[File:MacOS.png|32px|middle|link=]] '''macOS'''<br />
| Intel: Run [https://github.com/ryanvolz/radioconda/releases/download/2023.07.26/radioconda-2023.07.26-MacOSX-x86_64.pkg macOS Radioconda installer (x86_64)]<br />
|-<br />
| Apple Silicon: Run [https://github.com/ryanvolz/radioconda/releases/download/2023.07.26/radioconda-2023.07.26-MacOSX-arm64.pkg macOS Radioconda installer (aarch64)]<br />
|}<br />
<br />
= Other Installation Methods =<br />
<br />
== Platform-specific guides ==<br />
<br />
* [[LinuxInstall|Linux install guide]]<br />
* [[WindowsInstall|Windows install guide]]<br />
* [[MacInstall|Mac OS X install guide]]<br />
<br />
== Cross-platform guides ==<br />
<br />
* [[CondaInstall|Conda install guide]]<br />
* [https://github.com/gnuradio/pybombs#pybombs PyBOMBS] - Note: We are no longer including PyBOMBS as a recommended method of installing GNU Radio, unless you want to play around with old versions (e.g. GR 3.7, 3.8, and OOTs of matching version)<br />
<br />
== VMs and Live Images ==<br />
Over the years a number of Live Images and VMs have been created. There are currently no official versions but here are some current options:<br />
*[https://github.com/bastibl/instant-gnuradio Instant GNU Radio] A customizable, programmatically generated VM and live environment for GNU Radio. <br />
*[[UbuntuVM]] An Ubuntu 20.04 virtual machine image with GNU Radio 3.8.2.0, Fosphor, GQRX, and several other useful pieces of software. (Created using Instant GNU Radio)<br />
<br />
= OK, it's installed, what now? =<br />
<br />
If the installation worked without any trouble, you're ready to use GNU Radio! If you have no idea how to do that, the best place to start is with the [[Tutorials]].<br />
<br />
Optionally, you may run <code>volk_profile</code> on your terminal to help libvolk to determine the optimal kernels (may speed up GNU Radio). <br />
<br />
[[Category:Installation]]<br />
[[Category:Guide]]</div>Argilohttps://wiki.gnuradio.org/index.php?title=InstallingGR&diff=12945InstallingGR2023-02-08T17:34:18Z<p>Argilo: Update PPA version</p>
<hr />
<div><div style="float:right"><br />
{{Template:BeginnerTutorials}}<br />
</div><br />
= Quick Start =<br />
{| class="wikitable"<br />
|+ <br />
! Ubuntu 22.04<br />
||<br />
# <code>sudo apt-get install gnuradio</code><br />
||v3.10.1.1<br />
|-<br />
! Ubuntu 20.04<br />
||<br />
# <code>sudo add-apt-repository ppa:gnuradio/gnuradio-releases</code><br />
# <code>sudo apt-get update</code><br />
# <code>sudo apt-get install gnuradio python3-packaging</code><br />
||v3.10.5.1<br />
|-<br />
! Windows<br />
||<br />
# Install the latest [https://github.com/ryanvolz/radioconda/releases Radioconda installer]<br />
# Launch "GNU Radio Companion" from the Start menu<br />
||v3.10.5.1<br />
|-<br />
! macOS<br />
||<br />
# [https://brew.sh/ Install Homebrew]<br />
# <code>brew install gnuradio</code><br />
||v3.10.5.1<br />
|}<br />
<br />
= Other Installation Methods =<br />
<br />
== Platform-specific guides ==<br />
<br />
* [[LinuxInstall|Linux install guide]]<br />
* [[WindowsInstall|Windows install guide]]<br />
* [[MacInstall|Mac OS X install guide]]<br />
<br />
== Cross-platform guides ==<br />
<br />
* [[CondaInstall|Conda install guide]]<br />
* [https://github.com/gnuradio/pybombs#pybombs PyBOMBS] - Note: We are no longer including PyBOMBS as a recommended method of installing GNU Radio, unless you want to play around with old versions (e.g. GR 3.7, 3.8, and OOTs of matching version)<br />
<br />
== VMs and Live Images ==<br />
Over the years a number of Live Images and VMs have been created. There are currently no official versions but here are some current options:<br />
*[https://github.com/bastibl/instant-gnuradio Instant GNU Radio] A customizable, programmatically generated VM and live environment for GNU Radio. <br />
*[[UbuntuVM]] An Ubuntu 20.04 virtual machine image with GNU Radio 3.8.2.0, Fosphor, GQRX, and several other useful pieces of software. (Created using Instant GNU Radio)<br />
<br />
= OK, it's installed, what now? =<br />
<br />
If the installation worked without any trouble, you're ready to use GNU Radio! If you have no idea how to do that, the best place to start is with the [[Tutorials]].<br />
<br />
Optionally, you may run <code>volk_profile</code> on your terminal to help libvolk to determine the optimal kernels (may speed up GNU Radio). <br />
<br />
[[Category:Installation]]<br />
[[Category:Guide]]</div>Argilohttps://wiki.gnuradio.org/index.php?title=InstallingGR&diff=12920InstallingGR2023-01-27T14:15:51Z<p>Argilo: Update Windows version</p>
<hr />
<div><div style="float:right"><br />
{{Template:BeginnerTutorials}}<br />
</div><br />
= Quick Start =<br />
{| class="wikitable"<br />
|+ <br />
! Ubuntu 22.04<br />
||<br />
# <code>sudo apt-get install gnuradio</code><br />
||v3.10.1.1<br />
|-<br />
! Ubuntu 20.04<br />
||<br />
# <code>sudo add-apt-repository ppa:gnuradio/gnuradio-releases</code><br />
# <code>sudo apt-get update</code><br />
# <code>sudo apt-get install gnuradio python3-packaging</code><br />
||v3.10.5.0<br />
|-<br />
! Windows<br />
||<br />
# Install the latest [https://github.com/ryanvolz/radioconda/releases Radioconda installer]<br />
# Launch "GNU Radio Companion" from the Start menu<br />
||v3.10.5.1<br />
|-<br />
! macOS<br />
||<br />
# [https://brew.sh/ Install Homebrew]<br />
# <code>brew install gnuradio</code><br />
||v3.10.5.1<br />
|}<br />
<br />
= Other Installation Methods =<br />
<br />
== Platform-specific guides ==<br />
<br />
* [[LinuxInstall|Linux install guide]]<br />
* [[WindowsInstall|Windows install guide]]<br />
* [[MacInstall|Mac OS X install guide]]<br />
<br />
== Cross-platform guides ==<br />
<br />
* [[CondaInstall|Conda install guide]]<br />
* [https://github.com/gnuradio/pybombs#pybombs PyBOMBS] - Note: We are no longer including PyBOMBS as a recommended method of installing GNU Radio, unless you want to play around with old versions (e.g. GR 3.7, 3.8, and OOTs of matching version)<br />
<br />
== VMs and Live Images ==<br />
Over the years a number of Live Images and VMs have been created. There are currently no official versions but here are some current options:<br />
*[https://github.com/bastibl/instant-gnuradio Instant GNU Radio] A customizable, programmatically generated VM and live environment for GNU Radio. <br />
*[[UbuntuVM]] An Ubuntu 20.04 virtual machine image with GNU Radio 3.8.2.0, Fosphor, GQRX, and several other useful pieces of software. (Created using Instant GNU Radio)<br />
<br />
= OK, it's installed, what now? =<br />
<br />
If the installation worked without any trouble, you're ready to use GNU Radio! If you have no idea how to do that, the best place to start is with the [[Tutorials]].<br />
<br />
Optionally, you may run <code>volk_profile</code> on your terminal to help libvolk to determine the optimal kernels (may speed up GNU Radio). <br />
<br />
[[Category:Installation]]<br />
[[Category:Guide]]</div>Argilohttps://wiki.gnuradio.org/index.php?title=InstallingGR&diff=12919InstallingGR2023-01-27T14:11:47Z<p>Argilo: Update version numbers</p>
<hr />
<div><div style="float:right"><br />
{{Template:BeginnerTutorials}}<br />
</div><br />
= Quick Start =<br />
{| class="wikitable"<br />
|+ <br />
! Ubuntu 22.04<br />
||<br />
# <code>sudo apt-get install gnuradio</code><br />
||v3.10.1.1<br />
|-<br />
! Ubuntu 20.04<br />
||<br />
# <code>sudo add-apt-repository ppa:gnuradio/gnuradio-releases</code><br />
# <code>sudo apt-get update</code><br />
# <code>sudo apt-get install gnuradio python3-packaging</code><br />
||v3.10.5.0<br />
|-<br />
! Windows<br />
||<br />
# Install the latest [https://github.com/ryanvolz/radioconda/releases Radioconda installer]<br />
# Launch "GNU Radio Companion" from the Start menu<br />
||v3.10.5.0<br />
|-<br />
! macOS<br />
||<br />
# [https://brew.sh/ Install Homebrew]<br />
# <code>brew install gnuradio</code><br />
||v3.10.5.1<br />
|}<br />
<br />
= Other Installation Methods =<br />
<br />
== Platform-specific guides ==<br />
<br />
* [[LinuxInstall|Linux install guide]]<br />
* [[WindowsInstall|Windows install guide]]<br />
* [[MacInstall|Mac OS X install guide]]<br />
<br />
== Cross-platform guides ==<br />
<br />
* [[CondaInstall|Conda install guide]]<br />
* [https://github.com/gnuradio/pybombs#pybombs PyBOMBS] - Note: We are no longer including PyBOMBS as a recommended method of installing GNU Radio, unless you want to play around with old versions (e.g. GR 3.7, 3.8, and OOTs of matching version)<br />
<br />
== VMs and Live Images ==<br />
Over the years a number of Live Images and VMs have been created. There are currently no official versions but here are some current options:<br />
*[https://github.com/bastibl/instant-gnuradio Instant GNU Radio] A customizable, programmatically generated VM and live environment for GNU Radio. <br />
*[[UbuntuVM]] An Ubuntu 20.04 virtual machine image with GNU Radio 3.8.2.0, Fosphor, GQRX, and several other useful pieces of software. (Created using Instant GNU Radio)<br />
<br />
= OK, it's installed, what now? =<br />
<br />
If the installation worked without any trouble, you're ready to use GNU Radio! If you have no idea how to do that, the best place to start is with the [[Tutorials]].<br />
<br />
Optionally, you may run <code>volk_profile</code> on your terminal to help libvolk to determine the optimal kernels (may speed up GNU Radio). <br />
<br />
[[Category:Installation]]<br />
[[Category:Guide]]</div>Argilohttps://wiki.gnuradio.org/index.php?title=ControlPort&diff=12676ControlPort2022-12-01T20:29:34Z<p>Argilo: Remove reference to obsolete Thrift patch</p>
<hr />
<div>= ControlPort =<br />
<br />
ControlPort is a new interface for standardizing remote procedure calls in GNU Radio:<br />
<br />
* Remote control and visualization.<br />
* Use of ControlPort to enable debugging without requiring extra debug streams.<br />
* Abstracted interface for different back-end solutions.<br />
* No additional CPU usage while no monitoring is occurring.<br />
* Can connect multiple remotes to same GNU Radio application.<br />
* Can also have single ControlPort app control multiple GR apps.<br />
<br />
Each block defines interfaces to control data members.<br />
<br />
Defines ‘get’ and ‘set’ interface to query and update values of blocks.<br />
<br />
Currently, we are using the Apache Thrift project for the ControlPort backend. See below for details.<br />
<br />
Use preference files to control the state of ControlPort:<br />
<br />
* Edit section [ControlPort] in gnuradio-runtime.conf.<br />
** on: Set to True/On/1 or False/Off/0. Default=False.<br />
** edges_list: toggle exporting list of flowgraph edges (used by gr-perf-monitorx).<br />
<br />
Comes with a generic utility to allow you to see all interfaces of a flowgraph (make sure firewalls are set up to allow the connection):<br />
<br />
* gr-ctrlport-monitor <ip address or host name> <port><br />
** Tables lists all interfaces.<br />
** Update time defaults to 1 second and can be changed through the top menu.<br />
** Double clicking will open up an interfaces default GUI style handler (if it doesn't, no default exists).<br />
** Right click on an item will pop up a menu to select which type of plot to use.<br />
** Drag-and-drop any item on an existing graph to plot multiple items.<br />
** 'Tile' button or Ctrl-t will tile all open windows.<br />
<br />
* gr-perf-monitorx <ip address or host name> <port><br />
** Shows graph of the remote flowgraph.<br />
*** Blue nodes are blocks, and the size is proportional to the 'work time' performance counter.<br />
*** Red edges are buffers, and the size and darkness are proportional to the '% output buffer full" performance counter.<br />
** Updates every 1 second.<br />
** Change type of performance counter statistic: instantaneous, average, or variance.<br />
** Change the clock used in the performance counters.<br />
*** Thread is how much compute time is spent in a block's work function.<br />
*** Monotonic is how much wall clock time has passed between entering and exiting work.<br />
** Can open Runtime and Buffer Tables to see table or bar graphs of percent of each perf counter.<br />
** Can drag-and-drop blocks around the canvas to reorganize the display.<br />
** Reset button resets the performance counter stats.<br />
** Pause button stops the remote flowgraph; click again to restart.<br />
** 'Tile' button or Ctrl-t will tile all open windows.<br />
<br />
== Apache Thrift ==<br />
<br />
ControlPort requires a [https://thrift.apache.org/ Thrift] version of 0.9.2 or greater. On many systems, this is not the default version shipped with the OS, so we will need to install it. The [https://github.com/gnuradio/recipes/blob/master/apache-thrift.lwr PyBOMBS recipe] builds an acceptable version.<br />
<br />
To manually install the required version of Thrift on Ubuntu 14.04:<br />
<br />
* Install some additional dependencies:<br />
** apt-get install bison flex libevent-dev<br />
** Install "python-twisted" package (it provide the "trial" package that thrift requires and it fails silently if it does not find it...)<br />
** I also had to install "openssl-devel" (it contains the "libcrypto" library that thrift requires) on Fedora<br />
** Install libtool (if not already present on your system)<br />
* Clone the repo and check out version 0.9.2:<br />
** <code>git clone https://github.com/apache/thrift.git thrift</code><br />
** <code>cd thrift</code><br />
** <code>git checkout 0.9.2</code><br />
* Configure:<br />
** <code>./bootstrap</code><br />
** <code>./configure --prefix=$prefix PY_PREFIX=$prefix --with-cpp --with-python CXXFLAGS="-DNDEBUG"</code><br />
* Make sure C++ and Python Libraries are supported.<br />
* Build and install:<br />
** <code>make</code><br />
** <code>sudo make install</code><br />
<br />
Normally, you can install using <code>$prefix=/usr</code>. If using anything other than that, you also need the <code>PY_PREFIX</code> set because Thrift ignores the normal <code>--prefix</code> for Python installations and this forces the issue.<br />
<br />
Depending on your linux distribution, thrift's configure system fails to set the suffixes for Boost's unittest library correctly. You can fix that by hand, or work around it by disabling tests. Similar issues arise from the tutorials being built, lua and perl bindings; PyBOMBS disables those. To make thrift build without modification, I had to disable all this on a fedora 21:<br />
<br />
<code>/configure --prefix=/home/marcus/.usrlocal --disable-tests --with-lua=no --disable-tutorial --with-perl=no </code><br />
<br />
This installs the Python files into <code>$prefix/lib/python2.7/site-packages</code>, which may not be in <code>PYTHONPATH</code>, so add it:<br />
<br />
* <code>export PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/site-packages</code><br />
<br />
Or, to make it sticky between reboots, add the same line to your .bashrc file. If using pybombs, consider "source-ing" a generated environment file (pybombs env) ala<br />
<br />
* source $prefix/setup_env.sh<br />
<br />
=== Building GNU Radio ===<br />
<br />
When building GNU Radio, make sure that the build script is picking up Thrift and running everything properly. When cmake finishes, it prints out a list of enabled components, and you should see this:<br />
<br />
<pre>-- ######################################################<br />
-- # Gnuradio enabled components <br />
-- ######################################################<br />
-- * python-support<br />
-- * testing-support<br />
-- * gnuradio-runtime<br />
-- * gr-ctrlport<br />
-- * * thrift<br />
.... (more components)</pre><br />
If you don't see the "* * thrift" at this stage, cmake did not find the necessary C++ and Python support. Look back at the full cmake output to find the section on ControlPort. A successful configuration looks like:<br />
<br />
<pre>-- Configuring gr-ctrlport support...<br />
-- Dependency Boost_FOUND = 1<br />
-- Dependency SWIG_FOUND = TRUE<br />
-- Dependency SWIG_VERSION_CHECK = TRUE<br />
-- Dependency ENABLE_GNURADIO_RUNTIME = ON<br />
-- Enabling gr-ctrlport support.<br />
-- Override with -DENABLE_GR_CTRLPORT=ON/OFF<br />
-- Loading build date Thu, 06 Aug 2015 16:47:33 into constants...<br />
-- Loading version 3.7.8 into constants...<br />
-- <br />
-- Python checking for Thrift<br />
-- Python checking for Thrift - found<br />
-- Found and enabling Thrift backend to ControlPort<br />
-- Running thrift to build C++ bindings</pre><br />
If you have installed GNU Radio already, you can check to see what components are available and look for "* thrift" in this list:<br />
<br />
<pre>gnuradio-config-info --enabled-components<br />
python-support;testing-support;volk;gnuradio-runtime;gr-ctrlport;* thrift;... (more components)</pre></div>Argilohttps://wiki.gnuradio.org/index.php?title=Time_Delta&diff=12643Time Delta2022-11-01T14:53:56Z<p>Argilo: Fix typo</p>
<hr />
<div><code>Added in 3.10</code><br><br />
<br />
Compute system time differences and provide statistics upon completion.<br />
This block computes the difference between the current system time and a defined PDU key previously added (e.g.: by by the add_system_time block). This is useful for benchmarking PDU operations. The block also maintains running estimates of mean and variance, accessible by getters and printed when the flowgraph is stopped.<br />
<br />
== Parameters ==<br />
<b>(''R''):</b> <span class="plainlinks">[https://wiki.gnuradio.org/index.php/GNURadioCompanion#Variable_Controls ''Run-time adjustable'']</span><br />
<br />
; Time Delta Key<br />
: default: "time_delta_ms"<br />
<br />
; Time Key<br />
: default: "system_time"<br />
<br />
== Messages ==<br />
<br />
=== Inputs ===<br />
<br />
; pdu<br />
: input message<br />
<br />
=== Outputs ===<br />
<br />
; pdu<br />
: output message<br />
<br />
== Example Flowgraph ==<br />
<br />
This flowgraph can be found at [https://raw.githubusercontent.com/gnuradio/gnuradio/master/gr-pdu/examples/pdu_tools_demo.grc]<br />
<br />
[[File:Pdu_tools_demo_fg.png|800px]]<br />
<br />
== Example Output ==<br />
<br />
[[File:Pdu_tools_demo_out.png|800px]]<br />
<br />
== Source Files ==<br />
<br />
; C++ files<br />
: [https://github.com/gnuradio/gnuradio TODO]<br />
<br />
; Header files<br />
: [https://github.com/gnuradio/gnuradio TODO]<br />
<br />
; Public header files<br />
: [https://github.com/gnuradio/gnuradio TODO]<br />
<br />
; Block definition<br />
: [https://github.com/gnuradio/gnuradio/blob/master/gr-pdu/grc/pdu_time_delta.block.yml]<br />
<br />
[[Category:Block Docs]]</div>Argilohttps://wiki.gnuradio.org/index.php?title=InstallingGR&diff=12627InstallingGR2022-10-24T00:40:36Z<p>Argilo: Update Homebrew version</p>
<hr />
<div><div style="float:right"><br />
{{Template:BeginnerTutorials}}<br />
</div><br />
<br />
{| class="wikitable"<br />
|+ Install Quickstart<br>(Refer to the rest of this page for more OS and installation options)<br />
! Ubuntu 22.04<br />
||<br />
# <code>sudo apt-get install gnuradio</code><br />
||v3.10.1<br />
|-<br />
! Ubuntu 20.04<br />
||<br />
# <code>sudo add-apt-repository ppa:gnuradio/gnuradio-releases</code><br />
# <code>sudo apt-get update</code><br />
# <code>sudo apt-get install gnuradio python3-packaging</code><br />
||v3.10.4<br />
|-<br />
! Windows<br />
||<br />
# Install the latest [https://github.com/ryanvolz/radioconda/releases Radioconda installer]<br />
# Launch "GNU Radio Companion" from the Start menu<br />
||v3.10.4<br />
|-<br />
! macOS<br />
||<br />
# [https://brew.sh/ Install Homebrew]<br />
# <code>brew install gnuradio</code><br />
||v3.10.4<br />
|}<br />
<br />
<br />
= Types of Installation Methods =<br />
<br />
The recommended way to install GNU Radio on most platforms is using already available binary packages. Find your platform below in the [[#From_Binaries|From Binaries]] section for instructions on how to get GNU Radio through your regular package manager (e.g. [[#Ubuntu_PPA_Installation|Ubuntu PPA Installation]]), or visit the [[CondaInstall|Conda Installation]] page for instructions on how to use the Conda package manager to install GNU Radio on any Linux distribution, macOS, or Windows. For some platforms there are no binaries provided by available package managers or the GNU Radio project. In these cases please contact the maintainer of the package manager or the GNU Radio project to find a sensible way to provide binaries for your platform.<br />
<br />
In addition to using binaries, GNU Radio can be installed:<br />
<br />
# '''[[#From_Source|From source]]''' (for those who want full control)<br />
# '''[[#Using_PyBOMBS|Using PyBOMBS]]''' (for those who want it built from source and/or installed to a specific directory using a script)<br />
<br />
= From Binaries =<br />
<br />
== Linux ==<br />
<br />
Most distributions contain a package named <code>gnuradio</code> or similar in their standard repositories. For most use cases it is enough to install this package and start developing.<br />
<br />
The development of GNU Radio can be fast-paced, and binaries provided by your distribution may be outdated. '''Do check if the version you're installing is up to date! Sometimes old versions are not updated in the packaging systems.''' If you find a bug in a older GNU Radio version, please check if the bug still exists in the newer version of GNU Radio before filing a new issue.<br />
<br />
If the version shipped in your distribution is outdated please contact the corresponding maintainer to update it in the packaging system.<br />
<br />
Here are examples of how to install GNU Radio in various Linux distributions. <b>Click the link under &quot;Distribution&quot; for how to install dependencies.</b><br />
<br />
{|class="wikitable" style="margin: auto; width: 90%;"<br />
!scope="col"|Distribution<br />
!scope="col"|Command<br />
|-<br />
| [[UbuntuInstall|Debian/Ubuntu and derivates]]<br />
| <pre># apt install gnuradio</pre><br />
|-<br />
| [[FedoraInstall|Fedora]]<br />
| <pre># dnf install gnuradio</pre><br />
|-<br />
| RHEL/CentOS/Rocky Linux/AlmaLinux<br />
| <pre># yum install gnuradio</pre><br />
|-<br />
| [[ArchInstall|Archlinux]]<br />
| <pre># pacman -S gnuradio</pre><br />
|-<br />
| [[GentooInstall|Gentoo Linux]]<br />
| <pre># emerge net-wireless/gnuradio</pre><br />
|-<br />
| [[SuseInstall|Suse Linux]]<br />
| <br />
|-<br />
| [[InstallingGRFromSource_on_Raspberry_Pi|Raspberry Pi OS]]<br />
| <br />
|-<br />
|}<br />
<br />
On other distributions, simply use the appropriate package management command to install the <code>gnuradio</code> package and then please add it to this list. If you need newer versions or have a different platform please contact the package maintainer of your distribution or raise your issue on the mailing list.<br />
<br />
=== Ubuntu PPA Installation ===<br />
For Ubuntu, the latest builds (both released and pulled from master branch) are maintained as PPAs on [https://launchpad.net/~gnuradio launchpad].<br><br />
<b>Be sure to uninstall any previously installed versions of gnuradio first.</b> See [[UnInstallGR#From_PPA|UnInstallGR]].<br><br><br />
<br />
To access the current released version (3.10), add the gnuradio/gnuradio-releases ppa (removing other gnuradio ppas if already configured)<br />
<br />
<pre>$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases</pre><br />
<br />
To access the 3.9 released version, add the gnuradio/gnuradio-releases-3.9 ppa (removing other gnuradio ppas if already configured)<br />
<br />
<pre>$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.9</pre><br />
<br />
To access the 3.8 released version, add the gnuradio/gnuradio-releases-3.8 ppa (removing other gnuradio ppas if already configured)<br />
<br />
<pre>$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.8</pre><br />
<br />
To access the 3.7 released version (legacy), add the gnuradio/gnuradio-releases-3.7 ppa (removing other gnuradio ppas if already configured)<br />
<br />
<pre>$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.7</pre><br />
<br />
Then, update the apt sources, and install gnuradio<br />
<pre>$ sudo apt-get update</pre><br />
<pre>$ sudo apt install gnuradio</pre><br />
<br />
'''Attention:''' Do '''NOT''' try to install further packages like `gr-osmosdr` via Ubuntu's package management (i.e. using "apt"). Ubuntu will try to install a potentially incompatible version and your system will be in an undefined state. Instead, please first open GNURadio-Companion, and in the right-hand side block list, open "Soapy" -> "Source" or "Sink", to see whether the hardware you are most likely using is already integrated.<br />
<br />
<br />
'''Note on 3.10 packaging dependency'''<br />
For some distributions you may need to install the python module 'packaging' using pip (which may also need to be installed).<br />
<br />
$ sudo apt install python3-pip<br />
$ pip install packaging<br />
<br />
==== Modtool on Ubuntu ====<br />
NOTE: On released builds for Ubuntu 18.04 (bionic), there is an issue using gr_modtool after GNU Radio has been installed from the PPA. This is due to byte-compiled code that remains in the modtool templates after installation. To work around this issue:<br />
<br />
<pre>$ cd /usr/share/gnuradio/modtool/templates/gr-newmod<br />
$ sudo py3clean .</pre><br />
<br />
This issue does not appear for Ubuntu 19 and later packages<br />
<br />
=== Fedora COPR Installation ===<br />
<br />
**NOTE: FEDORA COPR not currently maintained**<br />
<br />
Packages are available for Fedora 29, 30, 31 hosted under COPR:<br />
<br />
https://copr.fedorainfracloud.org/coprs/gnuradio/<br />
<br />
1. Add the repository:<br />
<br />
-- For the latest released version:<br />
<pre>$ sudo dnf copr enable gnuradio/gnuradio-releases </pre><br />
-- For the latest pull from git master:<br />
<pre>$ sudo dnf copr enable gnuradio/gnuradio-master </pre><br />
<br />
2. Install GNU Radio<br />
<pre>$ sudo dnf install gnuradio </pre><br />
<br />
== Windows ==<br />
<br />
See the [[CondaInstall|Conda install guide]] or [https://github.com/ryanvolz/radioconda radioconda] to install GNU Radio 3.8 or newer on Windows.<br /><br />
<br />
If you need to install GNU Radio from source refer to the [[WindowsInstall|Windows install guide]].<br />
<br />
'''Note''': GNU Radio support on Windows is improving significantly but remains less tested and there are known problems and even significant bugs which affect regular usage of GNU Radio Companion. Please report bugs on the [https://github.com/gnuradio/gnuradio/issues GitHub Issues page] and if you have Windows development experience please consider investigating some of the [https://github.com/gnuradio/gnuradio/issues?q=is%3Aopen+is%3Aissue+label%3AWindows known issues].<br />
<br />
== Mac OS X ==<br />
<br />
Refer to the [[MacInstall|Mac OS X install guide page]].<br />
<br />
= From Source =<br />
<br />
Binary installation should be sufficient for most users, and certainly for anyone who is new to GNU Radio. However, if you have special requirements, want the latest version, or the binary packages are not working for you, you may want to install GNU Radio from source.<br />
<br />
=== Notes ===<br />
<br />
* By default GNU Radio will be installed in the <code>/usr/local</code> directory. See notes about [[InstallingGR#Common_cmake_flags|-DCMAKE_INSTALL_PREFIX]] to install it elsewhere.<br />
* Running and developing out-of-tree modules does not require GNU Radio to be installed from source. <br />
* <b>If you want to use GNU Radio with a USRP, you FIRST must clone and install UHD</b>. Follow the instructions in [[InstallingGRFromSource_on_Raspberry_Pi#Load_prerequisites|Install UHD from source]].<br />
* To install on a Raspberry Pi, see [[InstallingGRFromSource on Raspberry Pi]].<br />
* To build from source from within a conda environment, see [[CondaInstall#Building GNU Radio from source within a conda environment|the conda install guide]].<br />
<br />
=== For GNU Radio 3.10, 3.9, and Main Branch ===<br />
<br />
This section describes how to install GNU Radio 3.10, 3.9, and the Main branch from source code.<br />
<br />
==== Installing Dependencies ====<br />
<br />
Refer to [[InstallingGR#Linux|this page for your specific Linux distro]] to find how to install dependencies. For example, on Ubuntu 20.04 [[UbuntuInstall#Focal_Fossa_.2820.04.29_through_Impish_Indri_.2821.10.29|use this command]].<br />
<br />
==== Installing Volk ====<br />
<br />
Since Volk is no longer considered as a submodule of GNU Radio (GNU Radio commit #80c04479da962d048d41165081b026aafdaa0316),<br> you <b>MUST FIRST</b> install Volk, and then install GNU Radio. <br />
<br />
The basic idea is the same, but instead of building Volk along with GNU Radio, you need to clone and build it separately. For this example, we will start in the home directory. You can, of course, use any directory you wish and the results will be the same.<br />
<br />
* <code>cd</code><br />
* <code>git clone --recursive https://github.com/gnuradio/volk.git</code><br />
* <code>cd volk</code><br />
* <code>mkdir build</code><br />
* <code>cd build</code><br />
<b>Note:</b> In the following command, you can add <code>-DCMAKE_INSTALL_PREFIX=XXX</code> to install Volk into the PREFIX <code>XXX</code>; if not specified, then the PREFIX is <code>/usr/local</code>. See other CMake options in [[#Common_cmake_flags|Common cmake flags]].<br><br />
* <code>cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../</code><br />
* <code>make</code><br />
* <code>make test</code><br />
* <code>sudo make install</code><br />
<br />
If you're running Linux, then always remember to do the following command after installing any library:<br />
* <code>sudo ldconfig</code><br />
<br />
==== Installing GNU Radio ====<br />
<br />
* <code>cd</code><br />
* <code>git clone https://github.com/gnuradio/gnuradio.git</code><br />
* <code>cd gnuradio</code><br />
<b>Note:</b> If you want to build the <code>maint-3.10</code> or <code>maint-3.9</code> branch rather than the default <code>main</code> branch, enter:<br />
<code>git checkout maint-3.10</code> and then<br><br />
* <code>mkdir build</code><br />
* <code>cd build</code><br />
<b>Note:</b> In the following command, you can add <code>-DCMAKE_INSTALL_PREFIX=XXX</code> to install GNU Radio into the PREFIX <code>XXX</code>; if not specified, then the PREFIX is <code>/usr/local</code>. See other CMake options in [[#Common_cmake_flags|Common cmake flags]].<br><br />
* <code>cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../</code><br />
* <code>make -j3</code> (e.g. if you want to use 3 CPU cores during the build. To use 8 do -j8, to use all cores use -j$(nproc), to use 1, leave out the -j flag.)<br />
<b>Note:</b> In the following command, it is very possible that not all tests pass. Generally any error is a sign of a missing dependency such as the Python interface to ZMQ or NumPy or SciPy, none of which are required for building GNU Radio but are required for testing.<br />
* <code>make test</code><br />
* <code>sudo make install</code><br />
If you're running Linux, then always remember to do the following command after installing any library:<br />
* <code>sudo ldconfig</code><br />
As an optional step to increase performance, we recommend running the following, although it can take 10-15 minutes and you can always do it later:<br />
* <code>volk_profile</code><br />
If you encounter "Cannot import gnuradio" error, then go to [[ModuleNotFoundError#B._Finding_the_Python_library|Finding the Python library]] to set your PYTHONPATH and LD_LIBRARY_PATH.<br><b>After setting these environment variables, you need to do</b> <code>sudo ldconfig</code> <b>again</b> for the Linux dynamic library loader to find the just-installed GNU Radio libraries.<br><br />
If you have installed in a custom path with <code>-DCMAKE_INSTALL_PREFIX=XXX</code>, you will need to add that path to $PATH in order to find gnuradio-companion.<br />
<br />
=== For GNU Radio 3.8 or Earlier ===<br />
<br />
==== Installing Dependencies ====<br />
<br />
Refer to [[InstallingGR#Linux|this page for your specific Linux distro]] to find how to install dependencies. For example, on Ubuntu 20.04 [[UbuntuInstall#Focal_Fossa_.2820.04.29_through_Impish_Indri_.2821.10.29|use this command]].<br />
<br />
==== Installing GNU Radio ====<br />
For this example, we will start in the home directory; you can, of course, use any directory you wish and the results will be the same.<br />
<br />
* <code>cd</code><br />
* <code>git clone https://github.com/gnuradio/gnuradio.git</code><br />
* <code>cd gnuradio</code><br />
<br />
<b>Note:</b> In the following command, change <code>maint-3.8</code> to some other branch or tag if you want to build a different version of GNU Radio; see [https://github.com/gnuradio/gnuradio/tags tags] for tagged releases including pre-releases ("rc"). For [https://github.com/gnuradio/gnuradio/branches branches], it's generally wise to stick with "master" (the default after cloning), and, currently: <code>maint-3.7</code> or <code>maint-3.8</code>. Here we checkout the <code>maint-3.8</code> branch, which contains the latest 3.8 release plus any fixes or augmentations to it that will be in the next 3.8 release.<br />
<br />
* <code>git checkout maint-3.8</code><br />
* <code>git submodule update --init --recursive</code><br />
* <code>mkdir build</code><br />
* <code>cd build</code><br />
<br />
<b>Note:</b> In the following command, you can add <code>-DCMAKE_INSTALL_PREFIX=XXX</code> to install GNU Radio into the PREFIX <code>XXX</code>; if not specified, then the PREFIX is <code>/usr/local</code>. See other CMake options in [[#Common_cmake_flags|Common cmake flags]].<br><br />
<br />
* <code>cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../</code><br />
* <code>make -j3</code> (e.g. if you want to use 3 CPU cores during the build. To use 8 do -j8, to use all cores use -j$(nproc), to use 1 leave out the -j flag.)<br />
* <code>sudo make install</code><br />
<br />
If you're running Linux, then always remember to do the following command after installing any library:<br />
* <code>sudo ldconfig</code><br />
<br />
Go to [[ModuleNotFoundError#B._Finding_the_Python_library|Finding the Python library]] to set your PYTHONPATH and LD_LIBRARY_PATH.<br><b>After setting these environment variables, you need to do</b> <code>sudo ldconfig</code> <b>again</b> for the Linux dynamic library loader to find the just-installed GNU Radio libraries.<br><br />
If you have installed in a custom path with <code>-DCMAKE_INSTALL_PREFIX=XXX</code>, you will need to add that path to $PATH in order to find gnuradio-companion.<br />
<br />
==== For Ubuntu 18.04 ====<br />
<br />
An easy way to install GNU Radio 3.8 on many Ubuntu systems is to use the following commands (note that this skips the setup for UHD hardware):<br />
<br />
* <code>sudo apt install git cmake g++ libboost-all-dev libgmp-dev swig python3-numpy python3-mako python3-sphinx python3-lxml doxygen libfftw3-dev libsdl1.2-dev libgsl-dev libqwt-qt5-dev libqt5opengl5-dev python3-pyqt5 liblog4cpp5-dev libzmq3-dev python3-yaml python3-click python3-click-plugins python3-zmq python3-scipy python3-pip python3-gi-cairo</code><br />
* <code>pip3 install git+https://github.com/pyqtgraph/pyqtgraph@develop</code><br />
* <code>pip3 install numpy scipy</code><br />
* <code>echo 'export PYTHONPATH=/usr/local/lib/python3/dist-packages:usr/local/lib/python2.7/site-packages:$PYTHONPATH' >> ~/.bashrc</code><br />
* <code>echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.bashrc</code><br />
* <code>echo 'export PYTHONPATH=/usr/local/lib/python3/dist-packages:usr/local/lib/python2.7/site-packages:$PYTHONPATH' >> ~/.profile</code><br />
* <code>echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.profile</code><br />
* <code>cd ~/</code><br />
* <code>git clone --recursive https://github.com/gnuradio/gnuradio</code><br />
* <code>cd gnuradio</code><br />
* <code>git checkout maint-3.8</code><br />
* <code>mkdir build</code><br />
* <code>cd build</code><br />
* <code>git pull --recurse-submodules=on</code><br />
* <code>git submodule update --init</code><br />
* <code>cmake -DENABLE_GR_UHD=OFF ..</code><br />
* <code>make -j $(nproc --all)</code><br />
* <code>sudo make install</code><br />
* <code>sudo ldconfig</code><br />
<br />
Once this is done, reboot your computer and GNU Radio should be all set for you.<br />
<br />
== Common cmake flags ==<br />
<br />
* <code>-DENABLE_GR_XXX=ON</code> This enables (or disables for =OFF) the GNU Radio component named XXX. You might not need all of them, and this way, you can compile quicker.<br />
* <code>-DCMAKE_INSTALL_PREFIX=XXX</code> Install your stuff to XXX.<br />
* <code>-DCMAKE_BUILD_TYPE=Debug</code> This causes gcc to add debug symbols to all binaries. Useful for debugging (otherwise, it decreases efficiency!)<br />
* <code>-DPYTHON_EXECUTABLE=/usr/bin/python{2,3}</code> This selects the Python version and executable to be used during build time and will determine which Python libraries will be used for building the Python bindings.<br />
<p>For a list of additional cmake flags, as well as minimum versions of dependencies, see [https://www.gnuradio.org/doc/doxygen/build_guide.html]</p><br />
<br />
= Using PyBOMBS =<br />
<br />
PyBOMBS used to be the go-to method for building GNU Radio, UHD, and various Out of Tree (OOT) modules from source and then installing them into an isolated directory rather than system-wide, not unlike a Python virtualenv. We are no longer including PyBOMBS as a recommended method of installing GNU Radio, unless you want to play around with old versions (e.g. GR 3.7, 3.8, and OOTs of matching version). The PyBOMBS documentation is in the PyBOMBS [https://github.com/gnuradio/pybombs#pybombs README].<br />
<br />
= VMs and Live Images =<br />
Over the years a number of Live Images and VMs have been created. There are currently no official versions but here are some current options:<br />
*[https://github.com/bastibl/instant-gnuradio Instant GNU Radio] A customizable, programmatically generated VM and live environment for GNU Radio. <br />
*[[UbuntuVM]] An Ubuntu 20.04 virtual machine image with GNU Radio 3.8.2.0, Fosphor, GQRX, and several other useful pieces of software. (Created using Instant GNU Radio)<br />
<br />
= OK, it's installed, what now? =<br />
<br />
If the installation worked without any trouble, you're ready to use GNU Radio! If you have no idea how to do that, the best place to start is with the [[Tutorials]].<br />
<br />
Optionally, you may run <code>volk_profile</code> on your terminal to help libvolk to determine the optimal kernels (may speed up GNU Radio). <br />
<br />
[[Category:Installation]]<br />
[[Category:Guide]]</div>Argilohttps://wiki.gnuradio.org/index.php?title=AGC3&diff=12621AGC32022-10-21T04:47:21Z<p>Argilo: Fix type in parameter list</p>
<hr />
<div>[[Category:Block Docs]]<br />
High performance Automatic Gain Control class with attack and decay rates.<br />
<br />
Unlike the [[AGC2]] loop, this uses an initial linear calculation at the beginning for very fast initial acquisition. Moves to IIR model for tracking purposes.<br />
For Power the absolute value of the complex number is used.<br />
<br />
== Parameters ==<br />
(''R''): <span class="plainlinks">[https://wiki.gnuradio.org/index.php/GNURadioCompanion#Variable_Controls ''Run-time adjustable'']</span><br />
<br />
; Attack rate (''R'')<br />
: The update rate of the loop when in attack mode.<br />
; Decay rate (''R'')<br />
: The update rate of the loop when in decay mode.<br />
; Reference (''R'')<br />
: Reference value to adjust signal power to.<br />
; Gain (''R'')<br />
: Initial gain value.<br />
; Max gain (''R'')<br />
: Maximum gain value (0 for unlimited)<br />
; IIR update decimation <br />
: Stride by this number of samples before computing an IIR gain update<br />
<br />
<br />
== Example Flowgraph ==<br />
<br />
Insert description of flowgraph here, then show a screenshot of the flowgraph and the output if there is an interesting GUI. Currently we have no standard method of uploading the actual flowgraph to the wiki or git repo, unfortunately. The plan is to have an example flowgraph showing how the block might be used, for every block, and the flowgraphs will live in the git repo.<br />
<br />
== Source Files ==<br />
<br />
; C++ files<br />
: [https://github.com/gnuradio/gnuradio/blob/master/gr-analog/lib/agc3_cc_impl.cc Here]<br />
<br />
; Header files<br />
: [https://github.com/gnuradio/gnuradio/blob/master/gr-analog/lib/agc3_cc_impl.h Here]<br />
<br />
; Public header files<br />
: [https://github.com/gnuradio/gnuradio/blob/master/gr-analog/include/gnuradio/analog/agc3_cc.h Here]<br />
<br />
; Block definition<br />
: [https://github.com/gnuradio/gnuradio/blob/master/gr-analog/grc/analog_agc3_xx.block.yml Yaml]</div>Argilohttps://wiki.gnuradio.org/index.php?title=InstallingGR&diff=12593InstallingGR2022-09-21T14:01:56Z<p>Argilo: Update available version numbers</p>
<hr />
<div><div style="float:right"><br />
{{Template:BeginnerTutorials}}<br />
</div><br />
<br />
{| class="wikitable"<br />
|+ Install Quickstart<br>(Refer to the rest of this page for more OS and installation options)<br />
! Ubuntu 22<br />
||<br />
# <code>sudo apt-get install gnuradio</code><br />
||v3.10.1<br />
|-<br />
! Ubuntu 20<br />
||<br />
# <code>sudo add-apt-repository ppa:gnuradio/gnuradio-releases</code><br />
# <code>sudo apt-get update</code><br />
# <code>sudo apt-get install gnuradio python3-packaging</code><br />
||v3.10.4<br />
|-<br />
! Windows<br />
||<br />
# Install the latest [https://github.com/ryanvolz/radioconda/releases Radioconda installer]<br />
# Launch "GNU Radio Companion" from the Start menu<br />
||v3.10.4<br />
|-<br />
! macOS<br />
||<br />
# [https://brew.sh/ Install Homebrew]<br />
# <code>brew install gnuradio</code><br />
||v3.10.3<br />
|}<br />
<br />
<br />
= Types of Installation Methods =<br />
<br />
The recommended way to install GNU Radio on most platforms is using already available binary packages. Find your platform below in the [[#From_Binaries|From Binaries]] section for instructions on how to get GNU Radio through your regular package manager (e.g. [[#Ubuntu_PPA_Installation|Ubuntu PPA Installation]]), or visit the [[CondaInstall|Conda Installation]] page for instructions on how to use the Conda package manager to install GNU Radio on any Linux distribution, macOS, or Windows. For some platforms there are no binaries provided by available package managers or the GNU Radio project. In these cases please contact the maintainer of the package manager or the GNU Radio project to find a sensible way to provide binaries for your platform.<br />
<br />
In addition to using binaries, GNU Radio can be installed:<br />
<br />
# '''[[#From_Source|From source]]''' (for those who want full control)<br />
# '''[[#Using_PyBOMBS|Using PyBOMBS]]''' (for those who want it built from source and/or installed to a specific directory using a script)<br />
<br />
= From Binaries =<br />
<br />
== Linux ==<br />
<br />
Most distributions contain a package named <code>gnuradio</code> or similar in their standard repositories. For most use cases it is enough to install this package and start developing.<br />
<br />
The development of GNU Radio can be fast-paced, and binaries provided by your distribution may be outdated. '''Do check if the version you're installing is up to date! Sometimes old versions are not updated in the packaging systems.''' If you find a bug in a older GNU Radio version, please check if the bug still exists in the newer version of GNU Radio before filing a new issue.<br />
<br />
If the version shipped in your distribution is outdated please contact the corresponding maintainer to update it in the packaging system.<br />
<br />
Here are examples of how to install GNU Radio in various Linux distributions. <b>Click the link under &quot;Distribution&quot; for how to install dependencies.</b><br />
<br />
{|class="wikitable" style="margin: auto; width: 90%;"<br />
!scope="col"|Distribution<br />
!scope="col"|Command<br />
|-<br />
| [[UbuntuInstall|Debian/Ubuntu and derivates]]<br />
| <pre># apt install gnuradio</pre><br />
|-<br />
| [[FedoraInstall|Fedora]]<br />
| <pre># dnf install gnuradio</pre><br />
|-<br />
| RHEL/CentOS/Rocky Linux/AlmaLinux<br />
| <pre># yum install gnuradio</pre><br />
|-<br />
| [[ArchInstall|Archlinux]]<br />
| <pre># pacman -S gnuradio</pre><br />
|-<br />
| [[GentooInstall|Gentoo Linux]]<br />
| <pre># emerge net-wireless/gnuradio</pre><br />
|-<br />
| [[SuseInstall|Suse Linux]]<br />
| <br />
|-<br />
| [[InstallingGRFromSource_on_Raspberry_Pi|Raspberry Pi OS]]<br />
| <br />
|-<br />
|}<br />
<br />
On other distributions, simply use the appropriate package management command to install the <code>gnuradio</code> package and then please add it to this list. If you need newer versions or have a different platform please contact the package maintainer of your distribution or raise your issue on the mailing list.<br />
<br />
=== Ubuntu PPA Installation ===<br />
For Ubuntu, the latest builds (both released and pulled from master branch) are maintained as PPAs on [https://launchpad.net/~gnuradio launchpad].<br><br />
<b>Be sure to uninstall any previously installed versions of gnuradio first.</b> See [[UnInstallGR#From_PPA|UnInstallGR]].<br><br><br />
<br />
To access the current released version (3.10), add the gnuradio/gnuradio-releases ppa (removing other gnuradio ppas if already configured)<br />
<br />
<pre>$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases</pre><br />
<br />
To access the 3.9 released version, add the gnuradio/gnuradio-releases-3.9 ppa (removing other gnuradio ppas if already configured)<br />
<br />
<pre>$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.9</pre><br />
<br />
To access the 3.8 released version, add the gnuradio/gnuradio-releases-3.8 ppa (removing other gnuradio ppas if already configured)<br />
<br />
<pre>$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.8</pre><br />
<br />
To access the 3.7 released version (legacy), add the gnuradio/gnuradio-releases-3.7 ppa (removing other gnuradio ppas if already configured)<br />
<br />
<pre>$ sudo add-apt-repository ppa:gnuradio/gnuradio-releases-3.7</pre><br />
<br />
Then, update the apt sources, and install gnuradio<br />
<pre>$ sudo apt-get update</pre><br />
<pre>$ sudo apt install gnuradio</pre><br />
<br />
'''Attention:''' Do '''NOT''' try to install further packages like `gr-osmosdr` via Ubuntu's package management (i.e. using "apt"). Ubuntu will try to install a potentially incompatible version and your system will be in an undefined state. Instead, please first open GNURadio-Companion, and in the right-hand side block list, open "Soapy" -> "Source" or "Sink", to see whether the hardware you are most likely using is already integrated.<br />
<br />
<br />
'''Note on 3.10 packaging dependency'''<br />
For some distributions you may need to install the python module 'packaging' using pip (which may also need to be installed).<br />
<br />
$ sudo apt install python3-pip<br />
$ pip install packaging<br />
<br />
==== Modtool on Ubuntu ====<br />
NOTE: On released builds for Ubuntu 18.04 (bionic), there is an issue using gr_modtool after GNU Radio has been installed from the PPA. This is due to byte-compiled code that remains in the modtool templates after installation. To work around this issue:<br />
<br />
<pre>$ cd /usr/share/gnuradio/modtool/templates/gr-newmod<br />
$ sudo py3clean .</pre><br />
<br />
This issue does not appear for Ubuntu 19 and later packages<br />
<br />
=== Fedora COPR Installation ===<br />
<br />
**NOTE: FEDORA COPR not currently maintained**<br />
<br />
Packages are available for Fedora 29, 30, 31 hosted under COPR:<br />
<br />
https://copr.fedorainfracloud.org/coprs/gnuradio/<br />
<br />
1. Add the repository:<br />
<br />
-- For the latest released version:<br />
<pre>$ sudo dnf copr enable gnuradio/gnuradio-releases </pre><br />
-- For the latest pull from git master:<br />
<pre>$ sudo dnf copr enable gnuradio/gnuradio-master </pre><br />
<br />
2. Install GNU Radio<br />
<pre>$ sudo dnf install gnuradio </pre><br />
<br />
== Windows ==<br />
<br />
See the [[CondaInstall|Conda install guide]] or [https://github.com/ryanvolz/radioconda radioconda] to install GNU Radio 3.8 or newer on Windows.<br /><br />
<br />
If you need to install GNU Radio from source refer to the [[WindowsInstall|Windows install guide]].<br />
<br />
'''Note''': GNU Radio support on Windows is improving significantly but remains less tested and there are known problems and even significant bugs which affect regular usage of GNU Radio Companion. Please report bugs on the [https://github.com/gnuradio/gnuradio/issues GitHub Issues page] and if you have Windows development experience please consider investigating some of the [https://github.com/gnuradio/gnuradio/issues?q=is%3Aopen+is%3Aissue+label%3AWindows known issues].<br />
<br />
== Mac OS X ==<br />
<br />
Refer to the [[MacInstall|Mac OS X install guide page]].<br />
<br />
= From Source =<br />
<br />
Binary installation should be sufficient for most users, and certainly for anyone who is new to GNU Radio. However, if you have special requirements, want the latest version, or the binary packages are not working for you, you may want to install GNU Radio from source.<br />
<br />
=== Notes ===<br />
<br />
* By default GNU Radio will be installed in the <code>/usr/local</code> directory. See notes about [[InstallingGR#Common_cmake_flags|-DCMAKE_INSTALL_PREFIX]] to install it elsewhere.<br />
* Running and developing out-of-tree modules does not require GNU Radio to be installed from source. <br />
* <b>If you want to use GNU Radio with a USRP, you FIRST must clone and install UHD</b>. Follow the instructions in [[InstallingGRFromSource_on_Raspberry_Pi#Load_prerequisites|Install UHD from source]].<br />
* To install on a Raspberry Pi, see [[InstallingGRFromSource on Raspberry Pi]].<br />
* To build from source from within a conda environment, see [[CondaInstall#Building GNU Radio from source within a conda environment|the conda install guide]].<br />
<br />
=== For GNU Radio 3.10, 3.9, and Main Branch ===<br />
<br />
This section describes how to install GNU Radio 3.10, 3.9, and the Main branch from source code.<br />
<br />
==== Installing Dependencies ====<br />
<br />
Refer to [[InstallingGR#Linux|this page for your specific Linux distro]] to find how to install dependencies. For example, on Ubuntu 20.04 [[UbuntuInstall#Focal_Fossa_.2820.04.29_through_Impish_Indri_.2821.10.29|use this command]].<br />
<br />
==== Installing Volk ====<br />
<br />
Since Volk is no longer considered as a submodule of GNU Radio (GNU Radio commit #80c04479da962d048d41165081b026aafdaa0316),<br> you <b>MUST FIRST</b> install Volk, and then install GNU Radio. <br />
<br />
The basic idea is the same, but instead of building Volk along with GNU Radio, you need to clone and build it separately. For this example, we will start in the home directory. You can, of course, use any directory you wish and the results will be the same.<br />
<br />
* <code>cd</code><br />
* <code>git clone --recursive https://github.com/gnuradio/volk.git</code><br />
* <code>cd volk</code><br />
* <code>mkdir build</code><br />
* <code>cd build</code><br />
<b>Note:</b> In the following command, you can add <code>-DCMAKE_INSTALL_PREFIX=XXX</code> to install Volk into the PREFIX <code>XXX</code>; if not specified, then the PREFIX is <code>/usr/local</code>. See other CMake options in [[#Common_cmake_flags|Common cmake flags]].<br><br />
* <code>cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../</code><br />
* <code>make</code><br />
* <code>make test</code><br />
* <code>sudo make install</code><br />
<br />
If you're running Linux, then always remember to do the following command after installing any library:<br />
* <code>sudo ldconfig</code><br />
<br />
==== Installing GNU Radio ====<br />
<br />
* <code>cd</code><br />
* <code>git clone https://github.com/gnuradio/gnuradio.git</code><br />
* <code>cd gnuradio</code><br />
<b>Note:</b> If you want to build the <code>maint-3.10</code> or <code>maint-3.9</code> branch rather than the default <code>main</code> branch, enter:<br />
<code>git checkout maint-3.10</code> and then<br><br />
* <code>mkdir build</code><br />
* <code>cd build</code><br />
<b>Note:</b> In the following command, you can add <code>-DCMAKE_INSTALL_PREFIX=XXX</code> to install GNU Radio into the PREFIX <code>XXX</code>; if not specified, then the PREFIX is <code>/usr/local</code>. See other CMake options in [[#Common_cmake_flags|Common cmake flags]].<br><br />
* <code>cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../</code><br />
* <code>make -j3</code> (e.g. if you want to use 3 CPU cores during the build. To use 8 do -j8, to use all cores use -j$(nproc), to use 1, leave out the -j flag.)<br />
<b>Note:</b> In the following command, it is very possible that not all tests pass. Generally any error is a sign of a missing dependency such as the Python interface to ZMQ or NumPy or SciPy, none of which are required for building GNU Radio but are required for testing.<br />
* <code>make test</code><br />
* <code>sudo make install</code><br />
If you're running Linux, then always remember to do the following command after installing any library:<br />
* <code>sudo ldconfig</code><br />
As an optional step to increase performance, we recommend running the following, although it can take 10-15 minutes and you can always do it later:<br />
* <code>volk_profile</code><br />
If you encounter "Cannot import gnuradio" error, then go to [[ModuleNotFoundError#B._Finding_the_Python_library|Finding the Python library]] to set your PYTHONPATH and LD_LIBRARY_PATH.<br><b>After setting these environment variables, you need to do</b> <code>sudo ldconfig</code> <b>again</b> for the Linux dynamic library loader to find the just-installed GNU Radio libraries.<br><br />
If you have installed in a custom path with <code>-DCMAKE_INSTALL_PREFIX=XXX</code>, you will need to add that path to $PATH in order to find gnuradio-companion.<br />
<br />
=== For GNU Radio 3.8 or Earlier ===<br />
<br />
==== Installing Dependencies ====<br />
<br />
Refer to [[InstallingGR#Linux|this page for your specific Linux distro]] to find how to install dependencies. For example, on Ubuntu 20.04 [[UbuntuInstall#Focal_Fossa_.2820.04.29_through_Impish_Indri_.2821.10.29|use this command]].<br />
<br />
==== Installing GNU Radio ====<br />
For this example, we will start in the home directory; you can, of course, use any directory you wish and the results will be the same.<br />
<br />
* <code>cd</code><br />
* <code>git clone https://github.com/gnuradio/gnuradio.git</code><br />
* <code>cd gnuradio</code><br />
<br />
<b>Note:</b> In the following command, change <code>maint-3.8</code> to some other branch or tag if you want to build a different version of GNU Radio; see [https://github.com/gnuradio/gnuradio/tags tags] for tagged releases including pre-releases ("rc"). For [https://github.com/gnuradio/gnuradio/branches branches], it's generally wise to stick with "master" (the default after cloning), and, currently: <code>maint-3.7</code> or <code>maint-3.8</code>. Here we checkout the <code>maint-3.8</code> branch, which contains the latest 3.8 release plus any fixes or augmentations to it that will be in the next 3.8 release.<br />
<br />
* <code>git checkout maint-3.8</code><br />
* <code>git submodule update --init --recursive</code><br />
* <code>mkdir build</code><br />
* <code>cd build</code><br />
<br />
<b>Note:</b> In the following command, you can add <code>-DCMAKE_INSTALL_PREFIX=XXX</code> to install GNU Radio into the PREFIX <code>XXX</code>; if not specified, then the PREFIX is <code>/usr/local</code>. See other CMake options in [[#Common_cmake_flags|Common cmake flags]].<br><br />
<br />
* <code>cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=/usr/bin/python3 ../</code><br />
* <code>make -j3</code> (e.g. if you want to use 3 CPU cores during the build. To use 8 do -j8, to use all cores use -j$(nproc), to use 1 leave out the -j flag.)<br />
* <code>sudo make install</code><br />
<br />
If you're running Linux, then always remember to do the following command after installing any library:<br />
* <code>sudo ldconfig</code><br />
<br />
Go to [[ModuleNotFoundError#B._Finding_the_Python_library|Finding the Python library]] to set your PYTHONPATH and LD_LIBRARY_PATH.<br><b>After setting these environment variables, you need to do</b> <code>sudo ldconfig</code> <b>again</b> for the Linux dynamic library loader to find the just-installed GNU Radio libraries.<br><br />
If you have installed in a custom path with <code>-DCMAKE_INSTALL_PREFIX=XXX</code>, you will need to add that path to $PATH in order to find gnuradio-companion.<br />
<br />
==== For Ubuntu 18.04 ====<br />
<br />
An easy way to install GNU Radio 3.8 on many Ubuntu systems is to use the following commands (note that this skips the setup for UHD hardware):<br />
<br />
* <code>sudo apt install git cmake g++ libboost-all-dev libgmp-dev swig python3-numpy python3-mako python3-sphinx python3-lxml doxygen libfftw3-dev libsdl1.2-dev libgsl-dev libqwt-qt5-dev libqt5opengl5-dev python3-pyqt5 liblog4cpp5-dev libzmq3-dev python3-yaml python3-click python3-click-plugins python3-zmq python3-scipy python3-pip python3-gi-cairo</code><br />
* <code>pip3 install git+https://github.com/pyqtgraph/pyqtgraph@develop</code><br />
* <code>pip3 install numpy scipy</code><br />
* <code>echo 'export PYTHONPATH=/usr/local/lib/python3/dist-packages:usr/local/lib/python2.7/site-packages:$PYTHONPATH' >> ~/.bashrc</code><br />
* <code>echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.bashrc</code><br />
* <code>echo 'export PYTHONPATH=/usr/local/lib/python3/dist-packages:usr/local/lib/python2.7/site-packages:$PYTHONPATH' >> ~/.profile</code><br />
* <code>echo 'export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH' >> ~/.profile</code><br />
* <code>cd ~/</code><br />
* <code>git clone --recursive https://github.com/gnuradio/gnuradio</code><br />
* <code>cd gnuradio</code><br />
* <code>git checkout maint-3.8</code><br />
* <code>mkdir build</code><br />
* <code>cd build</code><br />
* <code>git pull --recurse-submodules=on</code><br />
* <code>git submodule update --init</code><br />
* <code>cmake -DENABLE_GR_UHD=OFF ..</code><br />
* <code>make -j $(nproc --all)</code><br />
* <code>sudo make install</code><br />
* <code>sudo ldconfig</code><br />
<br />
Once this is done, reboot your computer and GNU Radio should be all set for you.<br />
<br />
== Common cmake flags ==<br />
<br />
* <code>-DENABLE_GR_XXX=ON</code> This enables (or disables for =OFF) the GNU Radio component named XXX. You might not need all of them, and this way, you can compile quicker.<br />
* <code>-DCMAKE_INSTALL_PREFIX=XXX</code> Install your stuff to XXX.<br />
* <code>-DCMAKE_BUILD_TYPE=Debug</code> This causes gcc to add debug symbols to all binaries. Useful for debugging (otherwise, it decreases efficiency!)<br />
* <code>-DPYTHON_EXECUTABLE=/usr/bin/python{2,3}</code> This selects the Python version and executable to be used during build time and will determine which Python libraries will be used for building the Python bindings.<br />
<p>For a list of additional cmake flags, as well as minimum versions of dependencies, see [https://www.gnuradio.org/doc/doxygen/build_guide.html]</p><br />
<br />
= Using PyBOMBS =<br />
<br />
PyBOMBS used to be the go-to method for building GNU Radio, UHD, and various Out of Tree (OOT) modules from source and then installing them into an isolated directory rather than system-wide, not unlike a Python virtualenv. We are no longer including PyBOMBS as a recommended method of installing GNU Radio, unless you want to play around with old versions (e.g. GR 3.7, 3.8, and OOTs of matching version). The PyBOMBS documentation is in the PyBOMBS [https://github.com/gnuradio/pybombs#pybombs README].<br />
<br />
= VMs and Live Images =<br />
Over the years a number of Live Images and VMs have been created. There are currently no official versions but here are some current options:<br />
*[https://github.com/bastibl/instant-gnuradio Instant GNU Radio] A customizable, programmatically generated VM and live environment for GNU Radio. <br />
*[[UbuntuVM]] An Ubuntu 20.04 virtual machine image with GNU Radio 3.8.2.0, Fosphor, GQRX, and several other useful pieces of software. (Created using Instant GNU Radio)<br />
<br />
= OK, it's installed, what now? =<br />
<br />
If the installation worked without any trouble, you're ready to use GNU Radio! If you have no idea how to do that, the best place to start is with the [[Tutorials]].<br />
<br />
Optionally, you may run <code>volk_profile</code> on your terminal to help libvolk to determine the optimal kernels (may speed up GNU Radio). <br />
<br />
[[Category:Installation]]<br />
[[Category:Guide]]</div>Argilohttps://wiki.gnuradio.org/index.php?title=Embedded_Python_Block&diff=8842Embedded Python Block2021-10-24T14:17:11Z<p>Argilo: Add Python syntax highlighting</p>
<hr />
<div>[[Category:Block Docs]]<br />
Allows you to create a new (custom) block in Python without needing to make and install an Out of Tree Module (OOT). When you add the block to your flowgraph, the pre-populated code simply takes the input stream and multiplies it by a constant. Note that the structure of this Python block matches the structure of an Out of Tree Module (OOT) Python block. It's essentially a Python OOT block built into a grc flowgraph. <br />
<br />
=== Initial code in the Python block ===<br />
Here is the pre-populated code:<br />
<syntaxhighlight lang="python"><br />
"""<br />
Embedded Python Blocks:<br />
<br />
Each time this file is saved, GRC will instantiate the first class it finds<br />
to get ports and parameters of your block. The arguments to __init__ will<br />
be the parameters. All of them are required to have default values!<br />
"""<br />
<br />
import numpy as np<br />
from gnuradio import gr<br />
<br />
<br />
class blk(gr.sync_block): # other base classes are basic_block, decim_block, interp_block<br />
"""Embedded Python Block example - a simple multiply const"""<br />
<br />
def __init__(self, example_param=1.0): # only default arguments here<br />
"""arguments to this function show up as parameters in GRC"""<br />
gr.sync_block.__init__(<br />
self,<br />
name='Embedded Python Block', # will show up in GRC<br />
in_sig=[np.complex64],<br />
out_sig=[np.complex64]<br />
)<br />
# if an attribute with the same name as a parameter is found,<br />
# a callback is registered (properties work, too).<br />
self.example_param = example_param<br />
<br />
def work(self, input_items, output_items):<br />
"""example: multiply with constant"""<br />
output_items[0][:] = input_items[0] * self.example_param<br />
return len(output_items[0])<br />
</syntaxhighlight><br />
<br />
=== User notes ===<br />
<br />
* To revise the Python code:<br />
** right click on the Embedded Python block<br />
** select <q>Properties</q><br />
** select <q>Open in Editor</q><br />
** select <q>Use Default</q> or <q>Choose Editor</q><br />
** For some platforms the <q>Use Default</q> button may do nothing; see below.<br />
** if you select <q>Choose Editor</q>, the /usr/bin folder will open for you to pick one.<br />
** When you have finished editing, save the file (usually Ctrl-S).<br />
** close the edit window.<br />
** If there are any syntax errors, they are shown in the <q>Properties</q> window.<br />
** select <q>OK</q>. It is not necessary to select <q>Apply</q>.<br />
* to change the default editor (works for Debian):<br />
** open File Manager<br />
** single right click a file of type .py<br />
** left click on 'Properties'<br />
** click on the pull down for 'Open with:'<br />
** click on the editor of your choice<br />
** click OK<br />
<p><b>Important:</b> It is highly recommended that any flowgraph using an Embedded Python Block be placed in a separate directory (folder); particularly so if more than one Embedded Python Block is used in the same directory. This is because the generation process creates a file <q>epy_block_0.py</q> from that flowgraph. If you generate a different flowgraph in the same directory, its Embedded Python Block will overwrite the file.</p><br />
<p><b>Warning:</b> To make changes to the Python code, you <u>must</u> follow the steps above. If you edit the <q>epy_block_0.py</q> file directly and then generate the flowgraph again, your changes will be wiped out! (The most recent edited code is actually stored in the .grc file.)</p><br />
<br />
== Parameters ==<br />
The parameters for this block are simply those of your embedded Python block itself. <br />
<br />
Note that every parameter needs a default value. For example, in the code above, note line: <syntaxhighlight lang="python">def __init__(self, example_param=1.0): # only default arguments here</syntaxhighlight> If you don't have any parameters, change that line of code to <syntaxhighlight lang="python">def __init__(self):</syntaxhighlight><br />
<br />
If you have a vector length equal to a variable of your block, note that the default value must be "hardcoded".<br />
<br />
== Example Flowgraph ==<br />
<br />
This flowgraph shows how an Embedded Python Block can be used to convert a string from a Message Edit Box to a byte string for the output port. The text is sent through a Throttle to a File Sink. The file sink should have Unbuffered = On. In this particular case, the Throttle block is not required because all blocks will wait for a message string to be entered into the Message Edit Box. In this way the Message Edit Box limits the number of samples produced. Text output is in the black screen at the bottom of the image.<br />
<br />
[[File:Epy_demo.png|800px]]<br />
<br />
This is the epy_block_0.py code:<br />
<syntaxhighlight lang="python"><br />
"""<br />
Embedded Python Block demo<br />
"""<br />
<br />
# epy_block_0.py<br />
# created 10/17/2019<br />
<br />
import numpy as np<br />
from gnuradio import gr<br />
<br />
import pmt<br />
<br />
textboxValue = ""<br />
<br />
class my_sync_block(gr.sync_block):<br />
"""<br />
reads input from a message port<br />
outputs text<br />
"""<br />
def __init__(self):<br />
gr.sync_block.__init__(self,<br />
name = "Embedded Python demo",<br />
in_sig = None,<br />
out_sig = [np.byte])<br />
self.message_port_register_in(pmt.intern('msg_in'))<br />
self.message_port_register_out(pmt.intern('clear_input'))<br />
self.set_msg_handler(pmt.intern('msg_in'), self.handle_msg)<br />
<br />
def handle_msg(self, msg):<br />
global textboxValue<br />
<br />
textboxValue = pmt.symbol_to_string (msg)<br />
# print (textboxValue)<br />
<br />
def work(self, input_items, output_items):<br />
global textboxValue<br />
<br />
# get length of string<br />
_len = len(textboxValue)<br />
if (_len > 0):<br />
# terminate with LF<br />
textboxValue += "\n"<br />
_len += 1<br />
# store elements in output array<br />
for x in range(_len):<br />
output_items[0][x] = ord(textboxValue[x])<br />
textboxValue = ""<br />
self.message_port_pub(pmt.intern('clear_input'), pmt.intern(''))<br />
return (_len)<br />
else:<br />
return (0)<br />
</syntaxhighlight><br />
<br />
Another example can be found in https://github.com/duggabe/gr-morse-code-gen</div>Argilohttps://wiki.gnuradio.org/index.php?title=ChangeSets&diff=7517ChangeSets2020-08-27T01:48:52Z<p>Argilo: /* ChangeSets: API and Code Changes between Versions */</p>
<hr />
<div>= ChangeSets: API and Code Changes between Versions =<br />
<br />
Versions are of the form MAJOR.API.MINOR.PATCH.<br />
<br />
* Major versions are saved for huge changes to the entire project's operation and are very rare.<br />
* The API version determines the codes Application Programmable Interface. During an API version, we guarantee that the API will not change. Updating minor versions will still have the same API within these version series. The 'master' branch of our git repo tracks the API version.<br />
* The Minor version number is where we make updates and develop new features. There will be additions to the API but no changes to the existing API. The 'maint-x.y' branch of our git repo tracks the Minor version.<br />
* The Patch version (assumed 0 if not specified) is reserved for bug fixes and does not add any new features.<br />
<br />
Starting with v3.7.9 release tarballs are digitally signed with a [[ReleaseKey|GPG key]]<br />
<br />
* v3.7<br />
** [[Changelog Version 3.7.11]]<br />
** [[Changelog Version 3.7.10.1]]<br />
<br />
Changelogs prior to and including 3.7.10.1 were combined into a single page during the migration to MediaWiki:<br />
<br />
* [[ChangeLogsOld|Older changelogs]]</div>Argilo