Index by title

Below are some of the many papers involving GNU Radio and/or the USRP

Please feel free to add a summary, bibliographic info, and a link to your papers.

ETH Zürich (Switzerland), System Security Group

University of Texas at Austin, Hydra Project

*University of Notre Dame, Indiana

Virginia Tech, Center for Wireless Telecommunications (CWT)

Papers from Virginia Tech's Center for Wireless Telecommunications (CWT), a member of Wireless@VT, that specifically deal with SDR and cognitive radio techniques employing GNU Radio or USRP (links to papers will be provided later):

Karlsruhe Institute of Technology (Communications Engineering Lab)

University of California in LA, Networked & Embedded Systems Lab (NESL)

University of Delaware

University of Maryland

University of Pisa (Italy), DSP for Communications Lab

University of Washington, Magnetic Resonance Force Microscopy (MRFM)

University College London

Massachusetts Institute of Technology (MIT)


AllAboutDecibels

The Basics

A decibel (dB) is a logarithmic comparison of two power measurements.

Let P1 and P2 be two measurements of power.

A Bel (as in Alexander Graham Bell) is defined as

B = log10 (P1 / P2)

A Bel is a huge difference, so customarily a tenth of a bel, or deciBel is used.

dB = 10 * log10 (P1 / P2)

(Decibels have never made any sense to me -- John Gilmore -- but Bels make
perfect sense. So just divide by ten and think in Bels, which are just
logarithms base ten. Thus 20dB is 2 Bels which is a factor of 100. Why the radio
world complicated the simplicity of logs by multiplying them all by ten baffles me -- it's like calculating in furlongs per fortnight.)

dB's vis-a-vis Volts

In the electrical domain, it's sometimes more convenient to measure voltage than power.

Volts can be related to power like this: P = V*V / R, where R is a resistance.
That is, power goes as the square of voltage.

For two voltages V1 and V2, measured across two resistances (impedances) R1 and R2 a little algebra gives you:

P1 = V1^2 / R1
P2 = V2^2 / R2
dB = 10 * log10 ((V1^2 / R1) / (V2^2 / R2))

If R1 == R2, this simplifies to

dB = 10 * log10 ((V1/V2)^2)
db = 10 * 2 * log10 (V1/V2)
db = 20 * log10 (V1/V2)

dBm's

If you thought that was simple, they've thought of more stuff to complicate
your life. A dBm is a dB value calculated against a 1-milliwatt value.
Yep, not one watt, but a thousandth of a watt. Again the bogons have inserted
random factors into what ought to be simple.

Thus a 5dBm signal is a 0.5 Bel signal times 0.001 watt. 0.5 Bel is 10**0.5
or about 3.16. Thus 5 dBm is an inconvenient way to write 0.00316 watts. Didn't you always want to know
that?

A few handy numbers

Power

3 dB is a factor of 2   [10 * log10 (2) = 3.01]
6 dB is a factor of 4
10 dB is a factor of 10
20 dB is a factor of 100
-3 dB is a factor of 1/2
-6 dB is a factor of 1/4
-10 dB is a factor of 1/10
-20 dB is a factor of 1/100

Voltage

3 dB is a factor of 1.414
6 dB is a factor of 2
12 dB is a factor of 4
20 dB is a factor of 10
40 dB is a factor of 100
-3 dB is a factor of 0.707
-6 dB is a factor of 1/2
-12 dB is a factor of 1/4
-20 dB is a factor of 1/10
-40 dB is a factor of 1/100

----
CategoryDefinition



Amplitude Demodulation


Description

----

Classes:


AM demodulation block, 10 KHz channel.
This block demodulates an AM channel conformant to 10K0A3E emission
standards, such as broadcast band AM transmissions.
@param channel_rate:  incoming sample rate of the AM baseband
@type sample_rate: integer
@param audio_decim: input to output decimation rate
@type audio_decim: integer

Examples:

Image(AmDemod.png).


Application Program Interfaces

This section documents the interfaces to programs and functions that are part of GNU Radio.

While the eventual goal is for this section to provide complete documentation on all programs and functions, this is a slow, evolutionary process that will probably never be more than partially completed. Therefore, to provide the greatest utility as quickly as possible, this section focuses on items NOT contained in other obvious places - most specifically any command line help option that is available for the program or function in question.

Python Programs


usrp_rx_cfile.py

USAGE: usrp_rx_cfile.py [options] outputfilename
(NOTE: Contrary to the above description, the -f option is not optional)

LOCATION: gnuradio-examples/python/usrp

PURPOSE: To record data from a USRP RX (receiver) Daughterboard and dump it to a file.

OUTPUT: The data is written to the file as binary I,Q pairs. By default, values are IEEE single-precision (4-byte) floats but 16-bit integers can be selected using the -s option. The Endian-ness of the data is that of the processor.

COMMAND LINE OPTIONS


-f FREQ

DESCRIPTION: Set mixer frequency.

FORMAT: Engineering notation - a float followed immediately by an S.I. suffix (e.g., 3M or 2.9k).

DEFAULT VALUE: none (this is a required option - and, yes, that's an oxymoron)

FREQ is the frequency for the quadrature mixer located on the USRP. The incoming signal is multiplied by sin(FREQ*2pi*t) to yield the I output and cos(FREQ*2pi*t) to yield the Q output. This results in a frequency translation of the signal.

FREQ can be any value from -f~s~/2 to +f~s~/2. A value of 0 will result in no signal on the I output and the input signal being transferred directly to the Q output (after passing through the decimation filter).

-R RX_SUBDEV_SPEC

DESCRIPTION: Select signal source.

FORMAT: {A,B}[:{0,1}] (e.g., A or B:1)

DEFAULT VALUE: A (same as A:0)

The USRP has two slots for RX daughterboards, RXA and RXB. This option selects which daughterboard the data will be taken from. The RX daughterboard selected may also have two input ports, in which case a number following a colon can be added to select which one with :0 selecting the first input and :1 selecting the other. For instance, on the BasicRX board, the inputs are labeled "RX-A" and "RX-B", if this board is plugged into RXB on the USRP, then B:0 will select RX-A on this board while B:1 will select RX-B on it.

-d DECIM

DESCRIPTION: Set decimation factor.

FORMAT: An even integer in the range from 4 to 256

DEFAULT: 16

The output from the mixer is decimated by a factor of decimation factor

The USRP sampling frequency is typically 64 MSa/s, so a decimation factor of 64 will result in an effective sampling rate of 1 MSa/s being written to the file.

-N SAMPLES

DESCRIPTION: Set limit on number of samples to acquire.

FORMAT: positive integer

DEFAULT: infinity

The program is to terminate after collecting and writing the specified number of samples to the file. By default, the program will continue writing data until killed by the User.

-s

DESCRIPTION: Change output format to short integers instead of floats

FORMAT: No arguments

DEFAULT: IEEE single-precision (32-bit) floats.

If specified, the program will output 16-bit signed integers instead of 32-bit floats.


Installing on Arch Linux

Install the dependencies using pacman:
$ sudo pacman -S fftw wxpython libusb guile swig cppunit boost portaudio sdl gputils alsa-utils

You'll want alsa-utils to pot up your soundcard's output.

Build and install sdcc

To build sdcc, download and extract the package from the AUR http://aur.archlinux.org/packages.php?ID=6671 and run
$ makepkg

in the sdcc directory. To install sdcc, run
$ sudo pacman -U sdcc-XXX.pkg.tar.gz

replacing XXX with whatever package version and architecture was built. If you have yaourt installed you can build and install using:
$ yaourt -S sdcc

Downgrading

It may be necessary to downgrade some packages, as Arch typically has the very latest gcc and python, and gnuradio may not be ported to the latest versions yet. For instructions on how to do so consult the Arch Linux wiki

Build gnuradio

Now you can unpack and build gnuradio normally ala:
$ ./configure
$ make
$ make check
$ sudo make install.

(Don't forget to run ./bootstrap if building from the git repository)

Add paths to your .bashrc

You'll need to have these environment variables set in order to run the examples, so you can put these in your ~/.bashrc
PYTHONPATH=/usr/local/lib/python2.6/site-packages
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

ADROIT was a project funded by DARPA's ACERT program to create collaborative teams of cognitive software radios.
ADROIT uses GNU Radio and has implemented an 802.11 receiver.

ADROIT also provided funding for development of m-blocks.

The 802.11 code may be found on the ACERT Collaboration Server within the adroitgrdevel project.
The CVS repository may be browsed.
See also hints for 802.11 usage.


The GNU Radio Build Configuration System

The GNU Radio source code build system uses the standard method:

$ ./configure
$ make
$ sudo make install

or using an alternate build directory:

$ mkdir build
$ cd build
$ ../configure
$ make
$ sudo make install

to build and install the software. This is a sufficient starting point for most users.

GNU Radio consists of a set of component libraries, simply called "components" in what follows.

Each component lives in a separate directory off the source code tree root, and has a set of prerequisites for which the 'configure' script tests. Depending on the outcome of these configuration checks, the build system either selects or deselects individual components to build, test, and install. The default behavior is to perform all configuration tests, build all components that pass, and ignore the ones that don't.

Some users may wish to have finer control over what gets built and what does not, and the build system provides a facility to accomplish that. The build system also allows for incremental installation of individual components.

Build System Configuration Options

Three options exist for each component in the GNU Radio source code tree:

--enable-foo
--disable-foo
--with-foo[=arg]

where *foo* is the directory name of the component to be affected, and for the last option *arg* is the full path to the pkg-config file for foo ('foo.pc').

There are also:

--enable-all-components
--disable-all-components

These apply to all components in the tree that are not further specified on the configure script command line.

Default Behavior

Controlling individual components using --enable-foo, --disable-foo, and --with-foo[=arg]

Specifying --enable-foo causes the build system to consider it an error if configuration checks fail for the *foo* component, and exit with an error when that happens ('error out'). This option is suitable for ensuring that a particular component gets built and installed, or for understanding why configure errored out when the checks fail.

Specifying --disable-foo prevents that component from being built or installed even if its configuration checks pass. This option is suitable for components that you're not interested in or you know ahead of time won't pass configuration checks.

Specifying --enable-all-components or --disable-all-components applies the above behavior to everything that isn't otherwise specified later in the command line.

Specifying --with-foo causes the build system to look for the pkg-config file, using the provided PKG_CONFIG_PATH environment variable, for *foo* as evidence that the component *foo* is already installed. If *foo* is not already installed, the an error will be printed and configuration will stop. Significant efforts have been made to ensure that if --with-foo is specified, and *foo* is installed, then the paths to *foo*'s libraries and header files will not interfere with those from the --enable'd components.

Speficying --with-foo=arg is the same as --with-foo, except that component *foo* is searched for solely using PKG_CONFIG_PATH=arg.

NOTE: Specifying both --enable-foo and --with-foo will result in an error.

NOTE: When using --with-foo[=arg] : Because the build system uses pkg-config to locate components, PKG_CONFIG_PATH must include the full path (e.g. "/opt/local/lib/pkgconfig") of those packages unless they are installed in the --prefix provided to configure since that path is internally prepended to PKG_CONFIG_PATH.

WARNING: It is possible to install components into different --prefix's, and thus to include them as pre-installed using the --with option. The build system will use the first found pkg-config file for any given pre-installed and --with included component.

Common Use Cases

Default Behavior:

$ ./configure

Select for build and installation everything that passes configuration checks.

Checking for Everything:

$ ./configure --enable-all-components

Select everything for build and installation, except exit with an error message if any configuration check doesn't pass. This will likely fail for everyone because some platform-specific configuration checks are mutually exclusive (such as the various audio modules for different systems).

Selective Build:

$ ./configure --enable-all-components \
              --disable-foo1 \
              --disable-foo2

where *foo1* and *foo2* are components that will fail and you don't care about, or that you don't want to build regardless. Otherwise you want the build to fail if anything else fails configuration checks. For example, on a Linux system that otherwise has all the build dependent libraries installed:

$ ./configure --enable-all-components \
              --disable-gr-audio-osx \
              --disable-gr-audio-windows \
              --disable-gr-audio-oss

will ignore the non-Linux platform modules as well as the OSS audio stuff (which would otherwise compile ok).

Build Using Pre-Installed Components:

$ ./configure --disable-all-components \
              --enable-foo1 \
              --with-foo2

will try to build component *foo1* using just the already-installed library and header files for component *foo2* as found by pkg-config in the provided PKG_CONFIG_PATH.

Build Using Pre-Installed Components at a Specific Location:

$ ./configure --disable-all-components \
              --enable-foo1 \
              --with-foo2=bar

will try to build component *foo1* using just the already-installed library and header files for component *foo2* as found by pkg-config in PKG_CONFIG_PATH=bar.

"Minimal" Component Builds

To select a single component to build and install, use:

$ ./configure --disable-all-components \
              --enable-foo

where *foo* is a single component directory. This will cause the build to fail if *foo* doesn't pass configuration checks, and ignore any other packages.

WARNING: Individual GNU Radio components generally depend upon other components (such as *gnuradio-core*) to successfully compile. When using --disable-all-components, each component dependency must be specified via an --enable or --with option. The build system will produce an error if dependencies are not met, and most likely that component build will be skipped.

For example, component *gr-usrp* depends on components *usrp* and *gnuradio-core*. The former depends on components *omnithread*, *mblock*, and *pmt*. The latter depends on the component *omnithread*, which is redundant with the *usrp*'s dependencies. Hence, from a fresh source code build with nothing already installed, one would need to use the following command line in order to try to build *gr-usrp*:

$ ./configure --disable-all-components \
              --enable-gr-usrp \
              --enable-gnuradio-core \
              --enable-usrp \
          --enable-pmt \
          --enable-mblock \
          --enable-omnithread

The order of these on the configure command line is not important; the build system knows the proper order in which to build them.

As another example, suppose that components *usrp* (and its dependents) are already installed, via the commands:

$ ./configure --disable-all-components \
              --enable-usrp \
          --enable-pmt \
          --enable-mblock \
          --enable-omnithread
$ make
$ sudo make install
Then one could use those pre-installed components and build *gr-usrp* via the command:
$ ./configure --disable-all-components \
            --enable-gr-usrp
              --enable-gnuradio-core \
              --with-usrp \
          --with-pmt \
          --with-mblock \
          --with-omnithread

Making Distribution Tarballs

Regardless of what gets enabled, disabled, or included via --with-foo[=arg], the 'make dist' and 'make distcheck' operations will create a source distribution tarball of the entire collection of components.


Building GNU Radio

To build and install GNU Radio, you may either download a release tarball, or you may use the git client software to check out code from our git repository. Some operating systems may have binary installation packages available; see Operating System Specific Instructions below.

To checkout the latest stable release code, go to:
http://gnuradio.org/releases/gnuradio
To instead checkout the latest code from the development trunk, enter this on the command line:
$ git clone http://gnuradio.org/git/gnuradio.git

In general, if you are developing GNU Radio applications which need to depend on the stability of the features and API of GNU Radio components, it is recommended that you use the 3.2 stable release series.

To get a handle on what's going on, clone the repository (if you haven't already), then run "qgit" or one of the other git viewers on it. It will show you all of the branching and merging, diffs, etc.

First, ensure that you've fulfilled the dependencies specified in the top-level
http://gnuradio.org/redmine/repositories/changes/gnuradio/README.
Most GNU/Linux systems come with our dependencies already packaged.
You may need to install them off of your install CD/DVD or over the net.
See below for Operating System specific notes.

To compile, there are 5 steps. Start by cd'ing to the gnuradio directory, then complete the
following commands:

$ ./bootstrap         # Do NOT perform this step if you are building from a tarball.
$ ./configure
$ make
$ make check
$ sudo make install

This will perform all configuration checks and select for build, test, and installation all components that pass.

For finer control, read the instructions at BuildConfiguration.

Dealing with Old Build Problems

1) Uninstall gnuradio:

$ sudo make uninstall

2) To restore the original git files from any added files during an old build:

$ git clean -d -x -f

Then you can bootstrap, configure, make, etc.

Problems with configure

Some modules that I need will not be built

Operating System Specific Instructions

This section links to guides which go into more specific detail for a given operating system, outlining how to fulfill the build prerequisites, any non-standard build steps that must be taken, and general configuration issues. If a given operating system has binary installation packages or another automated way to build GNU Radio, it will be listed here.

Installation on the Play Station 3

USRP FPGA Firmware

To compile the verilog source code for the fpga firmware for the usrp you need Altera Quartus II Web Edition. This is only needed if you change the verilog code, since the distribution contains precompiled versions of this firmware.

How to run Quartus II under Linux

Current Known Build Problems

TicketQuery(component=build&


Port GNU Radio to the Cell Processor.


Component ezdop

Low-level interface to the AE6HO EZ Doppler radiolocation hardware. Can be used outside the GNU Radio framework.

Repository

[source:/gnuradio/trunk/ezdop /gnuradio/trunk/ezdop]

Status

Current tickets regarding ezdop.

Current Defects

TicketQuery(component=ezdop&

Current Enhancement Requests

TicketQuery(component=ezdop&

Current Tasks

TicketQuery(component=ezdop&


Component gnuradio-core

Repository

[source:/gnuradio/trunk/gnuradio-core /gnuradio/trunk/gnuradio-core]

Status

Current Defects

TicketQuery(component=gnuradio-core&

Current Enhancement Requests

TicketQuery(component=gnuradio-core&

Current Tasks

TicketQuery(component=gnuradio-core&


Component gnuradio-examples

Example programs on how to use the GNU Radio software package.

Repository

[source:/gnuradio/trunk/gnuradio-examples /gnuradio/trunk/gnuradio-examples]

Status

Current tickets regarding gnuradio-examples.

Current Defects

TicketQuery(component=gnuradio-examples&

Current Enhancement Requests

TicketQuery(component=gnuradio-examples&

Current Tasks

TicketQuery(component=gnuradio-examples&


Component gr-atsc

Implementation of Advanced Television Systems Committee ATSC digital video standard.

Repository

[source:/gnuradio/trunk/gr-atsc /gnuradio/trunk/gr-atsc]

Status

Current tickets regarding gr-atsc.

Current Defects

TicketQuery(component=gr-atsc&

Current Enhancement Requests

TicketQuery(component=gr-atsc&

Current Tasks

TicketQuery(component=gr-atsc&


Component gr-audio-alsa

Interface to the Advanced Linux Sound Architecture (ALSA).

Repository

[source:/gnuradio/trunk/gr-audio-alsa /gnuradio/trunk/gr-audio-alsa]

Status

Current tickets regarding gr-audio-alsa.

Current Defects

TicketQuery(component=gr-audio-alsa&

Current Enhancement Requests

TicketQuery(component=gr-audio-alsa&

Current Tasks

TicketQuery(component=gr-audio-alsa&


Component gr-audio-jack

Interface to the Jack Audio Connection Kit (JACK).

Repository

[source:/gnuradio/trunk/gr-audio-jack /gnuradio/trunk/gr-audio-jack]

Status

Current tickets regarding gr-audio-jack.

Current Defects

TicketQuery(component=gr-audio-jack&

Current Enhancement Requests

TicketQuery(component=gr-audio-jack&

Current Tasks

TicketQuery(component=gr-audio-jack&


Component gr-audio-oss

Interface to the Open Sound System audio API (OSS).

Repository

[source:/gnuradio/trunk/gr-audio-oss /gnuradio/trunk/gr-audio-oss]

Status

Current tickets regarding gr-audio-oss.

Current Defects

TicketQuery(component=gr-audio-oss&

Current Enhancement Requests

TicketQuery(component=gr-audio-oss&

Current Tasks

TicketQuery(component=gr-audio-oss&


Component gr-audio-osx

Interface to the Mac OSX audio subsystem

Repository

[source:/gnuradio/trunk/gr-audio-osx /gnuradio/trunk/gr-audio-osx]

Status

Current tickets regarding gr-audio-osx.

Current Defects

TicketQuery(component=gr-audio-osx&

Current Enhancement Requests

TicketQuery(component=gr-audio-osx&

Current Tasks

TicketQuery(component=gr-audio-osx&


Component gr-audio-portaudio

Interface to the PortAudio portable cross-platform audio API.

Repository

[source:/gnuradio/trunk/gr-audio-portaudio /gnuradio/trunk/gr-audio-portaudio]

Status

Current tickets regarding gr-audio-portaudio.

Current Defects

TicketQuery(component=gr-audio-portaudio&

Current Enhancement Requests

TicketQuery(component=gr-audio-portaudio&

Current Tasks

TicketQuery(component=gr-audio-portaudio&


Component gr-audio-windows

Interface to the Win32 audio subsystem.

Repository

[source:/gnuradio/trunk/gr-audio-windows /gnuradio/trunk/gr-audio-windows]

Status

Current tickets regarding gr-audio-windows.

Current Defects

TicketQuery(component=gr-audio-windows&

Current Enhancement Requests

TicketQuery(component=gr-audio-windows&

Current Tasks

TicketQuery(component=gr-audio-windows&


Component gr-comdi

Interface to the Linux Control and Measurement Device Interface API.

Repository

[source:/gnuradio/trunk/gr-comedi /gnuradio/trunk/gr-comedi]

Status

Current tickets regarding gr-comedi.

Current Defects

TicketQuery(component=gr-comedi&

Current Enhancement Requests

TicketQuery(component=gr-comedi&

Current Tasks

TicketQuery(component=gr-comedi&


Component gr-error-correcting-codes

Implementation of various error correcting channel codes.

Repository

[source:/gnuradio/trunk/gr-error-correcting-codes /gnuradio/trunk/gr-error-correcting-codes]

Status

Current tickets regarding gr-error-correcting-codes.

Current Defects

TicketQuery(component=gr-error-correcting-codes&

Current Enhancement Requests

TicketQuery(component=gr-error-correcting-codes&

Current Tasks

TicketQuery(component=gr-error-correcting-codes&


Component gr-ezdop

Low-level interface to the AE6HO EZ Doppler radiolocation hardware. Can be used outside the GNU Radio framework.

Repository

[source:/gnuradio/trunk/gr-ezdop /gnuradio/trunk/gr-ezdop]

Status

Current tickets regarding gr-ezdop.

Current Defects

TicketQuery(component=gr-ezdop&

Current Enhancement Requests

TicketQuery(component=gr-ezdop&

Current Tasks

TicketQuery(component=gr-ezdop&


gr-gpio

Description

gr-gpio is an extension to the normal USRP firmware, implemented as an alternative FPGA bitstream, using the existing USRP host code. With the gr-gpio component you can transmit and receive a digital stream to and from the USRP which is aligned with the existing analog stream. Digital data is sent to or received from the daughterboard GPIO pins and sacrifice one bit each from the I and the Q analog streams to transport the digital bits.

Receiving Streaming Digital Samples

Digital streams are sampled from GPIO 14 and GPIO 15 from the selected daughterboard and replace the LSB of the I and Q analog streams, respectively. In the host, on can then use usrp.source_s() to obtain the combined streams and separate them with logical bit operations. The GPIO pins are sampled at the decimated RF rate; that is, the GPIO data replaces the LSBs at the output of the digital downconverter. As a result of pipeline delays in the analog processing stream, there will be a fixed but decimation rate dependent delta between the analog and digital streams.

Transmitting Streaming Digital Samples

In the host, one uses usrp.sink_s() and encodes the desired digital data into the LSBs of the I and Q sample data. These are then routed to GPIO 14 and GPIO 15 of the selected daughterboard. The data is output on the GPIO pins at the same rate as the sample data arriving over the USB. Due to pipeline delays in the analog processing stream, there will be a fixed but interpolation rate dependent delta between the analog and digital streams.

Note: The headers on the daughterboards have a line of ground pins next to the gpio pins. Also, it is not safe for some daughterboards to connect all pins on the RX header to all pins of the TX header using a flat cable for a loopback test. Only connect GPIO pins 14 and 15 (and the corresponding ground pins).

Installing gr-gpio

gr-gpio is available as part of the standard GNU Radio build and has no additional external dependencies. Without additional configuration, the gr-gpio component:

The USRP host code is not changed.

Using gr-gpio

To receive streaming digital samples, one first creates a USRP source block using the gr-gpio FPGA bitstream:

from gnuradio import gpio

u = usrp.source_s(fpga_filename=gpio.fpga_filename, ...) # In addition to any other parameters

Create and configure daughterboard object as normally done.

Note: when using the BasicRX or LFRX daughterboards, one must ensure the receive MUX is set to enable complex
the mux value manually.

If using the daughterboard in RXA use:

<pre>

If using the daughterboard in RXB use:

<pre>

Since the USRP source is instantiated with usrp.source_s() it will produce a datastream of interleaved shorts:

<pre>
<pre>
  ...br
<pre>

To make packing and unpacking the analog and digital sample streams easier a new gnuradio block has been added:

<pre>

<pre>

To extract the digital values create and insert into the flowgraph:

<pre>

To extract the analog stream use:

<pre>

After the ana_strip block the stream becomes:

<pre>
<pre>
  ...br
<pre>

<pre>
convert the stream into a series of complex values.

After the dig_strip the stream becomes:

<pre>
<pre>
  ...br
<pre>

<pre>

*To transmit streaming digital samples*, one first creates a USRP sink block using the *gr-gpio* FPGA bitstream:

<pre>
from gnuradio import gpio

u = usrp.sink_s(fpga_filename=gpio.fpga_filename, ...) # In addition to any other parameters
</pre>

This block expects 16-bit interleaved short input samples, with the LSB of I and Q encoded with the values that will be driven onto GPIO pins 14 and 15:

<pre>
<pre>
  ...br
<pre>

h2. Example Applications with gr-gpio

gr-gpio installs the following scripts in $prefix/bin:

<pre>

<pre>
$ gpio_rx_sfile.py --help
usage: gpio_rx_sfile.py: [options] analog_filename digital_filename

options:
 -h, --help            show this help message and exit
 -R RX_SUBDEV_SPEC, --rx-subdev-spec=RX_SUBDEV_SPEC
                       select USRP Rx side A or B (default=A)
 -d DECIM, --decim=DECIM
                       set fgpa decimation rate to DECIM [default=16]
 -f FREQ, --freq=FREQ  set frequency to FREQ
 -g GAIN, --gain=GAIN  set gain in dB (default is midpoint)
 -N NSAMPLES, --nsamples=NSAMPLES
                       number of samples to collect [default=+inf]
 -F, --force-complex-RXA
                       enable basicRX hack to force complex mode on basicRX
                       and LFRX. Only works on side A. Only use with --gain 0
</pre>

<pre>

<pre>
 $gpio_usrp_siggen.py --help
usage: gpio_usrp_siggen.py [options]

options:
 -h, --help            show this help message and exit
 -T TX_SUBDEV_SPEC, --tx-subdev-spec=TX_SUBDEV_SPEC
                       select USRP Tx side A or B
 -f RF_FREQ, --rf-freq=RF_FREQ
                       set RF center frequency to FREQ
 -i INTERP, --interp=INTERP
                       set fgpa interpolation rate to INTERP [default=512]
 --sine                generate a complex sinusoid [default]
 --gaussian            generate Gaussian random output
 --uniform             generate Uniform random output
 -w WAVEFORM_FREQ, --waveform-freq=WAVEFORM_FREQ
                       set waveform frequency to FREQ [default=100000.0]
 -a AMPL, --amplitude=AMPL
                       set waveform amplitude to AMPLITUDE [default=16000.0]
 -g GAIN, --gain=GAIN  set output gain to GAIN [default=none]
 -o OFFSET, --offset=OFFSET
                       set waveform offset to OFFSET [default=0]
 --digital             generate (only) a digital wave on lsb (will be output
                       on gpio pins with special usrp firmware)
</pre>

<pre>

<pre>
$ gpio_usrp_fft.py --help
usage: gpio_usrp_fft.py [options]

options:
 -h, --help            show this help message and exit
 -w NUM, --which=NUM   select which USRP (0, 1, ...) default is 0
 -A ANTENNA, --antenna=ANTENNA
                       select Rx Antenna (only on RFX-series boards)
 -d DECIM, --decim=DECIM
                       set fgpa decimation rate to DECIM [default=32]
 -f FREQ, --freq=FREQ  set frequency to FREQ
 -g GAIN, --gain=GAIN  set gain in dB (default is midpoint)
 -W, --waterfall       Enable waterfall display
 -8, --width-8         Enable 8-bit samples across USB
 -S, --oscilloscope    Enable oscilloscope display (default)
 -F, --fft             Enable FFT display
 -n FRAME_DECIM, --frame-decim=FRAME_DECIM
                       set oscope frame decimation factor to n [default=1]
 -v V_SCALE, --v-scale=V_SCALE
                       set oscope initial V/div to SCALE [default=1]
 -t T_SCALE, --t-scale=T_SCALE
                       set oscope initial s/div to SCALE [default=10us]
 --digital             show (only) the digital wave on lsb (will be input
                       from gpio pins with special usrp firmware)
 --analog              show (only) the analog wave on msbs (will be input
                       from analog inputs)
 --file=FILE           input from file FILE in stead of USRP (will be input
                       from raw file in interleaved short format)
</pre>

h3. Loopback Testing

To perform a digital loopback test using BasicRX and BasicTX boards installed in side A, 
connect GPIO pin 14 on the BasicTX to GPIO pin 14 on the BasicRX.  Do the same for GPIO pin 15.

In one console:
<pre>
$ gpio_usrp_fft.py --digital -R A -d 128 -S
</pre>

This will create an oscilloscope which only shows the lsb of RXA (hardcoded).

In another console:
<pre>
$ gpio_usrp_siggen.py --digital -i 512
</pre>

This will send a digital test pattern (which only uses lsb) to TXA (hardcoded).


Component gr-gsm-fr-vocoder

Implementation of GSM 06.10 13 kbps voice codec.

Repository

[source:/gnuradio/trunk/gr-gsm-fr-vocoder /gnuradio/trunk/gr-gsm-fr-vocoder]

Status

Current tickets regarding gr-gsm-fr-vocoder.

Current Defects

TicketQuery(component=gr-gsm-fr-vocoder&

Current Enhancement Requests

TicketQuery(component=gr-gsm-fr-vocoder&

Current Tasks

TicketQuery(component=gr-gsm-fr-vocoder&


Component gr-howto-write-a-block

Tutorial on how to write a block for GNU Radio.

Repository

[source:/gnuradio/trunk/gr-howto-write-a-block /gnuradio/trunk/gr-howto-write-a-block]

Status

Current tickets regarding gr-howto-write-a-block.

Current Defects

TicketQuery(component=gr-howto-write-a-block&

Current Enhancement Requests

TicketQuery(component=gr-howto-write-a-block&

Current Tasks

TicketQuery(component=gr-howto-write-a-block&


Component gr-pager

Implementation of pager protocols.

Repository

[source:/gnuradio/trunk/gr-pager /gnuradio/trunk/gr-pager]

Status

Current tickets regarding gr-pager.

Current Defects

TicketQuery(component=gr-pager&

Current Enhancement Requests

TicketQuery(component=gr-pager&

Current Tasks

TicketQuery(component=gr-pager&


Component gr-qtgui

Provides Qt-based graphical user interface routines.

Repository

[source:/gnuradio/trunk/gr-qtgui /gnuradio/trunk/gr-qtgui]

Status

Current tickets regarding gr-qtgui.

Current Defects

TicketQuery(component=gr-qtgui&

Current Enhancement Requests

TicketQuery(component=gr-qtgui&

Current Tasks

TicketQuery(component=gr-qtgui&


Component gr-radar

Work-in-progress implementation of passive radar.

Repository

[source:/gnuradio/trunk/gr-radar /gnuradio/trunk/gr-radar]

Status

Current tickets regarding gr-radar.

Current Defects

TicketQuery(component=gr-radar&

Current Enhancement Requests

TicketQuery(component=gr-radar&

Current Tasks

TicketQuery(component=gr-radar&


Component gr-radio-astronomy

Radio Astronomy application based on USRP.

Repository

[source:/gnuradio/trunk/gr-radio-astronomy /gnuradio/trunk/gr-radio-astronomy]

Status

Current tickets regarding gr-radio-astronomy.

Current Defects

TicketQuery(component=gr-radio-astronomy&

Current Enhancement Requests

TicketQuery(component=gr-radio-astronomy&

Current Tasks

TicketQuery(component=gr-radio-astronomy&


Component gr-rdf

Work-in-progress radio direction finding routines.

Repository

[source:/gnuradio/trunk/gr-rdf /gnuradio/trunk/gr-rdf]

Status

Current tickets regarding gr-rdf.

Current Defects

TicketQuery(component=gr-rdf&

Current Enhancement Requests

TicketQuery(component=gr-rdf&

Current Tasks

TicketQuery(component=gr-rdf&


Component gr-trellis

Implementation of various Tellis coding methods.

Repository

[source:/gnuradio/trunk/gr-trellis /gnuradio/trunk/gr-trellis]

Status

Current tickets regarding gr-trellis.

Current Defects

TicketQuery(component=gr-trellis&

Current Enhancement Requests

TicketQuery(component=gr-trellis&

Current Tasks

TicketQuery(component=gr-trellis&


Component gr-usrp

GNU Radio interface to the USRP.

Repository

[source:/gnuradio/trunk/gr-usrp /gnuradio/trunk/gr-usrp]

Status

Current tickets regarding gr-usrp.

Current Defects

TicketQuery(component=gr-usrp&

Current Enhancement Requests

TicketQuery(component=gr-usrp&

Current Tasks

TicketQuery(component=gr-usrp&


Component gr-video-sdl

Interface to the SDL video library.

Repository

[source:/gnuradio/trunk/gr-video-sdl /gnuradio/trunk/gr-video-sdl]

Status

Current tickets regarding gr-video-sdl.

Current Defects

TicketQuery(component=gr-video-sdl&

Current Enhancement Requests

TicketQuery(component=gr-video-sdl&

Current Tasks

TicketQuery(component=gr-video-sdl&


Component gr-wxgui

Provides wxPython-based graphical user interface routines.

Repository

[source:/gnuradio/trunk/gr-wxgui /gnuradio/trunk/gr-wxgui]

Status

Current tickets regarding gr-wxgui.

Current Defects

TicketQuery(component=gr-wxgui&

Current Enhancement Requests

TicketQuery(component=gr-wxgui&

Current Tasks

TicketQuery(component=gr-wxgui&

GL Sinks

The following graphical sinks have been implemented in PyOpenGL.

The scope, fft, and waterfall sinks are drop-in replacements for the non-gl sinks.

Enable the GL Sinks

Rather than modifying existing programs, the GL sinks can be enabled via a configuration file.
To enable the GL sinks, edit or create ~/.gnuradio/config.conf and add the following lines:

[wxgui]
style=gl

Additional configuration options can be found in the README.gl.

PyOpenGL Issues

Certain graphics card/drivers cause the GL sinks to segfault.
Here is a list of known problem cards and potential solutions.

* Card * * OS * * Verbose * * Solution *
Intel G965 Unknown segmentation fault LIBGL_ALWAYS_INDIRECT=1
Intel G945 Ubuntu no issues

Also, if rendering is slow and CPU intensive, try disabling visual effects/compositioning.

Note: If you're getting this error "RuntimeError: Unable to import OpenGL. Are Python wrappers for OpenGL installed?", then you need to install the package "python-opengl"!


Component mblock

Work-in-progress message block implementation

Repository

[source:/gnuradio/trunk/mblock /gnuradio/trunk/mblock]

Status

Current tickets regarding mblock.

Current Defects

TicketQuery(component=mblock&

Current Enhancement Requests

TicketQuery(component=mblock&

Current Tasks

TicketQuery(component=mblock&


Component omnithread

Provides the cross-platform threading capabilities for GNU Radio.

Repository

[source:/gnuradio/trunk/omnithread /gnuradio/trunk/omnithread]

Status

Current tickets regarding omnithread.

Current Defects

TicketQuery(component=omnithread&

Current Enhancement Requests

TicketQuery(component=omnithread&

Current Tasks

TicketQuery(component=omnithread&


GNU Radio Components

GNU Radio is divided into a number of self-contained components which provide some logical unit of functionality.

Components that exist in the repository trunk today are:

Base System

gnuradio-core
Provides the runtime and various signal processing primitives

gnuradio-examples
Examples and demonstrations of GNU Radio functionality

gr-howto-write-a-block
Tutorial on how to write a block for GNU Radio

omnithread
Provides the cross-platform threading capabilities for GNU Radio

pmt
Work-in-progress implementation of polymorphic types

mblock
Work-in-progress message block implementation

Hardware Support

usrp
Low-level interface to the Universal Software Radio Peripheral (USRP). Can be used outside the GNU Radio framework.

gr-usrp
GNU Radio interface to the USRP

gr-comedi
Interface to the Linux Control and Measurement Device Interface API

ezdop
Low-level interface to the AE6HO EZ Doppler radiolocation hardware. Can be used outside the GNU Radio framework.

gr-ezdop
GNU Radio interface to the EZ Doppler

Audio Device Support

Usually only one of these needs to be used at a time.

gr-audio-alsa
Interface to the Advanced Linux Sound Architecture (ALSA)

gr-audio-jack
Interface to the Jack Audio Connection Kit (JACK)

gr-audio-oss
Interface to the Open Sound System audio API (OSS)

gr-audio-osx
Interface to the Mac OSX audio subsystem

gr-audio-portaudio
Interface to the PortAudio portable cross-platform audio API

gr-audio-windows
Interface to the Win32 audio subsystem

Graphics Support

gr-qtgui
Provides Qt-based graphical user interface routines

gr-wxgui
Provides wxPython-based graphical user interface routines

gr-video-sdl
Interface to the SDL video library

General Signal Processing

gr-trellis
Implementation of various Trellis coding methods

gr-gsm-fr-vocoder
Implementation of GSM 06.10 13 kbps voice codec

Specialty Application Areas

gr-atsc
Implementation of Advanced Television Systems Committee ATSC digital video standard

gr-pager
Implementation of pager protocols

gr-radar
Work-in-progress implementation of passive radar

gr-radio-astronomy
Radio Astronomy application based on USRP

gr-rdf
Work-in-progress radio direction finding routines


Component pmt

GNU Radio component for polymorphic types.

Repository

[source:/gnuradio/trunk/pmt /gnuradio/trunk/pmt]

Status

Current tickets regarding pmt.

Current Defects

TicketQuery(component=pmt&

Current Enhancement Requests

TicketQuery(component=pmt&

Current Tasks

TicketQuery(component=pmt&


Component usrp

Low-level interface to the Universal Software Radio Peripheral (USRP). Can be used outside the GNU Radio framework.

Repository

[source:/gnuradio/trunk/usrp /gnuradio/trunk/usrp]

Status

Current tickets regarding usrp.

Current Defects

TicketQuery(component=usrp&

Current Enhancement Requests

TicketQuery(component=usrp&

Current Tasks

TicketQuery(component=usrp&


Building and Installing CppUnit on Cygwin

GNU Radio uses CppUnit for testing. Although users are not required to run the tests, the installation procedure requires that the code for testing be available.

Note: If you installed cppunit 1.9.14-1 using Cygwin setup, you should uninstall it (using Cygwin setup) before building cppunit 1.12.0.

(1) Download cppunit-1.12.0.tar.gz from https://sourceforge.net/project/showfiles.php?group_id=11795 to /usr/src (i.e., C:\cygwin\usr\src on a default Cygwin installation). Unpack with
$ cd /usr/src
$ tar zxf cppunit-1.12.0.tar.gz
(2) If your gcc is older than 3.4.4-2: Download the patch file cppunit_dll_string.patch from [attachment:#56:cppunit_dll_string.patch] (using the "Original Format" link at the bottom of the page) to /usr/src. Apply the patch with
$ cd /usr/src/cppunit-1.12.0
$ patch -p0 -i ../cppunit_dll_string.patch
$ aclocal -I config
$ autoconf

If your gcc-core and gcc-g++ are version 3.4.4-2 or newer (cygcheck -c gcc-g++) you can skip this step. (3) Build and install with:
$ ./configure
$ make
$ make check
$ make install

CppUnit is installed under /usr/local/* by default.

Notes:


Cross Compiling GNU Radio for the Cell Processor

This page explains how to compile GNU Radio on an x86 or x86_64 platform, and
generate code for the Cell processor. This is most useful when developing
for the Sony PS3 which, because of it's small main memory size (256MB),
is a poor platform for software development.

Overview

There are several ways one can go about cross compiling anything. There are always
at least two machines involved: the build machine where the compilation takes place, and
the host machine where the resulting software runs. Oftentimes these machines have differing
architectures. In our case, the build machine is an x86 or x86-64 workstation
running GNU/Linux, while the host machine is a Cell based machine also running GNU/Linux. (These
instructions have been tested using a PS3, but are expected to work on a Cell bladeserver such as
the IBM QS21 too.)

The strategy described here requires that the build machine have read-only access via
NFS
to the root file system of the Cell host, and that both machines have read/write
access to a shared NFS file system.

Prerequisites

In order to be concrete, we call the build machine *build* and the host machine *ps3*.

At present the only RPM's available are for x86, x86_64 or Cell/BE machines running Fedora 7.
They also work fine on Fedora 8.
It should be possible to build the cross toolchain from source on virtually
any machine, but that is beyond the scope of this page.

* Your numeric uid and gid shall be the same on *build* and *ps3*. E.g.,
build$ id
uid=500(eb) gid=500(eb) groups=3(sys),10(wheel),500(eb),1000(usrp)

ps3$ id
uid=500(eb) gid=500(eb) groups=4(adm),10(wheel),500(eb),1000(usrp)
* Both *build* and *ps3* shall have ntp installed and operating and their clocks shall be synchronized.
$ sudo yum install ntp
$ sudo chkconfig --level 35 ntpd on
$ sudo service ntpd start

Details

Congratulations on making it this far! _You have handled all the prerequisites described
above, right?_ If not, please take care of them now. Google or your local sys admin can
provide assistance.

To cross compile there is some one-time stuff that needs to be done to set up everything between
*build* and *ps3*, and then there's the actual steps for cross compiling GNU Radio.

Setting up *build* and *ps3* so that they can talk

We need to arrange for *build* to be able to see the installed packages, includes
and libraries on *ps3* so that we can compile and link against them.
In addition, so that we can compile the software
on *build* but run the QA code (make check) on *ps3*, we must arrange that
they see a common file system, with identical path names to the shared file system from the root of each
system. (configure hard-codes absolute file names into the generated Makefile's).

Export the ps3 root filesystem read-only

You'll need to edit or create /etc/exports on *ps3* so that it contains something like this:
/       192.168.64.0/24(ro,all_squash)

Use man exports if you've got questions. Then run exportfs to have it take effect.
ps3$ sudo exportfs -a

Mount the ps3 root filesystem on build

On *build* create a mount point named /mnt/cell-root and mount the ps3 root there.
build$ sudo mkdir /mnt/cell-root
build$ sudo mount -o ro ps3:/ /mnt/cell-root
At this point you should be able to see the ps3 root filesystem from *build*.
(The warnings and question marks are normal. Special files aren't accessible across NFS.)
build$ ls -l /mnt/cell-root
ls: cannot access /mnt/cell-root/net: No such file or directory
ls: cannot access /mnt/cell-root/sys: No such file or directory
ls: cannot access /mnt/cell-root/dev: No such file or directory
ls: cannot access /mnt/cell-root/spu: No such file or directory
ls: cannot access /mnt/cell-root/home: No such file or directory
ls: cannot access /mnt/cell-root/proc: No such file or directory
ls: cannot access /mnt/cell-root/misc: No such file or directory
total 156
drwxr-xr-x  2 root root  4096 2007-11-08 04:56 bin
drwxr-xr-x  4 root root  4096 2007-10-25 17:34 boot
??????????  ? ?    ?        ?                ? dev
drwxr-xr-x 99 root root 12288 2007-11-08 15:18 etc
??????????  ? ?    ?        ?                ? home
drwxr-xr-x 16 root root  4096 2007-11-08 04:55 lib
drwxr-xr-x  7 root root  4096 2007-11-08 04:55 lib64
drwx------  2 root root 16384 2007-10-04 13:22 lost+found
drwxr-xr-x  2 root root  4096 2007-11-07 15:07 media
??????????  ? ?    ?        ?                ? misc
drwxr-xr-x  5 root root  4096 2007-11-08 13:12 mnt
??????????  ? ?    ?        ?                ? net
drwxr-xr-x  3 root root  4096 2007-10-24 13:41 opt
??????????  ? ?    ?        ?                ? proc
drwxr-xr-x  2 root root  4096 2007-11-08 19:50 proj
drwxr-x---  6 root root  4096 2007-11-07 13:55 root
drwxr-xr-x  2 root root 12288 2007-11-08 04:56 sbin
drwxr-xr-x  2 root root  4096 2007-10-04 13:26 selinux
??????????  ? ?    ?        ?                ? spu
drwxr-xr-x  3 root root  4096 2007-10-04 14:14 srv
??????????  ? ?    ?        ?                ? sys
drwxrwxrwt 14 root root  4096 2007-11-10 00:16 tmp
drwxr-xr-x 16 root root  4096 2007-09-19 08:18 usr
drwxr-xr-x 21 root root  4096 2007-10-04 14:43 var

If this doesn't work, check that NFS is running on *ps3* and *build*
and that there aren't any firewall rules that might be keeping you from connecting.
Look at /var/log/messages on both machines for clues. Once this is working, add a line to /etc/fstab on *build* so that
the filesystem is mounted automatically on boot.
ps3:/                   /mnt/cell-root          nfs     ro,intr,bg      0 0

Export the shared filesystem and mount it on both systems

Now we need to create the shared directory on *build*, export it, and then mount it
on both systems.

Find an existing filesystem on *build* that has at least a few gigs free, and
create a directory called share there. It should be readable and writable by your
regular login. The path isn't critical, just remember what you used. E.g.,
build$ mkdir /mnt/misc/share
Set up this directory for export by adding a line similar to this to /etc/exports on *build*:
/mnt/misc/share         192.168.64.0/24(rw)
Then export it:
build$ sudo exportfs -a
Create a mount point called /mnt/share on both machines:
build$ sudo mkdir /mnt/share
ps3$ sudo mkdir /mnt/share

and mount it on both machines:

build$ sudo mount build:/mnt/misc/share /mnt/share
ps3$ sudo mount build:/mnt/misc/share /mnt/share
You should be able to create a file from either machine and see it on the other.
E.g.,
build$ date > /mnt/share/foo

ps3$ cat /mnt/share/foo
Sat Nov 10 02:29:44 PST 2007

If this isn't working, take a look at /var/log/messages on both machines.

Once this is working, add a line to /etc/fstab on both machines so that the
mount will happen automatically at boot time:
build:/mnt/misc/share /mnt/share                  nfs     rw,intr,bg      0 0

Tweak filesystem on PS3 for cross compilation

A few symlinks need to be created on *ps3* and some linker scripts
need to be edited. There's a script that will do this for us.
The script is contained in the gnuradio trunk. As part of getting ready to do the
cross compilation, check out the gnuradio trunk into a directory on /mnt/share.
E.g.,
build$ mkdir /mnt/share/gr
build$ cd /mnt/share/gr
build$ svn co http://gnuradio.org/svn/gnuradio/trunk
Now, on *ps3* do this:
ps3$ sudo /mnt/share/gr/trunk/dtools/bin/tweak-cell-for-cross-compiling

Excellent! All the one-time set up is complete!

Do the Cross Compilation (Finally!)

Now on to the familar part...

To keep life simple we'll specify a *--prefix*
that's on /mnt/share. (This isn't required, but start this way. Otherwise, depending
on which machine you're on when you type "make install" you'll hose yourself with P(.5)
by installing binaries for the wrong architecture into /usr/local). The key difference
from native compilation is using the ./configure-cell-cross script instead
of ./configure directly. It accepts all the normal configure options.

On *build*:
build$ cd /mnt/share/gr/trunk
build$ ./bootstrap
build$ ./configure-cell-cross --prefix=/mnt/share/cell-install --with-boost=/mnt/cell-root/PLACE_YOU_INSTALLED_BOOST
build$ make  2>&1 | tee make.log
Assuming that configure and make completed successfully, we can
switch to *ps3* and run make check
ps3$ cd /mnt/share/gr/trunk
ps3$ make check
This should also work fine. When you're happy:
ps3$ make install
At this point the installed code should be ready to run. Be sure to set your
PYTHONPATH and PATH to point into your prefix:
ps3$ export PYTHONPATH=/mnt/share/cell-install/lib/python2.5/site-packages
ps3$ export PATH=$PATH:/mnt/share/cell-install/bin
Then try to run something:
ps3$ usrp_fft.py ...

Trouble Shooting

What could possibly go wrong???


Getting Started with Cygwin

This page tells you how to:

Installing Cygwin

Installing Cygwin is simple, but you must have administrator privileges for the initial installation, and you must either have administratior privileges or be the owner of the Cygwin registry entries to install Cygwin packages.

If you normally run with limited user privileges: Managing your Cygwin installation is easier if you are the owner of the Cygwin entries in the Windows registry.

The way to ensure this is to:
1. Log out of your usual account
2. Log into an account with administrator privileges and use the control panel to give your usual account administrator privileges
3. Switch to your usual account and install Cygwin using the procedure below
4. Log out of your usual account
5. Log into your administrator account and change your usual account back to limited user
If you do this, you will own the Cygwin entries in the registry. If you do not do this, you will need administrator privileges to install Cygwin packages.

There is also an option during the installation process to install Cygwin for "Just Me". This may be easier, but I have not tried it. You will still need administrator privileges if want to install a USRP.

To install Cygwin:

1. Go to http://www.cygwin.com
2. Click on "Mirror Sites" in the lefthand column and note the two mirror sites nearest you
3. Go back to http://www.cygwin.com and click on "Install Cygwin now"
4. Go ahead and run setup.exe; the default settings are fine, but you may want to make the "Local Package Directory" a subdirectory of your "Root Directory" (e.g., "C:\cygwin\setup")
5. When asked to choose a mirror site, choose one you selected above; if that one doesn't work, try the other one
6. Keep clicking "Next" until Cygwin has been installed; you probably want to click the boxes to put an icon on your desktop and add Cygwin to your startup menu

For convenience you may want to go back to http://www.cygwin.com, right-click on "Install Cygwin now" again, and save a copy of setup.exe in a convenient place (e.g., C:\cygwin\setup\setup.exe). You will be running setup.exe repeatedly to download and update Cygwin packages.

Starting a Cygwin Window

Most of the work in Cygwin is done by entering commands into a command prompt window. The commands you enter are interpreted by a GNU bash shell. You can start a Cygwin command window in one of the following ways:

Using setup.exe

One thing that makes Cygwin convenient is the ease of selecting and installing optional software packages with setup.exe. You can run setup.exe from the web, from a command prompt, or from Windows Explorer, depending on what privileges you have.

If you have administrator privileges or if you own the Cygwin registry entries, you can either:

If you have access to an account with administrator privileges and a non-blank password, you can:
1. Use Windows Explorer to navigate to the directory containing your saved setup.exe (if you have one) and double-click; then
2. Enter the account name and password when requested

Once Cygwin Setup is running, you can tell it to use the default values (Install from Internet; same root directory, "install for" setting, and default text file type as on your initial install; same local package directory; same internet connection; and same download site) until you get to the "Select Packages" window.

The "Select Packages" window is very powerful but is not immediately intutiive to all users, has no "Help" buttion, and the pop-up documentation may go away before you can finish reading it. The most important thing to know is that the "View" button cycles through several displays of packages:

Cygwin vs. Linux; Cygwin and Windows

Although Cygwin uses a bash shell and many of the same commands and programs as Linux, it is still running under the Windows operating system and must accommodate the needs and limitations of that system. Some of the important consequences are:

File and Path Names

End-Of-Line Conventions; Binary and Text Files

In Linux, lines in a text file are separated by a newline characters (ASCII Ctrl-J, often shown as !^J, or '\n' in C). In Windows, lines are separated by carriage return and newline characters (the two-character sequence ^J or "\r\n" in C). Many of the programs you will use with Cygwin don't care, but some do. When you see !^M popping up you know that there are Windows-style files around. When you look at a file in Windows Notepad and see all the lines running together with little boxes between them you know you are looking at a Linux-style file.

In general, when working on programs with Cygwin it is better to stick with the Linux \n line separators when possible. In particular, the Cygwin autoconf utility has problems with some .m4 files that include the !^M characters as line separators. This also means that it is better to use a Cygwin version of the Subversion program rather than a Windows version---the Windows version will give you the extra !^M characters with some files in some SVN repositories.

Permissions

The Linux su and sudo commands do not work on Cygwin. On Windows, access to some files and to parts of the Windows registry (a database of system configuration information) is limited to accounts with administrator privileges. Most files in Cygwin can be accessed without administrator privileges.

Many Windows systems are set up with administrator privileges on normal user accounts, but many users with Unix or Linux backgrounds prefer to work mostly as what Windows calls limited users. If you normally work in a limited user account and you need to access resources that require administrator privileges, you must to one of the following:

Where to Find More Infomation on Using Cygwin

The best places to start are the Cygwin FAQ and User's Guide. Both are available at http://www.cygwin.com, and they should also be installed on your machine (look under "Cygwin" in your "Start" -> "All Programs" menu). The User's Guide includes sections for Windows users who are new to Linux and Linux users who are new to Windows.


Installing GNU Radio with Cygwin

The easiest way to install GNU Radio on Windows is to use the Cygwin (http://www.cygwin.com) environment. Once Cygwin and the required utilities and third-party libraries are installed, installation of GNU Radio is as easy on Windows as it is on Linux.

These instructions are for release 3.2.2 and are current as of September 29, 2009. They cover installation of the core GNU Radio components and components for using the USRP, wxPython GUI, and PortAudio. They do not cover installation of components needed for USRP2, GRC, SDL video, or the Qt GUI.

To install GNU Radio with Cygwin you need to:

  1. Install the Cygwin environment
  2. Install the required utilities and third-party libraries
  3. Build and install GNU Radio
  4. Install the driver for the USRP (if you have a USRP)

Installing Cygwin

Installing Cygwin is easy, but there are a few details to worry about; see getting started with Cygwin. If you have previously installed Cygwin, you should check to see that your packages are up-to-date.

Installing Utilities and Third-Party Libraries

Utilities and third-party libraries are of two types: those that are available as Cygwin packages and those that must be downloaded and/or built separately.

apt-cyg may help you installing. It works like aptitude, so you can install and search packages from the command line.

Installing Cygwin packages

You will need the following Cygwin packages to build GNU Radio. For instructions on installing Cygwin packages see getting started with Cygwin: In order to use a USRP you will also need: If you want to install from SVN you will need:

Other libraries and utilities

Some of the libraries and utilities required by GNU Radio are not available as Cygwin packages. These packages must be installed manually:

If you need simultaneous capture and play of audio from your sound card or have difficulties with the basic audio support, you may want:

If you have a USRP you will also need:

Building and Installing a GNU Radio Release

GNU Radio can be built either from a release tarball (more stable) or from the latest code in the svn repository (latest features). This section describes how to build from the release tarball. Additional considerations when building from the svn repository are described later.

Downloading the Release Source Code

Download the latest release of the GNU Radio source code from ftp://ftp.gnu.org/gnu/gnuradio/gnuradio-3.2.2.tar.gz to a convenient working directory. Be sure that the name of your working directory does not contain any spaces. Unpack the tarball with
$ tar -zxf gnuradio-3.2.2.tar.gz

to produce the directory gnuradio-3.2.2.

Preparing to Build

You must specify where to find the pkg-config configuration files:
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

Building a Minimal GNU Radio System

GNU Radio is a large system with many options. The simplest build procedure configures and builds all the modules that it can, but you can customize your installation (and maybe save some time) by specifying appropriate options. For a first test, it is helpful to build a minimal GNU Radio. This is done with the commands:
$ cd gnuradio-3.2.2
$ ./configure --disable-all-components --enable-omnithread --enable-gruel --enable-gnuradio-core --enable-gr-audio-oss

This disables all components except those explicitly enabled, namely omnithread, gruel, gnuradio-core, and gr-audio-oss. To build and install these components use the commands:
$ make
$ make check
$ make install

You may get warning messages, but unless one of these commands stops with an error message you should have a working installation of GNU Radio. If you do get errors be sure to check hints, tips, known problems, and solutions for Windows. If an older version of GNU Radio was installed previously, you should remove it with make uninstall before you get to make check. To actually make GNU Radio do something, try:
$ export PYTHONPATH=/usr/local/lib/python2.5/site-packages
$ cd gnuradio-3.2.2/gnuradio-examples/python/audio
$ python dial_tone.py

This should produce a dial tone through your speakers. If Python gives you an error message, there is a problem with your installation of GNU Radio. If you get no error messages but no sound, check to see that your speakers are turned on, your volume is turned up, and that the "Wave" source is enabled in your audio control panel. Use Ctrl-C to stop the dial tone. If dial_tone.py stops by itself without producing sound or gives a Windows error pop-up, your version of Cygwin may be out of date (see hints, tips, known problems, and solutions for Windows).

The PYTHONPATH environment variable must be set to tell Python where to find the GNU Radio extension modules.

With this minimal GNU Radio system you can capture signals from your sound card, read signals from a file, or generate signals; process signals; and play signals on your sound card or save them to a file. Note that you cannot simultaneously capture and play signals using the same sound card with gr-audio-oss.

Building a Full GNU Radio System

Building a full GNU Radio system is simpler but takes longer:
$ cd gnuradio-3.2.2
$ ./configure

This enables all components for which the required libraries and utilities are available. To build and install these components use the commands:
$ make
$ make check
$ make install

Unless one of these steps fails due to an error, you should have a working GNU Radio installation. If one of the steps fails, you may be able to disable the component that failed. Use ./configure --help to see how the components are named. Look for the "--enable-..." options and add the corresponding "--disable-..." option to your ./configure command and repeat the above steps. If an old version of GNU Radio is installed, you should remove it with make uninstall before doing make check.

Note that make check sometimes fails on Cygwin due to problems with "sem_init" or "allocate_lock". These are Python and/or Cygwin problems, which don't affect most users of GNU Radio.

Be sure that PYTHONPATH is set as above before running a GNU Radio application.

Building and Installing GNU Radio from the SVN Repository

Note: These instructions are obsolete since the changeover to the git repository.

If you want the latest features and are willing to deal with code that is still in development, you can check out the latest code from the subversion (svn) repository:
$ svn co http://gnuradio.org/svn/gnuradio/trunk gnuradio

Be sure to use the Cygwin version of subversion (available from Cygwin setup); other versions of svn for Windows may produce files with an extra CR (^M) character at the end of each line.

The procedure for building the svn version is like that given above for building the release version, but because the svn version is constantly
changing, there may be extra requirements a need for patches. Note that the lists of requirements and patches may become out of date at any time.

Extra requirements:

The following patches are needed:

To apply a patch, follow the link to the listing of the patch file and download it to your gnuradio directory using the Original Format link at the bottom of the page. Then use the command
$ patch -p0 -b -i file.patch

(replacing file.patch with the name of the patch file) to apply the patch. After applying any patches and before running ./configure you must initialize the build with
$ ./bootstrap

and you must set the necessary environment variables:
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
The remainder of the build process is the same as for the release version except that boost should be found automatically in /usr/local/include:
$ ./configure
$ make
$ make check
$ make install

Be sure that no older version of GNU Radio is installed when running make check.

Expect `make check` to fail in test_inband.exe with "uncaught exception of type mbe_mblock_failed" errors; see Issue #191 for details.

Installing the Driver for the USRP

If you have a USRP you will need to install the driver for it; see installing the USRP driver for Windows.

Where to Go From Here

Now that your GNU Radio system is installed, it is time to start exploring. The best way to learn about GNU Radio is to study and modify the examples in the various subdirectories of gnuradio-3.2.2/gnuradio-examples/python and gnuradio-3.2.2/gnuradio/gr-utils/src/python.


Installing GNU Radio

The official Debian package repository has GNU Radio 3.0.2 available, though this is rather obsolete.

It is recommended that you [[BuildGuide|complete a source build] from the 32 stable series either through downloading a Release32Branch] tarball or using Subversion to check out the software from our subversion repository.

Building from source

In the first place you should have a look at the README file for the current dependencies. dpkg -l |grep <packagename> is your friend to see your current installed versions.

Resolving missing dependencies

If you get errors about missing programs/libraries or wrong versions, use the package management system like described above. To find the name of a package that provides a certain file use the Debian package search page. To get old versions of packages have a look at "If you want to build a recent svn snapshot of gnuradio you need wxgtk version 2.8 or later.
Debian Etch only has wxgtk version 2.6 which is not recent enough.
But you can install more recent wxgtk versions from the wxwidgets debian and ubuntu repository.

See [http://wiki.wxpython.org/InstallingOnUbuntuOrDebian Installing wxgtk-2.8 on debian etch":http://snapshot.debian.net/].


Debian Package Repository for GNU Radio

GNU Radio now has binary and source packages in the Debian repository format.
These allow you to install GNU Radio on to an Ubuntu Linux distribution without having to
perform a source compilation of the tree. In addition, the system package manager is able
to identify which runtime dependencies are needed such that these get installed
automatically when the GNU Radio packages are installed.

Packages Available

Currently, binary and source packages are available for the Ubuntu 9.04 (Jaunty) Linux
distribution, both 32-bit and 64-bit versions. These packages may work with other
Debian derivative operating systems; however, this is untested.

The packages are not part of the Ubuntu official archives; the repository is hosted at the gnuradio.org site.

Preparing Your Sytem for Binary Installation

If you have already installed GNU Radio on your system via a source compile, you will need to
uninstall it prior to installing the binary packages. The easiest way to do this is to
change directory into the top level directory of your source tree, then run 'make uninstall.':

$ sudo make uninstall

This is only possible if you have not cleaned out your source tree since the original 'make install'
was executed. Otherwise, you will have to manually go into $prefix/* and remove all traces of
gnuradio (and USRP if you installed that).

To configure your package manager to reference the GNU Radio packages, you will either need to the below lines into the file.

Ubuntu Jaunty (9.04) Distribution

To track the stable release branch, insert the following:

deb http://gnuradio.org/ubuntu stable main
deb-src http://gnuradio.org/ubuntu stable main

To track the unstable development branch, insert the following:

deb http://gnuradio.org/ubuntu unstable main 
deb-src http://gnuradio.org/ubuntu unstable main

Updating the Package List

manager's knowledge of the available packages. From the command-line, you would enter:

$ sudo aptitude update

Selecting Packages

The packages themselves contain the necessary dependency information that will "pull in" anything
needed by the packages you select, including other GNU Radio packages. Several "virtual" packages
have been created to ease this process.

To install all of the GNU Radio and USRP documentation, libraries, examples, and utilities, enter:

$ sudo aptitude install gnuradio gnuradio-companion

Configuring the USRP and/or USRP2 Hardware

In order for a regular user to have access to the hardware device, you must add that username to

$ sudo addgroup <USERNAME> usrp

The new group rights will become effective after the next login and after reconnecting or power cycling
the USRP. If you do not want to log out and log in, but only want to have a single shell with the new
rights immediately , you can su to your own account.


= Desktop Testing of OpenBTS =

Here's the hardware you will need for a desktop testing kit:

The recommended testing configuration is to operate in a cellular band not used in your area and use test phones that do not support your local cellular bands. This arrangement forces your test phone to camp to your basestation. It also prevents you from inadvertently attracting phones from the local licensed carriers. For example, to test in North America, you might use the EGSM900 band or the DCS1800 band and use a phone that does not support GSM850 or PCS1900.

If you do operate in a band that is also used by cellular carriers in your area, you will need to use SIMs from a carrier that does not offer service in you area and has no roaming agreements with carriers in your area. You can then use network parameters matched to the SIM and, hopefully, your test phones will ignore the local network and phones from your local network will ignore you.

If you do not operate in a band that is used by cellular carriers in your area, you can use any SIM you want.

If you want any flexibility at all in your choice of SIMs, you will need to use unlocked phones.

Be aware of power levels and local regulations. Here are some technical guidelines:

However, these are only technical pointers to help you comply with your local regulations. They are not legal advice on the regulations themselves. That is entirely your responsibility.


Git makes it easier for anyone to develop and contribute code to gnuradio. This article will describe how to use git with multiple repositiories so you can develop and publish your changes to gnuradio. The goal of this page is to help people manage git repositories so code may easily be shared among GNURadio developers.

The basic idea is you clone the gnuradio git repository and maintain a public repository with your work on github, or other public git server.

  1. Clone the repository
        $ git clone http://gnuradio.org/git/gnuradio.git
    
  2. Create a repository on a public git server such as http://www.github.org. Call it gnuradio-yourname.
  3. Be sure to set your identity so git has good identity information for your commits.
        $ git config user.name "Your Name" 
        $ git config user.email your@email.abc
    
  4. Since this is an existing git repo, do the following steps (I called the project gnuradio-balister):
        $ cd gnuradio
        $ git remote add balister git@github.com:balister/gnuradio-balister.git
        $ git push balister master
    

Now you have a local repository and a copy on github so you can publish your work.

Updates

To update master on your public repository:

    $ git commit [options] [files] 
    $ git push balister master 

Branching

Create a local branch, and publish the new work.

  1. Create the branch
        $ git branch new_work
    
  2. Checkout the branch
        $ git checkout new_work
    
  3. Do some work and commit it.
        $ git push balister new_work
    

Deleting Branches

When you are done with the branch delete it locally, and on the remote repository (if needed):

To delete your branch locally:

    $ git branch -d new_work

To Delete your branch from the server:

    $ git push balister :new_work

Remote Branches

If you want to create a local branch tracking a remote branch (e.g., to track a branch on the gnuradio server):

    $ git branch --track local_new_work origin/new_work
    $ git checkout local_new_work

Assuming that "new_work" is a branch on the repository you cloned originally

Converting From Old Subversion Repository to the New Git Repository

The subversion imported commits have the revision number at the end of the description in the "git-svn-id" line. For example, you can create and checkout a new branch with svn revision 10184 by doing the following.

  1. Find the commit hash from the git-svn-id.
      $ git log --grep=git-svn-id.*@10184
    
  2. Create and checkout a new branch named r10184 from the commit hash.
      $ git checkout -b r10184 cd7b07f0140ddff6
    

Other Resources

Some external resources that may be useful for learning/working with git:


Contribute to GNU Radio

Maintainership

GNU Radio is currently maintained by:

Coding Standards

All contributions should conform to the GNU Coding Standards as modified for C++ in [source:gnuradio/trunk/README.hacking README.hacking]

Before we can accept non-trivial code contributions from you, we need a copyright assignment on file with the FSF. A description of the process is available here.

This boils down to the following instructions:

Submitting Patches

Every patch must have several pieces of information before we can properly evaluate it.

Submit your patch by sending it to the mailing list.

When you have submitted your patch, somebody will tell you what to do next. If the patch is small, just send it directly to the list. Be sure to send the patch as a mime text attachment, or pasted directly into the mail. Uuencoded patches, or patches otherwise rendered unreadable by peculiar mime encoding make it much harder for the gnuradio developers to read and/or apply your patch. If your patch is very large (more than a hundred kilobytes), try to upload the patch itself to savannah and post only a link to the mailing list.

Persistent contributors who submit high quality patches may be given direct subversion access.

Submitting Bug Reports

There is a special list for reporting bugs, , to enable the developers to track submitted bug reports. If you think you have found a bug in gnuradio, please send as complete a report as possible to this list. Ideally, you should include the text you get by running config.guess, the text you see when you run ./configure, and if you can, a patch made with diff -u5 which fixes the problem. If you can send a small script which fails with the unpatched distribution, but passes with your patch applied we can add the test to the distribution to make sure the bug doesn't reappear.



Gnu Radio 3.2 Python Documentation


Modules:

* Signal Processing Blocks

* FPGA General Purpose IO (gpio) ====


 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
 3 <title>GNU Radio 3.2svn C++ API: Main Page</title>
 4 </head><body>
 5 <h1>GNU Radio 3.2svn C++ API Documentation</h1>
 6 <p>
 7 Welcome to GNU Radio!<p>
 8 For a list of all GNU Radio C++ blocks, please see <a href="modules.html">C++ Blocks</a>.<p>
 9 
10 Please note that at this time, we haven't found an acceptable way to provide unified documentation for the C++ parts of the system and the parts written in Python (mostly hierarchical blocks). Until this gets worked out, please bear with us, or better yet, solve it for us! </div>
11 
12 </body>
13 </html>

Source Download instructions

Stable

The latest stable release of GNU Radio can be found here:
[ftp://ftp.gnu.org/gnu/gnuradio/gnuradio-3.2.2.tar.gz]

An archive of older releases can be found here: [ftp://ftp.gnu.org/gnu/gnuradio/]

Development

If you prefer the latest development code, wish to contribute to GNU Radio, or want to work with features that haven't yet made it into the stable branch, you can check out the source from the git repository using one of these two lines:

$ git clone git://gnuradio.org/gnuradio
or
$ git clone http://gnuradio.org/git/gnuradio.git

Updating your local repository

$ git pull

Binaries Download instructions

If you're using Ubuntu, you can find pre-built Ubuntu packages for Ubuntu at this page: DebianPackages.


Documentación del USRP y GNU Radio en español. Gracias a Jorge A. Chávez Reyes.


Summary

The attached "gmskenhanced.py" file offers an enhanced GMSK demodulator that I believe to be superior to the GNURadio standard gmsk demodulator. It should be a drop-in replacement for the existing demodulator in designs, except that the transmitted data needs to be differentially encoded (you will NOT, however, need a differential decoder on the receive side). The enhanced demodulator should offer better bit error rate (BER) performance, especially for lower bandwidth-bittime (BT) products, such as the GSM standard BT=0.3, and in lower SNR conditions.

Details

The GNURadio standard gmsk demod is an attempt at a one-bit differential detector, and looks at the phase-change over one sample (should actually be over one symbol). The enhanced gmsk demod looks at the phase-change over two SYMBOLS and is therefore a two-bit-differential detector. The net effect is that inter-symbol-interference (ISI) is reduced: the eye openings in the resulting eye-diagrams are wider, and therefore more resistant to noise. A side-effect of a two-bit-differential detector is that the eye diagram is asymmetric, thus the decision threshold needs to biased. The constructor's default value (decision_threshold=0.1) should be fine for most cases.

Work based largely on:
Differential Detection of Gaussian MSK in a Mobile Radio Environment

Also see:
Differential Detection of GMSK Using Decision Feedback

And:
GMSK Modulation for Digital Mobile Radio Telephony

TODO

Code cleanup.

Detector portion of demod should really be rewritten in C.

If sufficiently vetted, check into svn?

Feedback

My BER testing shows a significant improvement, but I would like to hear from others. Please either post here or email me if you have a chance to try it out, even if it degrades performance or you can't make it work right.

Contact

(please replace the mythical beast with "steven", sorry for the CAPTCHA...)


Ettus Research

Ettus Research is the main supplier of [[USRP|USRP motherboards] along with the [wikiUsrpFPGA#ListofDaughterboards daughterboards]] required for transmitting and receiving signals over the air using the GNU Radio package.

Supplies can be purchased directly through Ettus Research.


Frequently Asked Questions

A series of questions commonly asked (and answered). Gathered from the mailing list archives and various experts.


General

Who/what/when/where/why/how (not necessarily in that order)?

What is GNU Radio?

GNU Radio is a collection of software that when combined with minimal hardware, allows the construction of radios where the actual waveforms transmitted and received are defined by software. What this means is that the digital modulation schemes used in today's high performance wireless devices are now software problems.

Where can I download GNU Radio?

Check the [[Download|download] page on the wiki then go over to the [wikiBuildGuide build guide]] for instructions on how to build and what dependencies GNU Radio has.

How come not all the components are getting installed?

(Something is missing here...)

How come it doesn't compile?

Have you read the [[BuildGuide|build guide] for your platform and made sure you have all the dependencies installed properly Also be sure to check the [wikiBuildGuide#CurrentKnownBuildProblems current known build problems]] section and be sure the problem affecting you is currently not listed.

If, after following the guide, nothing seems to work, ask the mailing list as a last resort.

How can I get involved?

You can point yourself over to the development page and first read it carefully, second read it again, and finally read it one more time. You should be able to figure out what to do by then.

What can I do to help contribute to GNU Radio?

There are currently some outstanding tasks that need to be accomplished as well as an endless supply of bugs that need to be fixed. Please feel free to enhance GNU Radio, but make sure you read the development page first before we can accept nontrivial contributions.

Who is part of GNU Radio?

GNU Radio is maintained by Eric Blossom, with regular contributions by Johnathan Corgan, Matt Ettus and others.

For a more complete list of contributors, please visit the [source:gnuradio/trunk/AUTHORS AUTHORS] file in the subversion repository.

Why did GNU Radio get started?

While GNU has been extremely successful in creating free software suites for exploration and hacking by the everyday user, there is still a large void when it comes to hardware hacking especially within the radio frequency spectrum. GNU Radio helps fill this void by supplying a suite of signal processing software blocks along with some tangible hardware to the general public at a modest price (free software, reasonably priced hardware).

Where can I ask other questions about GNU Radio not answered here?

You should feel free to join out mailing lists and actively participate or just read the different threads.

Build or Runtime Issues

If you have already tried looking at the BuildGuide page, and still seem to have build or runtime issues.

I get an error when importing from Python: _gnuradio_swig_py_runtime.so: undefined symbol: ... what do I do?

$ cat /etc/ld.so.conf
$ cp /etc/ld.so.conf /tmp/ld.so.conf
$ echo /usr/local/lib >> /tmp/ld.so.conf
$ sudo mv /tmp/ld.so.conf /etc/ld.so.conf
... then finally:
$ sudo ldconfig

Now try running those GNU Radio scripts again.


GNU Radio Processing Blocks

Everything dealing with the creation, implementation and usage of the GNU Radio core signal processing blocks.

What are the building blocks of GNU Radio at my disposal?

GNU Radio uses doxygen to help document all the different modules as well as the API for the core processing blocks.

Do you support BPSK/D-BPSK/QPSK/M-QAM/OFDM/etc.

Sure here are some examples. The information can be found here. If it hasn't been implemented, try it yourself! You'll be surprised what you'll learn.

Why bother with Python? I just want to code in C++!

It is currently being worked on (#128). There are a few different things that have to happen to support such a feat (#118), but if you want to see it done quicker feel free to help out.

Isn't Python slow? My application requires blazing speed.

Python is only used to setup the flow graph. Once setup, most of the work is done in C++.

How do I write a block?

Eric Blossom has put together a very nice tutorial on how to write a block for GNU Radio. Enjoy!


Universal Software Radio Peripheral (USRP)

Questions specific to the USRP and daughterboards, their functionality, and role within GNU Radio.

What is the Universal Software Radio Peripheral?

The [trac:USRP Universal Software Radio Peripheral (USRP)] is a general purpose motherboard which hosts a wide range of daughterboards which can be used with the signal processing blocks found in the GNU Radio software package to give access to the radio frequency spectrum.

The USRP hosts dual Analog Devices AD9862 mixed signal analog front end devices connected to an Altera Cyclone EP1C12 FPGA where most of the initial downconversion is done within the RX chain.

Can multiple USRPs be installed on one single host?

src1 = usrp.source_c( which=0 )
src2 = usrp.source_c( which=1 )

Now which USRP gets assigned #0 and #1 is dependent on the order they enumerate on the USB, first by bus, then by device. This may be affected by which one is plugged in first or turned on first.

It's possible, when writing your own code, to retrieve the serial number
Something missing here...

unit you've grabbed.

The other caveat is that most motherboards share a single USB controller for all their ports. So you're sharing the same 32 MB/s bandwidth across two USRPs now, effectively halving the maximum RF bandwidth you can work with if both USRPs are using the USB equally.

How can I record data from different daughterboards on the same USRP?

You'll need to write a small bit of code. The RX side of a USRP can only be opened once. Thus, you need a single program that reads input from both daughterboards at the same time.

Take a look at [source:gnuradio/trunk/gnuradio-examples/python/multi-antenna/multi_file.py multi_file.py]. It handles 4 simultaneous inputs.

Lastly, when using 2 inputs, there's no need to load special FPGA firmware. The standard file works fine.

What is inband signaling and how can I use it?

Inband signaling is receiving and transmitting control, status and data packets to a USRP to perform specific actions at specific times. This will allow for tight tolerances for TDMA style Media Access Controllers (MACs).

Can I run 802.11a/b/g/n/? with a USRP?

Some code has been released which can send and receive 802.11b at 1 mbps. However, USB 2.0 is too slow to support two way 802.11 interactions. A new version of the USRP is under
development which will have a faster interface which may be 802.11 capable.

Currently, no simply due to the latencies required do not allow for round trip processing of packets over the USB 2.0 interface on the USRP. This might get quicker with the inclusion of inband signaling in an upcoming release, but the round trip delay plus processing time probably won't work too well.

What frequency ranges are covered that I can use with the USRP?

Daughterboards are available which cover ranges from DC to 5.9 GHz.

Can I transmit and receive from the same USRP?

Yes, but there are some caveats that you must take into consideration. First, if using a cabled setup, be sure there is some attenuation between the transmitter and receiver. Second, realize that there is not much isolation on the board itself and signal can leak through even without an antenna.

How does the USRP decide where to allocate requested receive gain?

The current ADC chip (AD9862) on the main board can support 0-20 dB of gain, and various daughtercards can have different gain ranges of their own. Matt Ettus: "In general, we put as much gain as close to the antenna as possible. So the ADC gain is only added in if you request a very high gain. Each daughterboard is different, so check the files in gr-usrp/src/db_*.py for the exact system we use."

Can I stream digital data to or from the I/O pins on the USRP?

Yes, check out http://gnuradio.org/trac/wiki/CompGrGpio.

Comprehensive USRP FAQ can be found at USRP-FAQ page.


Instructions for Fedora Core has been moved to this page: FedoraInstall


Fedora Core 5 and 6 use udev, so follow these directions to configure non-root access to the USRP.

Fedora Core 5 and 6 Prerequisites

Install Fedora Core for software development, and then:

$ yum install fftw-devel cppunit-devel wxPython-devel libusb-devel sdcc
Some of the names of the binaries in sdcc are very generic, and they have therefore been moved to /usr/libexec/sdcc on Fedora, and symlinks prefixed with sdcc- have been created in /usr/bin. This might be a problem for existing programs, but the solution is simply to add /usr/libexec/sdcc to PATH before building GNU Radio:
$ export PATH=/usr/libexec/sdcc:$PATH

Now you have all the necessary bits and pieces to start a successful GNU Radio build.

If you wish to be able to generate the HTML documentation:

$ yum install xmlto graphviz

Post installation instructions

The default install path for GNU Radio is /usr/local, but this is not part of the default Python module search path. The easiest way to that is to add this to ~/.bashrc or in the personal initialization file for your favourite shell.

x86 (32-bit) systems:
export PYTHONPATH=/usr/local/lib/python2.4/site-packages
X86-64 systems:
export PYTHONPATH=/usr/local/lib64/python2.4/site-packages

You can also run this from the command line before running GNU Radio applications.

Note for x86_64 users

Due to some issues with the configuration of Python in Fedora, earlier versions of GNU Radio did not install the python modules in the correct location. This has now been fixed in changeset:4628, and will be included in future releases.


Fedora installation instructions

Gnuradio package from distribution

Gnuradio is now in Fedora default repository. Use yum or your favorite package installed to install it.

   yum install gnuradio usrp

Gnuradio from tarball

Install Fedora (FYI, we work fine w/ Fedora 8, 9, 10, 11, and 12), and then:

$ yum groupinstall "Engineering and Scientific" "Development Tools" 
$ yum install fftw-devel cppunit-devel wxPython-devel libusb-devel \
  guile boost-devel alsa-lib-devel numpy gsl-devel python-devel pygsl \
  python-cheetah python-lxml PyOpenGL 
$ yum install PyQT4-devel qwt-devel qwtplot3d-qt4-devel (The pkg names depend on the version of Fedora.  These work for 12)

You now have the basic requirements for building GNU Radio. Additional requirements are listed below. Notice that some are optional. Once you have all the requirements installed, you can proceed with the installation instructions included in the [[Download|GNU Radio distribution] or on-line [sourcegnuradiotrunkREADME]].

USRP

To build the firmware for the microcontroller on the USRP, you also need the _Small Device C Compiler. On Fedora Core 6 and later sdcc is available from the repository, and can therefore be installed by running:
$ yum install sdcc
Some of the names of the binaries in sdcc are very generic, and they have therefore been moved to /usr/libexec/sdcc on Fedora, and symlinks prefixed with sdcc- have been created in /usr/bin. This might be a problem for existing programs, but the solution is simply to add /usr/libexec/sdcc to your PATH before building GNU Radio:
$ export PATH=/usr/libexec/sdcc:$PATH

The version of sdcc packaged for Fedora 11 (2.9.0) does not work with GNU Radio 3.2. It is possible to use the version packaged for Fedora 10 (2.8.0) available for i386 and x86_64. Alternatively sdcc 2.9.0 can be compiled from source available here.

On earlier versions of Fedora you have to download the _Small Device C Compiler, build and install yourself.

Documentation

If you wish to be able to generate the HTML documentation:

$ yum install xmlto graphviz

Audio

Qt GUI

If you want to build the gr-qtgui package to use Qt plotting tools, install:

$ yum install qt4-devel qwt-devel qwtplot3d-qt4-devel PyQt4-devel

Post installation instructions

UDEV

Follow these directions to configure non-root access to the USRP.

Python

The default install path for GNU Radio is /usr/local, but this is not part of the default Python module search path. The easiest way to that is to add this to ~/.bashrc or in the personal initialization file for your favourite shell.

Determine what version of python you are using:
$ python -V
Python 2.5

Then set the PYTHONPATH environment variable to a value that includes your installation prefix
and the appropriate python version. E.g.,

x86 (32-bit) systems:
export PYTHONPATH=/usr/local/lib/python2.5/site-packages
X86-64 systems:
export PYTHONPATH=/usr/local/lib64/python2.5/site-packages

You can also run this from the command line before running GNU Radio applications.


Building and Installing FFTW for GNU Radio

GNU Radio requires a shared, single-precision version of FFTW. Many contemporary GNU/Linux systems come with FFTW suitably packaged. Systems using pkgsrc can install math/fftwf. In the event that no package is readily available on your platfrom, FFTW is easily built from source on any Linux, Cygwin, or MinGW/MSYS system. These instructions were written for Cygwin and MinGW, but should work on any of these systems.

(1) Download fftw-3.1.2.tar.gz from http://www.fftw.org/download.html to /usr/src (i.e., C:\cygwin\usr\src on a default Cygwin installation or C:\msys\1.0\src on a default MSYS installation).

(2) Build and install with (see note below for MinGW):
$ cd /usr/src
$ tar zxf fftw-3.1.2.tar.gz
$ cd fftw-3.1.2
$ ./configure --enable-float --enable-sse --enable-3dnow --enable-shared --disable-static
$ make
$ make check
$ make install

For MinGW you need more options on the ./configure command:
$ ./configure --with-our-malloc16 --enable-threads --with-combined-threads --enable-float --enable-sse --enable-3dnow --enable-shared --disable-static


FFTW is installed under /usr/local/* by default.

Notes:


Cypress EZ-USB FX2 USB Microcontroller

Official documentation: http://www-corot.obspm.fr/COROT-ETC/Files/CY7C68013.pdf

Details of the FX2 microcontroller...

The following loops were examined from [source:/gnuradio/trunk/usrp/firmware/src/usrp2/usrp_main.c usrp_main.c].

main( )

main_loop( )

1. Check for USB setup packets
1. Check and log RX Overruns/TX Underruns
1. Check for packets to send back to host
1. Check for packets to send to FPGA

USB Endpoints

Different USB endpoints are used to logically separate different operations occuring on the bus into separate flows. There are currently 3 USB endpoints checked/used within the main_loop( ) as described earlier.

Endpoint Description
0 Control/status
2 Host -> FPGA
6 FPGA -> Host

USB Transfers

Describe typical USB transfers. Always 512-byte bulk transfers. Link to in-band signaling information.

All control information is written using endpoint 0 and the vendor commands. These commands are separated into two different categories: VRT_VENDOR_IN and VRT_VENDOR_OUT. These are processed in the app_vendor_cmd( ) function seen in [source:/gnuradio/trunk/usrp/firmware/src/usrp2/usrp_main.c usrp_main.c].

All control communication between the FPGA and FX2 microcontroller is done over the SPI. Daughterboards all seem to be controlled by the generic VRQ_I2C_* and VRQ_SPI_* commands.

VRT_VENDOR_IN Commands

VRT_VENDOR_OUT Commands


gcell solves the problem of efficiently distributing potentially small tasks across the SPEs by using
a distributed SPE-centric scheduler that pulls work to SPEs as they become available.
In addition gcell provides high-performance DMA of arguments to and from the SPEs, task
completion notification to client processes, and binding and rendezvous between PPE and SPE code.
Benchmarks show near linear speed-up from 1 to 16 SPEs on 2-way Cell blades.

gcell: an SPE Scheduler and Asynchronous RPC Mechanism for the Cell Broadband Engine

The Interface

The primary interface is given in
gc_job_manager and
gc_job_desc.h.

The benchmark code is
benchmark_nop.cc.

Performance

Here's a snapshot of our current scaling performance. The test code submits 500k jobs and times how long it takes to complete all the jobs as a function of the number of spes used. Several runs are made, which vary in how much work each job does. For the purposes of the benchmark, the jobs busy wait for a specified number of microseconds on the SPE. This is called the 'work increment'. Thus, if the work increment is 10 us, the total useful_work is 10 us * 500k jobs = 5 seconds. The Y-axis plots useful_work divided by the real time required to complete all jobs. It's basically "speedup".

QS21 Performance:

Image(R-10231-qs21-20090115-0247.png)

PS3 Performance:

Image(R-10231-ps3-20090115-0226.png)


Gentoo Linux installation instructions

Firstly emerge the packages that gnuradio depends on.

$ emerge swig fftw cppunit boost alsa-lib sdcc guile wxpython xmlto numpy

Next download a release tarball or the source from SVN and perform the standard build and install procedure. Add "--prefix=/usr/" to the ./configure command to install the components to the correct location for Gentoo.

$ ./bootstrap
$ ./configure --prefix=/usr/
$ make
$ make check
$ make install

After these simple steps you should have a working GNU Radio install on your Gentoo system.


Getting Started

Three ways to start off with GNU Radio:

Official Stable Release:

Unstable development code:

If you have never used GNU Radio before, it is recommended to start with one of the official releases.

If your distribution has ready-to-use packages you are encouraged to start with them. It's easiest to install and you will get a usable GNU Radio installation to start right from. Official releases will give you a stable codebase for long-term development.

If your distribution or OS has no packages yet, you can build GNU Radio yourself from source. This can be be a bit challenging. Instructions for downloading can be found at Download. Instructions for installation are included in the GNU Radio distribution, but are also available online in the BuildGuide.

If you want to get the latest and greatest, need some recently added feature, or want to contribute to GNU Radio, you can get the latest version from the subversion repository. For instructions see the BuildGuide.

If you have any problems or questions, the place to ask is the discuss-gnuradio mailing list. Please take note of ReportingErrors

Operating System Specific Instructions

Hardware

The Universal Software Radio Peripheral or USRP2 is the recommended device for interfacing GNU Radio with the real world The USRP has been developed especially for GNU Radio, and is available from Ettus Research.

It is possible to use GNU Radio with other I/O hardware. See the FAQ for details on supported hardware. It is also possible to use the USRP with software other than GNU Radio. See the UsrpFAQ for details.

Training

If you or your group would like to get a jump start on using GNU Radio and the USRP, Corgan Enterprises LLC offers a 3-day, hands-on training class, to be held at your own location.


Global Navigation Satellite System

GNU Radio can be used to create GNSS receivers. The DBSRX daughterboard for the USRP is capable of receiving signal from all contemporary GNSS systems.

DBSRX settings

GNSS projects

Below is a list of projects that uses the GNU Radio framework or the USRP to implement GNSS receivers. Please add your self to the list if you are doing similar work.


= GlobalPositioningSystem or GPS =

Q: Is it possible to use GNU Radio to decode GPS signals?

A: Eventually it will be possible. Civilian accuracy GPS takes less bandwidth and processing power then ATSC reception.

Requirements

The Complete Specification Links to papers with details about software GPS implementations Overview of GPS Operation General GPS Information SBAS/WAAS/EGNOS/MSAS information here OpenGNSS Community Information Projects * READ THIS http://www.gps-sdr.com/ * An open source GPS project using GNU Radio and USRP hardware The Russian GLONASS

Q: What about DGPS for GPS positioning accuracy improvement?

A: For the continental US, WAAS is more reasonable. The marine DGPS beacons that operate at LF (~300kHz) would require another RF path and related antenna.

Q: What about WAAS, EGNOS (Europe), MSAS (Japan / Asia) for GPS positioning accuracy improvement?

A: WAAS is broadcast on the same L1 frequency as GPS itself. So WAAS support is a pure software feature.

----
CategoryRadio


PageOutline

GNU Radio Companion

/gnuradio/trunk/grc/freedesktop/grc-icon-128.png, width=128)

Note This guide is for the GRC bundled with gnuradio and not for any of the current releases. If you are using GRC 0.70 and below, please use this guide instead.

GNU Radio Companion (GRC) is a graphical tool for creating signal flow graphs and generating flow-graph source code. It is currently under development by Josh Blum.


New Features

What has changed in GRC since the stable 0.70 release?


Requirements

GRC Requirements

Most (if not all) of these requirements can be found in the package manager of you linux distribution.

GNU Radio Requirements

GRC is bundled with the current gnuradio trunk and will be included in the 3.2 release. I recommend configuring your GNU Radio installation with wx-python, usrp, and audio support. However, any configuration will work (see note). Follow the build-guide

Note: GRC will let you generate flow graphs with components that are not included in your local install. For example, you can generate a flow graph with a usrp source, but the code will error when executed unless GNU Radio is configured with usrp support.


Installation

Installing GRC

GRC is bundled with gnuradio, so following the build guide should be enough to install GRC. However, GRC will not be installed if you were missing any of the required components. Install any missing components and re-run configure/install:

./configure
make
sudo make install

GRC should appear in the list of configured components; if not, read the configure verbose for errors.

Installing Documentation

To view the blocks' documentation from inside GRC, install doxygen and configure gnuradio with doxygen support:

./configure --enable-doxygen
make
sudo make install

Installing Icons, Mime Type, and Menu Items

If you have an operating system that supports the freedesktop.org standards (Gnome, KDE, XFCE), then you may install the icons, mime type, and menu items bundled with GRC. After installing GRC, run the following command:

sudo grc_setup_freedesktop install

Execution

GRC installs two executable python files into your system's path.

Executing the Flow Graph Editor

Open a terminal and enter the following:

grc

Executing the USRP Probe Application

GRC provides a GUI app to probe the USRP for daughter-board information. Open a terminal and enter the following:

usrp_probe

Executing the USRP2 Probe Application

GRC provides a GUI app to probe the USRP2 for daughter-board information. Open a terminal and enter the following:

usrp2_probe

Usage Tips


Variables

Variables map symbolic names to values. In GRC, a variable can define a global constant or, a variable can be used in conjunction with a GUI to control a running flow graph.

Variable Block

The variable block is the most basic way to use a variable in GRC. The ID parameter of the variable block is the "symbolic name". The symbolic name must be alpha-numeric (underscores allowed) and begin with a letter. To use the variable, simply enter the symbolic name into a parameter of another block.

Variable Controls

Certain blocks have callback methods that allow their parameters to be changed while executing flow graph. Variable controls in GRC use variables in combination with callback methods to modify these parameters. If a parameter has a callback method, the parameter will be underlined in the block-properties dialog. The variable slider, variable text box, and the variable chooser block provide graphical widgets such as sliders, text boxes, radio buttons, and drop downs as variable controls. In addition, the variable sink block takes samples from a gnuradio stream and writes the samples to a variable.

String Evaluation

String parameters have a two-phase evaluation. First, GRC evaluates the parameter as-is. If the parameter does not evaluate to a string data type or the evaluation fails, then it is understood that the parameter had implied quotation. In this case, GRC will evaluate the parameter again with quotation marks; which will return a string with the exact code that was typed into the parameter window.

To use a variable inside a string simply type the name of the variable into the parameter: my_var. If the variable is not a string, cast the variable with python's str function: str(my_var). Standard python string functionality applies: "My Var = " + str(my_var).

*Note: String parameter types also include the file open and file save types.


Filter Design

Many blocks in gnuradio that take an array of complex or real taps as a parameter. GNU Radio provides a package to generate all kinds of filter and window taps. See the firdes package from the gnuradio documentation.

Firdes Taps Generators

Firdes Window Types

Firdes Notes

For the pass band functions, window defaults to the Hamming window. The beta parameter defaults to 6.76, and only applies to the Kaiser window.

Firdes Usage Example

Create a new "import" block, and enter the following for the import parameter:

from gnuradio.gr import firdes

Note: Most blocks with a taps parameter automatically import the firdes module. You only need to use the import block when firdes will not evaluate.

Enter the following into the taps parameter of a filter block:

firdes.low_pass(1.0, samp_rate, 1000, 100, firdes.WIN_HAMMING)

Use Taps from a File

Suppose that you have an array of filter taps stored in a file that you would like to use inside GRC:

Create a new "import" block, and enter the following for the import parameter:

import numpy

Enter the following into the taps parameter of a filter block:

numpy.fromfile('taps file path', numpy.complex64)

This will read an entire binary file and parse every 64 bytes into a complex number. Use numpy.float32 for real taps. See the numpy.fromfile help for more advanced usage:

Help on built-in function fromfile in numpy:

numpy.fromfile = fromfile(...)
    fromfile(file=, dtype=float, count=-1, sep=_) -> array.

    Required arguments:
        file -- open file object or string containing file name.

    Keyword arguments:
        dtype -- type and order of the returned array (default float)
        count -- number of items to input (default all)
        sep -- separater between items if file is a text file (default "")

    Return an array of the given data type from a text or binary file. The
    'file' argument can be an open file or a string with the name of a file to
    read from.  If 'count' == -1 the entire file is read, otherwise count is the
    number of items of the given type to read in.  If 'sep' is "" it means to
    read binary data from the file using the specified dtype, otherwise it gives
    the separator between elements in a text file. The 'dtype' value is also
    used to determine the size and order of the items in binary files.

Grid Positioning

GRC offers several graphical sinks and graphical controls for creating wx-gui flow graphs. (scope sink, fft sink, number sink, waterfall sink, constellation sink, slider control, and chooser control) Each of these graphical elements have a grid position parameter for precise positioning.

A grid position parameter is a list of 4 integers of the form (row, column, row span, column span). The row and column specify the position of the upper-left corner of the graphical element. The smallest position, the (0, 0) position, specifies the upper-left corner of the grid.

If left blank, the grid parameter specifies that the graphical element will be automatically stacked into a vertical sizer. The vertical sizer is positioned directly above the grid sizer. If you do not want any elements to be added to the vertical sizer, leave no grid parameters blank.

The row and column span specify the stretch, or the number of rows and columns that the graphical element can occupy. The row span specifies the number of rows down from the row positon, and the column span specifies the number of columns right of the column position. Therefore, the span must be at least (1, 1) to occupy the minimum of 1 grid cell.

Example

The user wishes to place a slider, centered directly above a graphical sink. The slider will be positioned at the 2nd column of the top row and with a column span of 2. The sink will be positioned on the 2nd row, and with a row span of 2 and a column span of 4. Notice the grid parameters below, and the resulting gui layout:

The Elements:

The Resulting GUI:

0,0 0,1 0,2 0,3
1,0 1,1 1,2 1,3
2,0 2,1 2,2 2,3

Hierarchical Blocks

GRC can create hierarchical blocks out of the built-in blocks. Hierarchical blocks can be instantiated inside of other grc flow graphs. The python code generated from a hierarchical block can itself be used in non-GRC flow graphs. Four important blocks are used in the creation of a hierarchical block: The options block, parameter blocks, and the pad source and pad sink.

The Options Block

In order to make a hierarchical block, the parameters in the options block must be set properly. The id of the options block sets the module name, and must be unique among the entire library of blocks (built-in and custom). The title parameter sets the display name for the block. The generate options must be set to "Hier Block". The category parameter sets the category for the new block. This category can be an existing category in the block selection window or a new category. Categories may be nested by specifying a name with slashes, ex: Custom/Filters. To put blocks into the root category, specify a single slash "/" (a blank category will hide your block).

Parameter Blocks

Parameter blocks specify variables in your hierarchical block that should be configurable in the top level block. Parameter blocks work much like variable blocks with a few exceptions: Parameters blocks cannot depend on variable blocks or other parameter blocks. Parameter blocks have a label parameter for display purposes. Parameter blocks take the place of a variable block, do not try to create a variable block with the same id as your parameter block.

Pad Source and Sink Blocks

The pad source and sink blocks create inputs and outputs for the hierarchical block. The pad blocks have configurable data types, vector lengths, and number of ports. A flow graph can have at most, one pad source, and one pad sink. A hierarchical block may have one pad sink and no pad source or no pad sink and one pad source, but it must have at least one pad block.

Creating and Instantiating

Notes


Adding Custom Blocks

Every block in GRC corresponds to an XML file that describes the block's parameters, inputs, outputs, and other attributes. Adding a custom block into GRC is simply a matter of creating one of these XML block definition files. A few caveats:

Creating the XML Block Definition

The best way to learn how to create the xml file is to learn by example. See the [/browser/gnuradio/trunk/grc/blocks block definitions] packaged with GRC, and read through a few files. Essentially, all block definitions are structured as follows:

<?xml version="1.0"?>
<block>
    <name>My Block Name</name>
    <key>my_package_my_block_ff</key>
        <category>Filters</category>
    <import>from gnuradio import my_package</import>
    <make>my_package.my_block_ff($param1, $param2)</make>
        <callback>set_param1($param1)</callback>
    <param>
        <name>Parameter 1</name>
        <key>param1</key>
        <type>real</type>
    </param>
    <param>
        <name>Parameter 2</name>
        <key>param2</key>
        <value>1</value>
        <type>int</type>
    </param>
    <sink>
        <name>in</name>
        <type>float</type>
    </sink>
    <source>
        <name>out</name>
        <type>float</type>
    </source>
        <source>
        <name>out</name>
        <type>float</type>
    </source>
</block>

Some Example Definitions

Installing the XML Block Definition

There are many methods to tell grc about your new xml file. Choose one of the following methods...

Method 1: Default Hier Block Location

Create the *.xml file inside ~/.grc_gnuradio/ where ~ is your home directory. If the directory does not exist, create it: mkdir ~/.grc_gnuradio/

Method 2: Configuration File

Create or edit ~/.gnuradio/config.conf and add the following lines:

[grc]
local_blocks_path=/path/to/my/blocks

The local_blocks_path can contain multiple paths separated by colons: local_blocks_path=/path/to/blocks1:/path/to/blocks2

Method 3: Environment Variable

Set the GRC_BLOCKS_PATH environment variable to a path that contains your custom block wrapper. The GRC_BLOCKS_PATH can contain multiple paths separated by colons: GRC_BLOCKS_PATH=/path/to/blocks1:/path/to/blocks2


Special Thanks


Screen Shots

Screen Shots

Feel free to submit your own screen shots or flow graphs.


PageOutline

GNU Radio Companion (Old)

Note These instructions are for GRC 0.70 and below. If you are using the GRC bundled with your gnuradio installation, please use this guide instead.

The GNU Radio Companion is a preliminary graphical user interface which allows GNU Radio components to be put together graphically. It is currently under development by Josh Blum. GNU Radio Companion encompasses over 200 blocks from the GNU Radio Project.


How it Works

Blocks are manually integrated into GRC via descriptive python definitions. The definitions are very flexible, and allow multiple GNU Radio blocks to be grouped into a single "super-block". A graphical interface allows the user to configure and connect these blocks into a flow graph. The flow graph is saved in an xml format. Another program reads this xml file and reconstructs the flow graph with native GNU Radio blocks.


Components

Flow Graph:
A flow graph is an interconnection of signal processing blocks. GRC provides a scrollable window to place and connect various signal blocks.

Signal Blocks:
Signal blocks perform all of the processing in a flow graph. For example: A signal block can be a filter, an adder, a source, or a sink. GRC represents signal blocks as colored, rectangular blocks. Each block has a label indicating the name of the block and a list of parameters.

Parameters:
Parameters influence the functioning of a signal block. For example: A parameter can be a sampling rate, a gain, or a flag. Most parameters for a signal block are displayed below the block's label.

Sockets:
Sockets are the inputs and outputs of a signal block. Each signal block has certain sockets associated with it. For example: An adder has several input sockets and one output socket. GRC represents a socket as a small rectangle attached to the graphical signal block. The socket has a label indicating its function. Labels are usually named "in" or "out". Some labels are named "vin" or "vout" to indicate a vector type. Sockets are also are colored to indicate their data type. Blue->complex. Red->float. Green->int. Yellow->short. Purple->byte.

Connections:
A connection joins an input and an output socket. GRC represents connections by drawing a line between the two sockets. Connections must be between matching data types (even vectored and non-vectored data types).

Variables:
A variable holds a number/string that is available to all elements in the flow graph. Variables serve two purposes: One, parameters can share a value by using a common variable. Two, a variable with a range can dynamically change the value of a parameter while the flow graph is running.


Download

Stable

An archive of all releases can be found here: Release Archive

Development

See the current GRC guide.


Installation

GRC dependencies: Any version of GNU Radio should work (however, I recommend the trunk for best support). If a block does not exist in a particular version, GRC will ignore the missing block. Installing GNU Radio will take care of most of GRC's dependencies. GRC needs wx support to run flow graphs, and gtk2 for its main GUI. The python XML module is essential, as all flow graphs and user preferences are saved to and loaded from xml. The package names for pyxml vary among software distributions. If GRC crashes with an XML related error, follow the cygwin + pyxml notes below.

Notes for Ubuntu Hardy Heron users: Ubuntu removed the xml.dom.ext package from their repositories. GRC 0.70 and below require this package. Solution: download the pyxml source. Unpack the source, and run "sudo python setup.py install" from the source directory. This issue has been fixed in the trunk and in future releases.

Notes for Cygwin users: Install pygtk with the Cygwin setup. For python-xml, download the pyxml source.
Unpack the source, and run "sudo python setup.py install" from the source directory. If that fails, just copy the xml directory into the python site-packages directory (with GNU Radio). Make sure that you install the X11 server with cygwin, and start the X11 server before running GRC.

Notes for MacOSX users: Follow the Mac Install Instructions. Use mac ports (or whatever program you picked) to install the dependencies for GRC. Also, make sure to install wx-python 2.6.3 or 2.8.6, since 2.8.4 causes problems.

Operating System Compatibility

Instructions

Executing the Program

In the src folder, execute Editor.py with the python interpreter. Saved flow graphs can be passed as the first argument to Editor.py.

Modifying Blocks

Adding a block:
Select a block from the signal block tree menu. Double click the block or click the add button. A new signal block will be placed on the screen.

Moving a block:
Left click a block and drag it around the flow graph. If you drag a block near a border that can be scrolled, wiggle the block to advance the scroll bar.

Rotating a block:
With a block selected, select rotate right or left from the tool bar. Short-cut keys: right or left.

Deleting a block:
With a block selected, select delete from the tool bar. Short-cut keys: delete.

Connecting blocks:
Left click on one socket and then left click on another socket. A connection will only be created between input and output sockets. An input socket may have no existing connections. An output socket may have unlimited connections. Red lines surrounding the connection indicates that the data types of the sockets do not match.

Modifying Parameters

Double click on a block or select it and choose properties from the edit menu. A dialog containing all the parameters for the signal block will appear. Some parameters are set via a drop down menu, most must be typed in as characters. These parameters are usually numeric, representing sampling rates, gains, and amplitudes. Numeric parameters may contain mathematical expressions with variables.

Math Expressions

A math expression may contain any number of variables, numbers, and operators. There must be an operator between every number/variable. Possible operators are +, -, *, /, ^. Numbers can be integers, decimals, floating-point, and complex. Python's built in floating point and imaginary formats are used. Floating point numbers end in an "e" followed by a signed integer. Imaginary numbers end in a "j". Matching bracket pairs are allowed: (), [], {}. Variables are denoted by a leading '$' character.

See Help->Math Expressions in the Editor.

Using Variables

The variable window has 5 columns: variable name, default value, minimum value, maximum value, step size. Choose add to create a new variable entry. Choose remove to delete a selected variable entry. Any value in an entry can be edited by clicking on the input field in the selected row. Invalid changes to a cell are ignored. Variable names are case-sensitive and alpha-numeric, and they may contain hyphens. The first character must be a letter. The default value for the variable may be any string.

Using Variables with Ranges

A variable with a range may be dynamically changed while the flow graph is executing. However, only signal block parameters, underlined in the signal block's properties window, can actually be altered while the flow graph is executing.

For a ranged variable, the default, minimum, maximum, and step size values must be of type float or int. To make a variable with a range, simply type a number into the min or the max input field and the other fields will be filled in. The min must be less than or equal to the default, and the max must be greater than or equal to the default. To remove the range from a variable, just clear one of the input cells for min, max, or step and all cells will be cleared.

Flow Graph Validation

Running a Flow Graph

If a flow graph is valid, all parameters are valid and all sockets are connected. Choose run from the tool bar or press F5. A wx window will appear with any sliders or graphs that were added. To stop the flow graph, close the wx window, press stop in the tool bar, or press F7. Flow graphs can be run without the interface by invoking the python interpreter on ExecFlowGraphGUI.py, and passing the saved flow graph as the first argument to ExecFlowGraphGUI.py.

Options

The options menu allows the user to adjust the window size, set user preferences, and view USRP information.

Wishlist

Feel free to add requests for new features and behaviors.


Screen Shots

Screen Shots

Feel free to submit your own screen shots or flow graphs.


If you'd like to contribute, take a look at these, or add your own!

Current Defects

TicketQuery(status!=closed&

Current Enhancements

TicketQuery(status!=closed&

Current Tasks

TicketQuery(status!=closed&

Suggested Projects

[I think a lot of these should be entered as Enhancement or Task tickets.]


欢迎来到GNU Radio!

介绍

GNU Radio 是免费软件开发套件,提供了信号实时处理的软件和低成本的软件无线电硬件。被广泛应用于业余爱好者,学术研究以及商业环境中去支持无线通讯的学术研究以便去真实实现无线电系统。

GNU Radio 应用程序用Python语言来编写,真实的信息处理过程是由C++浮点扩展库来实现的。因此开发者获得实时高效的可复用的应用开发环境。

虽然GNU Radio并不是主要用于仿真,但也要以不用真实硬件,而使用预先记录或生成的数据来开发信号处理算法。

内容

新闻


.


GRC

Acronym for GNU Radio Companion , the graphical user interface used to string GNU Radio blocks together.


How To Build an M-block

A high level introduction to m-blocks can be found here.

Overview

Page for info about the December 2006 HackFest

Attendees

That was about all we had space for as you can see:

http://n4hy.smugmug.com/gallery/2262143

Travel

The HackFest will be held December 13th-20th, 2006. Plan to arrive late on the 12th or sometime on the 13th.

Ettus Research Galactic Headquarters
604 Mariposa Avenue
Mountain View, CA 94041

The best airport to fly into is San Jose (SJC). The next best would be San Francisco (SFO). Oakland (OAK) should be considered a last resort.

Suggested Hotel -- Marriott Residence Inn Mountain View and Palo Alto http://marriott.com/property/propertypage/SFOMV

Other Hotels -- http://maps.google.com/maps?f=l&hl=en&q=hotel&near=604+mariposa+ave,+94041&ie=UTF8&z=15&om=1

This one is literally around the corner from GHQ. If they are full or cost too much, let me know. There is another [somewhat less nice] place next door.

If Eric isn't driving here from Reno, then it would be nice if someone rented a car. We only need one, though.

Note from Johnathan: As I live in San Jose, I can help shuttle people from the airport to Matt's if need be.

What to Bring

Plan

Hack away on important things missing from GNU Radio, like:

In addition to all the hacking, we'll have some other suitably geeky distractions planned. Ideas I'm working on right now include tours of the Computer History Museum, Stanford Linear Accelerator, Stanford Radio Club and "Big Dish" area, and TechShop. Suggestions for others also welcome.


HomebrewSurfaceMountConstructio

Lots of people have figured out surface-mount construction techniques and tools that work on a very limited budget. Getting boards assembled by a professional assembly house can be expensive, and there can be rules that may not make sense for a small project. (I've used an ISO-9000 board house in the past, and if I don't bring them paperwork that looks a particular way, they get antsy.) So these techniques for soldering teeny fine-pitch parts are cool, especially with the deals one can get these days on small runs of prototype PCBs.

Hints, tips, advice, background info, encouragement from: hams, piclist, gEDA mailing list, another ham, sci.electronics.basics

If you're going to do this, do NOT use your normal food toaster oven for soldering. Get another toaster oven just for soldering, and do NOT prepare food in it. It will fill up with lead and foul chemicals.
----
Radio Shack sells solder paste (which they call solder weld). I found a toaster oven at Walmart for $20. I decided to try to build the hot air pencil, which totalled about $20. I picked up a hobbyist kit with some surface-mount parts to experiment with. I also found it helpful to pick up a strong magnifying glass at an arts-and-crafts store.

My first experiment was to put some solder paste on two pads, put a resistor on them, and use the toaster oven to melt the solder paste. I used too much paste but the results were very successful. I am quite impressed with the toaster oven approach. Toaster oven discussions on the web talk a lot about the profile of temperature over time, and how semiconductors should not be subjected to extreme heat for more than a few seconds. My impression is that you want to run the thing a little below water's boiling temperature for a few minutes, to dry out any residual water, and then very quickly ramp up the temperature to the oven's maximum, watching the solder joints with the magnifier through the glass door. When the solder appears to have melted everywhere (and then giving it maybe another few seconds for the solder joints you can't see), turn off the oven and open the door so that things will cool quickly.

Then I put together the hot air pencil: a desoldering iron $10 with steel wool ($3, Home Depot) wedged into the nozzle, and replace the squeeze bulb with a tube ($2, Walmart) leading to an aquarium pump ($6, Walmart) so that hot air comes out of the nozzle. The trick is to jam as much steel wool into the nozzle as you can, otherwise the breeze will be so strong that it blows the SMT parts around, and it won't get hot enough to melt the paste. The steel wool provides more surface area to transfer more heat to the flowing air.

If you want a hot air pencil that isn't a cost-saving kludge, the Weller WSTA6 is available for about $60. It uses butane. I looked at one and it wasn't obvious where you get butane refills, or how you apply them. Boston-area people can get one at You-Do-It Electronics.

The hot air pencil seems to take considerable practice to use. Also the solder paste seems to be a bit cantankerous; I've read of people using brushes with it. I'll pick up one or two small paintbrushes and see if that makes it any easier.

There's a learning curve here, so be ready to do lots of inexpensive experiments. Get a roll of SMT resistors and some boards to solder them onto, and waste them liberally while you develop skill.
----
I've now done the toaster oven thing with two boards, having ordered a stencil from http://www.stencilsunlimited.com. I used the stencil for one board, and applied way too much solder paste, and my fine-pitch parts were full of shorts. I tried to remove these with solder wick but didn't have much luck.

I did the first board in a crowded roomful of hobbyists. It was fun, and it was a pleasant reminder of younger days, but the hustle and bustle weren't too helpful for the level of focus needed for SMT construction. I found it much easier, quicker, and more productive to do my SMT construction at home. You want quiet, lots of light, elbow room, and good magnifiers and tweezers. I haven't needed a microscope yet but it might be smart to start looking for one.

For the second board, I used a small paintbrush (the smallest in a set from the stationery section at Walmart) to apply paste directly to pads. On the second board, I decided to use the toaster oven twice, the first time to solder the resistors and caps, and the second time to solder the ICs. My reasoning is that (1) the Rs and Cs can handle heat better than silicon, and (2) this way, when I'm positioning the ICs, I don't need to worry that I'll accidentally push the Rs and Cs out of alignment. I don't think it's actually good practice, and I would be evil to recommend it to anybody who thinks they can populate their board with a single reflow.

One element where practice helps (and unfortunately nothing else seems to) is in knowing how much solder paste is right. The first time with the stencil, I put on too much, and studying it under the magnifier I worried that it might be too much, and the result was shorts. The second time I probably overcompensated, leaving only one or two grains of solder on some pads, and I'm concerned that some pins won't connect at all. Especially on the 144-pin FPGA, I doubt I have the eyesight or steadiness of hand to solder them individually.

Practice is important, and as I wrote earlier, it's good to create an environment where you can get a lot of practice for a small amount of money. The solder paste, the toaster oven, and the paintbrush are cheap, as are rolls of some 0805 and SOT-23 parts. It would be nice to find large cheap volumes of big fine-pitch ICs. The cheapest I've found is this CPLD for only $3.91, of $3.31 in lots of 25. It's in a 100-pin TQFP package with pin spacing of 0.5 mm. Somebody should make up a board especially for SMT construction practice, with no need for vias or a circuit that makes any sense. I might do that myself.
----
CategoryHardware


I have a dream ...

This page operates as a hub where ideas can come together and be linked to for further discussion and development. It also links to projects that are a work-in-progress as to help connect and get more input.

Moreover, this page gives a record of possible future projects that may be feasible well after the original idea has been presented.

GNU Radio Companion

GNU Radio Companion is a graphical user interface used to string components together and automatically generate the proper flowgraph.

Message Blocks

Message blocks (or m-blocks) are to be used for implementing tighter time constraints for transmission and reception of signals. This should allow for development of more complex MAC protocols including, but not limited to, GSM and other TDMA style protocols.

OpenGL Graphical Components

Currently, wxPython provides the graphical components for GNU Radio. Since this is not necessarily the most efficient way to display information, OpenGL might be a more efficient method.

RF Channel Simulation

Due to the highly abstracted nature of GNU Radio, creating channel blocks for RF channels is not completely out of the question. Gaussian, Rayleigh Fading, Rician Fading, etc could all be simulated along with different frequency offsets to create a better way to evaluate equalizer performance without the use of a USRP or any hardware.


Profiling In-band Signaling

We are in the stage of profiling the code and are looking for users to help contribute profile results on different architectures. If you could contribute to an architecture, we would greatly appreciate it.

You should be able to follow through the instructions sequentially, for which I'm going to provide Ubuntu specifics and general.

We have profile statistics for the following architectures already:

Building VMLinux

Running oprofile with full kernel profiling is required. To do this you must acquire an uncompressed version of your kernel, vmlinux.

In Ubuntu, building VMLinux can be done as follows:
sudo apt-get install linux-kernel-devel fakeroot build-essential
sudo apt-get source linux-image-2.6.20-16-generic
sudo apt-get build-dep linux-image-2.6.20-16-generic
cd linux-source-2.6.20-2.6.20/
sudo make oldconfig
sudo make vmlinux 
If you are running a custom or self-built kernel, go to your kernel source tree and run the following command:
make vmlinux

Obtaining oprofile

In Ubuntu you can use apt-get or aptitude to retrieve oprofile. Installing glibc-dbg is also necessary to get full symbol statistics for libc.
sudo apt-get install oprofile glibc-dbg

To build oprofile manually, download it from the official oprofile site and follow the instructions. http://oprofile.sourceforge.net/download/

Before running the oprofile daemon, we must tell it where vmlinux is located. replace $VMLINUX_PATH with the path that vmlinux is located, such as /boot or /usr/src/linux/
sudo opcontrol --setup --vmlinux=$VMLINUX_PATH/vmlinux
Test that oprofile will at least start with no errors:
sudo opcontrol --start
You should receive output similar to this, which specifies that it is using the kernel interface:
$ sudo opcontrol --start
Using 2.6+ OProfile kernel interface.
Reading module info.
Using log file /var/lib/oprofile/oprofiled.log
Daemon started.
Profiler running.

Obtaining the In-band code

To get the most current copy of the profiling in-band code, use SVN:
svn co http://gnuradio.org/svn/gnuradio/branches/developers/gnychis/inband-profiling
To build the code, perform the following series of commands.
cd inband-profiling/
(./bootstrap && ./configure && make) | tee inband_log
Install the code:
sudo make install

If you encounter any errors building the code, please report your inband_log.

Obtaining the new USRP in-band RBF

Since the new in-band code uses new packet formats across the USB bus which the USRP needs to interpret, a new RBF must be used.

You can obtain the RBF that will be used for profiling here:
http://www.andrew.cmu.edu/user/gnychis/usrp_inband_profiling.rbf

To install it, copy it to /usr/local/share/usrp/rev2/

In summary:
wget http://www.andrew.cmu.edu/user/gnychis/usrp_inband_profiling.rbf
sudo cp usrp_inband_profiling.rbf /usr/local/share/usrp/rev2/
sudo cp usrp_inband_profiling.rbf /usr/local/share/usrp/rev4/

Profiling the In-band Code

Enter the following directory within the inband-profiling branch which contains all of the applications which we will profile:
cd inband-profiling/usrp/host/apps-inband/
The following applications will be profiled: The applications do not take any parameters, here is an example of the RX run:
$ time ./test_usrp_inband_rx
[TEST_USRP_INBAND_RX] Opening the USRP
[TEST_USRP_INBAND_RX] Requesting RX channel allocation
[TEST_USRP_INBAND_RX] Receiving...
[TEST_USRP_INBAND_RX] Deallocating RX channel
[TEST_USRP_INBAND_RX] Closing the USRP

mb_runtime_thread_per_block: dtor (# workers = 1)

real    0m31.495s
user    0m8.805s
sys     0m0.436s
So let's get to the actual profiling! Start oprofile if you have not done so yet:
sudo opcontrol --start
Before EVERY oprofile run, reset the statistics or else they will carry over to other runs, and go ahead and run an application. Please provide your time per application with the reports. As soon as the application finishes, immediately save the statistics and perform a dump to ensure everything was written to disk. You now have a snapshot at the time your application finished. You will need to choose a different save name per run.
sudo opcontrol --reset
time ./test_usrp_inband_rx 
sudo opcontrol --save=test_usrp_inband_rx_1
sudo opcontrol --dump
Finally, let's retrieve the statistics. The applications you actually run in the top-most directory are scripts which run the true binaries in the .libs directory. opreport needs the true binary, which is prefixed with lt in the .libs directory.
opreport -l session:test_usrp_inband_rx_1 .libs/lt-test_usrp_inband_rx &> oprofile-test_usrp_inband_rx
And there you have it, if you look through oprofile-test_usrp_inband_rx you should see something similar to this:
CPU: P4 / Xeon with 2 hyper-threads, speed 2993 MHz (estimated)
Counted GLOBAL_POWER_EVENTS events (time during which processor is not stopped) with a unit mask of 0x01 (mandatory) count 240000
samples  %        image name               app name                 symbol name
40224    14.0335  libm-2.5.so              libm-2.5.so              sincosf
15753     5.4960  libpmt.so                libpmt.so                pmt_nthcdr(unsigned int, boost::shared_ptr<pmt_base>)
12494     4.3589  lt-test_usrp_inband_tx   lt-test_usrp_inband_tx   ui_nco<float, float>::sincos(std::complex<float>*, int, double)
12088     4.2173  libc-2.5.so              libc-2.5.so              malloc
11798     4.1161  libc-2.5.so              libc-2.5.so              free
.......

If you see _ under _symbol name for images such as libc, you did not install debug symbols for the library. libc should be the only issue, scroll back up to read about installing this, we require that these symbols be included.

Submitting Your Results

Create a machine_specs file with information about your machine:
uname -a >> machine_specs
cat /proc/cpuinfo >> machine_specs
Create a times file with information about the times of each application, such as:
test_usrp_inband_rx
-------------------
real    0m31.495s
user    0m8.805s
sys     0m0.436s

test_usrp_inband_tx
-------------------
<fill me>

test_usrp_inband_underrun
-------------------------
<fill me>
tar and compress your output files like so, for an attachment (or zip them, whichever is easier for you):
tar czvf inband_results.tar.gz machine_specs times oprofile-test_usrp_inband_tx oprofile-test_usrp_inband_rx oprofile-test_usrp_inband_underrun

Send an e-mail to George: gnychis at cmu dot edu, with inband_results.tar.gz as an attachment.

We greatly appreciate any help with the profiling, and once we collect enough profile results we will host them and there will be discussion on the board if you'd like to participate.

Thank you for your time!


In-band Signaling

The goal of in-band signaling in the [[USRP|USRP] is to support precision timing TDMA packet processing and other related items The in-band signaling allows for metadata and control information to be sent on the same channel as the data This information can be used to control the [wikiUSRP USRP]] on a per-packet basis, allowing low-latency transmission control which is needed for detailed Media Access Control (MAC) protocols.

Changes Required

To support in-band signaling, several changes need to be made to the USRP as well as the GNU Radio framework.

USRP Changes

GNU Radio Changes

ScheduleTODO
Profiling Effort


In-band Signaling Schedule

//img236.imageshack.us/img236/3688/groverall2ld9.png">http://img236.imageshack.us/img236/3688/groverall2ld9.png)

Component To Do Deadline Status * Assignment *
M-Block m-block ----- Testing Eric
M-Block Priority Scheduler ????? Not Started Person
gr_usrp Marshall 'm-block' to USB packet ????? Not Started Person
-- Timestamp packet ----- Not Started Person
-- Set header fields ----- Not Started Person
-- Fill payload and pad ----- Not Started Person
gr_usrp Marshall USB packet to m-block ????? Not Started Person
FX2 Differentiate [[MessageBlocks m-block] packets from [wikiUsrpFPGA FPGA]] programming packets ????? Not Started Person
FX2 Strip/Add USB packet padding ????? Not Started Person
FPGA Parse and interpret USB packet ????? Not Started Person
FPGA Timestamp counter ????? Not Started Person
FPGA Add two buses, I2C and SPI ????? Not Started Person
FPGA Encoding inbound USB packet ????? Not Started Person
-- Timestamp on first sample ----- Not Started Person
-- Set RSSI ----- Not Started Person
Daughterboard Brian???? ----- Not Started Person

Introduction To GSM

Introduction

GSM is an acronym that stands for Global System for Mobile Communications. The original french acronym stands for Groupe Spécial Mobile. It was originally developed in 1984 as a standard for a mobile telephone system that could be used across Europe.

GSM is now an international standard for mobile service. It offers high mobility. Subscribers can easily roam worldwide and access any GSM network.

GSM is a digital cellular network. At the time the standard was developed it offered much higher capacity than the current analog systems. It also allowed for a more optimal allocation of the radio spectrum, which therefore allows for a larger number of subscribers.

GSM offers a number of services including voice communications, Short Message Service (SMS), fax, voice mail, and other supplemental services such as call forwarding and caller ID.

Currently there are several bands in use in GSM. 450 MHz, 850 MHZ, 900 MHz, 1800 MHz, and 1900 MHz are the most common ones.

Some bands also have Extended GSM (EGSM) bands added to them, increasing the amount of spectrum available for each band.

GSM makes use of Frequency Division Multiple Access (FDMA) and Time Division Multiple Access (TDMA).
*TDMA will be discussed later

GSM allows for use of duplex operation. Each band has a frequency range for the uplink (cell phone to tower) and a separate range for the downlink (tower to the cell phone). The uplink is also known as the Reverse and the downlink is also known as the Forward. In this tutorial, I will use the terms uplink and downlink.

Frequency Division Multiple Access (FDMA)
GSM divides the allocated spectrum for each band up into idividual carrier frequencies. Carrier separation is 200 khz. This is the FDMA aspect of GSM.

Absolute Radio Frequency Channel Number (ARFCN)

The ARFCN is a number that describes a pair of frequencies, one uplink and one downlink. The uplink and downlink frequencies each have a bandwidth of 200 kHz. The uplink and downlink have a specific offset that varies for each band. The offset is the frequency separation of the uplink from the downlink. Every time the ARFCN increases, the uplink will increase by 200 khz and the downlink also increases by 200 khz.

*Note: Although GSM operates in duplex (separate frequencies for transmit and receive), the mobile station does not transmit and receive at the same time. A switch is used to toggle the antenna between the transmitter and receiver.

The following table summarizes the frequency ranges, offsets, and ARFCNs for several popular bands.

The following diagram illustrates an ARFCN with paired uplink and downlink frequencies for ARFCN 1 in the GSM 900 band.

The following is a way to calculate the uplink and downlink frequencies for some of the bands, given the band, the ARFCN, and the offset.

GSM 900

Up = 890.0 + (ARFCN * .2)
Down = Up + 45.0

example:

Given the ARFCN 72, and we know the offset is 45MHz for the GSM900 band:
Up = 890.0 + (72 * .2)
Up = 890.0 + (14.4)
Up = 904.40 MHz
Down = Up + Offset
Down = 904.40 + 45.0
Down = 949.40 MHz

The uplink/downlink pair for GSM900 ARFCN72 is 904.40/949.40 (MHz)

Here are the formulas for EGSM900, DCS1800, and PCS1900:

EGSM900

Up = 890.0 + (ARFCN * .2)
Down = Up + 45.0

DCS1800

Up = 1710.0 + ((ARFCN - 511) * .2)
Down = Up + 95.0

PCS1900

Up = 1850.0 + ((ARFCN - 512) * .2)
Down = Up + 80.0

Numbering System (Identifiers)

Mobile Subscriber ISDN (MSISDN)

The MSISDN is the subscriber's phone number. It is the number that another person would dial in order to reach the subscriber. The MSISDN is composed of three parts:
Country Code (CC)
National Destination Code (NDC)
Subscriber Number (SN)

Country Code (CC) - This is the international dialing code for whichever country the MS is registered to.

National Destination Code (NDC) - In GSM, an NDC is assigned to each PLMN. In many cases, a PLMN may need more than one NDC.

Subscriber Number (SN) - This is a number assigned to the subscriber by the service provider (PLMN).

The combination of the NDC and the SN is known as the National (significant) Mobile Number. This number identifies a subscriber within the GSM PLMN.

International Mobile Subscriber Identity (IMSI)

The IMSI is how the subscriber is identified to the network. It uniquely identifies the subscriber within the GSM global network. The IMSI is burned into the SIM card when the subscriber registers with PLMN service provider. The IMSI is composed of three parts :
Mobile Country Code (MCC)
Mobile Network Code (MNC)
Mobile Subscriber Identification Number (MSIN)

Type Allocation Code (TAC) - This number uniquely identifies the model of a wireless device. It is composed of 8 digits. Under the new system (as of April 2004), the first two digits of a TAC are the Reporting Body Identifier of the GSMA approved group that allocated this model type.

Serial Number (SNR) - This number is a manufacturer defined serial number for the model of wireless device.

Spare (SP) This number is a check digit known as a Luhn Check Digit. It is omitted during transmission within the GSM network.

On many devices the IMEI number can be retrieved by entering *#06#

Former IMEI Structure

Prior to April, 2004 the IMEI had a different structure:
Type Allocation Code (TAC) - 6 digits
Factory Assembly Code (FAC) - 2 digits
Serial Number (SNR) - 6 digits
Spare (SP) - 1 digit

As of April 2004, the use of the FAC was no longer required. The current practice is for the TAC for a new model to get approved by national regulating bodies, known as the Reporting Body Identifier.

International Mobile Equipment Identity/Software Version (IMEISV)

This is a newer form of the IMEI that omits the Spare digit at the end and adds a 2-digit Software Version Number (SVN) at the end. The SVN identifies the software version that the wireless device is using. This results in a 16-digit IMEI.
Type Allocation Code (TAC) - 8 digits
Serial Number (SNR) - 6 digits
Software Version Number (SVN) - 2 digits

IRC

There is an irc channel on the http://www.freenode.net network where people talk about GNURadio called #gnuradio.


Xilinx ISE Tools will run on Fedora 6 through 8, but you have to fight it a bit -- this was tested on 9.1i. Do the following:

* Turn off SELinux in the System:Administration:Security Level And Firewall menu from the GNOME Panel. ISE won't run (and won't tell you why) if SELinux is enabled. * Download and unzip the ISE distribution. * If running on X86_64, Edit the setup file to change references from lin64 to lin, just like the 386 version. The 64-bit version is not distributed for free. * Install normally * Install the 32 bit version of libstdc++ version 5
# yum install compat-libstdc++-33
* If you need to run several of the tools like the Constraints Editor and PACE, you'll have to install
OpenMotif *** Download the Fedora Core 5 Openmotif rpm from http://download.fedora.redhat.com/pub/fedora/linux/core/updates/5/i386/ *** Extract the files in /tmp
# rpm2cpio openmotif-2.3.0-0.1.9.3.i386.rpm | cpio -ivd
*** Copy the extracted library to /usr/lib
# cp ./usr/lib/libXm.so.4.0.0 /usr/lib
*** Create the needed symlinks
# cd /usr/lib
# ln -s libXm.so.4.0.0 libXm.so.4
# ln -s libXm.so.4.0.0 libXm.so.3
*** Install libXp
# yum install libXp.i386 
*** Before running any of the programs that need OpenMotif, you need to do the following from the shell
export DISPLAY=:0

List of USRP Daughterboards


GNU Radio has been compiled and installed on Mac OS X "Tiger" 10.4 or "Leopard" 10.5 ("OSX") running any compatible version of XCode on all recent Macs -- whether Intel or PPC. Although it might be possible to use GNU Radio under OSX 10.3, getting the background libraries and applications installed would likely be difficult.

There are 2 primary guides for installing GNU Radio on OSX: Jon Jacky and RadioWare@UND. As of the GNU Radio 3.2 release (24 May 2009), then former is somewhat out of date but can still be used as a reference if desired. The latter is up to date for 3.2, provides scripts for most of the work that provide equivalent functionality on either version of OSX.

There are a number of background libraries and applications that must be installed from source or binary in order to compile or execute GNU Radio. These can be obtained by using Fink, MacPorts, and/or from source / scratch. MacPorts tends to be more up-to-date with respect to new releases, which can be both a blessing and a curse. Both Fink and MacPorts offer thousands of ready-to-install libraries and applications, and hence they are highly recommended to use instead of installing from source / scratch. MacPorts will soon offer a meta-installer for GNU Radio release 3.2: "sudo port install gnuradio ursp" will install all known compilable GNU Radio modules including USRP.

NOTES:


Mailing lists

GNU Radio hosts a number of email lists for discussion of GNU Radio related topics at "It is strongly recommended that everyone using GNU Radio and/or the USRP subscribe to the discuss-gnuradio mailing list. It is the proper place to ask if you have any questions or problems.

Guidelines for posting

For hints and rationales see How do I quote correctly.

The lists

You can use the following table as a guide to the lists which are most relevant to you.

Please note that you must be subscribed to post to these lists. Postings from non-subscribed addresses are quietly dropped.

Name Description View archive Subscribe
[mailto:] This list is for discussion of GNU Radio development, porting to new platforms, ideas for the future, general GNU Radio usage or problems. New alpha and stable releases are announced here. View Mailman
[mailto:] This is where the patches to the gnuradio repository are posted for peer review before being committed to SVN. View Mailman
Automatically generated notifications of commits to the source code repository (read-only). View Mailman
The USRP-announce mailing list, which gets about 1 message per month, contains the latest news on the USRP. View Mailman

This information worked fine for Mandriva 2007.1

You should NOT need to compile any dependencies from source. EVERYTHING is available as a package. The install should be trivial. Some packages you will need to install if not already installed:

You can install these packages by using your favourite package manager.

Then follow instructions at BuildGuide.


Message Blocks

Introduction

Message blocks (or m-blocks) are a GNU Radio extension, designed in cooperation with BBN, that allows more natural handling of packet-based data. Full details of the message block can be found in the original BBN proposal: http://acert.ir.bbn.com/downloads/adroit/gnuradio-architectural-enhancements-3.pdf | http://web.archive.org/web/20070316174431/http://acert.ir.bbn.com/downloads/adroit/gnuradio-architectural-enhancements-3.pdf

The message-block introduces several new capabilities to GNU Radio:

A message-block is a bi-directional block in which information flows as messages that may contain data, metadata, control information, status information, and signals. Since m-blocks can communicate many different types of messages, each port is typed with a protocol class to ensure that only compatible ports are connected. This ensures that an m-block communicating control information is not connected with an m-block communicating status information. An m-block may have zero or more bi-directional message ports of the same protocol.

Multiple levels of aggregation can be used with the m-block such that m-blocks may be enclosed within each other. However, the m-block is not limited to containing other m-blocks. It may contain collections of GNU Radio blocks or flow_graphs. Aggregation allows for conversions between messages and streams of data samples to take place in an internal fashion to a single m-block. The following terminology is used:

Unlike GNU Radio blocks which are connected through a flow_graph which provides a scheduler and maintains topological information, the aggregation property of m-blocks require them to maintain their own topological information. There will only be a single top-level m-block that provides equivalent topological functionality of a GNU Radio flow_graph, rather than a corresponding flow_graph being needed for each m-block.

Each m-block has a processing callback function, handle_message, which handles the data and metadata processing as well as the message timing functionality. The handle_message callback relies on the scheduler for external event notification and therefore never blocks.

When used in conjunction with a priority based scheduler, the priority of the m-block will be the priority of the highest priority message within its queue. With a series of m-blocks in the scheduler, this allows for high priority signals to be processed quickly.

Data and Metadata

The messages that flow through m-blocks have two types of information: metadata and data. The metadata may contain the message version, timestamps, a priority, segmentation information, and commands/notifications from external entities. The data portion of the message carriers the data which may be transformed by blocks as it is passed through a flow_graph. The following is the proposed message format, taken from the BBN proposal:

Field _Description
Message Handle Unique identifier for this message.
Priority Message priority.
Signal An event name used to control state transitions within the FSM of m-blocks that process this message.
Timestamps A table that carries the entry/exit timestamps for blocks in the processing path. (not required of all blocks)
Data portion The data to be operated on by the blocks in a processing flow_graph.

Protocol Classes

As discussed in the introduction, each port on an m-block has an associated protocol class to ensure m-blocks connected to each other carry the same types of messages. Aside from the type, the protocol class also has an associated direction that specifies whether a message is permitted to travel in or out of the port. The proposed classes are the following:


see MultiUsrp


Installing GNU Radio with MinGW and MSYS

These instructions are for using MinGW and MSYS to install and build GNU Radio software, including USRP TX/RX support, under Windows XP.

These instructions include information from the old wiki pages at UsrpMinGW and MinGW.

NOTE: Do not use any spaces in your Windows folder names when creating new ones.

NOTE: Building under MinGW/MSYS can coexist peacefully with Cygwin installed. Set up separate home directories for the two systems until you are thoroughly familiar with both systems.

MinGW / MSYS

The easiest way to install MinGW and MSYS is to use the automated installers and then
update selected components as needed.

section of "the MinGW download area":http://sourceforge.net/project/showfiles.php?group_id=2435.  Select the "Candidate", "g++", and "MinGW make" options in the
installation wizard.
<pre>
administrator privileges to do this.

<pre>
System/Current Release: MSYS-1.0.10" section of
<pre>
(you may need administrator privileges to do this).  Type "y" to continue with post install, "y" when asked if MinGW is installed, and "C:/MinGW" when prompted for the MinGW install directory.
If you skip the post-install or install MSYS first, you will need to manually add the line
<pre>
C:/MinGW /mingw
</pre>
to the MSYS file @/etc/fstab@ (@c:\msys\1.0\etc\fstab@).

You can use MSYS version 1.0.11 if you prefer, but there is no installer yet (as of May 2008) for that version.

You can avoid some problems by intalling an updated version of bash.  Download
<pre>
<pre>
C:/msys/1.0/bin/bzip2 -d bash-3.1-MSYS-1.0.11-1.tar.bz2
C:/msys/1.0/bin/tar -xf bash-3.1-MSYS-1.0.11-1.tar
</pre>
Be sure that the MSYS shell is not in use; otherwise you will get a message like
<pre>
/usr/bin/tar: bin/sh.exe: Cannot open: File exists
</pre>

<pre>
"the MinGW download area":http://sourceforge.net/project/showfiles.php?group_id=2435 using the default values. 

The versions of autoconf, automake, and libtool loaded by the MSYS installer are too old.  To get newer versions, download the following files from  
the "User Contributed: mingwPORT/Current Releases" section of
"the MinGW download area":http://sourceforge.net/project/showfiles.php?group_id=2435:
* @wget-1.9.1-mingwPORT.tar.bz2@
* @autoconf-2.59-mingwPORT.tar.bz2@
* @automake-1.9.5-mingwPORT.tar.bz2@
to @/usr/src@ (create @/usr/src@ with @mkdir@ if you need to).  Then run the following commands (in an MSYS shell window):
<pre>
mkdir /usr/local
mkdir /usr/local/bin
cd /usr/src
tar -jxf wget-1.9.1-mingwPORT.tar.bz2
cd wget-1.9.1/mingwPORT
cp wget.exe /usr/local/bin
cd /usr/src
tar -jxf autoconf-2.59.mingwPORT.tar.bz2
cd autoconf-2.59/mingwPORT
./mingwPORT.sh
cd /usr/src
tar -jxf automake-1.9.5.mingwPORT.tar.bz2
cd automake-1.9.5/mingwPORT
./mingwPORT.sh
</pre>
You need to edit @/mingw/bin/aclocal@ to change all occurrences of @C:/@ to @/C/@.  You can do this with the editor of your choice (provided that it does not add formatting to the
file or change the end-of-line separators), or you can use sed:
<pre>
cd /mingw/bin
mv aclocal aclocal.orig
sed s.C:/./C/.g aclocal.orig > aclocal
</pre>

You may not need them, but it is convenient to have the utilities from @mingw-utils-0.3.tar.gz@ (from the "MinGW Utilities/Current Release: mingw-utils-0.3" section at "MinGW download
area at SourceForge":http://sourceforge.net/project/showfiles.php?group_id=2435.  Download these to @C:/MinGW@ and unpack with @tar -zxf@.

h2. Python

_Note: The latest version of Python that is known to work with GNU Radio is Python 2.4.4.  Versions
2.5.1 and 2.5.2 have been tried without success (builds work fine but GNU Radio modules cannot
be loaded) and version 2.4.5 is not available in a binary version for Windows." 

Download python-2.4.4.msi from "Python 2.4.4":http://www.python.org/download/releases/2.4.4.

Download numpy-1.0.4.win32-py2.4.exe from "Numerical Python":http://sourceforge.net/project/showfiles.php?group_id=1369.

Double-click python-2.4.4.msi to install, using default prompts.

Double-click numpy-1.0.4.win32-py2.4.exe to install, using default prompts.

h2. GNU Radio Dependencies

Unless otherwise noted, the following packages are required for building GNU Radio:

h3. libtool 2.2

Install libtool 2.2 using the instructions in hints tips known problems and solutions for Windows.

h3. WxPython for Win32

WxPython is not required to build GNU Radio, but many applications use it.

_Not certain if Unicode can be used with GNU Radio.  These instructions use ANSI._

Download wxPython2.8-win32-ansi-2.8.7.1-py24.exe from "Double-click on wxPython2.8-win32-ansi-2.8.7.1-py24.exe to install, using default prompts.  You may need administrator privileges for this step.[[BR":http://wxpython.org/download.php].
]

h3. pkg-config

Download the following files from "to @C:/msys/1.0/local@:
* GLib 2.16.3 Binaries (@glib-2.16.3.zip@)
* pkg-config 0.23 Tool binaries (@pkg-config-0.23-2.zip@)
and unpack them (into @/local@) using Windows "Extract All..." or your favorite unzip utility.
If you prefer, you can install these in @C:/MinGW@.

h3. SWIG

Download @swigwin-1.3.35.zip@ from [http://sourceforge.net/project/showfiles.php?group_id=1645 SWIG downloads":http://www.gtk.org/download-windows.html]. 
Extract @swigwin-1.3.35.zip@ to create the folder @swigwin-1.3.35@. You can put this folder in @C:\@, @/mingw@ or @/usr/src@. The instructions below assume it is in @C:\@.

h3. Boost

Download @boost_1_33_1_headers.zip@ from "Boost downloads":http://sourceforge.net/project/showfiles.php?group_id=7586, under "boost-subparts". 
Extract @boost_1_33_1_headers.zip@ to @C:\msys\1.0\local\include@.  To build from the svn trunk you will need boost 1.35 or later; see hints tips known problems and solutions for Windows.

h3. CppUnit

Download @cppunit-1.12.0.tar.gz@ from "CppUnit downloads":https://sourceforge.net/project/showfiles.php?group_id=11795 to a convenient directory (e.g., @C:\msys\1.0\src@).  From an MSYS shell:
<pre>
tar zxf cppunit-1.12.0.tar.gz
cd cppunit-1.12.0
./configure
make
make check
make install
</pre>
_Note: Attempts to use CppUnit 1.12.1 have failed in the @make check@ step._

h3. FFTW

_NOTE: Installing only the prebuilt DLLs from "is not sufficient for building GNU Radio unless you know how to create the necessary pkgconfig file.  Instructions on how to do this are welcome._

Follow the instructions in installing FFTW"httpwwwfftworginstallwindowshtml.

h3. Small Device C Compiler (SDCC)

Not required to build GNU Radio but needed to use the USRP.

Download sdcc-2.8.0-setup.exe from "SDCC downloads":http://sourceforge.net/project/showfiles.php?group_id=599. 
Double-click on sdcc-2.8.0-setup.exe to install; the default prompts work fine, but only the base tools and the include files are needed.   SDCC gets installed to C:\Program Files\SDCC. 
You will be given the option of adding this location to your Windows PATH; you can either do
this (once only!) or add /c/Progra~1/SDCC/bin to your MSYS PATH (see *PATH environment variable* below).

h3. Simple DirectMedia Layer (SDL)

This provides video capabilites; it is optional.

Download SDL-devel-1.2.13-mingw32.tar.gz from "Unpack and install with:
<pre>
tar -zxf SDL-devel-1.2.13-mingw32.tar.gz
cd SDL-1.2.13
make cross CROSS_PATH=/usr/local
</pre>
You can also download the source and do @configure; make; make install@ if you prefer.

h3. USB Library for Windows (libusb-win32)

Not required to build GNU Radio but needed to use the USRP.

Download libusb-win32-device-bin-0.1.12.1.tar.gz from [http://sourceforge.net/project/showfiles.php?group_id=78138 libusb-win32 downloads":http://www.libsdl.org/download-1.2.php]. to a convenient directory.  Install with:
<pre>
tar zxf libusb-win32-device-bin-0.1.12.1.tar.gz
cd libusb-win32-device-bin-0.1.12.1
cp include/* /usr/local/include
cp lib/gcc/* /usr/local/lib
cp bin/* /usr/local/bin
</pre>
*NOTE*: As described at "make sure your WinXP installation has Service Pack 2, or at least hotfix kb838989.  Refer to [http://support.microsoft.com/kb/838989":http://www.comsec.com/wiki?UsrpMinGW], for more information.

h3. PortAudio

_This package is required to build gr-audio-portaudio, which currently works better than gr-audio-windows._  See hints tips known problems and solutions for Windows for more information.

To install PortAudio see installing [[PortAudio]].

If you are using bash version 2.04, both @make@ and @make install@ will encounter errors.  The last few lines for the @make@ command look something like:
<pre>
for dir in ; do make -C $dir all; done
/bin/sh.exe: -c: line 1: syntax error near unexpected token @;'
/bin/sh.exe: -c: line 1: @for dir in ; do make -C $dir all; done'
make: *** [all-recursive] Error 2
</pre>

And, the last few output lines of the @make install@ command look like:
<pre>
for dir in ; do make -C $dir install; done
/bin/sh.exe: -c: line 1: syntax error near unexpected token @;'
/bin/sh.exe: -c: line 1: @for dir in ; do make -C $dir install; done'
maker1: *** [install-recursive] Error 2
maker1: Leaving directory @/c/portaudio'
make: *** [install] Error 2
</pre>

Don't worry about these errors; they do not affect the successful build and installation of portaudio.  For more information, see hints tips known problems and solutions for Windows.

h2. PATH environment variable

You need to be sure that the GNU Radio build process can find Python and SWIG.  One way to do this is to include them directly in your PATH variable.  You can edit the file @/etc/profile@ (i.e., @C:\msys\1.0\etc\profile@) to include a line like:
<pre>
export PATH=".:/usr/local/bin:/mingw/bin:/bin:/c/Python24:/c/Python24/DLLs:/c/Python24/libs:/c/swigwin-1.3.35:$PATH" 

</pre>
or you can adjust your PATH in @~/.bash_profile@.  You should also add a line to @/etc/profile@ or @~/.bash_profile@ to define the path to USRP firmware files, like the following example:
<pre>
export USRP_PATH=/usr/local/share/usrp
</pre>
These changes will take effect the next time you start a new MSYS shell.

Another way to make Python and SWIG available is to add scripts in the default PATH to point to the necessary programs.  For example, the following script can be placed in @/usr/local/bin/swig@ or @/mingw/bin/swig@:
<pre>
#! /bin/sh
exec /c/swigwin-1.3.35/swig.exe "$@" 
</pre>
The script for @python@ (in @/usr/local/bin/python@ or @/mingw/bin/python@) is a little more complicated:
<pre>
#! /bin/sh
if test $# -ne 0; then
  exec /c/Python24/python.exe "$@" 
else
  exec /c/Python24/python.exe -i
fi
</pre>

h2. GNU Radio Software

<pre>
<pre>
tar -zxf gnuradio-3.1.3.tar.gz
cd gnuradio-3.1.3
</pre>
Set the necessary environment variables and run the configuration script:
<pre>
export CPPFLAGS=-I/usr/local/include
export LDFLAGS="-L/usr/local/lib -lws2_32" 
./configure --prefix=C:/msys/1.0/local
</pre>
<pre>
<pre>
*********************************************************************
The following GNU Radio components have been successfully configured:

config
omnithread
gnuradio-core
usrp
gr-usrp
gr-audio-portaudio
gr-audio-windows
gr-atsc
gr-gpio
gr-gsm-fr-vocoder
gr-pager
gr-radar-mono
gr-radio-astronomy
gr-trellis
gr-video-sdl
gr-wxgui
gr-sounder
gr-utils
gnuradio-examples

You my now run the make command to build these components.

*********************************************************************
The following components were skipped either because you asked not
to build them or they didn't pass configuration checks:

gr-audio-alsa
gr-audio-jack
gr-audio-oss
gr-audio-osx
gr-comedi

These components will not be built.
</pre>
Next, in the MinGW window, build the GNU Radio software by typing the following command:
<pre>
make
</pre>
Verify everything built properly by typing the following command:
<pre>
make check
</pre>

If you are using bash 2.04, you will need to work around the "@for i in ;@" problem:  In gnuradio-3.1.3/usrp/doc/Makefile, comment out the following lines (approx. lines 755-759) as shown:

<pre>
#    @for i in $(DOCBOOK_HTML_FILES); do \
#        echo "$(INSTALL_DATA) $$i $(DESTDIR)$(docdir)/html"; \
#        $(INSTALL_DATA) $$i $(DESTDIR)$(docdir)/html; \
#    done
#    cp -r html $(DESTDIR)$(docdir)
</pre>
In gnuradio-3.1.3/gr-trellis/doc/Makefile, comment out the following lines (approx. lines 588-591) as shown:
<pre>
#    @for i in $(HTML_FILES); do \
#        echo "$(INSTALL_DATA) $$i $(DESTDIR)$(docdir)/html"; \
#        $(INSTALL_DATA) $$i $(DESTDIR)$(docdir)/html; \
#    done
</pre>

Install the GNU Radio software by typing the following command:

<pre>
make install
</pre>

h2. USRP Driver Installation

If you have a USRP, you will need to install the driver for it.  Refer to "installing the USRP driver for Windows":http://gnuradio.org/trac/wiki/USRPWindowsDriverInstall.  However, note that 2 of the 3 files you need are in different locations than shown on "that page":http://gnuradio.org/trac/wiki/USRPWindowsDriverInstall.  Use the following commands, instead of the ones shown on "that page":http://gnuradio.org/trac/wiki/USRPWindowsDriverInstall, to put the files in the same place:

<pre>
cd /c/gnuradio-3.1.3/usrp
cp /c/libusb-win32-device-bin-0.1.12.1/bin/libusb0.sys .
cp /c/libusb-win32-device-bin-0.1.12.1/bin/libusb0.dll .
</pre>

Then, follow the remaining instructions on the "USRP driver install page for Windows":http://gnuradio.org/trac/wiki/USRPWindowsDriverInstall.

Your USRP should be ready to go!


Each benchmark data point is generated by running a particular flowgraph.
The flowgraphs have a rectangular format, described by the number of pipelines and the number of stages in each pipeline. For the purposes of the benchmark, only the fir_filter_fff blocks count as stages; the null_source, head and null_sinks get folded into the overhead.
E.g.,
 1 <table width="100%" border="0">
 2 <tr>
 3 <td align=center><strong>1 pipeline x 3 stages</strong></td>
 4 <td align=center><strong>3 pipelines x 1 stage</strong></td>
 5 <td align=center><strong>3 pipelines x 3 stages</strong></td>
 6 </tr>
 7 <tr>
 8 <td align=center valign=top><img src="http://gnuradio.org/images/perf-data-images/1x3.png"></td>
 9 <td align=center valign=top><img src="http://gnuradio.org/images/perf-data-images/3x1.png"></td>
10 <td align=center valign=top><img src="http://gnuradio.org/images/perf-data-images/3x3.png"></td>
11 </tr>
12 </table>

Each FIR has 256 taps. Since these are implemented with a dot-product, we count 2 floating point operations (FLOP) per tap, per sample. For each run of the benchmark, we measure the user, system and real time. In addition we know the number of samples processed by the graph and the topology, thus we can compute the total number of floating point operations. We compute GFLOPS as the total FLOPs / real time / 1e9.

The benchmark code

The benchmark code and raw data are in
[source:gnuradio/branches/features/mp-sched/gnuradio-examples/python/mp-sched gnuradio-examples/python/mp-sched.]

You can plot the raw data and fly it around in 3D using

x86 and x86_64 Processors

On the x86 machines the kernel of gr.fir_filter_fff is implemented with SSE.

http://gnuradio.org/images/perf-data-images/dual-quad-core.png

http://gnuradio.org/images/perf-data-images/dual-quad-core-2.33-clovertown.png

http://gnuradio.org/images/perf-data-images/core2-duo.png

http://gnuradio.org/images/perf-data-images/core-duo.png

PowerPC Processors (using Altivec)

Note the differences in scaling between the same machines depending on whether we're using
Altvec or not. It's especially pronounced on the PS3.

http://gnuradio.org/images/perf-data-images/js21-altivec.png

In the next two graphs running on cell processors we're not yet using the SPEs.
This is all running on the PPE.

http://gnuradio.org/images/perf-data-images/qs21-altivec.png

http://gnuradio.org/images/perf-data-images/ps3-altivec.png

PowerPC Processors (without Altivec)

Please note that the benchmark does not contain any AltiVec code. Thus these machines are
at a disadvantage to the SSE enabled benchmark code on the x86 and x86_64. Within a graph, however,
the scaling is valid.

http://gnuradio.org/images/perf-data-images/js21.png

In the next two graphs running on cell processors we're not yet using the SPEs.
This is all running on the PPE.

http://gnuradio.org/images/perf-data-images/qs21.png

http://gnuradio.org/images/perf-data-images/ps3.png


MultiUsrp or Mimo use of the USRP

Here follows a description on how to connect two or more usrps (with a locked clock) and get synchronised samples.
In other words, how to get locked LO (Local Oscillators) and PhaseCoherent samples from multiple channels of multiple usrps (MIMO).

Quick start multi-usrp

Unpack, build and install usrp, gnuradio-core and gr-usrp
Versions need to be more recent then 2.7cvs/svn 11 may 2006

Make sure usrp/fpga/rbf/rev2/multi*.rbf is installed in /usr/local/share/usrp/rev2/
Make sure usrp/fpga/rbf/rev4/multi*.rbf is installed in /usr/local/share/usrp/rev4/
(If in doubt, copy manually)

Build and install gr-wxgui gr-audio-xxx and so on.

unpack gnuradio-examples.

There is a gnuradio-examples/python/multi_usrp directory which contains examples and explanation.

Put at least a basic RX or dbsrx board in RXA of the master and RXA of the slave board.
Make sure that the usrps have a serial or unique identifier programmed in their eeprom.
(All new rev 4.1 boards have this)
You can do without a serial but then you never know which usrp is the master and which is the slave.

Connecting the Cables

Now connect the 64MHz clocks between the boards with a short sma coax cable.
See USRPClockingNotes on how to enable clock-out and clock-in, and which daughterboards are supported.

You need one board with a clock out and one board with a clock in.

You can choose any of the two boards as master or slave, this is not dependant on which board has the clock-out or in.
In my experiments I had fewer problems when the board that has the clock-in will be the master board.

You can use a standard 16-pole flatcable to connect tvrx, basic-rx or dbsrx boards.
Of this 16pin flatcable only two pins are used (io15 and ground)
For all new daughterboards which use up a lot of io pins you have to use a cable with fewer connections.
The savest is using a 2pin headercable connected to io15,gnd (a cable like the ones used to connect frontpanel leds to the mainboard of a PC)

If using basic rx board

  Connect a 16-pole flatcable from J25 on basicrx/dbs_rx in rxa of the master usrp to J25 on basicrx/dbsrx in RXA of the slave usrp
  Don't twist the cable (Make sure the pin1 marker (red line on the flatcable) is on the same side of the connector (at io-8 on the master and at io8 on the slave.))
  For basic_rx this means the marker should be on the side of the dboard with the sma connectors. 
  For dbs_rx this means the marker should be on the side of the dboard with the two little chips.
  In other words, don't twist the cable, you will burn your board if you do.

You can also connect a flatcable with multiple connectors from master-J25 to slave1-J25 to slave2-J25 to ...
You will however have to think of something to create a common 64Mhz clock for more then two usrps. (See USRPClockingNotes)

For all other daughterboards

connect a 2wire cable from masterRXA J25 io15,gnd to slaveRXA J25 io15,gnd 

So now the hardware is setup, software is setup. Lets do some tests.

Connect power to both usrps.
unpack the gnuradio_examples somewhere (cvs version later then 11 may 2006)
go to the gnuradio-examples/python/multi_usrp folder.

Now run
 ./multi_usrp_oscope.py -x 12345678

It should tell you that usrp 12345678 is not found and tell you which serials are available. Now run
./multi_usrp_oscope.py -x actualserialnum 

You should now get an oscope with two channels, one is from the master and one is from the slave
It will which show the I-signal from channel 0 of the master usrp and I-signal from channel 0 of the slave usrp.
(For testing connect the same signal source to the inputs of both boards)
The signals should be aligned.
If you click the sync button, it will resync the master and slave (should never be needed) Now run
./multi_usrp_oscope.py --help

To see all available options.

Now you are ready to do phase-locked aligned signal processing.

You can also capture to file with:
./multi_usrp_rx_cfile.py 
To see all available options:
./multi_usrp_rx_cfile.py --help

Detailed desciption of MuliUsrp or Mimo use or the USRP==
description of the detail blocks used in usrp_multi.py ===

Multi usrp

With this code you can connect two or more usrps (with a locked clock) and get synchronised samples.
You must connect a (flat)cable between a dboard on the master in RXA and a dboard on the slave in RXA.
You then put one usrp in master mode, put the other in slave mode.

The easiest thing to see how this works is just looking at the code in
multi_usrp_oscope.py
multi_usrp_rx_cfile.py

Use the usrp_multi block which is installed by gr-usrp.
instantiate in the following way:

self.multi=usrp_multi.multi_source_align( fg=self, master_serialno=options.master_serialno, decim=options.decim, nchan=options.nchan )

nchan should be 2 or 4.

You determine which is the master by master_serialno (this is a text string a hexadecimal number).
If you enter a serial number which is not found it will print the serial numbers which are available.
If you give no serial number (master_serialno=None), the code will pick a Master for you.

You can get a reference to the master and the slave usrp in the following way:
        self.um=self.multi.get_master_usrp()
        self.us=self.multi.get_slave_usrp()

You only need these references for setting freqs/gains or getting info about daughterboards.
Don't use the output directly but use the aligned output from multi.get_master_source_c() and multi.get_slave_source_c() You get references to the aligned output samples in the following way:
aligned_master_source_c=self.multi.get_master_source_c()
aligned_slave_source_c=self.multi.get_slave_source_c()

These blocks have multiple outputs.
output 0 is the sample counter (high bits in I, low bits in Q)
You normally don't need the samplecounters so you can ignore output 0

output 1 is the first aligend output channel (if you enable 2 or 4 channels)
output 2 is the second output channel (only if you enable 4 channels)

so the usefull 4 channels are:
self.aligned_master_chan1=(self.multi.get_master_source_c(),1)
self.aligned_master_chan2=(self.multi.get_master_source_c(),2)
self.aligned_slave_chan1=(self.multi.get_slave_source_c(),1)
self.aligned_slave_chan2=(self.multi.get_slave_source_c(),2)

The two samplecounters are:
self.aligned_master_samplecounter=(self.multi.get_master_source_c(),0)
self.aligned_slave_samplecounter=(self.multi.get_slave_source_c(),0)
You can set the gain or tune the frequency for all 4 receive daughetrboards at once:
        self.multi.set_gain_all_rx(options.gain)
        result,r1,r2,r3,r4 = self.multi.tune_all_rx(options.freq)

This will only work reliably when you have all the same daughterboards.
Otherwise set all freqs and gains individually.

You must call self.multi.sync() at least once AFTER the flowgraph has started running.
(This will synchronise the streams of the two usrps)

This work was funded by Toby Oliver at Sensus Analytics / Path Intelligence.
Many Thanks for making this possible.

It was written by Martin Dudok van Heel of Olifantasia.com.
email: nldudok1_olifantasia_com


.


These instructions should work for most systems using pkgsrc (such as DragonflyBSD).

The most recent release of GNU Radio is usually available in pkgsrc, currently meta-pkgs/gnuradio. An easy way to get most of the dependencies installed in order to build from SVN is to build the GNU Radio meta-pkg. It can then be deleted, or left in place.

As of 2006-10, the GNU Radio sources build with BSD make as well as GNU make. In case of mysterious failures, try GNU make and report the bug.

To use dependencies provided by pkgsrc, one must pass CPPFLAGS and LDFLAGS to configure. Programs not built by pkgsrc should not be placed in /usr/pkg, so use a different prefix.

./bootstrap.sh

LDFLAGS="-L/usr/pkg/lib -R/usr/pkg/lib" CPPFLAGS="-I/usr/pkg/include" ./configure --prefix=/usr/gnuradio

make

sudo make install

To run "make distcheck", one must pass LDFLAGS and CPPFLAGS as above because distcheck runs configure after creating a tarball and unpacking it.

To run "make check", one must have large amounts of space free in /tmp (over 128 MB?) One can do "TMP=/usr/tmp make check" after creating another tmp dir to work around this problem.

Support for improved USB speed was committed to NetBSD-current in July, 2006. This code is also in the netbsd-4 branch. Code to use the new USB driver enhancements was committed to GNU Radio svn in September, 2006 prior to the creation of the 3.0 release branch.
Documentation of speed tests of the USB code are at
the ACERT ADROIT GNU Radio project CVS repository. See also the main project page.

The vmcircbuf tests use large amounts of sysv shm resources because 64 mapping objects are created and then all are freed.


Please try this new build and report on the mailing list any successes or failures. If you wish to build it yourself, you'll need to get it out of the new_eth branch of this git repository:
http://gnuradio.org/git/matt.git/
To create a local tracking branch do:
git branch --track new_eth origin/new_eth
git checkout new_eth

For those who can't do that, builds are attached to this page. You'll need both the FPGA image and the new firmware. If building yourself, make sure to do a make clean in both the fpga/top/u2_rev3 and firmware directories.


.


Installing Numpy

On most systems, numpy is available as a pre-built package, but if needed it can be installed from source by
downloading numpy-1.1.0.tar.gz from http://sourceforge.net/project/showfiles.php?group_id=1369 to /usr/src then:
cd /usr/src
tar zxf numpy-1.1.0.tar.gz
cd numpy-1.1.0
python setup.py install
If you get errors that say
Error: suffix or operands invalid for @fnstsw'

it is because you are using Cygwin binutils 20080523-1. You will need to either reinstall binutils 20060817-1 or make corrections to the Numpy source; see hints tips known problems and solutions for Windows.

On MinGW, download and run numpy-1.0.3.1.win32-py2.4.exe (or the python 2.5 version,
if that is what you need). Or you can be the first to try a newer version.


Octave

Octave is the most popular analysis tool with GNU Radio, as the GNU Radio package includes its own set of scripts for reading and parsing output.

Installing

Installing Octave can be done from source, or in Ubuntu using:
 sudo apt-get install octave
To use the GNU Radio octave scripts, you must add the path to your Octave path variable. This is easily done using your local ~/.octaverc configuration file. If you check out the GNU Radio trunk to /home/username/gnuradio/, you can add the following to ~/.octaverc:
 addpath("/home/username/gnuradio/gnuradio-core/src/utils/")

Parsing Data

To parse data output from GNU Radio, the easiest thing to do is use the provided scripts. Ensure that you have added the GNU Radio script path to your octave path, as described in the installing guide. These help you read data that you may have dumped to disk using gr.file_sink(size, filename).

You want to use one of the following methods, based on the size parameter used in gr.file_sink(). Each method takes a filename as the first parameter, and an optional second parameter which is the number of items to read from the file:
  • *read_complex_binary()*: gr.sizeof_gr_complex
  • *read_float_binary()*: gr.sizeof_float
  • *read_int_binary()*: gr.sizeof_int
  • *read_short_binary()*: gr.sizeof_short
  • *read_char_binary()*: gr.sizeof_char
For example, after capturing 64-bit complex using gr.file_sink(gr.sizeof_gr_complex, "capture.dat") in a Python script:
 c=read_complex_binary('capture.dat');
Data captured directly from the USRP is stored as 32-bit complex, rather than 64-bit complex (gr.sizeof_gr_complex). To read this data, first use read_short_binary() and then split it into a two dimensional vector:
 d=read_short_binary(data);
 c=split_vect(d,2);

Plotting

To plot data using octave, it is easiest to do with gnuplot. You can install GNU plot from source or using the Ubuntu repository:
 sudo apt-get install gnuplot
To plot I and Q separately over time, graph each component separately:
 plot([real(c), imag(c)])
Generating an I/Q plot (x-axis I, y-axis Q) can be done using:
 plot(c)

The OpenBTS Wiki Subspace

OpenBTS is an open-source Unix application that uses the Universal Software Radio Peripheral (USRP) to present a GSM air interface to standard GSM handset and uses the Asterisk software PBX to connect calls. The combination of the ubiquitous GSM air interface with VoIP backhaul could form the basis of a new type of cellular network that could be deployed and operated at substantially lower cost than existing technologies in greenfields in the developing world.

In plain language, we are working on a new kind of cellular network that can be installed and operated at about 1/10 the cost of current technologies, but that will still be compatible with most of the handsets that are already in the market. This technology can also be used in private network applications (wireless PBX, rapid deployment, etc.) at much lower cost and complexity than conventional GSM.

The pages are organized here by topic area. If you have something useful to add, please do so. To edit the wiki, you can register an account or use "guest" as a user name, and "gnuradio" as the password.

Source Code

Grab the project source code via svn:

We are in the process of moving to git and will update these instructions when that is complete. For now, you can check out this code from svn, but probably won't be able to update it later. -- 4 Jan 2010.

svn co http://gnuradio.org/svn/openbts/trunk/openbts

or

svn co http://gnuradio.org/svn/openbts/branches/releases/xx

where "xx" is the latest release number.

Project Background

Working with OpenBTS

I Want to Run OpenBTS!

  • OpenBTS/Releases. Where to get OpenBTS and what's in each release.
  • OpenBTS/BuildingAndRunning. How to build and run the OpenBTS and Transceiver applications.
  • Tickets. OpenBTS still keeps its ticket-tracker outside of the GNU Radio system. We really do use this and try to keep it up to date.
  • OpenBTS/smqueue. How to build and run the smqueue RFC-3428 store and forward server, our SMSC replacement.
  • OpenBTS/support. Where to get help.

PBX Configurations

OpenBTS replies on an external SIP PBX for its call switching functions.

Asterisk

  • OpenBTS/SettingUpAsterisk. How to configure Asterisk to work with OpenBTS and smqueue.
  • OpenBTS/Asteriskscript. A hostdesking dialplan that seperates SIP entries and actual phonenumbers and maximize flexibility, security and ease. However, this configuration is not compatible with smqueue.
  • OpenBTS/The use of autocreatepeer=yes. A line in /etc/asterisk/sip.conf in the [general] part that enables acceptance of any registration attempt of any SIP User Agent.

FreeSWITCH

OpenBTS Hardware and Testing

General

Phones

  • OpenBTS/Compatibility. Phones known to work or not to work with OpenBTS. All phones ''should'' work, so this is debugging data. Please update this with your own discoveries.
  • OpenBTS/NokiaDCT3. Why we love Nokia DCT-3 series handsets.

Clocks

The Burning Man Tests

We use the Burning Man festival as an opportunity to run test networks.

2009

2008

GSM General Information

  • The Um Interface. This is an overview of the GSM air interface, Um. This was originally going to be part of the OpenBTS documentation, but we put it in Wikipedia because it may be of interest to a wider audience. '''You need to understand this to understand most of the code in the GSM directory.'''
  • BTS Design and Network Management Considerations
    • OpenBTS/MS_Camping. The cell requirements to allow mobile station camping and some tips on getting your test phones to camp.
    • OpenBTS/Clocks. Comments on BTS clock quality and clock-related BTS bugs.
  • OpenBTS/The_Standard_Links
  • OpenBTS/Reading_The_Standard. Recommendations for newcomers.

GSM For Dummies - Comprehensive introduction into GSM from www.gsmfordummies.com.

OpenBTS Software Implementation

OpenBTS Hardware Implementation

  • OpenBTS/BM2008RF Burning Man 2008 RF Chains. The kludged up playa rig. Professional RF engineers, please promise not to laugh.
  • OpenBTS/BM2009RF Burning Man 2009 RF Chains. We're getting better at this. It's amazing what you can do with better planning and a little more money.
  • OpenBTS/Clocks. Comments on BTS clock quality and clock-related BTS bugs.

OpenBTS Network Integration Scenarios

Miscellany

  • OpenBTS/Logo
  • OpenBTS is a registered trademark of Kestrel Signal Processing, Inc.

Asterisk dialplan designed for use with OpenBTS

; This dialplan is specially designed for use with OpenBTS.

; It can also be used as an Asterisk based solution without using mobile phones.

; It provides full hotdesking for all phones registered and configured with sip entry in

; /etc/asterisk/sip.conf

;

; SIP entries in /etc/asterisk/sip.conf

; SIP entries in sip.conf has to look like this:

;

; [IMSI204123170034543]

; callerid=IMSI204123170034543 <IMSI204123170034543>

; canreinvite=no

; type=friend

; allow=gsm

; context=sip-internal

; host=dynamic

;

; Be aware of the fact that with SIP entries as above smqueue will not work properly.

;

; Automatic configuration of discovered IMSI numbers should be easy

; Because no dialplan info has to be added, automatic configuration of a SIP entry after

; discovering should not be that hard. The use of a file for every SIP entry included

; in SIP.conf is the way to go for this.

;

;*Simple, safe and flexible dialplan*

; This dialplan provides flexibility and seperates the SIP registration based on IMSI

; number and the actual phone numbers used to call.

;

; The basic idea behind this dial plan is to keep it as simple, safe and flexible

; as possible. It can be used as a ready to go solution but it might be

; a good idea to make some adjustments based on particular needs.

;

;*Number range 1001 - 1012 preconfigured*

; The number 1001 to 1012 are preconfigured. Expanding the number range is

; just a matter of copy and past of all the 1001 to 1012 parts in the dialplan and make some

; adjustments on the numbers. The dialplan should suite every OpenBTS deployment.

;

;*Logging in*

; When a mobile phone is registered to OpenBTS and Asterisk it needs

; to be logged in for a phone number. This is done by dialing 0<phone number>.

; Dialing 01001 makes the phone reachable at number 1001 and set the callerid

; to 1001. By default the pincode is 1234 but this can easily be changed.

; One phone can log in an unlimited number of phonenumbers. The limitation is

; the the range of numbers available within the dialplan.

;

;*Logging off*

; Dial 1<phonenumber> to log out of a phone umber. The result of dialing 11001 is that

; the phone is no longer reachable at number 1001

;

;*Automatic log off*

; A phone number will be logged off if a call is made to that number and the status is

; UNAVAILABLE.

;

;*Logging in is needed to make useful calls*

; A phone registered to the OpenBTS and Asterisk but not logged to a phonenumber

; can't make any usefull phonecalls. Any dialed number is routed to an Asterisk

; music on hold extensions or the monkeys screaming. This can be changed to personal

; needs like a voiceprompt that let the caller know that a login to a number is needed.

; This provides security to this solution. You need to have the proper credentials to make

; phonecalls.

;

;*Using a trunk*

; The dialplan is ready for use with a trunk so outbound calls can be made if the connection

; is actually there. In the dialplan all numbers of 10 positions are routed to the trunk.

; In the Netherlands this enables making national phonecalls. A phone needs to be logged into

; a phone number before an outbound call can be made. The numbermatching ca be changed to your needs.

; OPENBTS_TRUNK is the global variable to store the trunk.

;

;*Special numbers*

; Some special numbers, handy when testing, have been added to the dialplan:

; 01234 -> releases all logged in numbers. be aware that if you call this number and enter

; the password (default 1234) all phones are without an actual number.

; 02345 -> shows all phonenumbers and, if available, the IMSI number related to the phonenumber

; in the Asterisk Cli.

; 03456 -> shows the device state of the SIP registered IMSI numbers in the Asterisk Cli.

; This doesn't work at the moment while it should :-(

; 02000 -> a music on hold extension.

;

; Absolute timeout

; Set(Timeout(absolute)=XX) is used now and then so calls without the proper credentials

; end within a certain time. XX is the number of seconds before the connection will be ended.

;

; 4 different scenarios for a call

; Different things can happen when dialing a number, depending on the status of the phone used and the

; status of the number called. Info about the actual status can be viewed from the Asterisk Cli with verbose

; set to 5 (set verbose 5)

;

; scenario 1

; The phone used to dial a number hasn't been logged in. It is not possible

; to make any call without first logging in with a proper combination of number and password/pincode

;

; scenario 2

; The phone has been logged in properly but the number dialed isn't logged in

;

; scenario 3

; The phone has been logged in properly, the number dialed is logged in but the phone is switch off

; or out of range. When this happens the dialed number is logged off. Because OpenBTS does return a SIP code

; that Asterisk doesn't translate in a CHANUNAVAIL but in a NOANSWER dialstatus the handling of this status doesn't

; work properly. This isn't a real problem because the phone isn'r reachable anyway. The result is that the login

; stays in place despite the fact that the phone is turned off or out of reach.

;

; scenario 4

; The phone has been logged in properly and the number dialed has been logged in properly. the dialed phone will

; ring and probably be picked up ;-)

;

; When a trunk is configured the phone used to dial an outbound number has to be properly logged into

; The global variable OPENBTS_TRUNK is used to store the actual trunk.

;

;*How to install this dialplan?*

; Just do a select all of this wiki text and do a paste in an empty file. Save this file as /etc/asterisk/extensions.conf

; add some sip entries like the example at the beginning of this text to /etc/asteisk/sip.conf and do a reload.

; Now you are ready to go ;-)

;

; Hope it is useful and you will have lots of fun!
;

;

;Erik

;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; auteur : Erik de Wild

; company : Tripple-o : Your Asterisk migration partner

; e-mail : info at tripple-o.nl

; phone : 0031621830837

;

; Rights : Tripple-o owns the rights to this dialplan

; Country : the Netherlands

; Time Zone : GMT +1

;

; version : 1.0

; date : 24 december 2009

; License : This dialplan is GPL3 licensed with the condition that

; this header (from top to [global]) is kept in place, credits are addressed and you don't charge

; money for the dialplan as it is. Under this conditions you are allowed to use, change and

; redistribute it.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[globals]

OPENBTS_TRUNK => SIP/31208123456

; variables for the IMSI numbers

;;;;;;;;;;;;;;;

; Here you can couple a phone to a number used in a sip entry in sip.conf. Used with

; OpenBTS this is the IMSI.

;

; Be aware of the fact that a reload will also reset the values of the NR<NUMBER> variables.

; during testing and trying this might be usefull, but in production this will lead to

; a lot of confusing because of lost logins.

;

; Number 1001 is used to show how a static link between a phone number and the callerid defined in a sip entry can be established.

; This is just an example for further adjustments to your personal needs

;;;;;;;;;;;;;;;

;;;;;;;;;;;;

; Number 1001 is an example of how to change a hotdesk phonenumber into a static phonenumber.

; This can be done with every phonenumber available. Be sure to make all the adjustments

; needed. Logging in, logging off, automatic logging of if dialstatus is CHANUNAVAIL, logging

; off of all the numbers by calling 01234 and enter pincode.

;;;;;;;;;;;;

NR1001 => STATIC0000001 ; This will, in combination with some other adjustments, change 1001 in a static number

;NR1002 =>

;NR1003 =>

;NR1004 =>

;NR1005 =>

;NR1006 =>

;NR1007 =>

;NR1008 =>

;NR1009 =>

;NR1010 =>

;NR1011 =>

;NR1012 =>

[default]

[trunk]

exten => s,1,GotoIf($CALLERID}" class="wiki-page new">${NR1001}" = "${CALLERID}?CONTINUE)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1002}" = "${CALLERID}?CONTINUE)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1003}" = "${CALLERID}?CONTINUE)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1004}" = "${CALLERID}?CONTINUE)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1005}" = "${CALLERID}?CONTINUE)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1006}" = "${CALLERID}?CONTINUE)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1007}" = "${CALLERID}?CONTINUE)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1008}" = "${CALLERID}?CONTINUE)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1009}" = "${CALLERID}?CONTINUE)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1010}" = "${CALLERID}?CONTINUE)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1011}" = "${CALLERID}?CONTINUE)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1012}" = "${CALLERID}?CONTINUE)

exten => s,n,Answer()

exten => s,n,NoOp(The phone used to make an outbound call has not been logged into with proper credentials so no calls can be made.)

exten => s,n,Set(TIMEOUT=15) ; this is to assure that the line is released after 15 seconds

exten => s,n,MusicOnHold()

; MOH has to be replaced by some usefull voiceprompt like "sorry, you are not allowed to make

; outbound calls until you log in"

exten => s,n,NoOp(The trunk used for this outboundcall is ${OPENBTS_TRUNK})

exten => s,n(CONTINUE),Dial(${OPENBTS_TRUNK}/${CALLED_NUMBER},40,rt)

exten => s,n,Hangup()

exten => _31208080651,1,Dial(SIP/IMSI204203000434438,40,t)

exten => _31208080651,n,Hangup()

[sip-internal]

exten => _XXXX,1,Set(CALLED_NUMBER=${EXTEN})

exten => _XXXX,n,Goto(dialplan,start,1)

exten => _0XXXXXXXXX,1,Set(CALLED_NUMBER=${EXTEN})

exten => _0XXXXXXXXX,n,Goto(trunk,s,1)

exten => _0XXXX,1,Set(CALLED_NUMBER=${EXTEN})

exten => _0XXXX,n,Goto(dialplan,${EXTEN},1)

exten => _1XXXX,1,Set(CALLED_NUMBER=${EXTEN})

exten => _1XXXX,n,Goto(dialplan,${EXTEN},1)

[dialplan]

include => trunk

exten => start,1,GotoIf($CALLERID}" class="wiki-page new">${NR1001}" = "${CALLERID}?CONTINUE)

exten => start,n,GotoIf($CALLERID}" class="wiki-page new">${NR1002}" = "${CALLERID}?CONTINUE)

exten => start,n,GotoIf($CALLERID}" class="wiki-page new">${NR1003}" = "${CALLERID}?CONTINUE)

exten => start,n,GotoIf($CALLERID}" class="wiki-page new">${NR1004}" = "${CALLERID}?CONTINUE)

exten => start,n,GotoIf($CALLERID}" class="wiki-page new">${NR1005}" = "${CALLERID}?CONTINUE)

exten => start,n,GotoIf($CALLERID}" class="wiki-page new">${NR1006}" = "${CALLERID}?CONTINUE)

exten => start,n,GotoIf($CALLERID}" class="wiki-page new">${NR1007}" = "${CALLERID}?CONTINUE)

exten => start,n,GotoIf($CALLERID}" class="wiki-page new">${NR1008}" = "${CALLERID}?CONTINUE)

exten => start,n,GotoIf($CALLERID}" class="wiki-page new">${NR1009}" = "${CALLERID}?CONTINUE)

exten => start,n,GotoIf($CALLERID}" class="wiki-page new">${NR1010}" = "${CALLERID}?CONTINUE)

exten => start,n,GotoIf($CALLERID}" class="wiki-page new">${NR1011}" = "${CALLERID}?CONTINUE)

exten => start,n,GotoIf($CALLERID}" class="wiki-page new">${NR1012}" = "${CALLERID}?CONTINUE)

exten => start,n,NoOp(Phone used to make a phonecall is not logged in yet)

exten => start,n,Answer()

exten => start,n,Set(TIMEOUT=15) ; this is to assure that the line is released

; after 15 seconds

exten => start,n,MusicOnHold() ; has to be changed in a voiceprompt inviting to

; login to one of the numbers

exten => start,n(CONTINUE),Goto(00${CALLED_NUMBER},1)

exten => 001001,1,Macro(dialGSM,${NR1001},${CALLED_NUMBER})

exten => 001002,1,Macro(dialGSM,${NR1002},${CALLED_NUMBER})

exten => 001003,1,Macro(dialGSM,${NR1003},${CALLED_NUMBER})

exten => 001004,1,Macro(dialGSM,${NR1004},${CALLED_NUMBER})

exten => 001005,1,Macro(dialGSM,${NR1005},${CALLED_NUMBER})

exten => 001006,1,Macro(dialGSM,${NR1006},${CALLED_NUMBER})

exten => 001007,1,Macro(dialGSM,${NR1007},${CALLED_NUMBER})

exten => 001008,1,Macro(dialGSM,${NR1008},${CALLED_NUMBER})

exten => 001009,1,Macro(dialGSM,${NR1009},${CALLED_NUMBER})

exten => 001010,1,Macro(dialGSM,${NR1010},${CALLED_NUMBER})

exten => 001011,1,Macro(dialGSM,${NR1011},${CALLED_NUMBER})

exten => 001012,1,Macro(dialGSM,${NR1012},${CALLED_NUMBER})

exten => _00XXXX,1,NoOp(A non existing number has been dialed)

exten => _00XXXX,n,PlayBack(silence/3)

exten => _00XXXX,n,PlayBack(tt-monkeys)

exten => _00XXXX,n,Hangup()

exten => 02000,1,Answer

exten => 02000,n,MusicOnHold()

exten => 02000,n,Hangup()

;;;;;;;;;;;;

; clearing the values of all variables so you can start all over again

;;;;;;;;;;;;

exten => 01234,1,Answer()

exten => 01234,n,Background(silence/3)

exten => 01234,n,Authenticate(1234)

; exten => 01234,n,Set(GLOBAL=) ; should stay untouched because 1001 is a static number

exten => 01234,n,Set(GLOBAL=)

exten => 01234,n,Set(GLOBAL=)

exten => 01234,n,Set(GLOBAL=)

exten => 01234,n,Set(GLOBAL=)

exten => 01234,n,Set(GLOBAL=)

exten => 01234,n,Set(GLOBAL=)

exten => 01234,n,Set(GLOBAL=)

exten => 01234,n,Set(GLOBAL=)

exten => 01234,n,Set(GLOBAL=)

exten => 01234,n,Set(GLOBAL=)

exten => 01234,n,Set(GLOBAL=)

exten => 01234,n,Hangup()

;;;;;;;;;;;;;;

; this routine shows the values of the NR<XXXX> variables on screen of the Asterisk CLI when verbose is above 5

;;;;;;;;;;;;;

exten => 02345,1,Answer()

exten => 02345,n,NoOp(The value of NR1001 is: ${NR1001})

exten => 02345,n,NoOp(The value of NR1002 is: ${NR1002})

exten => 02345,n,NoOp(The value of NR1003 is: ${NR1003})

exten => 02345,n,NoOp(The value of NR1004 is: ${NR1004})

exten => 02345,n,NoOp(The value of NR1005 is: ${NR1005})

exten => 02345,n,NoOp(The value of NR1006 is: ${NR1006})

exten => 02345,n,NoOp(The value of NR1007 is: ${NR1007})

exten => 02345,n,NoOp(The value of NR1008 is: ${NR1008})

exten => 02345,n,NoOp(The value of NR1009 is: ${NR1009})

exten => 02345,n,NoOp(The value of NR1010 is: ${NR1010})

exten => 02345,n,NoOp(The value of NR1011 is: ${NR1011})

exten => 02345,n,NoOp(The value of NR1012 is: ${NR1012})

exten => 02345,n,Hangup()

exten => 03456,1,Answer()

exten => 03456,n,NoOP(The status of ZOIPER is ${DEVSTATE})

exten => 03456,n,NoOP(The status of ${NR1001} attached to 1001 is ${DEVSTATE})

exten => 03456,n,NoOP(The status of ${NR1002} attached to 1002 is ${DEVSTATE})

exten => 03456,n,NoOP(The status of ${NR1003} attached to 1003 is ${DEVSTATE})

exten => 03456,n,NoOP(The status of ${NR1004} attached to 1004 is ${DEVSTATE})

exten => 03456,n,NoOP(The status of ${NR1005} attached to 1005 is ${DEVSTATE})

exten => 03456,n,NoOP(The status of ${NR1006} attached to 1006 is ${DEVSTATE})

exten => 03456,n,NoOP(The status of ${NR1007} attached to 1007 is ${DEVSTATE})

exten => 03456,n,NoOP(The status of ${NR1008} attached to 1008 is ${DEVSTATE})

exten => 03456,n,NoOP(The status of ${NR1009} attached to 1009 is ${DEVSTATE})

exten => 03456,n,NoOP(The status of ${NR1010} attached to 1010 is ${DEVSTATE})

exten => 03456,n,NoOP(The status of ${NR1011} attached to 1011 is ${DEVSTATE})

exten => 03456,n,NoOP(The status of ${NR1012} attached to 1012 is ${DEVSTATE})

;;;;;;;;;;;;;;;;

; this actually links phonenumber to an IMSI number

;;;;;;;;;;;;;;;;

; commented because no log in to number 1001 is needed

;;;;;;;;;;;;;;;;

;exten => 01001,1,Answer()

;exten => 01001,n,Background(silence/3)

;exten => 01001,n,Authenticate(1234)

;exten => 01001,n,Set(GLOBAL=${CALLERID})

;exten => 01001,n,Hangup()

exten => 01002,1,Answer()

exten => 01002,n,Background(silence/3)

exten => 01002,n,Authenticate(1234)

exten => 01002,n,Set(GLOBAL=${CALLERID})

exten => 01002,n,Hangup()

exten => 01003,1,Answer()

exten => 01003,n,Background(silence/3)

exten => 01003,n,Authenticate(1234)

exten => 01003,n,Set(GLOBAL=${CALLERID})

exten => 01003,n,Hangup()

exten => 01004,1,Answer()

exten => 01004,n,Background(silence/3)

exten => 01004,n,Authenticate(1234)

exten => 01004,n,Set(GLOBAL=${CALLERID})

exten => 01004,n,Hangup()

exten => 01005,1,Answer()

exten => 01005,n,Background(silence/3)

exten => 01005,n,Authenticate(1234)

exten => 01005,n,Set(GLOBAL=${CALLERID})

exten => 01005,n,Hangup()

exten => 01006,1,Answer()

exten => 01006,n,Background(silence/3)

exten => 01006,n,Authenticate(1234)

exten => 01006,n,Set(GLOBAL=${CALLERID})

exten => 01006,n,Hangup()

exten => 01007,1,Answer()

exten => 01007,n,Background(silence/3)

exten => 01007,n,Authenticate(1234)

exten => 01007,n,Set(GLOBAL=${CALLERID})

exten => 01007,n,Hangup()

exten => 01008,1,Answer()

exten => 01008,n,Background(silence/3)

exten => 01008,n,Authenticate(1234)

exten => 01008,n,Set(GLOBAL=${CALLERID})

exten => 01008,n,Hangup()

exten => 01009,1,Answer()

exten => 01009,n,Background(silence/3)

exten => 01009,n,Authenticate(1234)

exten => 01009,n,Set(GLOBAL=${CALLERID})

exten => 01009,n,Hangup()

exten => 01010,1,Answer()

exten => 01010,n,Background(silence/3)

exten => 01010,n,Authenticate(1234)

exten => 01010,n,Set(GLOBAL=${CALLERID})

exten => 01010,n,Hangup()

exten => 01011,1,Answer()

exten => 01011,n,Background(silence/3)

exten => 01011,n,Authenticate(1234)

exten => 01011,n,Set(GLOBAL=${CALLERID})

exten => 01011,n,Hangup()

exten => 01012,1,Answer()

exten => 01012,n,Background(silence/3)

exten => 01012,n,Authenticate(1234)

exten => 01012,n,Set(GLOBAL=${CALLERID})

exten => 01012,n,Hangup()

;;;;;;;;;;;;;;;;;;;;;

; this removes the link between a phone number and an IMSI number

;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;

; commented out because loging off is not needed with a static number

;;;;;;;;;;;;;;;

;exten => 11001,1,Answer()

;exten => 11001,n,Set(GLOBAL=)

;exten => 11001,n,Goto(beep,1)

exten => 11002,1,Answer()

exten => 11002,n,Set(GLOBAL=)

exten => 11002,n,Goto(beep,1)

exten => 11003,1,Answer()

exten => 11003,n,Set(GLOBAL=)

exten => 11003,n,Goto(beep,1)

exten => 11004,1,Answer()

exten => 11004,n,Set(GLOBAL=)

exten => 11004,n,Goto(beep,1)

exten => 11005,1,Answer()

exten => 11005,n,Set(GLOBAL=)

exten => 11005,n,Goto(beep,1)

exten => 11006,1,Answer()

exten => 11006,n,Set(GLOBAL=)

exten => 11006,n,Goto(beep,1)

exten => 11007,1,Answer()

exten => 11007,n,Set(GLOBAL=)

exten => 11007,n,Goto(beep,1)

exten => 11008,1,Answer()

exten => 11008,n,Set(GLOBAL=)

exten => 11008,n,Goto(beep,1)

exten => 11009,1,Answer()

exten => 11009,n,Set(GLOBAL=)

exten => 11009,n,Goto(beep,1)

exten => 11010,1,Answer()

exten => 11010,n,Set(GLOBAL=)

exten => 11010,n,Goto(beep,1)

exten => 11011,1,Answer()

exten => 11011,n,Set(GLOBAL=)

exten => 11011,n,Goto(beep,1)

exten => 11012,1,Answer()

exten => 11012,n,Set(GLOBAL=)

exten => 11012,n,Goto(beep,1)

;;;;;;;;;;;

; just some useless noice

;;;;;;;;;;;

exten => beep,1,Background(silence/2)

exten => beep,n,PlayBack(beep)

exten => beep,n,PlayBack(beep)

exten => beep,n,PlayBack(beep)

exten => beep,n,PlayBack(beep)

exten => beep,n,PlayBack(beep)

exten => beep,n,Hangup()

[macro-dialGSM]

;;;;;;;;;;;;;

; check all NR<number> variables to determine what phone number is used to call,

; so there is proper value for ${CALLERID}

;;;;;;;;;;;;;

exten => s,1,GotoIf($CALLERID}" class="wiki-page new">${NR1001}" = "${CALLERID}?NR1001)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1002}" = "${CALLERID}?NR1002)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1003}" = "${CALLERID}?NR1003)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1004}" = "${CALLERID}?NR1004)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1005}" = "${CALLERID}?NR1005)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1006}" = "${CALLERID}?NR1006)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1007}" = "${CALLERID}?NR1007)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1008}" = "${CALLERID}?NR1008)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1009}" = "${CALLERID}?NR1009)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1010}" = "${CALLERID}?NR1010)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1011}" = "${CALLERID}?NR1011)

exten => s,n,GotoIf($CALLERID}" class="wiki-page new">${NR1012}" = "${CALLERID}?NR1012:NOT_LOGGED_IN)

;;;;;;;;;;;;;;;;

; you have to add call-limit=1 to the sip entries for the gsm phones

; to make DEVSTATE (asterisk 1.4) or DEVICE_STATE (asterisk 1.6) work
; The result is that when a phone is busy the dialstatus

; returned by Asterisk is CHANUNAVAIL instead of BUSY. This is the reason why

; (for now) the automatic log off in case of dialstatus is disabled

; edw 29 december 2009

;;;;;;;;;;;;;;;;

exten => s,n(NR1001),Set(CALLERID=1001)

exten => s,n,Set(CALLERID=1001)

exten => s,n,Goto(CONTINUE)

exten => s,n(NR1002),Set(CALLERID=1002)

exten => s,n,Set(CALLERID=1002)

exten => s,n,Goto(CONTINUE)

exten => s,n(NR1003),Set(CALLERID=1003)

exten => s,n,Set(CALLERID=1003)

exten => s,n,Goto(CONTINUE)

exten => s,n(NR1004),Set(CALLERID=1004)

exten => s,n,Set(CALLERID=1004)

exten => s,n,Goto(CONTINUE)

exten => s,n(NR1005),Set(CALLERID=1005)

exten => s,n,Set(CALLERID=1005)

exten => s,n,Goto(CONTINUE)

exten => s,n(NR1006),Set(CALLERID=1006)

exten => s,n,Set(CALLERID=1006)

exten => s,n,Goto(CONTINUE)

exten => s,n(NR1007),Set(CALLERID=1007)

exten => s,n,Set(CALLERID=1007)

exten => s,n,Goto(CONTINUE)

exten => s,n(NR1008),Set(CALLERID=1008)

exten => s,n,Set(CALLERID=1008)

exten => s,n,Goto(CONTINUE)

exten => s,n(NR1009),Set(CALLERID=1009)

exten => s,n,Set(CALLERID=1009)

exten => s,n,Goto(CONTINUE)

exten => s,n(NR1010),Set(CALLERID=1010)

exten => s,n,Set(CALLERID=1010)

exten => s,n,Goto(CONTINUE)

exten => s,n(NR1011),Set(CALLERID=1011)

exten => s,n,Set(CALLERID=1011)

exten => s,n,Goto(CONTINUE)

exten => s,n(NR1012),Set(CALLERID=1012)

exten => s,n,Set(CALLERID=1012)

exten => s,n,Goto(CONTINUE)

exten => s,n,(NOT_LOGGED_IN),NoOp(The phone that is used to make a call is not logged into with proper credentials)

exten => s,n,Set(TIMEOUT=15)

exten => s,n,PlayBack(silence/2)

exten => s,n,MusicOnHold()

exten => s,n,Hangup()

exten => s,n(CONTINUE),Set(STOP=0) ; just a variable to hold the value zero

exten => s,n,NoOp(${LEN}) ; handy as cli output

exten => s,n,GotoIf($LEN}"_=_"${STOP}" class="wiki-page new">${LEN}" = "${STOP}?STOPCALL) ; If no IMSI code is stored into NR<NUMBER> variable

; and for that reason the variable is empty stop, otherwise
; dial the number.

exten => s,n,NoOp(the call is actually set up and all checks are passed)

exten => s,n,Set(TIMEOUT=300) ; set length of call to the max of 5 minutes 300 seconds

exten => s,n,Dial(SIP/${ARG1},20,rt)

exten => s,n,Goto(s-${DIALSTATUS},1)

exten => s,n(STOPCALL),NoOp(The number dialed is not logged in and for that reason not reachable)

exten => s,n,playback(silence/2)

exten => s,n,Set(TIMEOUT=15)

exten => s,n,Answer()

exten => s,n,MusicOnHold()

exten => s,n,Hangup()

exten => s-CANCEL,1,Hangup()

exten => s-NOANSWER,1,Hangup()

exten => s-BUSY,1,Busy(30)

;;;;;;

; add the handling as you would like it

;;;;;;

exten => s-BUSY,n,Hangup()

exten => s-CONGESTION,1,Congestion(10)

exten => s-CONGESTION,n,NoOp(call routed to congestion extension)

exten => s-CONGESTION,n,Goto(s-CHANUNAVAIL,1)

exten => s-CONGESTION,n,Hangup()

exten => s-CHANUNAVAIL,1,NoOp(The phone number called is logged in but the phone is turned off or out of range)

exten => s-CHANUNAVAIL,n,playback(silence/2)

exten => s-CHANUNAVAIL,n,playback(ss-noservice)

exten => s-CHANUNAVAIL,n,Goto(s-${ARG2},1)

;;;;;;

; if phonenumber is not available the value of NR<XXXX> variable will be erased

; so the relation between a phonenumber and an IMSI number ends

; This is disabled because of the returned dialstatus (CHANUNAVAIL) when call-limit+1 is reached

; The return value should be BUSY

;;;;;;

; comented out because 1001 is static number

;;;;;;

;exten => s-1001,1,NoOp(SET=)

;exten => s-1001,n,Hangup()

exten => s-1002,1,NoOp(SET=))

exten => s-1002,n,Hangup()

exten => s-1003,1,NoOp(SET=))

exten => s-1003,n,Hangup()

exten => s-1004,1,NoOp(SET=))

exten => s-1004,n,Hangup()

exten => s-1005,1,NoOp(SET=))

exten => s-1005,n,Hangup()

exten => s-1006,1,NoOp(SET=))

exten => s-1006,n,Hangup()

exten => s-1007,1,NoOp(SET=))

exten => s-1007,n,Hangup()

exten => s-1008,1,NoOp(SET=))

exten => s-1008,n,Hangup()

exten => s-1009,1,NoOp(SET=))

exten => s-1009,n,Hangup()

exten => s-1010,1,NoOp(SET=))

exten => s-1010,n,Hangup()

exten => s-1011,1,NoOp(SET=))

exten => s-1011,n,Hangup()

exten => s-1012,1,NoOp(SET=))

exten => s-1012,n,Hangup()


The OpenBTS Project

The OpenBTS Project is an effort to construct an open-source Unix application that uses the Universal Software Radio Peripheral (USRP) to present a GSM air interface ("Um") to standard GSM handsets and uses the Asterisk software PBX to connect calls. This is in fact very different from a conventional GSM BTS, which is a dumb device that is managed externally by a basestation controller (BSC) and connects calls in a remote "mobile switching center" (MSC). Because of this important architectural difference, the end product of this project is better referred to as an access point, even though the project is called "OpenBTS".

Image(OpenBTSArch.jpg)

Overall Architecture of the OpenBTS Access Point

Why Build an Open Source GSM Stack?

The combination of the ubiquitous GSM air interface with VoIP backhaul could form the basis of a new type of cellular network that could be deployed and operated at substantially lower cost than existing technologies. Since these new hybrid networks are not readily compatible with legacy networks, and since radical two-tier pricing would be disruptive for existing carriers, we are not likely to see this kind of innovation from the conventional telecom community. This is the primary motivation for starting this project: a vision of truly universal telephone service. The inspiration for this project came from a simultaneous recognition of these elements after several years of experience with GSM, software radios, VoIP and sustainable power systems:
  • The USRP can be readily adapted as a GSM transceiver and the hardware can be reworked to give a carrier-grade radio for use in a software BTS.
  • GSM is simple. Once you have a coding framework and understand the specifications, this stuff almost writes itself.
    • L1 is textbook radio and FEC algorithms.
    • L2 is simplified HDLC.
    • L3 is fully defined in GSM 04.08 and ITU-T Q.931 and is immediately familiar to anyone who has worked with ISDN.
  • Most telephone switching functions, calling features and mobility management functions can be moved into Asterisk, eliminating the need for most of the network infrastructure (HLRs, MSCs, etc.).
  • Plenty of functional GSM handsets are discarded in rich countries every year that can be reused in developing countries.
  • With economical software design and careful selection of power amplifiers, it should be possible to run a low-capacity GSM cell from solar panels or micro wind turbines, drastically reducing the cost of service in off-grid environments.

GSM is Old and Boring. Why Not CDMA?

GSM is a good choice precisely because it is old and boring. Everyone knows it works and 80% of the world's carriers are still using it. It's a proven technology that is well-suited to the target application and the specification is publicly available.

CDMA physical layers are too complex for an inexpensive all-software radio and do not scale well for low-capacity cells. CMDA capacity comes in increments of 50 or more subscriber lines and the lowest layers of your radio must process all of that bandwidth whether you intend to use it or not. By contrast, GSM capacity comes in increments of 7-8 lines and a well-managed radio can even ignore inactive parts of the signal. Beyond the technical issues, IS-95-style CMDA (including cdma2000) is tightly controlled intellectual property. You can't even get a copy of the specification without signing an NDA and paying several hundred dollars, so open-source CDMA is out of the question.

What About GPRS/EDGE and UMTS?

Future versions of the OpenBTS may well support GPRS and EDGE. GPRS, when available, should be a software-only upgrade for any installed OpenBTS system. EDGE support may require additional computational resources but the additional software is not complex, at least when compared to the rest of the BTS. UMTS, however, is a radically different CDMA-style physical layer and well outside the current scope of this project.
All that said, let's walk before we run by implementing basic voice services on a single-ARFCN GMSK BTS.

What's Wrong with WiFi, WiMax, WiWhatever?

There are a lot of people out there who would rather not blanket Africa with WiWhatever than find a way to make GSM dirt cheap. We say "not" because none of those people who talk about it are really going to do it because it's not a realistic goal. It's sexier to talk about the newest air interface and that talk gets a lot a buzz, but the truth is that that WiWhatever is poorly suited to mobile telephony.

WiFi range is far too short for mobile coverage in rural areas. For example, you're not going to cover 700 square miles with a single WiFi tower, but that's exactly what GSM was made to do. If access points are connected through different ISPs, handovers will be unreliable. The phones are expensive and power-hungry, and compared to GSM they always will be. WiFi may become a decent technology for semi-mobile telephones in dense urban areas, but it's not a mobile phone standard and it's not well-matched to the rural cellular application.

WiMax has most of the problems of WiFi. To make matters worse, most WiMax bands don't penetrate structures very well. Most WiMax deployers are planning to solve this problem by saturating large buildings with small access points. That's fine in Manhattan and London, but we don't see anyone putting femtocells in a million houses when those households couldn't afford phones in the first place.

More important than all of that is to remember the goal of the OpenBTS: universal telephone service. Our project philosophy is that it is much better to give people basic telephone service with an upgrade path to 250 kb/sec packet service than to generate a lot of hype over a scorching fast broadband technology that can probably never be truly universal.

WiWhatevers do have a place in OpenBTS, though: backhaul. The standard OpenBTS backhaul is likely to be redundant-path point-to-point WiFi or WiMax.

Is This Emerging Telephony?

We certainly hope so.

Who Are You People, Anyway?

OpenBTS is now part of the GNU Radio project and administered by the Free Software Foundation.

The original founders of this project are David A. Burgess (dburgess00 (at) gnuradio.org) and Harvind S. Samra (hssarmra (at) gnuradio.org). They are still major contributors, but assigned their copyrights to FSF on 24 October 2008. For a number of practical reasons, Harvind and David also conduct a lot of their OpenBTS activities through a California S-Corporation called Kestrel Signal Processing, Inc.

Sounds Good. How Do I Start?

Start from the project's main GNU Radio wiki page, OpenBTS. Read it all, get a copy and try to use it.
After that, it depends on what you want to do.

I Want to Work on the Software

We specifically need:
  • DSP and comms people for the transceiver and L1 FEC,
  • protocol people and well-rounded C++ programmers for L2 and L3,
  • embedded people get this code onto a target embedded board and
  • Asterisk people to help us get the most out of Asterisk.

I Want to Work on the Hardware

We specifically need:
  • digital hardware engineers to customize the USRP motherboard
  • RF engineers to redo USRP layouts and specify external components like amplifiers and filters
  • mechanical engineers for packaging, cooling and off-grid power systems
  • power engineers for off-grid power systems

I'm Not Technical, but Want to Help

There are also ways to support this project in a non-technical capacity.
  • If you have some rural land in Solano or Yolo Counties in California, you could host a test range.
  • We are usually in need of equipment: test equipment, power amps, filters, masts, etc.
  • We could always use money to support the work. OpenBTS can be funded though the Public Software Fund.
    ...or maybe you can offer something we just haven't thought of yet.

OpenBTS Burning Man 2008 RF Chains

Transmit Chain

USRP -> 3318PA -> DB4090 -> 20' LMR-400 -> lightning arrestor -> 20' RG-8X -> 9 dBi antenna

  • The output of the USRP is set to 19 dBm.
  • The Downeast 3318PA is a "33 cm" power amp with a gain of about 14 dB at our operating frequency. It's an obsolete product and datasheets are no longer available.
  • The DB Products DB4090 is a 2-cavity duplexer with 65 dB of isolation between the tx and rx. Here's the only document we can find on it.

One problem to note is that the USRP puts out spurs and noise in the rx band, about 80 dB down from the tx signal, but still high enough to be a problem without good duplexing isolation.

With cable losses the EIRP of the antenna was about 39dBm.

Receive Chain

9 dBi antenna -> 20' RG-8X -> lightning arrestor -> 20' LMR-400 -> DB4090 -> preamps -> rx filter -> USRP

  • The preamps are Angle Linear PHEMT. We used a cascade of 3 to give 24 dB of gain.
  • The "rx filter" was a homemade 2-element interdigital filter and not a very good one. It had 60 dB of suppression in the downlink band, but 20 dB of insertion loss. It would not have worked but for all those preamps.

The Rx chain of the USRP was set to maximum gain, so the RF amp was set to the max of 70dB, and the programmable gain amp in front of the A/D was set to 20dB. According to the USRP RFX900 specs, the low-pass filter has a notch about 50-55 MHz from the center freq. So we twiddled with the RFX900 receive LO, so that our transmit frequency fell into this notch, giving us more transmit isolation. That feature would not work, however, in a multi-ARFCN system.

Getting the Picture

http://openbts.sourceforge.net/FieldTest/layout.jpg


FAQ for the Burning Man 2009 "Papa Legba" Test Network

Image(PapaLegbaSticker.jpg)

Administrative

  • Who is doing this? This is an activity of the OpenBTS project. The entity legally responsible for the test is Kestrel Signal Processing, Inc.. The actual on-site engineers are David Burgess and Harvind Samra.
  • Is this legal? Yes. We have an experimental license, WD9XSP, and a consent letter from Verizon authorizing us to operate in their KNKN224 block A cellular spectrum. We are also coordinating operations with Commnet Wireless to prevent interference.
  • How much does the service cost me? Nothing.
  • What do you do for emergency calls? Nothing. We are an experimental service and do not support emergency calls.
  • Where is your camp? We are Papa Legba, placed at 4:30 & H. Look for the WD9XSP tower. Drop by for a sticker and a tour.

Black Rock City, LLC

  • Does BM-Org know about you? Sorta. The technical side of the organization is supportive and coordinating network service for our backhaul. Other parts of the organization are still finding out about us.

Commnet Wireless

  • Are those your trucks and towers at Frog Pond and in Gerlach? No. That's Commnet Wireless, a commercial cellular carrier who is providing cellular service at Burning Man this year.
  • Are you going to interfere with each other? No. Commnet will be operating in the block B spectrum under license KNKN225. We will be in block A. We have exchanged contact information to resolve any unforeseen problems on-site.
  • What is you relationship to Commnet? None. Please do not get us confused.

Practical

Service Capabilities

Papa Legba's primary service is on-Playa text messaging, the delivery of text messages between handsets within BRC. We will also have limited support for speech service.
  • Can I call the "real world"? If you do get full speech service, you will indeed be able to call out of BRC.
  • Can the "real world" call me? If you have speech service, you will be able to receive inbound calls from VoIP carriers through the +883 iNum country code.
  • Can I use my own VoIP PBX to route calls to my cellphone while I'm at Burning Man? Yes, as soon as we know our public IP address.
  • Can I text the "real world"? You can send text to many internet-based IM services, like Gizmo or Skype. You can also send text to e-mail addresses.
  • Can the "real world" text me? You can receive text from many internet-based IM services, but probably not from cellular carriers.

Using My Phone

  • Will my phone work with the Papa Legba network? All current-market phones that work with AT&T or T-Mobile will also work with Papa Legba, even if they are locked. You can use your existing SIM, too.
  • How will you know my phone number? You will tell Papa Legba via SMS. When your handset first contacts the network, you will receive a text message asking you to respond with your 10-digit phone number. If that process is successful, you will receive another message informing you that you have been provisioned in the network. That's it.
  • My phone shows service but I can't make a call. Why not? Only the first few hundred subscribers will get full speech service. Everyone else will just get SMS. There are two good reasons for this:
    1. We don't have enough equipment for everyone to get normal speech service.
    1. Widespread speech service would change the nature of BRC in ways a lot of people would not like.
  • How do I know my phone is on your network? You will see a network ID of "001 01", "Test" or "PpaLgba", depending on your handset brand and model.
  • How can I force my phone to use one network or the other? That depends on your phone model. We are still working on a collection of instructions:
  • Will my carrier charge me for every text message I send or receive on the Papa Legba network? No, the Papa Legba network is a separate isolated network from your normal carrier's network, and no charges will apply as no SMS is being sent or received through your normal carrier.
  • Will putting a Papa Legba sticker on my phone make it work better? Probably.

Technical

  • What band and technology are you using? GSM850.
  • What are your specific frequencies and powers? Our frequencies will be 870-880 MHz downlink and 825-835 MHz uplink. We will operate our downlink at 20 W EIRP. In the uplink, the typical GSM handset has a maximum power of 1 W, although we will use closed link power control to minimize handset power to the greatest degree possible.
  • What RF equipment are you using? See OpenBTSBM2009RF.
  • What network software do you use? We use Asterisk for our speech PBX and provisioning functions. We use a custom server for SMS. All interfaces are based on SIP/RTP. The GSM stack itself is OpenBTS.
  • What is your GSM configuration? We will operate 3 or 4 BTS units. Each will be a single ARFCN. Each will be configured with channel combinations V, 3xVII, 4xI. That will give each BTS unit 4 speech channels and the ability to transfer 300-400 text messages per minute.

Miscellaneous

  • Why "Papa Legba"? Papa Legba is a voodoo deity who mediates human contact with the spirit world. Like Papa Legba, our radio equipment stands at a crossroads between seen and unseen worlds.
  • How much did this cost? The BOM cost for the full system is about $16k. We have sponsors, though:
    • Martin Pelayo is providing our 70' tower.
    • John Gilmore funded part of the development of our SMS air interface and actually wrote the SMS server himself.
    • Voxbone is providing funding and most of our VoIP connectivity.

Burning Man 2009 RF Chains

We have legal clearance for operation in 870-880 MHz downlink, 825-835 MHz uplink.

RF Paths

We start by planning the uplink (receive) path. Here are the core facts:

  • The typical handset has a maximum output of 30 dBm on what is roughly a 0 dBi antenna.
  • The thermal noise level of the GSM channel is about -120 dBm.
  • We want a minimum Ec/No of 8 dB, which is standard for GSM systems (GSM 03.30), giving a residual BER of 0.2%, meaning that the signal level would need to be -112 dBm in an ideal receiver.
  • We assume a mast height of 50 ft (~15 m).
    Image(RF chain image.png)

RX Path

antenna -> long cable -> duplexer -> LNA1 -> BPF -> USRP

Comments on components:

  • The USRP is believed to have a noise figure of about 8 dB.
  • The best cable we can reasonably afford is LMR-400, 0.13 dB/m @ 900 MHz. The cable will be about 15 m long, for a loss of 2 dB (rounding).
  • The insertion loss on the duplexer is 1 dB, worst case.
  • A decent LNA has a noise figure of 1 dB or less.
  • We can expect to get a gain of about 10 dB in the antenna.

LNA1 is outside the USRP to help overcome any noise or crosstalk inside the USRP case. We need a phone at the edge of the service radius to produce -112 dBm at that LNA1 input. The path from the handset to the LNA1 is

30 dBm -P +10 -2 -1 -1 = 36 dBm -P = -112 dBm

where P is the path loss. Rearrange for

P = 112 + 36 = 148 dB.

So we can tolerate a path loss of 148 dB and we are working from a 15 m tower at 830 MHz. According to the Hata model, that corresponds to a range of 5.0 km (3.1 mi) for suburban service and 15.8 km (9.8 mi) for open rural service. Black Rock City is about 3.8 km wide and the distance from center camp to the highway is 8-10 km, so this system will meet the goals of providing solid coverage over BRC and much of the "deep Playa" and providing service over the last few miles of highway approaching the turn to the front gate.

How much LNA gain do we need? The D/A on the USRP has a range of 2 v p-p (10 dBm on 50 Ohms) and the bottom 5% of that range (-16 dBm on 50 Ohms) is occupied by noise at maximum gain. So to match our thermal noise of -120 dBm to the USRP's noise floor of -16 dBm, we need a total gain of 104 dB. The USRP already has an internal gain of up to 81 dB, so we need 23 dB of gain from LNA1. LNA1 also allows us to tolerate insertion loss in the BPF without a loss of receiver performance.

TX Path

USRP -> PA -> duplexer -> long cable -> antenna

Our ERP is limited to 20 W (43 dBm) by our license. Since the handset is transmitting 1 W, downlink range isn't going to be an issue. The point of the transmit path analysis is to determine the specifications for PA. The path gain from the PA to the antenna is:

T -1 -2 +10 = T +7 = 43 dBm

where T is the transmit power, so T is 36 dBm maximum, or 4 Watts. In a 2-ARFCN system, that will be 2 W/ARFCN, or 10 W EIRP/ARFCN, which is plenty of downlink power for this system.

The output of the USRP is about 20 dBm, so we need a gain of about 16 dBm in the PA.

In summary, our ideal PA is 36 dBm output, 16 dB gain. We can use PAs with slightly higher power or higher gain by scaling back the USRP output or using an attenuator.

RX/TX Isolation

These aspects of the design determine the required degree of rx/tx isolation:

1. Receiver levels at the USRP.  We are pushing 36 dBm into the same cable that is bringing in our -112 dBm signal.  We need to push that 36 dBm down to the thermal noise level of -120 dBm by the time it hits the USRP.  So we need an isolation of 120 + 36 = 156 dB between these paths at the USRP.
1. LAN compression. LNA1 will start to compress at an output of 24 dBm. The gain is 32 dB, so LNA1 will start to compress for an input of -8 dBm. So the duplexer must push the 39 dBm PA output down below -8 dBm to avoid compression. So we need at least 47 dB of isolation in the duplexer to avoid compression.
1. RX-band noise in USRP TX output. The USRP outputs noise in the receive band about 80 dB below the transmit signal level, or around -60 dBm. The duplexer needs to be able to suppress that noise down to -120 dBm or lower to prevent degradation of the receiver. So we need at least 60 dB of isolation in the duplexer to limit that noise.

So we need a total of 156 dB of transmitted signal suppression from the duplexer and BPF together. We need at least 60 dB of that to come from the duplexer.

Component Specifications

LNA

We are planning to use the Mini-Circuits ZRL-1150LN. It is readily available and is very reasonably priced, given its specifications:

  • 685-1000 MHz
  • 31 dB gain
  • 1 dB compression at 24 dBm
  • <1 dB noise figure
  • +10 - +17 VDC supply
  • $120

PA

Because we are operating under an experimental license in GMS850, we can use modified or de-rated 33 cm amateur equipment, which will save a considerable amount of money. The Downeast Microwave 3340PA is a good candidate:

  • 30 dB gain
  • 46 dB IP1 output
  • 13.5 VCD supply
  • $235

The 3340PA will require a 15 VCD Zener diode on its power supply terminals to protect from over-voltage damage. We will need a 10-15 dB attenuator to match the output level of the RFX900 to the expected input level of the PA.

Duplexer

The candidate duplexer is the Anatech Microwave AD836-881D200:

  • 824-849 MHz, 869-894 MHz
  • 70 dB isolation
  • <1 dB insertion loss
  • $360

Bandpass Filter (BPF)

The candidate BPF is the Aantech Microwave AB832B477:

  • passband 824-840 MHz
  • 95 dB suppression at 869 MHz
  • <1 dB insertion loss
  • $325

With the 70 dB duplexer, this BPF will give a total tx-rx isolation of 165 dB, beating our requirement by 9 dB.

Antenna

The candidate antenna is the Hyperlink HG913P-120:

  • 860-960 MHz (should work well enough at 825 MHz, though)
  • 13 dBi (de-rate to 10 dBi for 825 MHz, worst case)
  • 120-deg x 15-deg beam
  • $200

The additional 3 dB of antenna gain may add 40% to the coverage range.

Power consumption

Each unit pulled 60 W:

  • PA 20 W.
  • USRP 15 W.
  • mini-ITX single-core 1.6 GHz Atom 12 W.
  • LNA 10 W.
  • other misc. stuff 3 W.

Part of the problem is that we used an oversized class A PA with very low efficiency. That PA power load should probably be cut in half.


Building and Runing OpenBTS

OpenBTS is written to compile in a typical GNU build environment run on POSIX operating systems. (MS Windows does not meet either of those requirements. This is not a Windows application.) The current supported systems are Linux and Apple OS X, although ports to other Unix-like systems should not be difficult. If you get stuck, take a look at the OpenBTSsupport page for possible source of help.

OpenBTS requires three (or four) running binaries:

  1. An OpenBTS GSM stack
  2. The software transceiver that communicates with the USRP.
  3. The Asterisk PBX.
  4. If you want to support SMS between handsets, you will also need the smqueue SMS store-and-forward server.

For testing, you probably also want a local SIP softphone. Zoiper works well for this. We have also used wired phones on unlocked PAP2 adapters.

Dependencies

To build and run OpenBTS you need to have installed:
  • The USRP driver library libusrp. This is available via gnuradio.You do not need all of GNU Radio, just libusrp. Instructions for building libusrp and its minimum dependencies are given later in this page. All releases of OpenBTS through "Kinder" (2.4) are to be used with GNU Radio 3.1. Starting from release 2.5 ("Lacassine") both GNU Radio 3.1 and GNU Radio 3.2 are supported.
  • The SIP library osip2, available from GNU's FTP site. You will need version 3.0 or later. OpenBTS will not build with earlier versions. Starting in release 2.5 ("Lacassine"), you will need version 3.3 or later.
  • The oRTP library ortp, available from savannah. Releases OpenBTS through "Jean Lafitte" may not be compatible with oRTP releases 0.15 and later. (We haven't tried yet, but know that some calling interfaces changed in that oRTP release.)
  • Asterisk. We have been using version 1.4.

Port Assignments

Asterisk, OpenBTS and your softphone will all be running on localhost, so port assignments must be coordinated. These are the standard port assignments for an OpenBTS host:
  • Asterisk runs SIP on UDP port 5060 and RTP on UDP ports 16386-16483. These are configurable in the sip.conf file.
  • OpenBTS runs SIP on UDP port 5062 and RTP on UDP ports 16484-16583. In most versions of OpenBTS, these ports are configurable from the OpenBTS.config file.
  • The SMS store and forward server smqueue, runs SIP on UDP port 5063. This component is for use with releases 2.5 and later.
  • We normally configure Zoiper to run SIP on UDP port 5061 and RTP on UDP ports 16384 and 16385. With most SIP phones, only the lower RTP port is specified and the other is implied.
  • The transceiver interface runs in a block of UDP ports starting at 5700 and documented in README.TRXManager. In most versions of OpenBTS, these ports are configurable from the OpenBTS.config file, but that is not recommended unless you really know what you are doing.
  • MySQL uses TCP port 3306.

Asterisk Configuration

Asterisk configuration files are normally kept in /etc/asterisk. Most aspects of Asterisk's default configuration are adequate for OpenBTS. Look at the files in the Asterisk directory and read all of the comments. These is also a detailed description on the Setting Up Asterisk page. The files of interest for OpenBTS are:

  • sip.conf, which defines the SIP users and, possibly, the connection to your VoIP carrier
  • extensions.conf, which assigns telephone numbers to users and defines rules for local and outbound dialing
  • iax.conf, which may define the connection to your VoIP carrier

Softphone Configuration and Port Assignments

Check the port assignments given above. If possible, set the SIP test phone to use the GSM codec.

Building a GSM Stack and Transceiver

Most of OpenBTS is a kit of parts that can be assembled to form a basestation of a specific configuration. The OpenBTS.cpp file in the standard distribution is just an example basestation to show how that's done.

Software Organization

OpenBTS software has these components:
  • The software defined transceiver, a standalone binary built in "Transceiver/". It communicates with the rest of the OpenBTS application over a UDP interface described in "README.TRXManager".
  • A set of object files that provide the components of an OpenBTS application:
    • GSM-specific components in "GSM/".
    • SIP-specific components in "SIP/".
    • The control interface for the transceiver in "TRXManager/".
    • Hybrid GSM/SIP control functions in "Control/".
    • Generic data structures and forward error correction functions in "CommonLibs/".
  • A top-level OpenBTS application, with examples given in the apps directory. This top level application defines certain required global objects and sets their configuration parameters. See OpenBTS.cpp as an example.

Building and Installing

Building dependencies

osip2 and ortp

If you are building on Linux or Mac OS X, libosip and libortp are likely available via your package management system (apt-get, macports, etc). If not, follow the usual ./configure, make, make install process.

Make sure that the versions downloaded via the package management system match the requirements. In a deb-based distribution you can check the version of the package using the command
aptitude show libosip2-dev

If you compile libortp 0.13.1 from source and you are using a modern version of gcc, you will get errors of the type 'format not a string literal and no format arguments' in the tests folder, grab the tests from the latest version of libortp 0.16 that correct those formating errors.

libusrp

libusrp is available via gnuradio. All releases of OpenBTS through 2.3 are made for use with GNU Radio 3.1. Starting from release 2.5 both GNU Radio 3.1 and GNU Radio 3.2 are supported.

If you're a happy Ubuntu user, look at this detailed manual on how to install GNU Radio on your system.

After getting the appropriate gnuradio sources, build libusrp by configuring with the following arguments:
./configure --disable-all-components --enable-usrp --enable-omnithread --enable-mblock --enable-pmt

This will build just libusrp (and dependencies) from gnuradio. You might need to install a few extra dependencies: python-all-dev, swig, libfft3w-dev, libcppunit-dev, libboost-dev, sdcc-nf (notice the non-free package that includes the ASX8051 port).

There are some other common build problems you might encounter: * If you are trying to build under OS X, you will encounter a problem with XML validation in the documentation that will prevent you from building libusrp. The solution to this problem is to remove xmlto from your path. See "for details. * If you had to install the "boost" libraries, the include files were probably installed in /usr/local/include/boost-<version>, where <version> is whatever version you installed. You may need to create a soft link to /usr/local/include/boost for the compiler to find them. You can do that with the command
sudo ln -s /usr/local/include/boost-<version> /usr/local/include/boost
* If you use ubuntu, there is a problem into our configure script that don't look the right place searching libusrp. To fix it (until we don't fix the configure script) follow the next steps:
$ cd /usr/local/include/
$ sudo ln -sf usrp/usrp_bytesex.h .
$ sudo ln -sf usrp/usrp_standard.h .
$ sudo ln -sf usrp/usrp_prims.h .

MySQL connectors

These will be required in release 3.0 and later. The MySQL C and C++ connectors require CMake, available from http://www.cmake.org/":http://lists.gnu.org/archive/html/discuss-gnuradio/2008-05/msg00163.html. The build procedure is then
cmake .
make
sudo make install

Building OpenBTS

For "Breaux Bridge" and Later Releases (1.2-)

OpenBTS, since release 1.2, "Breaux Bridge",uses a typical GNU build process. Once all the dependencies are satisfied, grab the sources. There are a few ways to do that.

Anyone can get the public release from GNU Radio via SVN:
svn co http://gnuradio.org/svn/openbts/trunk/ openbts
If you are an active contributor and have the password for the kestrelsp.com server, you get a development release via SFTP:
sftp openbts@kestrelsp.com

and extract your tar.gz package:
tar xzf openbts-<whatever>.tar.gz
The build process follows the standard GNU procedure:
cd openbts
./bootstrap
./configure
make
make install
You will get:
  • a binary called "transceiver" in the Transceiver/ directory
  • in early verisons (pre-"New Iberia"), one or more binaries called "OpenBTS<band>", each configured to operate in the indicated <band>, in the apps/ directory
  • in later versions ("New Iberia" and later), a binary called OpenBTS, in the apps/ directory

In the 2.x release series, you will also get a binary called "sendsms" in the apps/ directory that can be used to send text messages to handsets, although this utility is obsolete after 2.3 as it has been replaced with a command in the OpenBTS CLI.

For Releases 1.0 and 1.1

  1. Go to trunk/apps and type "make".
  2. Copy Transceiver/std_inband.rbf to /usr/local/share/usrp/rev4.
You will get:
  • a binary called "transceiver" in the Transceiver/ directory and
  • in early verisons, one or more binaries called "OpenBTS<band>", each configured to operate in the indicated <band>, in the apps/ directory

These are obsolete, unsupported releases, so you are on your own from here.

Notes for building on Mac OS X 104. and 10.5

* osip2 can be installed via Macports. The following command will build dependencies for gnuradio and openbts.
sudo port install guile libusb libosip2
* ortp needs to be built by source.

Notes for building on Fedora Core 11

attachment:OpenBTS_FedoraCore11_InstallGuide.pdf

Note that this install guide is a little out of date, especially with respect to instructions for finding and downloading the source code packages. This wiki page is authoritative.

For GCC 4.4.1 and OpenBTS revision 11665 I had to manually add:

Hardware Requirements

See OpenBTSDesktopTestingKit.

Running the System

The OpenBTS system is a set of multiple applications that work together and communicate.

  • The transceiver, which communicates with the USRP and includes the GMSK software-defined radiomodem.
  • The GSM stack (the actual OpenBTS) which implements the GSM protocol up to layer 3.
  • The Asterisk PBX, which performs call switching and other network interface functions.

Releases "Arnaudville" through "Eunice" (1.0-1.5)

In these releases, OpenBTS is configured by editing and re-compiling the main OpenBTS application. Diagnostic and status messages are dumped to stdout and stderr, controlled by "#define DEBUG" entries in the source code of the various modules. The transceiver is started manually along with the GSM stack.

To run these versions, you will need at least three terminal windows.
  1. Start Asterisk.
  2. Start your SIP test phone and be sure that it can register with Asterisk.
  3. Start the transceiver (in Transceiver/). It's best to route the output to /dev/null.
  4. Start OpenBTS<band> (in apps/). You probably want to pipe the output through grep.
    • "grep Control" to see L3 activities.
    • "grep LAPDm" to see L2 transactions.
    • "grep SIP" to see SIP transactions.

Releases "St. Francisville" through "New Iberia" (1.6, 2.0-2.2)

In these releases, OpenBTS is configured by a file called "OpenBTS.config". The transceiver is started manually along with the GSM stack.

To run these versions, you will need at least three terminal windows.
  1. Start Asterisk.
  2. Start your SIP test phone and be sure that it can register with Asterisk.
  3. Start the transceiver (in Transceiver/). It's best to route the output to /dev/null.
  4. Start OpenBTS (in apps/). You probably want to pipe the output through grep.
    • "grep Control" to see L3 activities.
    • "grep LAPDm" to see L2 transactions.
    • "grep SIP" to see SIP transactions.

Releases "Jean Latfitte" and Later (2.3-)

In these releases, OpenBTS is initially configured by a file called "OpenBTS.config", but some aspects of the configuration can be controlled in real time from a command line interface (CLI). Diagnostic and status messages are logged to files with logging level and destination controlled by entries in the configuration file and can also be controlled from the CLI. The transceiver is started automatically along with the GSM stack.

Copying OpenBTS.config

In releases "Kinder" (2.4) and later, the OpenBTs.config file is not directly in the distribution. Instead there is a file called "OpenBTS.config.example" that needs to be copied to "OpenBTS.config" before starting the application for the first time. This change was made to allow OpenBTS.config to be overwritten from the CLI without destroying the original file. It also prevents individual developers' versions of OpenBTS.config from getting put into the distribution by accident.

Running the System

To run these versions, you will need at least two terminal windows, but probably want three
  1. Start Asterisk.
  2. Start your SIP test phone and be sure that it can register with Asterisk.
  3. Start OpenBTS (in apps/) and wait for the CLI prompt to appear, which indicates that configuration is complete and the system is running.
  4. (Optionally) Run "tail -f" on the log file to watch status in real time.

Once the system is running, you can use the "help" command to get more information on the features of the CLI. The features vary from one release to the next.

Common Problems

Bad LD_LIBRARY_PATH

You get
dburgess@localhost:~/r2.5Lacassine/apps$ ./OpenBTS 
./OpenBTS: error while loading shared libraries: libosip2.so.4: cannot open shared object file: No such file or directory

The problem is that your LD_LIBRARY_PATH does not include a path to the named library, libosip2.so.4 in this example. You need to define your LD_LIBRARY_PATH in your .bashrc or your .cshrc, depending on which shell type you use.

Stray Transceiver Process

Symptom:
[dburgess@localhost apps]$ ./OpenBTS 
bind() failed: Address already in use
terminate called after throwing an instance of 'SocketError'
Aborted

Problem: OpenBTS shut down uncleanly and left a stray transceiver process.

Solution: Kill the stray transceiver process and try again. Like this
[dburgess@localhost apps]$ ps
  PID TTY          TIME CMD
23233 pts/1    00:00:00 bash
23342 pts/1    00:00:32 transceiver
23369 pts/1    00:00:00 ps
[dburgess@localhost apps]$ kill -KILL 23342
[dburgess@localhost apps]$ !.
./OpenBTS 
You can also use killall:
killall transceiver

Forgetting to Start the Transceiver

This is a common mistake in releases prior to 2.3.

Symptom: A run attempt ends with
1254170958.179475 0xa072f500: TRXManager.cpp:268: WARNING -- retrying transceiver command after response timeout
1254170959.200521 0xa072f500: TRXManager.cpp:268: WARNING -- retrying transceiver command after response timeout
1254170959.200624 0xa072f500: TRXManager.cpp:283: ERROR -- lost control link to transceiver
terminate called after throwing an instance of 'SocketError'
Abort trap

Problem: OpenBTS is trying to connect to the transceiver process, but it isn't there.

Solution: Start the transceiver before starting OpenBTS, as per the instructions in the "Running" section for releases prior to 2.2 and earlier.

TRX Underruns

This can happen in all releases.

Symptom: You get a lot of this message
1253778301.154327 3082251152: USRPDevice.cpp:353: WARNING -- UNDERRUN in TRX->USRP interface

Problem: The software is not feeding transmitted data to the radio fast enough to keep up with real time. An occasion underrun is OK, but more than a few every few minutes will make your system unusable.

Solution(s):
  • Try running the transceiver and OpenBTS under nice to improve priority.
  • Kill other applications to free up CPU resources and reduce swapping.
  • Get a faster computer. A 1.6 GHz single-core Intel should be adequate, though.

Transceiver Commands Fail

Symptom: The transceiver is running, but you get these messages
1254342002.0361 ALARM 1077699712 Transceiver.cpp:519: RX failed to tune
1254342002.0375 ALARM 1073875856 TRXManager.cpp:357: RXTUNE failed with status 1
1254342002.0805 ALARM 1073875856 TRXManager.cpp:409: POWERON failed with status 1
1254342002.0850 ALARM 1073875856 TRXManager.cpp:422: SETPOWER failed with status 1

CPU consumption will also be very high.

Problem: You may be running the wrong transceiver program for your USRP hardware. For a stock 64 MHz USRP, user Transceiver/transceiver. For a 52 MHz USRP, use Transceiver52M/transceiver.

Solution: Set the correct path for TRX.Path in OpenBTS.config.


About Kalibrator

If you don't have expensive laboratory equipment and you want to know accuracy of your USRP clock, you can use an application Kalibrator (Copyright (c) 2009 Joshua Lackey, Alexander Chemeris). Of cource you cannot achieve such precision measurement like with hi-tech lab equipment, but it's enough to find out modest clock calibration errors.

Latest version of Kalibrator today is 0.2 and is available here. Starting from the next update of OpenBTS Kalibrator will be distributed as a part of OpenBTS standard package.

How it works

Kalibrator takes advantage of the existing real networks and their accuracy. So you need to be in range within some operator's BTS. You pass the downlink frequency of the previously scanned ARFCN as a command line parameter for Kalibrator. Using some math Kalibrator can estimate the value of frequency difference between the frequency it tunes USRP to and the frequency of a BTS working in +-200kHz range near that frequency.

Building and running

To build Kalibrator with gnuradio 3.2.2 (ver. 3.1.3 is not currently supported) run 'make' and you will get binary file 'kal' which is ready for use.

Now you need to know which ARFCN is better to use. With any GPRS modem supporting AT commands it is possible to find an ARFCN with the strongest signal. Without such modem, you have to scan whole band by manual iteration through downlink frequencies (it can be inconvenient especially on 1800/1900 band). Search this file for specific downlinks all_gsm_channels_arfcn.txt.

Suitable channels must have at least -70 to -80dBm strenght, else you got to much overruns and the result could be misguiding. That's just good to have more channels to scan to eliminate possible wrong error. There is an example of network scan from GPRS modem (offset values are added manually).
T-Mobile operator
=================
at^moni
Serving Cell                                          I Dedicated channel
chann rs  dBm MCC MNC  LAC cell NCC BCC PWR RXLev  C1 I chann TS timAdv PWR  dBm Q ChMod    offset
   58 53  -57 230  01 4358 719D   2   4  33  -106  48 I    Limited Service            -2197 Hz

OK

at^monp
chann rs  dBm MCC MNC BCC  C1  C2    offset
  106 45  -65 230  01   7  40  40    -2507 Hz
   75 37  -73 230  01   2  32  32    -2367 Hz
   28 21  -89 230  01   4  16  16    N/A
   80 17  -93 230  01   1  12  12    N/A

OK

Telefonica O2 operator
======================
at^moni
Serving Cell                                       Z   I Dedicated channel
chann rs  dBm MCC MNC  LAC cell NCC BCC PWR RXLev  C1 I chann TS timAdv PWR  dBm Q ChMod    offset
   86 59  -51 230  02 04BC 090B   1   3  33  -106  54 I    Limited Service            -2496 Hz

OK
at^monp
chann rs  dBm MCC MNC BCC  C1  C2    offset
  114 47  -63 230  02   4  42  42    N/A
  112 30  -80 230  02   7  25  25    N/A
   93 19  -91 230  02   7  14  14    N/A

OK

Here is obvious how the values were obtained.

[openBTS@openBTS kal-0.2]# ./kal -f 946600000 -u
USRP side: B
FPGA clock: 52000000
Decimation: 192
Antenna: RX2
Sample rate: 270833.343750
average [min, max] (range, stddev)
-2197.789062 [-2431, -1843] (588, 146.761444)
overruns: 0
not found: 0

[openBTS@openBTS kal-0.2]# ./kal -f 956200000 -u
USRP side: B
FPGA clock: 52000000
Decimation: 192
Antenna: RX2
Sample rate: 270833.343750
average [min, max] (range, stddev)
-2507.531006 [-2575, -2436] (139, 40.815132)
overruns: 0
not found: 0

[openBTS@openBTS kal-0.2]# ./kal -f 950000000 -u
USRP side: B
FPGA clock: 52000000
Decimation: 192
Antenna: RX2
Sample rate: 270833.343750
average [min, max] (range, stddev)
-2367.053467 [-2431, -2275] (156, 43.972340)
overruns: 0
not found: 0

[openBTS@openBTS kal-0.2]# ./kal -f 952200000 -u
USRP side: B
FPGA clock: 52000000
Decimation: 192
Antenna: RX2
Sample rate: 270833.343750
average [min, max] (range, stddev)
-2496.760254 [-2592, -2375] (217, 61.745182)
overruns: 0
not found: 0

By default RX and side are set to ones used by OpenBTS, so usually you need only one mandatory parameter '-f'. You can use -u is optional parameter for continous display.

... page in progress


The default clock of the USRP is 64Mhz. GSM clocks are derived from a 13 Mhz so multiples of 13 are "good clocks" for the host.

Re-clocking the USRP to 52 Mhz will make your host more CPU efficient.

Using USRP with a external clock signal

So now you've got an external clock signal, probably a stable 52Mhz clock, and you want to run OpenBTS with it. Here are the hardware and software setup instructions.

Hardware modifications to the USRP to use a external clock:

  • Solder an SMA connector into J2001. This is the clock input. Be careful when soldering the SMA connector so you don't break the delicate trace from J2001 to C927.
  • Move R2029 to R2030. This disables the onboard clock. R2029/R2030 is a 0-ohm resistor.
  • Move C925 to C926.
  • Remove C924.

Software modifications to gnuradio:

** For gnuradio ver. 3.1.3 *** In usrp/host/lib/legacy/usrp_basic.h, line 122 should read
long  fpga_master_clock_freq () const { return 52000000; }
*** In usrp/host/lib/legacy/usrp_standard.cc, line 703 should be commented out
//assert (dac_freq () == 128000000);
*** run "make install" *** rebuild openbts *** modify OpenBTS.config (or whatever config file you are using) so that TRX.Path points to "../Transceiver52M/transceiver". ** For gnuradio ver. 3.2 or higher *** In usrp/host/lib/legacy/usrp_basic.cc, line 116 should read
d_verbose (false), d_fpga_master_clock_freq(52000000), d_db(2)
*** In usrp/host/lib/legacy/usrp_standard.cc, line 1024 should be commented out
// assert (dac_rate() == 128000000);
*** In usrp/host/lib/legacy/db_flexrf.cc, line 179 should read
return 52e6/_refclk_divisor();
  • run "make install"
  • rebuild openbts
  • modify OpenBTS.config (or whatever config file you are using) so that TRX.Path points to "../Transceiver52M/transceiver".

Known Problems

As of release 2.5 "Lacassine", the 52 MHz modifications do not work with Mac OS X systems. If you use OS X, you will need to continue to use a 64 MHz clock.


About BTS Clocks

Many of the problems getting phones to "camp" in both OpenBTS and OpenBSC have been related to frequency accuracy. To understand this problem, you have to understand clock technologies and you have to understand how a typical GSM phone acquires a signal.

Let's start with this, from GSM 05.10 Section 5.1:

The BTS shall use a single frequency source of absolute accuracy better than 0.05 ppm for both RF frequency generation and clocking the timebase. The same source shall be used for all carriers of the BTS.

For the pico BTS class the absolute accuracy requirement is relaxed to 0.1ppm.

First: What is Supposed to Happen

An error of 0.05 ppm is 45 Hz in the low bands (850/900) and 90 Hz in the high bands (1800/1900). That is VERY accurate, the kind of accuracy you get from a GPS-disciplined VCTCXO (temperature-compensated voltage-controlled crystal oscillator) or an OCXO (oven-controlled crystal oscillator, a $100-$200 part). Doppler shift in the direct path from a 150 km/h car or train is on the order of 0.15 ppm, so the necessity of this kind of accuracy is questionable, but that's what is in the spec. Given Doppler effects, the observed frequency difference between two carrier-grade basestations is a few hundred Hz, worst case.

The typical GSM handset has a medium-quality VCTCXO. On a cold start, not locked to any outside clock, this clock has a an accuracy of around 20 ppm, or about 18 kHz in the low bands (850/900) and about 36 kHz in the high (1800/1900) bands. So, starting "cold" with no information, the phone runs a time-consuming frequency search over the whole possible drift range of its own clock and continues this search until it finds a beacon signal from a BTS.
Once the phone finds a beacon, it uses the carrier from the BTS to correct its own local clock by adjusting the control voltage on the VCTCXO. From that point on, the VCTCXO is just as accurate os the BTS clock as long as it is receiving the BTS signal. If the BTS signal is lost, the handset's clock will drift within some know worst-case rate. Knowing how long its local clock has been drifting, the handset can calculate the worst-case drift and use that information to narrow next frequency search.

So, you turn on a handset from "cold", it does a big frequency search until it finds a BTS. If it looses that BTS signal, it searches for another, but this time it does a much smaller frequency search, knowing that the signal from the next BTS will be within a few hundred Hz of its expected frequency and that its own local clock has not drifted much since last seeing a beacon. If the handset finds another beacon during this small search, it will stop searching. (That's critical for the next part of this discussion.) If the handset fails to find a beacon in the small search, it will widen the search range or a multiband phone might try a different band.

Second: What Goes Wrong When You Use an Inaccurate Clock

Now, suppose your BTS uses a simple XO (crystal oscillator) clock, which produces an error on the order of a several kHz on your RF
carrier. This is the case for OpenBTS with a "stock" USRP and it is also the case with the the Siemens BS-11 (used by OpenBSC) when it is locked to the clock from a typical ISDN-grade E1 interface card. This kind of BTS can fail in three possible ways, depending on just how bad the clock error is and how the system is being used:

Effect of Large Frequency Errors (Several kHz or More)

The first type of failure is where the BTS XO error is so large that your BTS beacon falls completely outside the handset's "big" search range. The handset simply never finds the BTS signal. This is the error Fabian Uehlin found when he first tried to operate OpenBTS in the 1800 band. He fixed it by using an external clock with much better accuracy.

Effect of Modest Frequency Errors (500 Hz to a Few kHz)

The second type of failure is when your BTS RF carrier is within the "big" search range but differs from the local "real" networks by more than a few hundred Hz. In this situation, the handset will either see your BTS or it will see the "real" network, but not both. Whatever system the handset sees first will control its clock and make it blind to the other. This kind of failure was discussed in detail in the OpenBSC e-mail list in Spring 2009. It has not been discussed much in the OpenBTS list, but it is safe to assume that it happens if you try to run the BTS in the same band as your local GSM carriers or try to work with multi-band phones. If I am not mistaken, the OpenBSC people fixed this problem by realizing that the VCOCXO in the BS-11 is much better than the XO on their standard E1 card -- if they just leave it alone. In OpenBTS we avoid this problem by operating in non-local bands and disabling other bands in the handsets so that they never see any other network. (OpenBTS can do that because unlike OpenBSC our radio is mostly software and very flexible.)

The XO errors of the BTS and the handsets will vary with age and temperature, so the failure behavior will be different for every handset at any given time and will vary from hour to hour as things warm up and cool down. That can make it all seem very mysterious and can make diagnosis difficult.

When You Try to Run a Multi-BTS System

Normally, a handset receives a neighbor list from its serving BTS and constantly monitors the signal levels from the beacons of these neighbors. The key feature used for this monitoring is the extended training sequence (XTS) of the synchronization burst. This XTS has a duration of 64 symbols (roughly 0.25 ms). If we search for this XTS with a matched filter, the performance of that matched filter will degrade rapidly for frequency offsets greater than about 1/(4*0.25 ms), or about 1 kHz, because at higher frequencies the relative phases of the XTS and the matched filter will drift by more than 90 degrees over the correlation period. So neighbor monitoring (and therefore mobility itself) starts to fail for per-BTS carrier offsets of more than 500 Hz.

A 500 Hz error is 0.5 ppm in the low bands and 0.25 ppm in the high bands. While this is an easier requirement than the 0.05 ppm given in the spec, it is much tighter than could be provided by a simple XO. This accuracy can be provided by an OCXO or a good quality VCTCXO with regular calibration.

Solution to All Problems: Use a Good Clock

In the long-term, OpenBTS will fix both of these clock problems completely replacing the XO clock in the USRP with something much more accurate, either a true OCXO or a very high-quality VCTCXO with an automated calibration procedure.

Several OpenBTS uses have also recommended the kit "FA-SY 1" from Funkamateur, available for about 40€, for desktop testing.

Third: When You Violate Clocking Relationships

Getting back to 05.10 Section 5.1, the GSM specifications dictate that the RF carrier and the symbol clock in the BTS be derived from a common source.

In the handset, the symbol clock is disciplined by the BTS RF carrier, just like the carrier clock. So, if your BTS RF carrier is in error by N ppm, the handset symbol clock will also be in error by N ppm. That's OK if the BTS symbol clock has exactly the same error, which it WILL if you derive everything from a common clock that way the specification tells you to.

But suppose you try to be clever. You know that once your equipment is warmed up, your BTS XO is consistently in error by +11 ppm, giving an RF carrier error of +10 kHz. So you deliberately de-tune your RF carrier by -10 kHz. That fixes the problems described in the previous section, but creates a new problem in the symbol rate clock. The standard GSM symbol clock is 270.833333 kHz. Your BTS XO is really off by +11 ppm, so your BTS symbol clock is really 270.836312 kHz. The handset locks to your BTS RF carrier, which is now spot-on its specified frequency, so the handset generates a correct internal symbol clock of 270.833333 kHz. So now the BTS and handset symbol clocks are slipping against each other at a rate of 11 ppm, or about 3 symbols per second.

Another variation on this problem is if you ignore the spec and use different clock devices for your RF carrier and your symbol clock. For example, suppose you have two 0.5 ppm OCXOs. Their relative fractional difference will be about 0.5 ppm, giving a drift of about one symbol every 7 seconds or so. (I've actually see this done before, too.)

Different handsets respond to the slipping symbol clock in different ways. In our experience, Nokia DCT3s just deal with it, apparently re-syncing on every frame, so if we only use DCT3s for testing, we may never realize that it is a serious problem. A Nokia DCT4 may camp to the beacon briefly, but will abort a transaction when the clock slips. In some handset designs, the symbol slipping interacts with the closed-loop timing advance, making that control loop unstable. Again, the error seems mysterious because different handset models respond in different ways and the effect will very with temperature as the XO in the BTS drifts around.


OpenBTS Handset Compatibility

All handsets have bugs in their GSM stacks. If your BTS has no bugs of its own, then it will not invoke most of these latent handset bugs. When we see specific handset models behave badly with OpenBTS, that lets us know that OpenBTS has a bug. Eventually, as OpenBTS improves, the bugs will get fixed and all of these phones will move to the "Known to Work" list. Also, handset manufacturers tend to use the same GSM stacks for years across many products, so if a single handset from a given manufacturer works then there's a good chance that many other models from that manufacturer made around the same time will work as well.

Developers are encouraged to update this page frequently to report their experiences, especially with phone models not already listed here.

Phones Known to Work with OpenBTS

Note that most multi-band phones will require forcing when tested in the presence of other networks. That is normal behavior of the handset and does not indicate a problem with OpenBTS.

phone manufacturer phone model(notes) SIM type GSM band USRP clock computer (CPU, clock, mem, OS) GNU Radio version 1.6 2.3 2.4 2.5.1 2.6
Nokia DCT-3 series many 850, 900, 1800 64 or 52 various 3.1, 3.2 OK OK OK OK OK
DCT-4 series many 850, 900, 1800 64 or 52 various 3.1, 3.2 OK OK OK OK
DCT-4+ series many 850, 900, 1800 64 or 52 various 3.1, 3.2 OK
7650 China (460 00), Thailand (520 01), Israel (425-01 and 425-02) 900 MHz 52 MHz TCXO P4 2.4 GHz With Centos, linux kernel 2.6.18 OK OK OK OK
6021 900 MHz ClockTamer @ 52 MHz Intel C2D T7200@1GHz, 4GB RAM, Ubuntu 9.04, 2.6.28 3.2.2 OK OK
3310 900 MHz ClockTamer @ 52 MHz Intel C2D T7200@1GHz, 4GB RAM, Ubuntu 9.04, 2.6.28 3.2.2 OK
3410 900 MHz ClockTamer @ 52 MHz Intel C2D T7200@1GHz, 4GB RAM, Ubuntu 9.04, 2.6.28 3.2.2 OK
2600 230/01 900 MHz ClockTamer @ 52 MHz Intel C2D 2.26GHz, 3GB RAM, fc11 2.6.29 3.2.2 OK
3120 230/02 900 MHz ClockTamer @ 52 MHz Intel C2D 2.26GHz, 3GB RAM, fc11 2.6.29 3.2.2 OK
7250 230/02 900 MHz ClockTamer @ 52 MHz Intel C2D 2.26GHz, 3GB RAM, fc11 2.6.29 3.2.2 OK
3120 classic 230/02 900 MHz ClockTamer @ 52 MHz Intel C2D 2.26GHz, 3GB RAM, fc11 2.6.29 3.2.2 OK
6720 classic o² Germany 1800 MHz external clock @ 64 MHz Ubuntu Karmic, 2 GB 3.1.3 OK
6230b T-Mobile USA 1900 MHz ClockTamer @ 52 MHz Intel C2D P7570 2.26GHz, 2GB RAM, F12, 2.6.33-rc5 3.3git (02616cf) OK
Siemens MT50 230/03 900 MHz 64 MHz internal Intel C2D 2.26GHz, 3GB RAM, fc11 2.6.29 3.1.3 OK OK
CF62 230/03 900 MHz 64 MHz internal Intel C2D 2.26GHz, 3GB RAM, fc11 2.6.29 3.1.3 OK OK OK
MC75 modem 230/03 900 MHz 64 MHz internal Intel C2D 2.26GHz, 3GB RAM, fc11 2.6.29 3.1.3 OK OK
A52 900 MHz ClockTamer @ 52 MHz Intel C2D T7200@1GHz, 4GB RAM, Ubuntu 9.04, 2.6.28 3.2.2 OK OK
A65 900 MHz ClockTamer @ 52 MHz Intel C2D T7200@1GHz, 4GB RAM, Ubuntu 9.04, 2.6.28 3.2.2 OK OK
AX75 Vodafone CZ (230/03), China (460/02) 900 MHz KSP's 52 MHz Intel E3200 @1.9GHz, GA-G41M, 1GB RAM, Ubuntu 9.10, 2.6.31-16 3.2.2 OK
Ericsson R310 230/03 900 MHz 64 MHz internal Intel C2D 2.26GHz, 3GB RAM, fc11 2.6.29 OK OK
T68i OK
Alcatel BG3 Vodafone 900 MHz ClockTamer @ 52 MHz Intel C2D 1.86GHz, 4GB RAM, Ubuntu 9.10 OK
Treo 650 OK
700 OK
T-Mobile G1 stock 64 MHz OK OK
Motorola F3 OK
Apple iPhone 2G OK (?)
Apple iPhone 3G OK
OpenMoko FreeRunner 2G OK
Samsung M140L 850 MHz 64MHz external clock OK
C270 O2 Germany 900 MHz ClockTamer @ 52 MHz Intel CPU, Ubuntu 9.10 64Bit 3.2.2 OK
A137 ATT 850 MHz stock 64 MHz Intel MacBook Pro 3.1 OK
E-Ten Glofiish M700 850 MHz 64MHz external clock OK
HTC Touch 900 MHz ClockTamer @ 52 MHz Intel C2D T7200@1GHz, 4GB RAM, Ubuntu 9.04, 2.6.28 3.2.2 NO OK
Hero o² Germany 1800 MHz external clock @ 64 MHz Ubuntu Karmic, 2 GB 3.1.3 OK
LG GB102 o2 branded, unlocked 900 MHz ClockTamer @ 52 MHz Intel C2D T7200@1GHz, 4GB RAM, Ubuntu 9.10, 2.6.31-17 3.3git (ecbbd26) kind of
BlackBerry Curve 8320 T-Mobile USA 900/1900 MHz ClockTamer @ 52 MHz Intel C2D P7570 2.26GHz, 2GB RAM, F12, 2.6.33-rc5 3.3git (02616cf) OK

Notes

The Nokia 3410 and Nokia 3310 sometimes fail to register. This is caused by interference from existing GSM network, so if you see this you should try to find ARFCN with less interference. Seems Nokia phones are much more sensitive to interference then e.g. Siemens ones.

Phone that Sort-of Work with OpenBTS

Recent Blackberry models can register, do SMS and sometimes place calls but sometimes hang in strange states. Last tested with release 2.4 and need retesting in 2.5 or later.

Nokia N80 and E71 camp with OpenBTS but not consistently, probably only after the SIM connected from a more 'friendly' phone (e.g. Nokia 7650). Tested with OpenBTS 2.4 with a 52 MHz clock. Test performed in Israel on the 900 MHz band. SIM cards from Israel (425 01 and 425 02). OpenBTS running on P4 2.4 GHz with Centos, linux kernel 2.6.18. This needs to be retested with 2.5 or 2.6. Update: Nokia E71 was tested with OpenBTS 2.5.3, GnuRadio pre-3.3 (from git) and ClockTamer@52MHz clock. It registers with OpenBTS smoothly and receives SMSes without any problems. Call Nokia E71 to Samsung S5230 establishes fine, but no audio is heard. This needs to be tested better.

The LG GB102 o2 branded, unlocked to work with any SIM-card can't connect to OpenBTS. It sees the network, but when you press "Connect" it says "Fail" immediately. At the same time it connects perfectly to commercial GSM network. Further tests have shown that it connects to OpenBTS if it mimics to the home network of the SIM card inserted. But when you try to use test network (001:01) phone can't connect to it. This appears to be a serious bug in the handset, not a flaw in OpenBTS.

Phones Known not to Work with OpenBTS

The Motorola Razr V3 is fails to register with OpenBTS. Last tested with release 2.4. This is probably due to an improper response to the GPRS Suspension Request message and should be fixed in release 2.5 but has still not been retested.


Desktop Testing of OpenBTS

Here's the hardware you will need for a desktop testing kit:

  • A USRP. To our knowledge, OpenBTS has not been used with URSP2.
  • A computer running Linux or Mac OS X with a USB-2.0 port and libusrp installed. We recommend against Dell laptops because their hardware tends to couple a lot of noise into the USRP via the USB cables, at least in some models. We have had our best results with Apple PowerBooks and MacBooks. We have not tested a lot of desktop machines, but generally have had better success with them than with desktops. Virtual machines are not likely to work, nor is Cygwin. We would be interested in reports of what systems tend to work best.
  • Two RFX900 daughter cards for GSM 850/900 operation. The ISM band filter on the RFX900 will need to be removed. A stock USRP with a 64 MHz crystal oscillator will not function correctly in the 1800/1900 bands, so there is no use for an RFX1800. You can convert your RFX1800 into an RFX900 with the command
burn-db-eeprom -A --force -t rfx900 
  • You need two RFX boards to minimize crosstalk between the receive and transmit sections. When installing the daughter cards in the USRP, there will be an "A" board (installed on "TXA" and "RXA") and a "B" board (installed on "TXB" and "RXB").

OpenBTS will transmit on the "A" board, on the "TX/RX" connector.

OpenBTS will receive on the "B" board, on the "RX2" connector.

  • Antennas with SMA connectors to fit the USRP and matched to whatever cellular band you intend to use. The VERT900 antenna, also available from Ettus works fine. Or just do a Google search for "cellular antenna SMA" and see what pops out. (You actually only need one antenna for desktop development work.)
  • At least two GSM phones. Our preferred testing phone is a DCT-3 series Nokia. We say at least two phones, but for full-load testing of a single-ARFCN system you need seven.
  • SIMs. Every phone needs a SIM. The requirements for the SIMs depend on the band in which you chose to operate and are discussed below.
  • A SIP phone. We've used a PAP2 adapter and we've used the Zoiper softphone applciation.

Need a visual of that? Here's a laptop, USRP and a couple of DCT-3 test phones:

The recommended testing configuration is to operate in a cellular band not used in your area and use test phones that do not support your local cellular bands. This arrangement forces your test phone to camp to your basestation. It also prevents you from inadvertently attracting phones from the local licensed carriers. For example, to test in North America, you might use the EGSM900 band or the DCS1800 band and use a phone that does not support GSM850 or PCS1900.

If you do operate in a band that is also used by cellular carriers in your area, you will need to use SIMs from a carrier that does not offer service in you area and has no roaming agreements with carriers in your area. You can then use network parameters matched to the SIM and, hopefully, your test phones will ignore the local network and phones from your local network will ignore you.

If you do not operate in a band that is used by cellular carriers in your area, you can use any SIM you want.

If you want any flexibility at all in your choice of SIMs, you will need to use unlocked phones.

Be aware of power levels and local regulations. Here are some technical guidelines:

  • Operate in a cellular band not used by your local carriers. This will reduce your likelihood of interfering with their service and will make your own test more controllable.
  • Do not use a transmit antenna. Plenty of power leaks out of the USRP for close-range testing. In fact, using a transmit antenna causes a lot of transmit power to couple into the receiver, reducing receiver performance and limiting uplink range. (I realize that photo above shows two antennas, but you will get better results without the transmit antenna.)
  • Do use a receive antenna. Remember that GSM uses active uplink power control. The more sensitive your receiver is, the less power the BTS will need to request from the phone.
  • Keep the phones close to the USRP. Again, keeping the distance short (less than 2m) will allow the BTS to control the phone down to minimum power.
  • Be aware of local radio applications and avoid their spectrum. This is especially important for air navigation and air traffic control radar systems. Perform a spectrum survey to know what frequencies are in use in your area. Check you regulator's licensing database to know who holds licenses in your area.
  • Test indoors to limit propagation.
  • Use a test phone with an RSSI display. You should not need received power levels above -80 dBm for desktop protocol testing.

However, these are only technical pointers to help you comply with your local regulations. They are not legal advice on the regulations themselves. That is entirely your responsibility.

How to camp to OpenBTS with arbitrary SIM

To make your phone choose OpenBTS even if other networks try to steal your connection you should:

  1. Change your OpenBTS settings to show identity of some NON local operator, preferably some non-existent one, and start your OpenBTS.
  2. In your phone's menu find "Network selection" item somewhere in "Settings" menu. You sill see that it's set to "Automatic".
  3. Change item value to "Manual". Phone will start searching for available networks. It will take some time, be patient.
  4. When a window with available network operators appear, choose your OpenBTS network. It may hide under some strange name like "MCC 123 MNC 89" or "USA MNC 234" or with the name which is different from you set in OpenBTS.config, because phones use internal DB of MCC/MNC to operator name pairs and at this point just can't sense the name you set for OpenBTS in its config.
    • If you don't see any strange network in the networks list, your OpenBTS setup is sompletely wrong or you just forgot to turn OpenBTS on. ;)
  5. From now on this phone will try to camp to OpenBTS ONLY until you change this in network settings to other manual network or to "Automatic".

PS If you change MCC&MNC in your OpenBTS setup, don't forget to update network settings in your test phones accordingly.


OpenBTS Frequently Asked Questions

Distributions, Servers, Software Licenses and Copyrights

What is "Kestrel Signal Processing, Inc." and what is its relationship to OpenBTS?

Kestrel Signal Processing, Inc. (KSP) is a software and signal processing consulting company in Fairfield, California. OpenBTS originated at KSP. KSP holds a blanket license for non-GPL distributions of OpenBTS and the great majority of publicly-available OpenBTS source code was written or commissioned by KSP.

Why are there two SVN servers?

OpenBTS uses two SVN servers, one at GNU Radio (through this trac) and one at KSP. Most active development is on the KSP server. That is because the OpenBTS project founders can grant accounts on the KSP server to whomever they want, whereas the GNU Radio server is controlled by the FSF. However, the KSP server is not publicly available because KSP prefers to make public releases of OpenBTS through GNU Radio. The GNU Radio OpenBTS trunk lags the KSP trunk by 4-6 weeks.

How do I get an account on the GNU Radio SVN server?

Execute a copyright assignment agreement with the FSF.

How can I get an account on the KSP SVN server?

To get an account on the KSP server you need to do one of the following:
  1. Execute a contributor's license agreement with KSP. This agreement will transfer copyrights for you contribution to KSP and KSP will grant you back a blanket license to your own contributions where you want. It is similar in principle to the Asterisk contributors' license agreement.
  2. Engage KSP in an OpenBTS consulting or support contract.

If there are two servers, are there also two distributions?

Not really, at least not yet. In principle, there is a GPL distribution at GNU Radio and a non-GPL distribution available from KSP. In practice, though, these are identical source code and differ only in licensing. This could change, though, if someone contributes source code to the GNU Radio OpenBTS core application within executing a copyright assignment with KSP. Should that ever happen, the GNU Radio and KSP distributions will diverge, since KSP cannot use GPL-only contributions in non-GPL releases.

Note that the copyright-transfer requirement applies only to the core OpenBTS application, the GSM "stack". It does not apply to the transceiver or to support applications like smqueue. Those components will be used under GPL even in commercial applications and can include any GPL-compatible components. If someone contributes GPL code to those support applications, it may also be incorporated into KSP's development trunk.

Do you realize that the GPLv3 patent license requirements prevent GPLv3 distributions from being used in most commercial GSM applications?

Yes. If you to use OpenBTS in a commercial application, you will probably need a non-GPLv3 license from KSP. You will still be responsible for arranging your own patent licensing for those patent-encumbered parts of the GSM specification. There are 100-200 essential patents for elements 2G GSM, depending on the feature set you intend to support.

Is OpenBTS being used in real products?

As of February 2010, not quite yet, but it is being used in the development of real products that will probably reach the market later in 2010.

Hardware, Software and Cellular Standards

Why are the transceiver and GSM stack in different applications?

Splitting the software radio transceiver and the rest of the GSM stack into two parts offers two advantages:
  1. Developers can adapt the system to other radio hardware or to their own existing demodulators without modifying the GSM stack.
  2. The transceiver and GSM stack can be licensed independently, allowing us to use GNU Radio's GPL libusrp driver with a non-GPL GSM stack.

Do you support the USRP2?

To date, nobody has provided a transceiver to support the USRP2.

Relationships to Other Projects

What is the relationship between OpenBTS and the rest of GNU Radio?

OpenBTS is part of the GNU Radio project and uses the same USRP hardware. However, the only part of the GNU Radio software actually used by OpenBTS is the libusrp device interface.

What is the relationship between OpenBTS and OpenBSC?

OpenBSC is an Abis-based GSM core network simulator designed for use with commercial BTS products. It is an entirely different project with an entirely different set of goals. Furthermore, the different implementation styles (C single-thread event driven versus C++ multithread dataflow) prevent direct transfer of code from one project to another. That said, the two projects often encounter identical engineering and design problems and many people who contribute in one project often follow technical discussions in the other.

What is the relationship between OpenBTS and Airprobe?

Airprobe is a GSM passive receiver and protocol analyzer. Airprobe may be useful as a debugging tool for OpenBTS developers, but it is not supported by the OpenBTS project.


Idle-Filling in OpenBTS

In the GSM standard, most channels require some kind of idle-filling sequence.
  • For the SDCCH, this filling sequence is a zero-length L2 frame (GSM 04.06 5.4.2.3). This pattern is transmitted whenever the SDCCH is in use for a transaction and no other L2 frame is available for transmission.
  • For the CCCH, this filling sequence is an empty paging message, sent whenever no other messages are available for transmission.
  • The a dummy burst used to insure continuous transmission on C0 and on any other Cn that carries a BCCH. It is transmitted in any radio burst that is not in use by some logical channel.

The question of how idle sequences are generated drives much of the L1 and L2 architecture in a software BTS. In the OpenBTS architecture, the bulk of any idle fill task is handled at a very low level by the software defined radio, in what is sometimes called "L0", the radio interface below the L1 FEC modules.

To support idle filling, the software transmitter keeps a table for each timeslot large enough to store all of the radio bursts for a a complete cycle of that slot's TDMA pattern. (The software transmitter is aware of the channel combination in use on a given timeslot.) There are two rules for managing this table:
1. Whenever a radio burst is sent to the software transmitter, the transmitter stores a copy of the outgoing burst in that slot's filler table, indexed by the outgoing bust's frame number, modulo the TDMA cycle period.
1. Whenever the software transmitter needs to send a radio burst at a specific position in the TDMA pattern and none is enqueued for transmission, the transmitter will pull a substitute burst from the filler table.

The effect of this pair of rules is that whenever the bursts of an L2 frame are sent to the radio for transmission on a particular logical channel, that burst pattern will continue to be repeated in its TMDA positions on the radio link until the bursts of another L2 frame are sent to replace it. The implication for the higher layers is that an idle filling frame need only be sent once, at the start of an idle period, and the lower layers of the radio will continue to repeat that idle pattern until some new activity overwrites it.

With a sufficiently long TDMA cycle time, this mechanism may also be used to generate the system information messages of the SACCH or BCCH, although we do not do that yet.


Introduction To GSM from www.gsmfordummies.com

Introduction

GSM is an acronym that stands for Global System for Mobile Communications. The original french acronym stands for Groupe Spécial Mobile. It was originally developed in 1984 as a standard for a mobile telephone system that could be used across Europe.

GSM is now an international standard for mobile service. It offers high mobility. Subscribers can easily roam worldwide and access any GSM network.

GSM is a digital cellular network. At the time the standard was developed it offered much higher capacity than the current analog systems. It also allowed for a more optimal allocation of the radio spectrum, which therefore allows for a larger number of subscribers.

GSM offers a number of services including voice communications, Short Message Service (SMS), fax, voice mail, and other supplemental services such as call forwarding and caller ID.

Currently there are several bands in use in GSM. 450 MHz, 850 MHZ, 900 MHz, 1800 MHz, and 1900 MHz are the most common ones.

Some bands also have Extended GSM (EGSM) bands added to them, increasing the amount of spectrum available for each band.

GSM makes use of Frequency Division Multiple Access (FDMA) and Time Division Multiple Access (TDMA).
*TDMA will be discussed later

GSM allows for use of duplex operation. Each band has a frequency range for the uplink (cell phone to tower) and a separate range for the downlink (tower to the cell phone). The uplink is also known as the Reverse and the downlink is also known as the Forward. In this tutorial, I will use the terms uplink and downlink.

Frequency Division Multiple Access (FDMA)

GSM divides the allocated spectrum for each band up into idividual carrier frequencies. Carrier separation is 200 khz. This is the FDMA aspect of GSM.

Absolute Radio Frequency Channel Number (ARFCN)

The ARFCN is a number that describes a pair of frequencies, one uplink and one downlink. The uplink and downlink frequencies each have a bandwidth of 200 kHz. The uplink and downlink have a specific offset that varies for each band. The offset is the frequency separation of the uplink from the downlink. Every time the ARFCN increases, the uplink will increase by 200 khz and the downlink also increases by 200 khz.

*Note: Although GSM operates in duplex (separate frequencies for transmit and receive), the mobile station does not transmit and receive at the same time. A switch is used to toggle the antenna between the transmitter and receiver.

The following table summarizes the frequency ranges, offsets, and ARFCNs for several popular bands.

The following diagram illustrates an ARFCN with paired uplink and downlink frequencies for ARFCN 1 in the GSM 900 band.

The following is a way to calculate the uplink and downlink frequencies for some of the bands, given the band, the ARFCN, and the offset.

GSM 900

Up = 890.0 + (ARFCN * .2)
Down = Up + 45.0

example:

Given the ARFCN 72, and we know the offset is 45MHz for the GSM900 band:
Up = 890.0 + (72 * .2)
Up = 890.0 + (14.4)
Up = 904.40 MHz
Down = Up + Offset
Down = 904.40 + 45.0
Down = 949.40 MHz

The uplink/downlink pair for GSM900 ARFCN72 is 904.40/949.40 (MHz)

Here are the formulas for EGSM900, DCS1800, and PCS1900:

EGSM900

Up = 890.0 + (ARFCN * .2)
Down = Up + 45.0

DCS1800

Up = 1710.0 + ((ARFCN - 511) * .2)
Down = Up + 95.0

PCS1900

Up = 1850.0 + ((ARFCN - 512) * .2)
Down = Up + 80.0

Numbering System (Identifiers)

Mobile Subscriber ISDN (MSISDN)

The MSISDN is the subscriber's phone number. It is the number that another person would dial in order to reach the subscriber. The MSISDN is composed of three parts:

Country Code (CC)
National Destination Code (NDC)
Subscriber Number (SN)

Country Code (CC) - This is the international dialing code for whichever country the MS is registered to.

National Destination Code (NDC) - In GSM, an NDC is assigned to each PLMN. In many cases, a PLMN may need more than one NDC.

Subscriber Number (SN) - This is a number assigned to the subscriber by the service provider (PLMN).

The combination of the NDC and the SN is known as the National (significant) Mobile Number. This number identifies a subscriber within the GSM PLMN.

International Mobile Subscriber Identity (IMSI)

The IMSI is how the subscriber is identified to the network. It uniquely identifies the subscriber within the GSM global network. The IMSI is burned into the SIM card when the subscriber registers with PLMN service provider. The IMSI is composed of three parts:
Mobile Country Code (MCC)
Mobile Network Code (MNC)
Mobile Subscriber Identification Number (MSIN)

Mobile Country Code (MCC) - This number identifies which country the subscriber's network is in. It has 3 digits.

Mobile Network Code (MNC) - This number identifies the home GSM PLMN of the subscriber (Cingular, T-Mobile, etc.). It has 2 or 3 digits. Some networks may have more than one MNC allocated to it.

Mobile Subscriber Identification Number (MSIN) - This number uniquely identifies a user within the home GSM network.

International Mobile Equipment Identity (IMEI)

The IMEI uniquely identifies the Mobile Equipment itself. It is essentially a serial number that is burned into the phone by the manufacturer. The IMEI is composed of three parts:
Type Allocation Code (TAC) - 8 digits
Serial Number (SNR) - 6 digits
Spare (SP) - 1 digit

Type Allocation Code (TAC) - This number uniquely identifies the model of a wireless device. It is composed of 8 digits. Under the new system (as of April 2004), the first two digits of a TAC are the Reporting Body Identifier of the GSMA approved group that allocated this model type.

Serial Number (SNR) - This number is a manufacturer defined serial number for the model of wireless device.

Spare (SP) This number is a check digit known as a Luhn Check Digit. It is omitted during transmission within the GSM network.

On many devices the IMEI number can be retrieved by entering *#06#

Former IMEI Structure

Prior to April, 2004 the IMEI had a different structure:
Type Allocation Code (TAC) - 6 digits
Factory Assembly Code (FAC) - 2 digits
Serial Number (SNR) - 6 digits
Spare (SP) - 1 digit

As of April 2004, the use of the FAC was no longer required. The current practice is for the TAC for a new model to get approved by national regulating bodies, known as the Reporting Body Identifier.

International Mobile Equipment Identity/Software Version (IMEISV)

This is a newer form of the IMEI that omits the Spare digit at the end and adds a 2-digit Software Version Number (SVN) at the end. The SVN identifies the software version that the wireless device is using. This results in a 16-digit IMEI.
Type Allocation Code (TAC) - 8 digits
Serial Number (SNR) - 6 digits
Software Version Number (SVN) - 2 digits


Logical Channels from www.gsmfordummies.com

Introduction

As you remember from the Introduction to TDMA tutorial. GSM divides up each ARFCN into 8 time slots.

These 8 timeslots are further broken up into logical channels.

Logical channels can be thought of as just different types of data that is transmitted only on certain frames in a certain timeslot.

Different time slots will carry different logical channels, depending on the structure the BSS uses.
There are two main categories of logical channels in GSM:

Signaling Channels
Traffic Channels (TCH)

Signaling Channels

These are the main types of signaling Channels:Broadcast Channels (BCH) - Transmitted by the BTS to the MS. This channel carries system parameters needed to identify the network, synchronize time and frequency with the network, and gain access to the network.

Common Control Channels (CCH) - Used for signaling between the BTS and the MS and to request and grant access to the network.

Standalone Dedicated Control Channels (SDCCH) - Used for call setup.

Associated Control Channels (ACCH) - Used for signaling associated with calls and call-setup. An ACCH is always allocated in conjunction with a TCH or a SDCCH.

*keep in mind, these are only categories of logical channels, they are not logical channels themselves.

The above categories can be divided into the following logical channels:

Broadcast Channels (BCH)
Broadcast Control Channel (BCCH)
Frequency Correction Channel (FCCH)
Synchronization Channel (SCH)
Cell Broadcast Channel (CBCH)

Common Control Channels (CCCH)
Paging Channel (PCH)
Random Access Channel (RACH)
Access Grant Channel (AGCH)

Standalone Dedicated Control Channel (SDCCH)
Associated Control Channel (ACCH)
Fast Associated Control Channel (FACCH)
Slow Associated Control Channel (SACCH)

Let's examine each type of logical channel individually.

Broadcast Channels (BCH)

Broadcast Control Channel (BCCH) - DOWNLINK - This channel contains system parameters needed to identify the network and gain access. These paramters include the Location Area Code (LAC), the Mobile Network Code (MNC), the frequencies of neighboring cells, and access parameters.

Frequency Correction Channel (FCCH) - DOWNLINK - This channel is used by the MS as a frequency reference. This channel contains frequency correction bursts.

Synchronization Channel (SCH) - DOWNLINK - This channel is used by the MS to learn the Base Station Information Code (BSIC) as well as the TDMA frame number (FN). This lets the MS know what TDMA frame they are on within the hyperframe.

*The BSIC was covered in the Introduction to GSM Tutorial. You can also read about the numbering schemes used in GSM.

Cell Broadcast Channel (CBCH) - DOWNLINK - This channel is not truly its own type of logical channel. The CBCH is for point-to-omnipoint messages. It is used to broadcast specific information to network subscribers; such as weather, traffic, sports, stocks, etc. Messages can be of any nature depending on what service is provided. Messages are normally public service type messages or announcements. The CBCH isnt allocated a slot for itself, it is assigned to an SDCCH. It only occurs on the downlink. The CBCH usually occupies the second subslot of the SDCCH. The mobile will not acknowledge any of the messages.

[Back to Top]

Common Control Channels (CCCH)

Paging Channel (PCH) - DOWNLINK - This channel is used to inform the MS that it has incoming traffic. The traffic could be a voice call, SMS, or some other form of traffic.

Random Access Channel (RACH) - UPLINK This channel is used by a MS to request an initial dedicated channel from the BTS. This would be the first transmission made by a MS to access the network and request radio resources. The MS sends an Access Burst on this channel in order to request access.

Access Grant Channel (AGCH) - DOWNLINK - This channel is used by a BTS to notify the MS of the assignement of an initial SDCCH for initial signaling.

[Back to Top]

Standalone Dedicated Control Channel (SDCCH) - UPLINK/DOWNLINK - This channel is used for signaling and call setup between the MS and the BTS.
Associated Control Channels (ACCH)
Fast Associated Control Channel (FACCH) - UPLINK/DOWNLINK - This channel is used for control requirements such as handoffs. There is no TS and frame allocation dedicated to a FAACH. The FAACH is a burst-stealing channel, it steals a Timeslot from a Traffic Channel (TCH).

Slow Associated Control Channel (SACCH) - UPLINK/DOWNLINK - This channel is a continuous stream channel that is used for control and supervisory signals associated with the traffic channels.

[Back to Top]

Signaling Channel Mapping

Normally the first two timeslots are allocated to signaling channels.

Remember that Control Channel (aka signaling channels) are composed of 51 TDMA frames. On a time slot Within the multiframe, the 51 TDMA frames are divided up and allocated to the various logical channels.

There are several channel combinations allowed in GSM. Some of the more common ones are:
FCCH + SCH + BCCH + CCCH
BCCH + CCCH
FCCH + SCH + BCCH + CCCH + SDCCH/4(0..3) + SACCH/C4(0..3)
SDCCH/8(0 .7) + SACCH/C8(0 . 7)

FCCH + SCH + BCCH + CCCH

Downlink

Uplink BCCH + CCCH

/>

Downlink

Uplink FCCH + SCH + BCCH + CCCH + SDCCH/4(0..3) + SACCH/C4(0..3)
The SACCH that is associated with each SDCCH is only transmitted every other multiframe. Each SACCH only gets half of the transmit time as the SDCCH that it is associated with. So, in one multiframe, SACCH0 and SACCH1 would be transmitted, and in the next multiframe, SACCH2 and SACCH3 would be transmitted. The two sequential multiframes would look like this:

/>

Downlink

Uplink

You will also notice that the downlink and uplink multiframes do not align with each other. This is done so that if the BTS sends an information request to the MS, it does not have to wait an entire multiframes to receive the needed information. The uplink is transmitted 15 TDMA frames behind the downlink. For example, the BTS might send an authentication request to the MS on SDCCH0 (downlink) which corresponds to TDMA frames 22-25. The MS then has enough time to process the request and reply on SDCCH0 (uplink) which immediately follows it on TDMA frames 37-40. SDCCH/8(0 .7) + SACCH/C8(0 . 7)
Once again, the SACCH that is associated with an SDCCH is only transmitted every other multiframe. Two consecutive multiframes would look like this:

/>

Downlink

Uplink Traffic Channels (TCH)
Traffic Channels are used to carry two types of information to and from the user:

/>

Encoded Speech
Data

There are two basic types of Encoded Speech channels:

Encoded Speech - Encoded speech is voice audio that is converted into digital form and compressed. See the Speech Encoding tutorial to see the process.
Full Rate Speech TCH (TCH/FS) - 13 kb/s
Half Rate Speech TCH (TCH/HS) - 5.6 kb/s

Data - Data refers to user data such as text messages, picture messages, internet browsing, etc. It includes pretty much everything except speech.

Full rate Data TCH (TCH/F14.1) - 14.4 kb/s
Full rate Data TCH (TCH/F9.6) - 9.6 kb/s
Full rate Data TCH (TCH/F4.8) - 4.8 kb/s
Half rate Data TCH (TCH/F4.8) - 4.8 kb/s
Full rate Data TCH (TCH/F2.4) - ≤2.4 kb/s
Half rate Data TCH (TCH/H2.4) - ≤2.4 kb/s

[Back to Top]

Traffic Channel Mapping
Time slots 2 through 7 are normally used for Traffic Channels (TCH)

Traffic Channel Multiframes are composed of only 26 TDMA frames. On each multiframe, there are 24 frames for Traffic Channels, 1 frame for a SACCH, and the last frame is Idle. Remember that a MS (or other device) only gets one time slot per TDMA frame to transmit, so in the following diagrams we are looking at a single time slot.

Full Rate Traffic Channel (TCH/FS)

When using Half-Rate Speech Encoding (TCH/HS), the speech encoding bit rate is 5.6 kb/s, so one time slot can handle two half-rate channels. In this case, one channel will transmit every other TDMA frame, and the other channel would be transmitted on the other frames. The final frame (25), which is normally used as an Idle frame, is now used as a SACCH for the second half-rate channel.

Half Rate Traffic Channel (TCH/HS)

[Back to Top]

ARFCN Mapping
This diagram shows a sample Multiframe with logical channels mapped to time slots and TDMA frames. This is just one possible configuration for an ARFCN.
*For illustrative purposes, half of the traffic channels are full-rate and the other half are half-rate

TS0
TS1
TS2
TS3
TS4
TS5
TS6
TS7
*Remember that CCH Multiframes have 51 frames and TCH Multiframes only have 26. Their sequences will synchronize every superframe.

[Back to Top]

Offset
Even though GSM uses a full duplex radio channel, the MS and the BTS do not transmit at the exact same time. If a MS is assigned a given time slot, both the MS and the BTS will transmit during that given time slot, but their timing is offset. The uplink is exactly 3 time slots behind the downlink. For example, if the MS was allocated a TCH on TS3, the BTS would transmit when the downlink is on TS3 and the MS is set to receive on TS3. At this point, the uplink is only on TS0. Once the uplink reaches TS3, the MS would begin to transmit, and the BTS is set to receive on TS3. At this point, the downlink would be at TS6. When the MS is not transmitting or receiving, it switches frequencies to monitor the BCCH of adjacent cells.

[Back to Top]

Speech Data Throughput
When looking at a Time slot allocated to a TCH, you will notice that TCH does not occur on every single frame within a time slot. There is one reserved for a SACCH and one that is Idle. So, in a TCH Multiframe, only 24 of the 26 frames are used for traffic (voice/data). This leaves us with a data throughput of 22.8 kb/s.

Here is the math:

1. Calculate bits per TCH Multiframe:
We know that there are 114 bits of data on a single burst, and we know that only 24 of the 26 frames in a TCH multiframe are used to send user data.
114 bits × 24 frames = 2736 bits per TCH multiframe

So, we know that on a single timeslot over the duration of one TCH multiframe, the data throughput is 2736 bits.

2. Calculate bits per millisecond (ms):
From step one above, we know that the throughput of a single TCH multiframe is 2736 bits. We also know that the duration of a TCH multiframe is 120ms.
2736 bits / 120 ms = 22.8 bits per millisecond

3. Convert milliseconds (ms) to seconds:
Now we need to put the value into terms of seconds. There are 1000 milliseconds in a second, so we simply multiply the value by 1000.
22.8 bits/millisecond × 1000 = 22,800 bits per second (22.8 kb/s)

4. Convert bits to kilobits:
Finally, we want to put it into terms of kilobits per second, wich is the most common term for referring to data throughput. We know a kilobit is 1000 bits, so we simply divide the term by 1000.
22,800 bits/s ÷ 1000 = 22.8 kb/s

So now we see why the data throughput of a single allocated timeslot is 22.8 kb/s.

There is an easier method to come to this number:

We know that only 24 of the 26 frames carry data, so we can say that the new throughput would be 24/26 of the original throughput. If we convert this to decimal form:
24÷26 = .9231

We know from the TDMA Tutorial that the data throughput of a single timeslot is 24.7 kb/s. Apply this 24/26 ratio to the 24.7 kb/s throughput:
24.7 × .9231 = 22.8 kb/s

You can see that we get the same answer as above.

A single BTS may have several Transceivers (TRX) assigned to it, each having its own ARFCN, each ARFCN having 8 time slots.

The logical channels that support signaling will normally only be on one ARFCN. All of the other ARFCNs assigned to a BTS will allocate all 8 time slots to Traffic Channels, to support multiple users.

The following diagram is an example of how a medium-sized cell might be set up with 4 TRX (ARFCNs).

Sample Medium-Size Cell

[Back to Top]

Frequency Hopping
Each radio frequency Channel (ARFCN) is influenced differently by propagation conditions. What affects channel 23 may not affect channel 78 at all. Within a given cell, some frequencies will have good propagation in a certain area and some will have poor propagation in that area. In order to take advantage of the good propagation and to defeat the poor propagation, GSM utilizes frequency hopping. Frequency hopping means that a transceiver hops from one frequency to another in a predetermined sequence. If a transceiver hops through all of the avilable frequencies in a cell then it will average out the propagation. GSM uses Slow Frequency Hopping (SFH). It is considered slow becuase the system hops relatively slow, compared with other frequency hopping systems. In GSM, the operating frequency is changed every TDMA frame.

The main reason for using slow frequency hopping is because the MS must also change its frequency often in order to monitor adjacent cells. The device in a transceiver that generates the frequency is called a frequency synthesizer. On a MS, a synthesizer must be able to change its frequency within the time frame of one time slot, which is equal to 577 µs. GSM does not require the BTS to utilize frequency hopping. However, a MS must be capable of utilizing frequency hopping when told to do so.

The frequency hopping and timing sequence is known as the hopping algorithm. There are two types of hopping algorithms available to a MS.

  • Cyclic Hopping - The transceiver hops through a predefined list of frequencies in sequential order.
  • Random Hopping - The transceiver hops through the list of frequencies in a random manner. The sequence appears random but it is actually a set order.

There are a total of 63 different hopping algorithms available in GSM. When the MS is told to switch to frequency hopping mode, the BTS will assign it a list of channels and the Hopping Sequence Number (HSN), which corresponds to the particular hopping algorithm that will be used.

The base channel on the BTS does not frequency hop. This channel, located in time slot 0, holds the Broadcast Control Channels which the MS needs to monitor to determine strength measurements, determine access parameters, and synchronize with the system.

If a BTS uses multiple transceivers (TRX) then only one TRX will hold the the Broadcast Channels on time slot 0. All of the other TRXs may use time slot 0 for traffic or signaling and may take part in the frequency hopping.

There are two types of frequency hopping method available for the BTS: synthesizer hopping and baseband hopping.

  • Synthesizer Hopping - This requires the TRX itself to change frequencies according to the hopping sequence. So, one TRX would hop between multiple frequencies on the same sequence that the MS is required to.
  • Baseband Hopping - In this method there are several TRX and each one stays on a fixed frequency within the hopping frequency plan. Each TRX would be assigned a single time slot within a TDMA frame. For example, time slot 1 might be assigned to TRX 2 in one TDMA frame and in the next TDMA frame it would be assigned to TRX 3, and the next frame would be TRX 3. So, the data on each time slot would be sent on a different frequency each frame, but the TRXs on the BTS do not need to change frequency. The BTS simply routes the data to the appropriate TRX, and the MS knows which TRX to be on for any given TDMA frame.

Baseband Frequency Hopping


Logo

The openbts logo was developed by Alex Polvi with the help of Logan Welliver and released into the public domain on November 17th, 2008.


Mobility Management

This is about OpenBTS' HLR replacement, which we will just call an "HLR" here for simplicity.
The HLR can be implemented using Asterisk's internal databases or with a database server.

HLR Abstraction

At a minimum, the HLR stores the following for each subscriber:

  • IMSI
  • a routable number address (E.164, local extension or ISDN address)
  • the IP address of the BTS where the subscriber most recently registered

At a minimum, the HLR will support these actions:

  • resolve a routable address to an IMSI
  • resolve an IMSI to a routable address
  • find the most recent BTS IP address associated with an IMSI
  • insert a new ISDN/address pair
  • update the recent BTS IP for a given ISMI

The HLR Implemented in Asterisk

Asterisk already stores the minimum data set required for the HLR.
This information can be accessed through the Asterisk command line interface using a C function like popen() using this syntax:
asterisk -rx "<command>" 
Here's an example of popen() use:
FILE* result = popen("dialplan show 2003@sip-local","r");
if (!result) {
  // Handle error here.
}
// Now read and parse the result as if reading a file.
//...
// When done, close the stream.
pclose(result);

Resolving a numeric address to an IMSI

dburgess@pBook> sudo asterisk -rx "dialplan show 2003@sip-local" 
[ Context 'sip-local' created by 'pbx_config' ]
  '2003' =>        1. Dial(SIP/310410226242003)                  [pbx_config]

-= 1 extension (1 priority) in 1 context. =-

The extension was 2003, the IMSI is 310410226242003.

Resolving an IMSI to a numeric address

dburgess@pBook> sudo asterisk -rx "sip show user 310410226242003" 

** Name       : 310410226242003
  Secret       : <Not set>
  MD5Secret    : <Not set>
  Context      : sip-external
  Language     : 
  AMA flags    : Unknown
  Transfer mode: open
  MaxCallBR    : 384 kbps
  CallingPres  : Presentation Allowed, Not Screened
  Call limit   : 0
  Callgroup    : 
  Pickupgroup  : 
  Callerid     : "" <2003>
  ACL          : No
  Codec Order  : (gsm:20)
  Auto-Framing:  No 

Get the numeric address from the Callerid line.
Here, the IMSI is 310410226242003 and the numeric address is 2003.

Find the most recent BTS IP for an IMSI

dburgess@pBook> sudo asterisk -rx "database showkey SIP/Registry/310410226242003" 
/SIP/Registry/310410226242003    : 127.0.0.1:5062:3600:310410226242003:sip:310410226242003@127.0.0.1:5061;rinstance=6cc428b1f3f45ada

Here, IMSI 310410226242003 was most recently registered on port 5062 on localhost.

Insert a new ISDN/Address Pair

We will do this by modifying sip.conf and extensions.conf and then reloading them into Asterisk.
We should not do this more often than once every few minutes, though.

Update the recent BTS IP for a given IMSI

This is done by the BTS itself via the SIP interface during the registration process. That already works.

The HLR Implemented in MySQL

In the long run (after the Asterisk version works) the HLR will be implemented as a MySQL database table.
From this table, we construct the sip.conf and extensions.conf files for our Asterisk servers.

Asterisk Operations

Whenever a new subscriber is added or an E.164 field or IMSI is altered, the sip.conf and extensions.conf files need to be regenerated and reloaded for the serving Asterisk server. There must be a better way to do that.


MS Camping Conditions

The following are the cell requirements for normal MS cell camping (ref 1):

  1. The cell should be one of the selected PLMN.
  2. It should not be "barred". (This status is set by parameters CELL_BAR_ACCESS and CELL_BAR_QUALIFY, ref 2.)
  3. It should not be in an LA which is in the list of "forbidden" LAs for roaming.
  4. The radio path loss between MS and BTS must be below a threshold (ref 2) set by the PLMN operator. (This threshold is calculated from parameters obtained from the system broadcast.)
  5. It should not be a SoLSA exclusive cell to which MS does not subscribe. This requirement is only valid for MSs supporting SoLSA. (SoLSA is Support of Localized Service Area.)

Some Practical Advice on Getting a Test Handset to Camp to Your BTS

The handset's decision to camp to a BTS is made in the handset. The BTS can send signals that can encourage a handset to behave one way or another, but in the end the BTS cannot force a handset to camp,
only offer an attractive invitation.

The handset will camp to whatever network its SIM is programmed to prefer, which is usually the network of the operator that issued the SIM, followed by its roaming partners. (A locked phone is one that will only accept SIMs from the carrier that locked it.) The only way sure to get the MS to camp to your BTS automatically is to be the only BTS available. Here are four ways to do that:

  1. Use a single-band handset and be the only BTS in that band, or take a multi-band handset and disable the local bands. That's why, in North America, where all of the local GSM systems are 850 and 1900, we usually test in the 900 band and use handsets built or set to operate as 900-only. This works with Nokia DCT3s using field test mode. This works with Treo650's using the "network" menu. This probably works with most unlocked/unbranded multiband phones.
  2. Go somewhere where there is no GSM coverage in any band. That's why we test OpenBTS systems at Burning Man.
  3. Use a SIM from a carrier who has no roaming agreements with the carriers in your area and then use the network parameters that the SIM wants to see. For example, if you are outside of the UK, you might try Tesco SIMs, since Tesco has no roaming agreements outside the UK, and then advertise whatever MNC and MCC appear in the first 6 digits of the Tesco IMSI.
  4. Make or program your own SIM and then match your network parameters to it. I haven't tried this either, but it should work.

Note that we DO NOT RECOMMEND using the network parameters from your local network and relying on proximity to the test BTS to get a phone to camp to it. First, that is much less reliable than the options
listed above. Second, that risks interfering with your local cellular service. If you distract a phone from the real network while someone is making an emergency call, you can find yourself in jail, just to offer an example of the kind of thing that can go wrong. So mimicking AT&T/Voda/BT/whomever is a BAD IDEA.

More Comments (From a List Posting by Ken Erney)

Camping depends heavily on a number of factors. Once a handset has registered with a network, it usually is quite happy to stay there until something prompts a change. In most cases, if you are using an operator's SIM, say AT&T, the handset will stay on the current network until its current connection quality drops, it moves, or it sees another AT&T signal or another signal in the SIM cards preferred provider list. Your BTS then either needs to be broadcasting the same NMC/MCC (i.e. spoofing...which has legal implications) or you need your own SIM card in the handset that is configured with the MCC/MNC of your BTS.

The other way to accomplish this is to set your OpenBTS to use the 001 test code for MNC. Most phones will attempt to camp on this code if its the best signal around and its not happy on its own network. This
works best if you are in a zero-coverage area and you are sending out the 001 test code.

In the end, unless you use your own SIM cards and you have the phone configured to use your BTS, it won't just jump over to you if its happy where it is....and certainly for operator SIM cards, the phone will keep to its preferred provider list. You should also be aware that if the phone is SIM locked then you can't even put your own SIM card in the device as it will only work with the network that locked it (i.e. if you have an ATT phone and its been locked to only use the ATT network, then it won't work at all when you change the SIM card).

References

  1. 3GPP TS 03.22 V8.7.0
  2. 3GPP TS 05.08 v8.23.0

Mobile-Terminated Calls (MTC) in OpenBTS

The MTC is the most complex operation in the Stage 1 OpenBTS. The MTC is the transaction by which an incoming call is connected to a mobile handset. It is largely implemented in Control/CallControl, but with other parts in SIP/SIPInterface, Control/SDCCHDispatch and Control/FACCHDisptach.

Here is the transaction sequence for the MTC:

1. An INVITE arrives at the SIPInterface giving the GSM mobile ID (an IMSI) as the SIP user ID.
1. The SIPInterface (in SIPInterface::checkInvite) creates a call entry in the global transaction table and also initiates the paging process (via Pager::addID).
1. The Pager sends out the mobile ID of the called handset in Paging Request messages on the CCCH (Common Control Channel). The CCCH is a unicast channel monitored by all idle handsets in the cell.
1. The handset, upon seeing its ID in a paging request, starts sending channel requests on the RACH (Random Access Channel).
1. The RACH bursts are received and decoded in L1 and passed up to the AccessGrantController in Control/RadioResource. The RACH burst contains an 8-bit tag.
1. AccessGrantController allocates an SDCCH (Standalone Dedicated Control Channel) and sends a description of this channel, along with the associated 8-bit tag, in an Immediate Assignment message on the CCCH.
1. The handset, still monitoring the CCCH, sees its 8-bit tag in the immediate assignment and goes to the assigned channel.
1. The first message on the SDCCH is a Paging Response from the handset. This message is processed in the SDCCHDispatcher, which checks the indicated service type and passes the message along to the MTCStarter in Control/CallControl, via the PagingResponseHandler in Control/RadioResource.
1. The MTCStarter searches the transaction table for the entry created by the SIPInterface back in step 2.
1. MTCStarter initiates alerting (ie, makes the handset ring) and allocates a Traffic Channel (TCH) for the call.
1. The TCH assignment is sent to the handset in an Assignment Message. The transaction ID for this call is also put onto the TCH channel object as a tag.
1. The handset moves to the assigned channel and sends an Assignment Complete message on the FACCH.
1. The assignment complete message arrives in the FACCHDispatcher, which checks its tagged transaction ID in the transaction table and passes control to the MTCController, also in Control/CallControl.
1. The call setup proceeds in the MTCController.
1. Once the call is fully connected, control passes to the callManagementLoop, also in Control/CallControl.

If things go well, all of this will take 3-5 seconds.


Independent Network With Roaming to Standard GSM

Suppose you have an isolated area with no cellular coverage. You want to cover it with OpenBTS. Not far away there is a city covered by a standard GSM carrier. You want a phone that will work in both places with a single number. You do not expect to negotiate a settlement agreement or direct network integration with the incumbent GSM carrier.

  1. Get a GSM account and SIM from carrier in the city. This account will include an E.164 DID (a "telephone number").
  2. Get an account with a VoIP carrier, including another E.164 DID.
  3. Set the "Call Forwarding on Mobile Subscriber Not Reachable" on GSM account (from step 1) to point to your VoIP E.164 DID (from step 2).
  4. Program the SIM's IMSI into your OpenBTS Asterisk server.
  5. Set the network preferences on the GSM phone to favor your OpenBTS system.

Now,

  • When you take the phone to the city you will get service from the standard GSM carrier.
  • When you are around your OpenBTS system, you will get service from that and calls to your "city" number will get forwarded to your VoIP account and from there to your OpenBTS Asterisk server. To the outside world you appear to have a single number, the number from the GSM account assigned in step 1.

Also, if you are really cheap, you can just get a single E.164 DID in step 2 to be shared by all subscribers through a set of extensions in you OpenBTS Asterisk server, but this will make dialing non-standard for inbound callers.


GSM Network Architecture from www.gsmfordummies.com

A GSM network is made up of multiple components and interfaces that facilitate sending and receiving of signalling and traffic messages. It is a collection of transceivers, controllers, switches, routers, and registers.

A Public Land Mobile Network (PLMN) is a network that is owned and operated by one GSM service provider or administration, which includes all of the components and equipment as described below. For example, all of the equipment and network resources that is owned and operated by Cingular is considered a PLMN.

Mobile Station (MS)
The Mobile Station (MS) is made up of two components:

Mobile Equipment (ME) This refers to the physical phone itself. The phone must be able to operate on a GSM network. Older phones operated on a single band only. Newer phones are dual-band, triple-band, and even quad-band capable. A quad-band phone has the technical capability to operate on any GSM network worldwide.

Each phone is uniquely identified by the International Mobile Equipment Identity (IMEI) number. This number is burned into the phone by the manufacturer. The IMEI can usually be found by removing the battery of the phone and reading the panel in the battery well.

It is possible to change the IMEI on a phone to reflect a different IMEI. This is known as IMEI spoofing or IMEI cloning. This is usually done on stolen phones. The average user does not have the technical ability to change a phone's IMEI.

Subscriber Identity Module (SIM) - The SIM is a small smart card that is inserted into the phone and carries information specific to the subscriber, such as IMSI, TMSI, Ki (used for encryption), Service Provider Name (SPN), and Local Area Identity (LAI). The SIM can also store phone numbers (MSISDN) dialed and received, the Kc (used for encryption), phone books, and data for other applications. A SIM card can be removed from one phone, inserted into another GSM capable phone and the subscriber will get the same service as always.

Eadch SIM card is protected by a 4-digit Personal Identification Number (PIN). In order to unlock a card, the user must enter the PIN. If a PIN is entered incorrectly three times in a row, the card blocks itself and can not be used. It can only be unblocked with an 8-digit Personal Unblocking Key (PUK), which is also stored on the SIM card.

Base Transceiver Station (BTS)

Base Transceiver Station (BTS) - The BTS is the Mobile Station's access point to the network. It is responsible for carrying out radio communications between the network and the MS. It handles speech encoding, encryption, multiplexing (TDMA), and modulation/demodulation of the radio signals. It is also capable of frequency hopping. A BTS will have between 1 and 16 Transceivers (TRX), depending on the geography and user demand of an area. Each TRX represents one ARFCN.

One BTS usually covers a single 120 degree sector of an area. Usually a tower with 3 BTSs will accomodate all 360 degrees around the tower. However, depending on geography and user demand of an area, a cell may be divided up into one or two sectors, or a cell may be serviced by several BTSs with redundant sector coverage.

A BTS is assigned a Cell Identity. The cell identity is 16-bit number (double octet) that identifies that cell in a particular Location Area. The cell identity is part of the Cell Global Identification (CGI), which is discussed in the section about the Visitor Location Register (VLR).


120 ° Sector

The interface between the MS and the BTS is known as the Um Interface or the Air Interface.


Um Interface

Base Station Controller (BSC)

Base Station Controller (BSC) - The BSC controls multiple BTSs. It handles allocation of radio channels, frequency administration, power and signal measurements from the MS, and handovers from one BTS to another (if both BTSs are controlled by the same BSC). A BSC also functions as a "funneler". It reduces the number of connections to the Mobile Switching Center (MSC) and allows for higher capacity connections to the MSC.

A BSC my be collocated with a BTS or it may be geographically separate. It may even be collocated with the Mobile Switching Center (MSC).


Base Station Controller

The interface between the BTS and the BSC is known as the Abis Interface


Abis Interface

The Base Transceiver Station (BTS) and the Base Station Controller (BSC) together make up the Base Station System (BSS).


Base Station System

Mobile Switching Center (MSC)

Mobile Switching Center (MSC) - The MSC is the heart of the GSM netowrk. It handles call routing, call setup, and basic switching functions. An MSC handles multiple BSCs and also interfaces with other MSC's and registers. It also handles iner-BSC handoffs as well as coordinates with other MSC's for inter-MSC handoffs.


Mobile Switching Center

The interface between the BSC and the MSC is known as the A Interface


A Interface

Gateway Mobile Switching Center (GMSC)

There is another important type of MSC, called a Gateway Mobile Switching Center (GMSC). The GMSC functions as a gateway between two networks. If a mobile subscriber wants to place a call to a regular landline, then the call would have to go through a GMSC in order to switch to the Public Switched Telephone Network (PSTN).


Gateway Mobile Switching Center

For example, if a subscriber on the Cingular network wants to call a subscriber on a T-Mobile network, the call would have to go through a GMSC.


Connections Between Two Networks

The interface between two Mobile Switching Centers (MSC) is called the E Interface


E Interface

Home Location Register (HLR)

Home Location Register (HLR) - The HLR is a large database that permanently stores data about subscribers. The HLR maintains subscriber-specific information such as the MSISDN, IMSI, current location of the MS, roaming restrictions, and subscriber supplemental feautures. There is logically only one HLR in any given network, but generally speaking each network has multiple physical HLRs spread out across its network.

Visitor Location Register (VLR)

Visitor Location Register (VLR) - The VLR is a database that contains a subset of the information located on the HLR. It contains similar information as the HLR, but only for subscribers currently in its Location Area. There is a VLR for every Location Area. The VLR reduces the overall number of queries to the HLR and thus reduces network traffic. VLRs are often identified by the Location Area Code (LAC) for the area they service.


Visitor Location Register

Location Area Code (LAC)

A LAC is a fixed-length code (two octets) that identifies a location area within the network. Each Location Area is serviced by a VLR, so we can think of a Location Area Code (LAC) being assigned to a VLR.

Location Area Identity (LAI)
An LAI is a globally uniqe number that identifies the country, network provider, and LAC of any given Location Area, which coincides with a VLR. It is composed of the Mobile Country Code (MCC), the Mobile Network Code (MNC), and the Location Area Code (LAC). The MCC and the MNC are the same numbers used when forming the IMSI.


Location Area Identity (LAI)

Cell Global Identification (CGI)
The CGI is a number that uniquely identifies a specific cell within its location area, network, and country. The CGI is composed of the MCC, MNC, LAI, and Cell Identity (CI)


Cell Global Identity

The VLR also has one other very important function: the assignment of a Temporary Mobile Subscriber Identity (TMSI). TMSIs are assigned by the VLR to a MS as it comes into its Location Area. TMSIs are unique to a VLR. TMSIs are only allocated when in cipher mode.

The interface between the MSC and the VLR is known as the B Interface and the interface between the VLR and the HLR is known as the D Interface. The interface between two VLRs is called the G Interface


B and D Interfaces

Equipment Identity Register (EIR)

Equipment Identity Register (EIR) - The EIR is a database that keeps tracks of handsets on the network using the IMEI. There is only one EIR per network. It is composed of three lists. The white list, the gray list, and the black list.

The black list is a list if IMEIs that are to be denied service by the network for some reason. Reasons include the IMEI being listed as stolen or clonedor if the handset is malfunctioning or doesnt have the technical capabilities to operate on the network.

The gray list is a list of IMEIs that are to be monitored for suspicous activity. This could include handsets that are behaving oddly or not performing as the network expects it to.

The white list is an unpopulated list. That means if an IMEI is not on the black list or on the gray list, then it is considered good and is "on the white list".

The interface between the MSC and the EIR is called the F Interface.


Equipment Identity Register

Authentication Center (Auc)

Authentication Center (AuC) - The AuC handles the authentication and encryption tasks for the network. The Auc stores the Ki for each IMSI on the network. It also generates cryptovariables such as the RAND, SRES, and Kc. Although it is not required, the Auc is normally physically collocated with the HLR.


Authentication Center

There is one last interface that we haven't discussed. The interface between the HLR and a GMSC is called the C Interface. You will see it in the full network diagram below.This completes the introduction to the network architecture of a GSM network. Below you will find a network diagram with all of the components as well as the names of all of the interfaces.


Full GSM Network


Nokia DCT-3 Test Phones and OpenBTS

Field test mode

DCT-3 is the software release used in Nokia's 3rd generation handsets, most of which were marketed in the period 1998-2003. These models are particularly useful for BTS development because they all support Nokia's field test mode.

|| model || bands || field test enabling ||
|| 2100 || || ||
|| 3210 || || ||
|| "3310":http://en.wikipedia.org/wiki/Nokia_3310 || 900 1800 || serial ||
|| 3315 || || ||
|| 3330 || || ||
|| 3350 || || ||
|| 3390 || || ||
|| 3395 || || ||
|| 3410 || || ||
|| 3610 || || ||
|| 3810 || || ||
|| "5110":http://en.wikipedia.org/wiki/Nokia_5110 || 900 || serial ||
|| 5130 || || ||
|| "5190":http://en.wikipedia.org/wiki/Nokia_5190 || 1900 || serial? ||
|| 5210 || || ||
|| 5510 || || ||
|| 6110 || 900 || serial ||
|| 6130 || || ||
|| 6138 || || ||
|| 6150 || || ||
|| 6190 || 1900 || serial? ||
|| 6210 || || ||
|| 6250 || || ||
|| 7110 || || ||
|| 7190 || 1900 || keypad ||
|| 8210 || || ||
|| 8250 || || ||
|| "8290":http://en.wikipedia.org/wiki/Nokia_8290 || 1900 || keypad ||
|| 8810 || || ||
|| 8850 || || ||
|| 8855 || || ||
|| 8890 || 900 1900 || IR ||
|| 9110 || || ||

(Please update this page with your own experiences.)

The most important screen in field test mode is screen "01":
<pre>
01

 ARF RSI PCC
  S TT Q MMM
  C1   C2
    CHAN
</pre>
These fields mean:
* ARF: current ARFCN.
* RSI: RSSI in dBm, 3-digit values are negative.
* PCC: power control command (when transmitting), *not* a dBm value (GSM 05.05 4.1).  Larger values generally mean *less* transmitted power.
**** In low bands (850, 900), "5" means maximum power, usually 1 W.
**** In low bands (850, 900), "19" means minimum power, 5 mW.
* S: current timeslot, 0..7.
* TT: timing advance, in symbol periods.  Can also be used as a rough estimate of MS-BTS distance, TT*550 meters.
* Q: link quality score, 0-7, 0 is best.
* MMM: radio link timeout counter.  Link is dead when/if it reaches zero.
* C1: path loss criterium (GSM 03.22 3.6, GSM 05.08 6.4).
* C2: cell reselection criterium (GSM 03.22 3.6, GSM 05.08 6.4).
* CHAN: current channel type.  Here are a few mode common codes:
**** AGCH: access grant channel (requesting service)
**** BCCH: broadcast control channel (acquiring BTS)
**** CCCH: common control channel ("camped")
**** SDCCH: standalone dedicated control channel (control transactions)
**** FA: full rate FACCH, signaling only mode (control transactions)
**** TFR: full rate TCH+FACCH, full rate speech codec (speech call)
**** TEFR: full rate TCH+FACCH, enhanced full rate speech codec (speech call)
**** F144: 14.4 kbit/sec circuit-switched data (data call)

An excellent document covering field test mode/net monitor for Nokia phones is available "| here ":http://www.mwiacek.com/gsm/netmon/faq_net6.htm#42
A description of the test is available "| here ":http://www.mwiacek.com/gsm/netmon/faq_net2.htm#12

h2. LAPDm tracelog

With the appropriate MBUS serial cable, DCT-3 phones can also log the LAPDm signaling they send and receive. "Gammu":http://cihar.com/gammu/ is used to create the traces, which can then be displayed by "Wireshark":http://www.wireshark.org/ 1.1.2 or later. This procedure is detailed "here":https://svn.berlin.ccc.de/projects/airprobe/wiki/tracelog, but briefly:

* Install gammu
* Run gammu-config
* Get a copy of _nhm5_587.txt_ from the gammu tarball (gammu/depend/nokia/dct3trac)
* Run:
<pre>
gammu --nokiadebug nhm5_587.txt v20-25,v18-19
wireshark out.xml
</pre>

h2. Field Mode Enable Software

Logo Express 3.1b did the work in Nokia 6110 with a serial cable http://www.geocities.com/wolfitdown/download.htm


OpenBTS Plans and Milestones

This information is somewhat out of date. More accurate information will be put into the Trac milestones. When that is sufficiently complete, this page will be removed.

Our current development goals are:
  • Build a system that can be used in an alpha deployment in the developing world.
  • Release a complete GPL GSM stack for VoIP telephony and IP-based text messaging.
We plan to achieve these goals in stages with a functional milestone at the end of each stage.
  • Stage 1: Complete missing parts of GPL release under an improved architecture. DONE as of 10 November 2008. This was the 1.x release series. Release 1.6 was the last in this series.
  • Stage 2: Robust control and SMS. This is the minimum system to offer reliable SMS in a confined space. In progress. This is the current 2.x release series. The current release is 2.5.
  • Stage 3: Improved receiver and analog RF paths. Capacity expansion, multiple ARFCNs, HR/AMR vocoders. This work has started.
  • Stage 4: More range, more features, lower OPEX. Additional tasks fall into two classes:
    • Performance and efficiency improvements.
    • Carrier features.

OpenBTS Execution Loads and Profile

Running r10019:
  • with partial optimization in L1 and the transceiver
  • with debug messages turned on in L2 and L3

Loads on a 2.33 GHz core 2 duo Apple MacBook Pro are:

num active lines OpenBTS transceiver Asterisk total
0 0.5% 33% 0% 34%
1 3.3% 37% 1% 41%
2 6.0% 40% 1% 47%
3 7.8% 44% 1.1% 52%
4 11% 46% 1.4% 58%

These loads are percentages of a single core, so a fully loaded system is 200% on this scale.

  • The transceiver is the GMSK radiomodem and the interface to the radio hardware.
  • The OpenBTS application is everything from the L1 TMDA up to the SIP interface.
  • Asterisk runs most of the L3 functions and the transcoders.

In the transceiver, most of this load is in the demodulator. In the OpenBTS application, roughly half of this load is in L1 FEC decoding, with the rest spread around in other components.

These load figures do not include the vocoders, since these are GSM-to-GSM calls and no transcoding is required in the BTS. (The BTS is just forming a conduit for GSM vocoder frames.)

I don't have 7 test phones handy at the moment, but using a simple linear projection, the full-load computational requirement is:

num active lines OpenBTS transceiver Asterisk total
7 19% 56% 2.5% 76%

... or the equivalent of a single 1.8 GHz core.


Please, write down your own findings on how to tackle with this inceadibly huge specification. Estecially, where newcomer should start from.

Reading L1 specs

Your notes here

Reading L2 specs

The primary document for L2 is GSM 04.06, but that document assumes prior knowledge of HDLC.

Reading L3 specs

Most of L3 specification is contained in Technocal Specification (TS) 04.08.

But to understand message format descriptions you must read Section 11 and Annex B of TS 04.07, where required notation is introduced.


OpenBTS Releases

Releases are numbered and named. The release series 1.x, 2.x, etc. are based on the stages defined in OpenBTSPlan. Numeric sequences are chronological within each release series, but not across series. Names are taken from small towns in Louisiana and are chronological alphabetical, ignoring name prefixes like "Saint" and "New".

Stage 1 Basic Speech
Number Name Release Date YYYY-MM-DD GNU Radio SVN Site New Features Bugs Fixed
1.0 (none) 2008-11-09 pre-GNU obsolete completed L1, L2
1.1 Arnaudville 2008-11-20 r10019 obsolete MTC timeout
1.2 Breaux Bridge 2008-11-?? r10088 ? GNU FTP GNU build, VEA (#316) #321 #327 #329
1.3 Carencro 2009-12-?? N/A obsolete first injunction release
1.4 Donaldsonville 2009-12-?? N/A obsolete fixed Ubuntu build errors
1.5 Eunice 2008-12-22 N/A obsolete moved "abort" calls into L3 subclasses fixed L2 bugs
1.6 New Iberia 2009-02-28 r11641 sf.net import of 2.2 improvements to non-SMS release
Stage 2 Text Messaging
Number Name Release Date YYYY-MM-DD GNU Radio SVN Site New Features Bugs Fixed
2.0 St. Francisville 2009-01-09 N/A obsolete SMS, config file
2.1 Grand Coteau 2009-03-?? N/A obsolete DTMF Linux stack overflow
2.2 Houma 2009-03-10 N/A obsolete LEGAL notice several threading and clocking errors in the transceiver
2.3 Jean Lafitte 2009-04-22 N/A obsolete CLI, logging, emergency calls better TRX-stack clock sync
2.4 Kinder 2009-06-18 r11656 sf.net neighbor lists non-Asterisk SIP bugs
2.4.1 Kinder 2009-10-21 r11657 sf.net several bugs cleaned up with valgrind
2.5 Lacassine 2009-11-30 r11664 sf.net smqueue SMS server GNU Radio 3.2 compatibility
2.5.1 Lacassine 2009-12-02 TBD sf.net
2.6 Mamou TBD TBD TBD limited RRLP, improved CLI config management, congestion management DCT-4+ early assignment, timing advance bugs

OpenBTS RF Development Plans

These are our ideas for future RF development. If you are working on the RF task, feel free to edit and comment in this document.

Bear in mind that this device may not need FCC certification in its intended deployments.

Transmit Chain

USRP -> tx filter -> PA -> duplexer -> cables and antenna

  • The tx fitler provides suppression for out-of-band noise and is matched a standard GSM downlink band. The current candidate design is a stripline interdigital filter or low-cost cavity resonator (see below).
  • The PA is TBD, but will likely be similar to the Downeast PA3340 ([http://www.downeastmicrowave.com/PDF/3340pa.PDF]). Just get a good UHF module and let it do its job.
  • The duplexer proposal is a 2-cavity 1/4-wave design built from paint cans, coffee cans or large-diameter copper pipe. We're not joking here. We don't want a $4k hunk of precision machine work in the middle of a "low-cost" system.

Receive Chain

antenna and cables -> duplexer -> rx filter -> preamps -> USRP

  • The preamps need to provide at least 20 dB of gain to overcome noise inside the USRP. They need to be cheap, too. And they need enough headroom to overcome head-far problems. Even though GSM support active uplink power control, we do not want to be entirely reliant on it. The good news is that with the antenna up on a tower, there's a limit to how close handsets can be.
  • The rx filter is similar to the tx filter above, but passes the uplink band. In this side of the radio, though, insertion loss and a efficiency are more important.

USRP Changes

We are planning to build a new radio board based on the USRP, but specifically tailored for GSM applications.
Right now, OpenBTS uses a USRP with two RFX daughter cards. For actual deployment, it would be better to have a single board that combines all of these features:
  • a USRP-compatible control section, modeled on the USRP motherboard
  • two RFX-style receive sections with better RF isolation
  • one RFX-stype receive section
  • an OCXO running at a multiple of 13 MHz
  • on-board GSM-specific filters, either SAW or ceramic
    This board would still be software-compatible with the USRP, allowing developers to continue to use USRP-based kits for desktop testing.

Ticket #334 tracks the status of this work.

Other Details

Antenna

For omni cells, we can probably get a lot of service from marine cellular band antennas, built to be installed on boats and yachts. They are tough, efficient and only about $100 each. For sectorized installations, there are a number of panel style antennas on the market that should be suitable, including inexpensive designs built for the US 900 MHz ISM band.

Connectors

We only want two connector types in our RF system: SMA for low power and N for high power.


Setting Up Asterisk to Work with OpenBTS

OpenBTS integration with Asterisk is simple in principle: each SIM is configured in Asterisk as a SIP user, using the IMSI as the SIP user name.
So provisioning an OpenBTS subscriber has two steps:
1. Get the IMSI from the SIM.
1. Make the corresponding entries in sip.conf and extensions.conf to support the new SIP user.

Getting the IMSIs

There are several ways to get the IMSI for a SIM so that it can be programmed into Asterisk's configuration files. Which one you use will depend on the volume of SIMs you need to provision.

Getting the IMSI with OpenBTS Itself

This is the easiest approach for small numbers of SIMs.
Whenever a handset tries to register with OpenBTS, it will send a mobile identity. You can force the handset to use the IMSI as its identity and then capture the IMSI from the OpenBTS console output when the handset tries to register. Here are the steps: * Be in the correct GSM band. Be sure the handset is configured to use the same band as you OpenBTS binary, and no other. * Reset the handset's TMSI. This procedure is derived from GSM 04.08. Turn off the handset. Remove the battery and SIM. Replace them and turn the phone back on. This will clear any TMSI stored in the phone. * Let the phone try to register. ** For releases prior to "Jean Lafitte": Start running the full OpenBTS (OpenBTS + transceiver + Asterisk). Pipe out output of the OpenBTS binary through "| grep Control" and watch for something like this:
FACCHDispatch.cpp:53 ControlLayer FACCHDispatcher waiting for ESTABLISH RadioResource.cpp:87 ControlLayer AccessGrantResponder RA=27 when=0:7734
RadioResource.cpp:127 ControlLayer AccessGrantResponder sending PageMode=(0)  DedicatedModeOrTBF=(TMA=0 Downlink=0 DMOrTBF=0) ChannelDescription=(typeAndOffset=SDCCH/4-3 TN=0 TSC=0 ARFCN=29) RequestReference=(RA=27 T1'=5 T2=12 T3=33) TimingAdvance=0
SDCCHDispatch.cpp:101 ControlLayer SDCCHDispatcher got MM Location Updating Request MobileIdentity=(IMSI=310410186585294)
MobilityManagement.cpp:111 ControlLayer LocationUpdatingController MM Location Updating Request MobileIdentity=(IMSI=310410186585294)
MobilityManagement.cpp:121 ControlLayer LocationUpdatingController waiting for registration
MobilityManagement.cpp:137 ControlLayer LocationUpdatingController : SIPRegistration -> FAIL
SDCCHDispatch.cpp:136 ControlLayer SDCCHDisptacher waiting for RELEASE
SDCCHDispatch.cpp:97 ControlLayer SDCCHDisptacher waiting for ESTABLISH
** For "Jean Lafitte" and later: Start OpenBTS and Asterisk with the OpenBTS logging level set to "INFO" and watch for something like this in the log:
RadioResource.cpp:152: AccessGrantResponder RA=0x15 when=0:1192710 age=25 TOA=0.0000
RadioResource.cpp:196: AccessGrantResponder sending PageMode=(0) DedicatedModeOrTBF=(TMA=0 Downlink=0 DMOrTBF=0) ChannelDescription=(typeAndOffset=SDCCH/4-0 TN=0 TSC=0 ARFCN=975) RequestReference=(RA=21 T1'=3 T2=12 T3=24) TimingAdvance=0
MobilityManagement.cpp:119: LocationUpdatingController MM Location Updating Request  LAI=(MCC=901 MNC=55 LAC=0x29b) MobileIdentity=(TMSI=0x49ffcddd)
MobilityManagement.cpp:172: LocationUpdatingController registration FAIL: IMSI=234100223456161
* In either version, the SIP registration attempt will return "FAIL" because this IMSI is not yet provisioned in Asterisk.

If you're really clever, you'll write some kind of Python script to catch the log output and automatically update the Asterisk configuration files.  If you do that, please share your scripts with the rest of us.  That would make this technique applicable to very large numbers of SIMs in situations where acceptance rules can be applied based on the upper digits of the IMSI.

h3. Use the GSM "AT" Interface

Many GSM devices support a Hayes-style "AT" command interface, defined in GSM 07.07.  This interface supports the "AT+CIMI" command, described in GSM 07.07 Section 5.6, which will return the IMSI of the device's installed SIM.
This is a good approach if you have a device that affords easy SIM changes, like a "MultiTech GSM modem":http://www.multitech.com/PRODUCTS/Families/MultiModemGPRS/ and need to provision a few dozen subscribers.

Again, if you're really clever you'll write a script to automate that.  And if you're a good person you'll share it with the rest of us.

h3. Order Lots of SIMs

If you need even larger numbers of SIMs provisioned you might consider ordering a batch of them with sequential IMSIs that can be easily programmed into Asterisk with a script.

h2. Programming IMSIs Into Asterisk

To provision an IMSI into Asterisk you will need to modify two files: sip.conf and extensions.conf.  These files are normally located in /etc/asterisk.

h3. Creating a SIP User in sip.conf

The minimal entry for the IMSI in sip.conf looks like this:
<pre>
r310410186585294
canreinvite=no
type=friend
allow=gsm
context=sip-external
host=dynamic
</pre>
This defines a SIP user called "310410186585294".

h3. Assigning an Address in extensions.conf

We recommend this macro for dialing OpenBTS users:
<pre>
[macro-dialGSM]
exten => s,1,Dial(SIP/${ARG1})
exten => s,2,Goto(s-${DIALSTATUS},1)
exten => s-CANCEL,1,Hangup
exten => s-NOANSWER,1,Hangup
exten => s-BUSY,1,Busy(30)
exten => s-CONGESTION,1,Congestion(30)
exten => s-CHANUNAVAIL,1,playback(ss-noservice)
exten => s-CANCEL,1,Hangup
</pre>
(And if any Asterisk expert has improvements to that, please feel free to submit them.)

With that macro in place, the GSM handset can be assigned an extension just like any other Asterisk terminal device.
For example, this macro assigns extension "2103" to the handset with ISMI "310410186585291":
<pre>
;; the name in the brackets is the context, it should be the same with the context line in sip.conf
[sip-external]
exten => 2103,1,Macro(dialGSM,310410186585291)
</pre>
And this macro allows a specific block of 1,000 AT&T SIMs (310410186585000-310410186585999) to be dialed by the last 4 digits of the IMSI:
<pre>
exten => _5XXX,1,Macro(dialGSM,310410186585${EXTEN:-3})
</pre>


We have evaluated OpenBTS 2.5 (trunk) with FreeSWITCH 1.0.4. There are a few things to consider to get the setup running:

OpenBTS acts as a SIP client that registers into FreeSWITCH. You need to change OpenBTS.Config to match the IP address of your internal or external default profiles. If you use the external profile make sure that the port number is 5080 and not 5060. FreeSWITCH needs to be have a profile that accepts the registration without requesting authentication. If you try to register OpenBTS with FreeSWITCH, you want to make sure that 401 (Unauthorized) or 407 (Proxy Authentication Required) are not requested.

OpenBTS has a very minimal SIP stack, so make sure that FreeSWITCH accepts the registration blindly.

One alternative is to use IP CIDR to ensure that only OpenBTS is accepted. Create a new entry in the directory to allow local registrations (registrations that come from the very same server) blindly

 <include>
  <user id="31041464646464646" cidr="192.168.46.15/24">
    <params>
      <param name="vm-password" value="461000"/>

 <param name="accept-blind-reg" value="true"/>
 <param name="accept-blind-auth" value="true"/>

    </params>
    <variables>
      <variable name="toll_allow" value="domestic,international,local"/>
      <variable name="accountcode" value="31041464646464646"/>
      <variable name="user_context" value="default"/>
      <variable name="effective_caller_id_name" value="Extension 461000"/>
      <variable name="effective_caller_id_number" value="461000"/>
      <variable name="outbound_caller_id_name" value="$${outbound_caller_name}"/>
      <variable name="outbound_caller_id_number" value="$${outbound_caller_id}"/>
      <variable name="callgroup" value="techsupport"/>
    </variables>
   </user>
 </include>

Another issue that you need to consider is the codec, the current implementation of OpenBTS supports GSM. Make sure that your profile accepts GSM as default codec. If your audio sounds like dropping dozen of wine glasses against the floor, it might the case that FreeSWITCH is sending PCMU audio to the phone. Not good! :) There is a bug around (20090917) that should be fixed soon in trunk.

The third issue to deal with is DTMF detection. OpenBTS provides DTFM to FreeSWITCH as INFO SIP Messages. DTMF are sent to FreeSWITCH as Signal=Number {0-12} where 11 is * and 12 is #. FreeSWITCH expects the * and # as Signal=* and not Signal=11. There is a bug around (20090917) that should be fixed soon in trunk that relates to multiple DTMFs in a single call. The CSeq field in the SIP Message needs to increments per DTMF or the DTMF are not properly detected by FreeSWITCH (in fact, it will only detect the first one!).

If you are working with OpenBTS and FS drop me a line, check for my address in http://www.it46.se/contact


Smqueue is an RFC-3428 store and forward server, used to support SMS in OpenBTS installations. Smqueue runs alongside Asterisk to provide SMS routing service. Smqueue is distributed with OpenBTS releases 2.5 and later. It uses parts of the OpenBTS source code, but has very different build dependencies and may be run on a different machine than the one used to run OpenBTS. Because of these different build and installation requirements, smqueue is not part of the normal GNU build process for the rest of the OpenBTS application.

To build smqueue, go to the smqueue directory and type "make -f Makefile.standalone". That's it. You do not have to run the OpenBTS configure script to do this. If you get build errors, it is probably due to having an out-of-date osip2 installation. You need osip2 release 3.3 or later.

As of release 2.5, smqueue uses the Asterisk SIP registry for address resolution and message routing. Therefore smqueue must be run as root and must run on the same machine as your Asterisk server.

The original version of smqueue was written by John Gilmore and used for the experimental SMS system at Burning Man 2009.


SMS Handling in OpenBTS

The OpenBTS application implements SMS delivery over the air interface. It does not, on its own, provide any mechanism for store and forward handling of text messages. This document describes the proper SMS interface for OpenBTS and the "smqueue" application that will provides the store and forward function. Smqueue is not intended to be a complete SMSC, but does serve the purpose of an SMSC in OpenBTS networks.

SMS Interface to OpenBTS

The SMS interface to the OpenBTS application is SIP/SIMPLE page-mode messaging, as described in RFC-3428. This interface forms a functional mapping between SIP/SIMPLE and SMS layer 4, the relay layer (RL), described in GSM 04.11. The layer 5 PDU, the transport PDU (TPDU), should handled opaquely, although in the first iteration of the system the message payload is handled as an ASCII string. (The SMS TPDU, is described in GSM 03.40 Section 9.2.) Where are the layers?
1. In the Transceiver and GSM/GSML1FEC.cpp
1. In GSM/GSML2LAPDm.cpp
1. In Control/SMSControl.cpp
1. This is the SIP layer.
1. This is the TPDU layer.

SMS Delivery to the MS

To deliver a text message to the MS through OpenBTS, smqueue sends to OpenBTS a SIP MESSAGE request addressed to the destination user's IMSI and containing the message string. OpenBTS will attempt to deliver the message as the payload of an RP-DATA message, as described in GSM 04.11 Section 6. If delivery is successful, as determined by the receipt of an RP-ACK message from the MS, OpenBTS will respond with 200 OK. If delivery fails with an RP-ERROR message from the handset, OpenBTS will respond with a corresponding SIP error response. However, the most common delivery failure will be when the handset does not respond to paging, in which case OpenBTS will not produce any response at all.

SMS Submission from the MS

When an MS sends a text message though OpenBTS, it will do so by sending the message string as the payload in an RP-DATA message, as per GSM 04.11. OpenBTS will decode the SIP headers to determine the destination address of the message. OpenBTS will then submit a SIP MESSAGE request to smqueue, addressed to the E.164 address of the destination user and containing the message string. Smqueue responds with 202 Accepted, which OpenBTS then relays to the MS as an RP-ACK message.

Operation Inside smqueue

Needs to be completed.

Implementing Additional Features and Interfaces

Messages with destination ISDN addresses to not corresponding to known IMSIs in the HLR are set aside for special handling.

Delivery Reports

A full SMS implementation would include delivery reports to the original sender of a message reporting the final success or failure of a message. Such reports would be generated whenever a subscribed-originated message is deleted from the messages table.

SIP-Based Messaging Relays

We need handling for non-numeric SIP destinations. Another candidate for a short code function.

E-Mail Relays

GSM 03.40 Section 3.8 describes internetworking between SMS and internet electronic mail at the transport layer.
Smqueue should support this feature.

Short Codes

A short code is a destination ISDN address inside the SMSC that corresponds to a special function that acts on the message content. A well-known example of a short code is the 40404 address through which North American cellular subscribers can submit messages to Twitter.

The smqueue application can implement short code functions by registering those functions in a map (associative array) indexed by short code. Each short code function takes two arguments, the message string and the IMSI of the sender.

As of release 2.5, smqueue implements the following short code applications in smcommands.cpp:

  • shortcode_four_one_one: Return queue status assigned number and the IMSI of the requesting handset.
  • shortcode_zap_queued: Remove a message from the queue, by its tag.
  • shortcode_register: Register the user's phone with the HLR (autoprovisioning).
  • whiplash_quit: Seekrit SMS message to make the server quit for valgrind leak checking.
  • shortcode_debug_dump
  • shortcode_quick_chk

Interfacing to Standard SMSCs

Messages addressed to normal E.164 addresses not in the HLR should be sent to an outside SMSC for delivery through standard GSM mechanisms. Smqueue will also (eventually) need to interface to standard SMSCs to accept incoming SMS from standard GSM sources. Both types of interfacing should be possible with Kannel.

Useful documents:

OpenBTS Support

While OpenBTS is much simpler than a conventional GSM system, it is admittedly more complex to install and configure than a typical desktop application. If you don't have a working knowledge of GSM, Unix, and VoIP, all at the same time, you might have problems getting your system to work. Help is available.

For Free

(A lot of this comes from the GNU Radio GettingHelp wiki page.)

Free support for OpenBTS is available from this wiki and through the public mailing list openbts-discuss (at) sourceforge.net. You can subscribe at https://lists.sourceforge.net/lists/listinfo/openbts-discuss.
Please read the wiki carefully and search the list archives before posting.
If you ask a question from the FAQ or documentation on the mailing list, it will probably be ignored.

Your problem might be that you need to learn more about the things that OpenBTS uses, rather than an issue with OpenBTS itself. If it turns out that you have a general question about C++, Unix, Asterisk, the USRP or some other technology, please consider asking your question in a forum dedicated to the engineering discipline that you need help with. If your question is specifically about OpenBTS, GSM, or closely related concepts, discuss-openbts is probably the best forum you can ask, but try to answer your question using the GSM specifications themselves and the Web first.

I've done everything above, and I still have a question. How do I ask it?

You're most likely to get a helpful response on the mailing list if you ask nicely and provide enough information for us to diagnose the problem. Read and understand How To Ask Questions The Smart Way. At the very least, we need to know:
  • What release of OpenBTS are you running?
  • What error messages did you get, if any?
  • How did the behavior of your code differ from what you expected?
  • What was at the end of the OpenBTS log, at least at the INFO level?
  • What handset models are you using?
  • What is your operating band?
  • What operating system are you using? (Linux, BSD, Mac OS X, or other? Which distribution? Which version? 32- or 64-bit?)
  • What specific kind of computer are you running OpenBTS on? (Which CPU architecture? Single-processor or SMP?)
  • If you're using an USRP, what daugherboard(s) are you using?
  • What analog hardware (antennas, amplifiers, filters, etc.) is connected to the inputs and outputs of your radio?

How should I format my message?

How To Ask Questions The Smart Way has excellent guidance on this question. The following are the most commonly violated principles. These rules might differ from what you're used to at work or at school, particularly if your organization uses Outlook or PDAs. They are conventions that Unix users and Usenet have followed since at least the 1980s, and your messages are more likely to be answered if you follow them.

  • Don't send large attachments to the list. The servers have limited bandwidth. If you need to show some big files, put them on a Web- or FTP-server.
  • Don't send entire python scripts or block source files in your message. If you have a short, relevant snippet of code you can include it inline, but please include long blocks of code or entire source files as an attachment; or even better, post them to a public web or FTP site.
  • Don't send HTML email. Many users use text-based email readers, and it is therefore considered bad practice to use HTML formatting on mailing lists. Aggressive formating like colours will most likely get lost.
  • Don't top-post. It makes following the discussion in longer threads difficult.
  • Trim your replies. When replying to a message, remove content that is not relevant to your reply, such as signatures and questions that you don't answer.
  • Don't reply to other unrelated messages to create a new topic/thread. This creates confusion with threaded mail readers. Create a new message.
  • Conversely, when replying to a message in an existing thread, use your email program's Reply feature rather than composing a new message with the same subject. Threaded mail readers rely on the In-Reply-To header, which will be preserved by your Reply button/menu but will not be there if you create a new message.
  • If your message includes Web links to particular posts or threads on discuss-gnuradio, also include the subject lines of the posts that you're referring to. Try to link to the official gnu.org archive rather than sites like ruby-forums.org or Nabble - those site are likely to randomly disappear or change URL paths, thus making your link meaningless.
  • If you intend to participate in discussions on discuss-gnuradio, please be subscribed to the list using the format option that sends individual messages for each incoming message, not the daily digest format. Reply to individual messages, not to the digest. Send mail to the list from a real email address that you can receive replies at, not using a Web tool like ruby-forums.org.

Sharing your Solution

If you could solve your problem, it would be more than welcome if you share it with others. Just post a closing message with your solutions. This has multiple benefits:
  • It helps others who have the same problem to find the right solution.
  • It shows all helpers that their help had some positive result and thus increases motivation to help again.
  • It gives additional information about the structure of your problems, which can be useful in other cases

I asked a question and I haven't gotten an answer yet. What can I do?

Often the reason the question has not been answered is that it appears as if the questioner has not followed the suggestions on this page. By following the suggestions on this page, you will increase your chances of getting an answer.

Questions often don't receive an answer until days after they were posted. While you are waiting, please continue to work on your problem yourself; mail the list if you find a solution. Don't re-post the same question to the list and don't ask it directly to someone whose email address you got from the list. Please remember that participants offer support through the discussion list as a courtesy, not an obligation. They have their own problems to work on most of the time.

One big difference between open source and proprietary software is that in the open source world, people will ignore your problems for free. But if you are in a hurry or have a commercial project dependent on OpenBTS, you should consider actually paying someone for their time instead of just depending on the kindness of strangers. Income from paid support is part of what makes this project possible.

Kestrel Signal Processing

Kestrel Signal Processing, Inc., the commercial home of OpenBTS, provides the following services:

  • Installation and configuration support.
  • Customizations, new features and ports to new platforms.
  • Training and workshops.
  • Embedded computer boards with OpenBTS pre-installed.
  • USRP hardware modified to better support OpenBTS.
  • Licenses other than GPLv3.

For more information, contact dburgess (at) kestrelsp.com. Kestrel can also provide customizations of OpenBTS under licenses other than GPL. When contacting Kestrel through e-mail, please be sure to put "openbts" (all lowercase) in the subject line. Please do not contact Kestrel directly seeking free support.

Note that GNU/FSF does not endorse Kestrel, but the simple fact is that they maintain the project and wrote most of the source code.

Others

You may also find developers available for contract-based support on the openbts-discuss mailing list. These developers may be able to provide many of the services listed above, with the exception of non-GPL licensing. (And if you are such a developer, feel free to put your contact information on this wiki page.)


Where to download The Standard

You can download PDF version of standards from ETSI web site. The best way I found to do this is using ETSI Standards Search:
1. Open ETSI Standards Search page in your browser.
1. Enter standard number, e.g. "04.08" in "Search for" field. Make sure that "exact expression" is selected in the radio-box on the right and all check-boxes are unchecked. You may also wish to select "All on 1 page". Then press "Search" button.
1. Search for the latest standard available. Latest GSM standards belong to so called "Phase 2+" and their name starts with "Digital cellular telecommunications system (Phase 2+)" and usually have several revisions (aka versions). Usually latest version is 7.xx.xx.
1. Click "Download" on right-up to the standard name.
1. If you haven't registered, register your e-mail (it's free!), and then you'll need to just enter your e-mail and click "Submit" - you'll be forwarded to reqested standard download page.

If you prefer MS Word files, you can get them from (in Zipped form) from 3GPP site: http://www.3gpp.org/ftp/Specs/archive/ Archives are named like xxyy-abc.zip for the standard XX.YY with version A.B.C. E.g. for 04.07 version 7.3.0: http://www.3gpp.org/ftp/Specs/archive/04_series/04.07/0407-730.zip
Detaied information on the version history, etc can be obtained at these pages: http://www.3gpp.org/ftp/Specs/html-info/
E.g. page for 04.07 is at http://www.3gpp.org/ftp/Specs/html-info/0407.htm

Especially useful (but huuuge) page is this: http://www.3gpp.org/ftp/Specs/html-info/SpecReleaseMatrix.htm Here you can find full list of standards with their revision history.

Note: It seems that 3GPP downloads offer more recent versions for some parts of the standard. E.g. latest version of 04.08, available from ETSI is v7.7.1, while 3GPP offers v7.21.0 (see here)


OpenBTS The use of autocreatepeer=yes

There seem to be ready to go solution for autoregistration available within Asterisk. Just add "autocreatepeer=yes" to the general part with some extra lines to /etc/asterisk/sip.conf and it is working ok! See http://www.voip-info.org/wiki/page_history.php?page_id=685
for the Asterisk developer who earn the credits for adding this option to Asterisk.

[general]

allowoverlap=no ; Disable overlap dialing support. (Default is yes)

bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)

bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)

srvlookup=yes ; Enable DNS SRV lookups on outbound calls

; lines for automatic sim registration

autocreatepeer=yes

canreinvite=no

call-limit=1

type=friend

allow=gsm

context=sip-internal

host=127.0.0.1 ; the assumption is that OpenBts and Asterisk bth run on the same machine

This [general] part is from a working system. Originally the autocreatepeer=yes is mend for the scenario where a dedicated registrar like kamailio/openser is in front of Asterisk and Asterisk can accept any request for registring a peer because the authentication already took place. In combination with the hotdesk routine I added to the wiki this is actually working great.

Be aware of the fact that the context "sip-internal" has to be part of your dialplan or you have to adjust this line in sip.conf so the
context fits with an available extension in the dialplan. Using this option without further authentication with number and pincode before
calling out introduces a great security risk. I guess you don't want people freely to register to your OpenBTS network and have the
permission to make outbound calls s be carefull. Context sip-internal should offer only the permission to log in. I hope this is helpfull

Be aware of the legal framework you have to comply to. What is explained might not be allowed in your country. Don't end up in jail or spending vacation money on penalties!

\Erik


Time Division Multiple Access (TDMA) from www.gsmfordummies.com

Introduction

GSM uses Time Division Multiple Acces (TDMA) as its access scheme. This is how the MS interfaces with the network. TDMA is the protocol used on the Air (Um) Link. GSM uses Gaussian Minimum-Shift Keying (GMSK) as its modulation methos.

Time Division means that the frequency is divided up into blocks of time and only certain logical channels are transmitted at certain times. Logical channels will be introduced in the next lesson.The time divisions in TDMA are known as Time Slots.

Time Slots

A frequency is divided up into 8 time slots, numbered 0 to 7.


Time Slots

On a side note, also remember that GSM carrier frequencies are separated by 200kHz and that GSM operates in duplex. A channel number assigned to a pair of frequencies, one uplink and one downlink, is known as an Absolute Radio Frequency Channel Number (ARFCN). For a review of the ARFCN go to the Introduction to GSM Tutorial.

Each time slot lasts 576.9 µs. A time slot is the basic radio resource used to facilitate communication between the MS and the BTS.


Time Slot Duration

Data Rates

As stated earlier, GSM uses Gaussian Minimum-Shift Keying (GMSK) as its modulation method. GMSK provides a modulation rate of 270.833 kilobits per second (kb/s).

At that rate, a maximum of 156.25 bits can be transmitted in each time slot (576.9 µs).

Math:

270.833 kb/s × 1000 = 270,833 bits/sec    (Converting from kilobits to bits)
270,833 b/sec ÷ 1,000,000 = .207833 b/µs (Calculating bits per miscrosecond)
.207833 b/µs × 576.9 µs = 156.25 bits (Calculating number of bits per time slot)
So, 156.25 bits can be transmitted in a single time slot


Bits per Time Slot

Data Burst

The data transmitted during a single time slot is known as a burst. Each burst allows 8.25 bits for guard time within a time slot. This is to prevent bursts from overlapping and interfering with transmissions in other time slots. Subtracting this from the 156.25 bits, there are 148 bits usable for each burst.

There are four main types of bursts in TDMA:

Normal Burst (NB)
Frequency Correction Burst (FB)
Synchronization Burst (SB)
Access Burst (AB)

Normal Burst

The data transmitted during a single time slot is known as a burst. Each burst allows 8.25 bits for guard time. This is to prevent bursts from overlapping and interfering with transmissions in other time slots.

Out of 156.25, this leaves 148 bits usable for each burst.

Here is the structure of a normal burst:


Burst

Tail Bits - Each burst leaves 3 bits on each end in which no data is transmitted. This is designed to compensate for the time it takes for the power to rise up to its peak during a transmission. The bits at the end compensate for the powering down at the end of the transmission.

Data Bits - There are two data payloads of 57 bits each.

Stealing Flags - Indicates whether the burst is being used for voice/data (set to "0") or if the burst is being "stolen" by the FACCH to be used for singalling (set to "1"). *The FACCH is discussed in the Logical Channels Tutorial

Training Sequence - The training sequence bits are used to overcome multi-path fading and propagation effects through a method called equalization.

*Note: 3GPP TS 45.001 Standard does not describe stealing bits, and instead allows for two 58-bit data payloads in a burst. However, it is common practice in GSM networks to use 57-bit payloads and stealing bits.

This diagram illustrates a single burst inside a time slot. Remember that 8.25 bits are not used in order to allow for a guard time.


Burst within a Time Slot

Since each burst has two 57-bit data segments, we can see that a single burst has a data payload of 114 bits.

Frequency Correction Burst

This burst is used for frequency synchronization of the mobile station. It is an unmodulated carrier that shifts in frequency. It has the same guard time as a normal bit (8.25 bits). The broadcast of the FB usually occurs on the logical channel FCCH.
*The FCCH is discussed in the Logical Channels Tutorial


Frequency Correction Burst

Synchronization Burst

This burst is used for time synchronization of the mobile. The data payload carries the TDMA Frame Number (FN) and the Base Station Identity Code (BSIC). It is broadcast with the frequency correction burst. The Synchronization Burst is broadcast on the Synchronization Channel (SCH).
*The SCH is discussed in the Logical Channels Tutorial


Synchronization Burst

Access Burst

This burst is used the by mobile station for random access. It has a much longer guard period (68.25 bits compared to the 8.25 bits in a normal burst). It is designed to compensate for the unknown distance of the mobile station from the tower, when the MS wants access to a new BTS, it will not know the correct Timing Advance.
*The RACH is discussed in the Logical Channels Tutorial


Access Burst

Calculating the Data Throughput

Since each burst has two 57-bit data segments, we can see that a single burst has a data payload of 114 bits.

Each burst lasts 576.9 µs, so we can calculate the theoretical bit rate of a single time slot:

114 bits ÷ 576.9 µs = .1976 bits/µs    (Calculating bits per µs)
.1976 bits/µs × 1,000,000 = 197,607 bits/sec nbsp; (Converting µs to sec)

Since there are 8 time slots per carrier frequency, each time slot would only get 1/8 of this bit rate, so...

197,607 bits ÷ 8 = 24,700 bits    (Calculating bit rate for one of eight time slots.)
24,700 bits ÷ 1000 = 24.7 kbits/sec (Converting bits to kilobits)

So, using GMSK modulation there is a maximum bit rate of 24.7 kb/s for a single time slot. Note that this bit rate does not account for any error correction bits. Any bits used for error correction would have to be stolen from the 114-bit data payload of each burst.

TDMA Frame Structure & Hierarchy

TDMA Frame
Each sequence of 8 time slots is known as a TDMA frame. The duration of a TDMA frame is 4.615 milliseconds (ms) (576.9 µs × 8).
  • Remember that a TDMA frame is 8 time slots and that no one resource will be given an entire TDMA frame, the resources must share them.


A TDMA Frame

Multiframe
A Multiframe is composed of multiple TDMA frames.

There are two types of multiframes:

Control Channel Multiframes
Traffic Channel Multiframes

*Control Channels and Traffic Channels are explained in Logical Channels Tutorial.

Control Channel Multiframe
composed of 51 TDMA frames
duration = 235.4 ms


Control Channel Multiframe

Traffic Channel Multiframe
composed of 26 TDMA frames
duration = 120 ms


Traffic Channel Multiframe

Here is a diagram comparing the Control Channel multiframe and a traffic channel multiframe.


Traffic Channel and Control Channel Multiframes

The next diagram shows a Traffic Channel (TCH) Multiframe with TS2 (green) being allocated to a Mobile Station (MS). The red arrow indicates the sequence of transmission. The sequence starts in TDMA frame 0 at TS0, proceeds through all eight time slots, then starts again with TDMA frame 1.

In this example, the MS has been allocated a Traffic Channel in TS2. Therefore the MS will only transmit/receive during TS2 of each TDMA frame.


Single Time Slot Allocated

Superframe

A Superframe is composed of multiple Multiframes.

Again, there is a superframe for Control Channels and one for Traffic Channels.

Control Channel Superframe
composed of 26 Control Channel (CCH) multiframes (each CCH multiframe has 51 TDMA frames)
duration = 6.12 seconds

Traffic Channel Superframe
composed of 51 Traffic Channel (TCH) multiframes (each TCH) multiframe has 26 TDMA frames)
duration = 6.12 seconds

Each superframe, whether it is a CCH or TCH frame, consists of 1326 TDMA frames (51 * 26)
*Note: The CCH and TCH frame sequences will synchronize every superframe.

Hyperframe
A hyperframe is composed of 2048 superframes.
duration = 3h 28m 53s 76ms (12,533.76 seconds)
consists of 2,715,548 TDMA frames

Each TDMA frame is numbered according to its sequence within the hyperframe, starting from 0 and ending at 2,715,547.

The TDMA frame number within a hyperframe is abbreviated FN. The FN is one of the variables used in GSM encryption algorithms.

The following diagram shows the relationship between all of the various time segments introduced in this tutorial.


Relationship of All Time Segments


OpenGL Graphical Components

According to Ticket #91, the current way of displaying the graphical sinks (oscope, fft, waterfall, etc) are all done in Python without the use of C++ wxWidgets. There is apparently already an OpenGL version of the waterfall scope as Ticket #86 explains. It might be worth while to investigate getting all of these components to be written and optimized for OpenGL.


BBN 802.11

BBN has written 802.11 code under funding from DARPA.

After GNU Radio is installed, build it using bootstrap/configure/make install to the same prefix.

This has been tested on NetBSD, and reported to work on Linux.

The following has been reported working

  • ? Mb/s transmit and receive without Barker code
  • 1 Mb/s receive with the Barker code

Those experimenting with the code should be familiar with both GNU Radio and 802.11; this is not a good area for beginners.

MRFM

The UW Quantum System Engineering Laboratory has written code for Magnetic Resonance Force Microscopy (MRFM) under funding from the Army Research Office. The code, with explanation and instructions, is available here.

Some of the code might be useful to other GNU Radio users.
  • On the FPGA side, there is a 2-stage biquad filter with 24-bit (not 16-bit) data path and filter coefficients.
  • There is also an input multiplexer and adder.
  • On the host side, there is code (in Python with Scipy) that transforms transfer functions, expressed as ratios of polynomials with floating point coefficients, into cascaded biquad stages with scaled integer coefficients.
  • The host side code acts as a server, so it can communicate with the MRFM experiment software over TCP/IP sockets.
  • There is a sample client, also in Python with Scipy.

This is a page which users can use to let people know what sorts of things they are doing with GNU Radio and/or the USRP. We have divided the users into various groups.

Please feel free to add your organization to this list. Even better would be to create a simple page with links to your work, info about your project, and how GNU Radio and/or the USRP have made your work possible or easier.

To edit this page, you'll need to log in. If you don't have your own account, please use the "guest" account and its password. If you don't know the guest password, please send mail to [mailto:?subject="guest%20password" ].

Commercial Academic Government Research Institutions and other organizations Amateur Radio Individual

Wiki Page Templates

_(since 0.11

The default content for a new wiki page can be chosen from a list of page templates.

That list is made up from all the existing wiki pages having a name starting with PageTemplates/.
The initial content of a new page will simply be the content of the chosen template page, or a blank page if the special (blank page) entry is selected. When there's actually no wiki pages matching that prefix, the initial content will always be the blank page and the list selector will not be shown (i.e. this matches the behavior we had up to now).

To create a new template, simply create a new page having a name starting with PageTemplates/.

(Hint: one could even create a !PageTemplates/Template for facilitating the creation of new templates!)

Available templates:
TitleIndex(PageTemplates/)

----
See also: TracWiki


  • AD8342 - LF to 500MHz Active Receive Mixer
  • 10.7Mhz SAW Filter 180kHz Bandwidth p/n: SDECS10M7HA00-R0 (Digikey: 490-1224-1-ND)
  • PE4306 - 50 Ohm RF Digital Attenuator from Peregrine Semiconductors
  • GALI-74+ Monilithic Amplifier - IP3 +38dBm at 100MHz
  • AD9959 - 4 Channel 500 MSPS DDS with 10-bit DACs
  • AD9958 - 2 Channel 500 MSPS DDS with 10-bit DACs
  • [http://www.minicircuits.com/pdfs/SCA-4-10.pdf] 4-way 0-degree splitter/combiner

Date: Wed, 23 Jan 2008 12:25:20 -0800
From: Eric Blossom <eb@comsec.com>
Subject: Re: [Discuss-gnuradio] Enhancing Gnuradio Doxygen Generated Official Documentation
To: "Firas A." <firasmail2000@yahoo.com>
Cc: Discuss-gnuradio@gnu.org
Sender: discuss-gnuradio-bounces+eb=comsec.com@gnu.org

On Wed, Jan 23, 2008 at 11:42:50AM -0800, Firas A. wrote:
>
> Hi Eric,
>
> kindly, I have a question about the possibility to make the
> documentation changes to svn source files.
>

Firas (and everybody else!),

I'd prefer that you send us lots of relatively small changes, instead
of one big change in 15 days.  This allows one of the committers to
take a quick look at the patch and apply it.  Smaller patches take
less review from us, and are more likely to get applied right away.
This is the way we manage the software too.

Here's how to do it:

** check out the trunk
** edit the header file documentation or python doc strings, or whatever
** when you're happy with your changes send the output of

    $ svn diff

  to patch-gnuradio.

One of the committers will review the patch and if it looks good will
apply it to the trunk or will suggest changes.

Then you can update your copy of the trunk, and continue working.  To
pipeline this process, checkout a new copy of the trunk in a different
directory and start working on your second set of changes in there.
Then when you send the diff, it'll be for the new changes only.

After we've seen a series of good patches from you that apply cleanly,
and follow our conventions, we can talk about getting you write
access to the repo.

Thanks again for your commitment to improving GNU Radio!

Eric
Date: Wed, 23 Jan 2008 13:02:11 -0800
From: Johnathan Corgan <jcorgan@corganenterprises.com>
Subject: [Discuss-gnuradio] Patch submission guidelines
To: "discuss-gnuradio@gnu.org" <discuss-gnuradio@gnu.org>
Sender: discuss-gnuradio-bounces+eb=comsec.com@gnu.org

None of the below are mandatory, but are some conventions to follow to
help us more easily evaluate and apply a patch.  These are not just
for documentation patches, but for functionality as well:

* Patches are submitted in the form of a SVN created diff, not individual files.

* Diffs are made from the GNU Radio tree root, and are based on an SVN
check out of the GNU Radio trunk.

* The diff contains the minimal but related incremental changes, for
all the files needing modification to implement the change.  In other
words, the diff should take a working GNU Radio source tree and modify
it to become a working GNU Radio source tree with the feature
implemented.

* After applying the diff, the tests 'make check' and 'make distcheck'
must both pass.

* When relevant, QA code exists to automate unit testing of the new
functionality.

* There should be no additional compiler warnings to what already occurs.

* No gratuitous whitespace changes.

It does take time and practice to follow the above, so again, the
above aren't rules, but more of a "scoring system" that will improve
the chance of your contribution being accepted into the project.

Incidentally, these are the same criteria that we review before we
merge code from our developer branches into the trunk.

.


The Sony PlayStation 3 is the cheapest way to get access to a Cell Processor.

http://www.us.playstation.com/PS3/About


Building and Installing PortAudio on Windows

PortAudio (http://www.portaudio.com) provides a uniform programming interface to a variety of audio devices. For Windows users, it is a convenient way to get a working, full-duplex, soundcard interface for GNU Radio. Although PortAudio includes code to access Windows audio through DirectX, kernel streaming, ASIO, or WASAPI interfaces,
performance with the traditional Windows "wave" interface is satisfactory for most GNU Radio purposes. This version is easily built under Cygwin and MinGW/MSYS. (These instructions should also work for Linux systems, but need to be tested.)

Detailed Instructions

Download pa_snapshot.tgz from http://www.portaudio.com/download.html to /usr/src. Then:
$ cd /usr/src
$ tar -zxf pa_snapshot.tgz
$ cd portaudio
$ ./configure --disable-static
$ make
$ make install

PortAudio is installed under /usr/local/* by default.

Notes:

  • pa_snapshot.tgz appears to build and work well, but that could change any day; if necessary, you can use pa_stable_v19_061121.tar.gz, but on Cygwin you will need to run autoconf before doing ./configure
  • version pa_stable_v19_20071207 is available, but the installation procedure omits a required file (pa_win_waveformat) when using the default audio libraries for Windows
  • you can use a directory other than /usr/src if you prefer
  • to install PortAudio somewhere other than /usr/local use the --prefix= option on ./configure (but be sure that GNU Radio's ./configure can find it)
  • for more information on PortAudio see http://www.portaudio.com

Presentations

This page is meant to hold presentations on GNU Radio implementations and applications the people wish to make publicly available.


Hierarchical Quasi-Real-Time Scheduler

details of the new scheduler


Installing Fedora Core 6 on PlayStation 3

Follow the instructions at:
"Retyped here for convenience (and in case link ever goes away). I also removed the last few pages of information regarding starting the X Server. This takes too many resources, and we're only interested in getting it on the network and running GNU Radio, anyway.

You'll want to have a USB/RF keyboard attached to the PS3 at this point.

Installation Instructions

  • On your USB flash drive:
    • Create a directory named PS3
      • Create a subdirectory of PS3 called otheros
    • From PS3 add-on CD, copy /kboot/otheros.bld to flashdrive:/PS3/otheros
    • Copy otheros.self downloaded above to flashdrive:/PS3/otheros
  • Format your PS3's harddrive (this will erase all data on the entire drive)
    • There are four options for a 60 GB harddrive:
      1. All to PS3
      2. All to Other OS
      3. 10 GB to Other OS and rest to PS3
      4. 10 GB to PS3 and rest to Other OS
    • choose either option 2 or 4.
    • In the XMB menum, go to Settings --> System Settings --> Format Utility
      • Be sure to select Quick format (10 seconds) or you'll be waiting 3.5 hours.
  • Start loading the Other OS
    • Plug in the USB flashdrive
    • In XMB navigate to Settings --> System Settings --> Install Other OS
      • The console should automatically detect the necessary files on the flashdrive
      • Follow the prompts to install the bootloader onto the hard drive
  • Change default OS to Other OS
    • Settings --> System Settings --> Default System: change from PS3 to Other OS
  • Reboot the system.
  • At the kboot command prompt, enter: install-fc sda
  • Insert the Fedora 5/6 DVD when asked
    • Hit y on the keyboard and enter to begin the installation process
    • Select Full Installation
  • Wait... a while. The PS3 looks frozen for a bit, then it will start installing files. This process takes 4 - 5 hours.
  • When the DVD automatically ejects, insert the PS3 add-on CD when asked and hit yes
  • When the CD automatically ejects, enter the password when asked
  • Type reboot and hit enter
  • Start hacking

Installation of GNU Radio on FC6 on the PS3

  • Enable the development repositories for Yum
    • In /etc/yum.repos.d/ edit fedora-development.repo and enable all repositories by setting enabled to 1
    • In /etc/yum.repos.d/ edit fedora-extras-development.repo and enable all repositories by setting enabled to 1
      • I also had to use the baseurl instead of the default mirrorlist to resolve the packages
  • Install FFTW, CPPUNIT, USB, SDCC, guile, numpy, wxPython and SWIG
yum install fftw-devel cppunit-devel libusb-devel sdcc alsa-lib-devel guile numpy wxPython
tar xjf swig-1.3.31.tar.gz
cd swig-1.3.31
./configure && make && sudo make install
  • SDCC is installed in a slightly strange way here, so fix some of the links:
ln -s /usr/bin/sdcc-sdcc /usr/bin/sdcc
ln -s /usr/bin/sdcc-asx8051 /usr/bin/asx8051
ln -s /usr/bin/sdcc-sdcpp /usr/bin/sdcpp
ln -s /usr/bin/sdcc-aslink /usr/bin/aslink
  • Get the GNU Radio installation from Subversion and install it
svn co http://gnuradio.org/svn/gnuradio/trunk
cd trunk
./bootstrap
./configure
make
sudo make install
  • Set PYTHONPATH to point to the default /usr/local installation directory:
    • export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.4/site-packages/
    • Set this in you're login script ~/.bashrc to automatically load on login
  • Add USRP udev rule:

Audio

Audio is an unresolved issue. Success was reported with native PS3 sound on Yellow Dog but not on FC6 yet.

An investigation on the use of the Atlas/Janus/Ozy hardware from the HPSDR project is underway. This is an open source (GPL) and open hardware project (contributions are covered by the TAPR [http://tapr.org] Open Hardware License The combination of boards mentioned here are available from TAPR. They are quite inexpensive for this level of hardware. Taken together they provide a USB2 interface to a 200 kHz wide baseband IF system with a pulse width modulator and codec for microphone and speaker connections. Bill Tracey (kd5tfd@XXXXewjt.com) is a GnuRadio user, HPSDR contributor, has a PS3, and is working on using this interface under Linux for several DSP projects including [http://gnuradio.org/trac/wiki]. and DttSP "h1. Using GNU Radio

The normal flow graph control in Python is broken and we haven't found a fix for it yet. (fixed in [6212":http://groups.yahoo.com/group/dttsp-linux]) However, the new method of running the scheduler and flow graphs is to use hier_block2s. This will eventually become the standard way of handling the flow graphs when version 3.2 is released, which deprecate hier_block. The hier_block2 work in the PS3, although there are a few bugs and unresolved issues. Most basic items work, though.

To test a GNU Radio example, use the example code found in:

gnuradio-examples/python/hier

Specifically, to test that the USRP works, run:

cd gnuradio-examples/python/hier/usrp
./usrp_siggen.py -T <A|B> -f <frequency>

There are some unresolved issues with the hier_block2's, but this simple example runs fine.

Installing the IBM Cell SDK version 2.1

If you want to write code that takes advantage of the Cell SPE's,
you'll need the IBM SDK.
The SDK requires FC6.

* Download the SDK2.1 iso * Make sure you've got these prereqs installed:
yum install ed freeglut freeglut-devel libXmu-devel libXext-devel gcc make perl rsync flex byacc netpbm netpbm-devel mesa-libGL-devel mesa-libGLU-devel libX11-devel numactl numactl-devel
* Follow the instructions starting on page 13 of ""Software Development Kit 2.1 Installation Guide"":http://www-304.ibm.com/jct01004c/systems/support/supportsite.wss/docdisplay?brandind=5000008&lndocid=MIGR-65726 * When you're ready to install, do:
./cellsdk install --nosim --nokernel
./cellsdk build --gcc

Installing Fedora 7 and the IBM SDK 3.0 on PlayStation 3

These are the quick and dirty instructions. If these don't make sense, take a look
Installing Fedora Core 6 on the [[PlayStation 3]] for additional background.

You'll want to have a USB/RF keyboard attached to the PS3 at this point.

Installation Instructions

  • Update the firmware on your PS3 to the latest (2.00 as of the time this was written).
  • Format your PS3's harddrive (this will erase all data on the entire drive)
    • There are four options for a 60 GB harddrive:
      1. All to PS3
      2. All to Other OS
      3. 10 GB to Other OS and rest to PS3
      4. 10 GB to PS3 and rest to Other OS
    • choose either option 2 or 4.
    • In the XMB menum, go to Settings --> System Settings --> Format Utility
      • Be sure to select Quick format (10 seconds) or you'll be waiting 3.5 hours.
  • Install the Linux boot loader
    • Insert the CELL-Linux-CL_20071023-ADDON CD into the PS3
    • In XMB navigate to Settings --> System Settings --> Install Other OS
      • The console should automatically detect the necessary files on the CD
      • Follow the prompts to install the bootloader onto the hard drive
  • Change default OS to Other OS
    • Insert the FC-7-ppc DVD into the PS3. Then,
    • Settings --> System Settings --> Default System: change from PS3 to Other OS
    • If everything is working, you'll see a kboot prompt.
  • At the kboot command prompt, enter:
    • *cd //mnt/root/ppc/ppc64 * # Note two leading slashes
    • kexec -f --initrd=ramdisk.image.gz --command-line="video=720p" vmlinuz
  • Answer anaconda's questions
    • Select your keyboard and language preference
    • When it says it can't find your media
      • Press "Select Driver", and scroll down to !PlayStation 3 (ps3_storage)
    • When asked about partitioning, select custom partiotioning and create a ext3 partition as the / partition and then a swap.
      • LVM doesn't seem to work with the kernel and that is on the addon cd (at least 20071023)
      • The same applies also to ext2
    • When you get to the part about what packages to install, select only Software Development and Customize Later
  • Wait... a while. The PS3 looks frozen for a bit, then it will start installing files. This process takes 4 - 5 hours.
  • It will eventually eject the DVD, say that it's rebooting, and hang ;)
    • Press and hold the power button until it beeps the second time (about 7 seconds), then release
    • Press it again. It'll boot the new system.
  • Answer the first boot questions: set root passwd, create regular user, etc...
    • It will hang again on reboot, so hold power button again
* Install the updated kernel and goodies *** Insert the ADDON CD ** *cd /media/<don't remember>/target ** *rpm -ihv --force *.rpm *** Edit /etc/yaboot.conf so that it'll boot the new kernel
# yaboot.conf generated by anaconda

boot=/dev/sda
init-message=Welcome to Fedora!\nHit <TAB> for boot options

partition=1
timeout=80
install=/usr/lib/yaboot/yaboot
delay=10
enablecdboot
enableofboot
enablenetboot
nonvram
mntpoint=/boot/yaboot
usemount

image=/boot/vmlinux-2.6.23
        label=linux-23
        read-only
        initrd=/boot/initrd.img-2.6.23
        append="video=720p rhgb quiet root=LABEL=/1" 

image=/boot/vmlinuz-2.6.21-1.3194.fc7
        label=linux-21
        read-only
        initrd=/boot/initrd-2.6.21-1.3194.fc7.img
        append="video=720p rhgb quiet root=LABEL=/1" 
  • Reboot system (it'll hang the first time. Do the hold the button trick)
    • (the 2.6.23 kernel you just installed knows how to shutdown and reboot the PS3 properly)
  • Apply any updates (except kernel updates) that are available
  • To reduce memory consumption make the following changes:
    • edit /etc/inittab and change id:5:initdefault to id:3:initdefault (disables X-server and graphical login)
    • disable non-essential services. E.g., sendmail, cups, anything else you can live without.
  • Start hacking

Installation of GNU Radio on F7 on the PS3

  • Do NOT enable the development repositories for Yum
    • In /etc/yum.repos.d/ edit fedora-development.repo and enable all repositories by setting enabled to 0
    • In /etc/yum.repos.d/ edit fedora-extras-development.repo and enable all repositories by setting enabled to 0

These are the rawhide directories and are inconsistent with the use of SDK 3.0

  • Install prerequisites
$ sudo yum groupinstall "Development Tools" 
$ sudo yum install fftw-devel cppunit-devel libusb-devel guile boost-devel alsa-lib-devel numpy swig sdcc
  • SDCC is installed in a slightly strange way here, so fix some of the links:
Some of the names of the binaries in sdcc are very generic, and they have therefore been moved to /usr/libexec/sdcc on [http://www.fedoraproject.org Fedora":http://www.kernel.org/pub/linux/kernel/people/geoff/cell], and symlinks prefixed with sdcc- have been created in /usr/bin. This might be a problem for existing programs, but the solution is simply to add /usr/libexec/sdcc to your PATH before building GNU Radio:
$ export PATH=/usr/libexec/sdcc:$PATH
  • Get the GNU Radio installation from Subversion and install it
svn co http://gnuradio.org/svn/gnuradio/trunk
cd trunk
./bootstrap
./configure
make
sudo make install
  • Set PYTHONPATH to point to the default /usr/local installation directory:
    • export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.5/site-packages/
    • Set this in your login script ~/.bashrc to automatically load on login
  • Add USRP udev rule:

Using GNU Radio

FIXME update this

Installing the IBM Cell SDK version 3.0

Follow the download and installation instructions
here.

You'll need to create an IBM ID if you don't already have one.

Note, the IBM SDK contains both free and non-free software.
We're only using the free stuff, and it should be possible to get the free stuff
without agreeing to IBM's non-free licenses. Perhaps somebody with some time can sort this
out.

Hint: They install
this repo file
in /etc/yum.repos.d/cellsdk-Fedora.repo

I think all the free stuff is in the CellSDK-Open-Fedora-* repository at the Barcelona Supercomputing Center.


Fedora 8 can be installed on the PS3. It has improved kernels, libraries, compilers, and more.

It is compatible with the Cell SDK 3.0 and it is easy enough to install on the PS3.

IT MUST BE INSTALLED IN TEXT MODE AS FOLLOWS:

You'll want to have a USB/RF keyboard attached to the PS3 at this point.

Installation Instructions

  • Burn the ISO's to disc (do this for both files downloaded above)
    • In Linux: cdrecord --device=<cdwriter-device> -tao -eject <image-file.iso>
    • Or use whatever DVD/CD burning tool you prefer (k3b is nice under KDE)
  • Update the firmware on your PS3 to the latest (2.41 as of the time this was written).
  • Format your PS3's harddrive (this will erase all data on the entire drive)
    • There are four options for a 60 GB harddrive:
      1. All to PS3
      2. All to Other OS
      3. 10 GB to Other OS and rest to PS3
      4. 10 GB to PS3 and rest to Other OS
    • choose either option 2 or 4.
    • In the XMB menum, go to Settings --> System Settings --> Format Utility
      • Be sure to select Quick format (10 seconds) or you'll be waiting 3.5 hours.
  • Install the Linux boot loader
    • Insert the ADDON iso CD that you made into the PS3
    • In XMB navigate to Settings --> System Settings --> Install Other OS
      • The console should automatically detect the necessary files on the CD
      • Follow the prompts to install the bootloader onto the hard drive
  • Change default OS to Other OS
    • Insert the FC-8-ppc DVD into the PS3. Then,
    • Settings --> System Settings --> Default System: change from PS3 to Other OS
    • If everything is working, you'll see a kboot prompt.
  • At the kboot command prompt, enter:
    linux64 xdriver=fbdev video=720p install text
    • If video resolution 720p does not work please consult
    • "* Note that there are different options depending on where in the world you are located.
  • Answer anaconda's questions
    • When you get to the part about what packages to install, select only Software Development and Customize Later
    • Unlike FC 7, you can install the default partitions. They work perfectly.
  • Wait... a while. The PS3 looks frozen for a bit, then it will start installing files. This process takes 4 - 5 hours.
  • It will eventually eject the DVD, say that it's rebooting, and hang ;)
    • Press and hold the power button until it beeps the second time (about 7 seconds), then release
    • Press it again. It'll boot the new system.
  • Answer the first boot questions: set root passwd, create regular user, etc...
    • It will hang again on reboot, so hold power button again
  • After reboot do a yum update and the next kernel you get will reboot!
  • Reboot and ENJOY! You may now install SDK 3.0.
    • run sudo yum install compat-expat1
    • Beware. You will likely need to block the fedora repositories in /etc/yum.repos.d by changing all
    • enable=1 to enable=0 AFTER you have installed compat-expat1 to get the right libraries and utilities
    • for the Cell processor. Make sure that after the SDK is installed you enable the fedora and fedora-updates
    • repositories again.
  • In /etc/yum.conf place the line
    • exclude=blas blas-devel oprofile-debuginfo oprofile numactl numactl-devel
    • you may need to yum erase these files before you install the SDK
    • sudo yum erase blas blas-devel oprofile-debuginfo oprofile numactl numactl-devel
    • will do the trick. More detailed instructions for the SDK are below, almost a
    • complete walk through.
  • Develop PS3 apps!

Installation of GNU Radio on F8 on the PS3

Disable any rawhide repositories in the files /etc/yum.repo.d as they are inconsistent with the use of SDK 3.0

  • Install prerequisites
$ sudo yum groupinstall "Development Tools" 
$ sudo yum install fftw-devel cppunit-devel libusb-devel guile boost-devel alsa-lib-devel python-devel numpy swig sdcc gsl-devel pygsl
  • SDCC is installed in a slightly strange way here, so fix some of the links:
Some of the names of the binaries in sdcc are very generic, and they have therefore been moved to /usr/libexec/sdcc on Fedora, and symlinks prefixed with sdcc- have been created in /usr/bin. This might be a problem for existing programs, but the solution is simply to add /usr/libexec/sdcc to your PATH before building GNU Radio:
$ export PATH=/usr/libexec/sdcc:$PATH
  • Get the GNU Radio installation from Subversion and install it
svn co http://gnuradio.org/svn/gnuradio/trunk
cd trunk
./bootstrap
./configure
make
sudo make install
  • Set PYTHONPATH to point to the default /usr/local installation directory:
    • export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.5/site-packages/
    • Set this in your login script ~/.bashrc to automatically load on login
  • Add USRP udev rule:

Using GNU Radio

FIXME update this

Installing the IBM Cell SDK version 3.0 continued

To successfully install all the correct tools on Fedora 8 the following additions to the SDK installation instructions are needed:

sudo yum install compat-expat1 yum-fastestmirror yum-skip-broken

sudo yum erase oprofile oprofile-debuginfo blas blas-devel numactl numactl-devel

sudo vi /etc/yum.repos.d/fedora.repo

and change the enable=1 to enable=0

sudo vi /etc/yum.repos.d/fedora-updates.repo

and change the enable=1 to enable=0

Follow the download and installation instructions
here.

You'll need to create an IBM ID if you don't already have one.

Following the successful COMPLETION of the installation (sudo /opt/cell/cellsdk verify gives all the right answers) do the following:

sudo vi /etc/yum.conf
and add a line
exclude=blas blas-devel oprofile oprofile-debuginfo numactl numactl-devel

sudo vi /etc/yum.repos.d/fedora.repo

and change the enable=0 you did above back to enable=1

sudo vi /etc/yum.repos.d/fedora-updates.repo

and change the enable=0 you did above back to enable=1

run

sudo yum update

just to make sure it is now checking all of the following repositories
fedora, fedora-updates, cellsdk-open, cellsdk-fedora, and cellsdk-extras-fedora.

make sure that the ppu32-gcc compiler is in your PATH, otherwise:
export PATH=/opt/cell/toolchain/bin:$PATH

Note, the IBM SDK contains both free and non-free software.
We're only using the free stuff, and it should be possible to get the free stuff
without agreeing to IBM's non-free licenses. Perhaps somebody with some time can sort this
out.

Hint: They install
this repo file
in /etc/yum.repos.d/cellsdk-Fedora.repo

I think all the free stuff is in the CellSDK-Open-Fedora-* repository at the Barcelona Supercomputing Center.

Cross Compiling for the Cell

Now that you've got all the software installed and have discovered that compiling on the PS3
(or QS21 for that matter) takes nearly forever, please check out these instructions for CrossCompilingForCell.
It's how most of us do our actual Cell development.


Running Altera Quartus II Web Edition under Linux

To generate the firmware for the altera Cyclone FPGA on the usrp from the usrp verilog sourcecode you need Quartus II Web Edition version 5.1 or later.
Unfortunately this is not opensource, but there is a free download with from the altera website.

You also need to get a free license.

Download Quartus II Web edition

This is windows-only software.

At the time of this writing, version 5.1SP1 and version 6.0 seems to work fine for the usrp verilog code.
I don't think the 5.1SP1 version is still available for download (the 6.0SPx version is)
The files I downloaded and tested were:
quartusii_51_sp1_web_edition.exe
quartusii_60_sp1_web_edition.exe

There are several ways to run this software under linux.


Method 1 Quartus using Wine:

Install Wine version 0.9.19 or later (a recent cvs version will probably also work).
(Older versions do not work, believe me, I tried. I even tried cxoffice.)
Now make sure you set the emulated operating system to windows 98.
(run winecfg and set Applicatios\default settings Windows to windows98)
If you emulate windows 2000 it will not work.
The problem is mainly that the licensing copy protection crashes.
I have allways found it strange that you need to install a very invasive kernel_mode licensing/copyprotection tool to install software which is free to download with a license that is free and forever renewable.

If you want to get rid of any old wine settings and applications you can just move ~/.wine to something else and run winecfg. It will generate a clean .wine folder including default registry settings for you.

Now run the quartus installer.
make sure you select at least the quartus core component and the cyclone device, the tutorials are also probably handy.
All other devices are not needed for the usrp.

You don't really need the extra options you get when you select the talkback feature, so you can disable it.
If you want to do timing analysis and stuff you should keep it selected.
Quartus Ii 5.1SP1 should run to completion without any trouble.
It might hang on the last screen. If you nothing happens for a very long time you can savely kill it with CRTL-C in the console which started wine.

Now you need to get and install the (free) license.
You can request it on the altera website.

To request a license you need your NIC ID.
NIC ID
The NIC ID is a 12-character hexadecimal string embedded in the
network interface card that Altera uses to uniquely identify the PC where
the software is installed.

Wine should present your real NIC ID without alteration towine which will pas it to quartus.
(beware, this is not the case for all emulators)
There are multiple ways of getting this ID.
Linux: Type /sbin/ifconfig eth0 at a command prompt.
nldudok1@quarkdeb:/$ /sbin/ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:B0:D0:AB:CC:BA
          inet addr:192.168.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::213:ffff:aabb:ccdd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16137 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10640 errors:0 dropped:0 overruns:0 carrier:0
          collisions:2 txqueuelen:1000
          RX bytes:20428079 (19.4 MiB)  TX bytes:898048 (877.0 KiB)
          Interrupt:58 Base address:0xe400

NIC ID is the ID to the right of HWaddr, without the colons, e.g.,
00B0D0ABCCBA. To be sure wine sees exactly the same ID you can also use lmutil.exe which installed with quartus
Do the following.
/$ cd ~/.wine/drive_c/altera/quartusXXX/win/
~/.wine/drive_c/altera/quartusXXX/win$ wine lmutil.exe hostid
Invoking /usr/lib/wine/wine.bin lmutil.exe hostid ...
lmutil - Copyright (c) 1989-2003 by Macrovision Corporation. All rights reserved.
The FLEXlm host ID of this machine is ""00b0d0abccba 001122334455"" 
Only use ONE from the list of hostids.
Wine exited with a successful status

In this case only use the first number (00b0d0abccba in the example above)

Now you have the right NIC ID you can request a license on the altera website:
Go back to the quatus download page and click "Get Web Edition License"
Download Quartus and get web edition license
Fill out the form, including the NIC ID and a valid emailadres.
You should now get a licensefile by email.
Save the license file somewhere on you wine C-drive
for example:
~/.wine/drive_c/altera/

For any other licensing problems see the altera licensing document
Altera Software Licensing

Now it is time to start quartus.
/$ cd ~/.wine/drive_c/altera/quartusXXX/bin/
~/.wine/drive_c/altera/quartusXXX/bin$ wine quartus.exe

Quartus 6.0 will open with a few errors:
error:This program is for windows NT only.
Click on OK.
error:Quartus II is not fully registered, with a list of problems.
Click on OK.
Quartus 5.1SP will not have these errormessage.

message:Quartus II help will only work if you have installed Internet Explorer 4.0 or higher.
I haven't worked on this error yet. It might go away if you install the wine gecko fake IE or find a way to install a real IE.

Quartus should now start with a license options screen.
Choose, "I have a valid license"
And direct it to C:\altera\ (or wherever you put the file) and choose the license file.

You can allways change the license file and options with the Tools menu\License setup.
Here you will also see the NICID you entered earlier.

Now you are ready to compile the usrp verilog code to a usrp????.rbf file.
The easiest way is to open the usrp quartus project file
gnuradiosrcdir/usrp/fpga/toplevel/usrp_std/usrp_std.qpf

(Note with the default wine configuration you Z: drive is the same as /)

If you want you can now try to set back the default settings of wine to windows 2000 and only run quartus.exe and quartus_sh.exe as windows 98.
I have not tried this though.
For this you have to run winecfg again.


Method 2 Quartus using qemu

Warning Untested:

Install a recent Qemu.
Make a new virtual machine and install windows 98 or windows 2000 or windows XP.
Download Quartus II (see above)
Install Quartus within the virtual machine.

Request a license file using the NICID of you virtual machine
In you virtual windows do:
Type ipconfig /all at a commandprompt.
The NIC ID is the physical address without the dashes. If
your PC has more than one network card, you can use any of the
cards’ NIC IDs as long as the selected network card is always
connected to the computer.

Now you have the right NIC ID you can request a license on the altera website:
Go back to the quatus download page and click "Get Web Edition License"
Download Quartus and get web edition license
Fill out the form, including the NIC ID and a valid emailadres.
You should now get a licensefile by email.
Save the license file somewhere on you qemu virtual C-drive.
Run quartus II from the start menu and choose "have valid license"

You could also choose request a license now. (This should work within Qemu if you have networking setup and working)


Method 3: Quartus using VMware

Install some flavour of VMware.
Make a new virtual machine and install windows 2000 or windows XP.
Download Quartus II (see above)
Install Quartus within the virtual machine.

Request a license file using the NICID of you virtual machine
In you virtual windows do:
Type ipconfig /all at a commandprompt.
The NIC ID is the physical address without the dashes. If
your PC has more than one network card, you can use any of the
cards’ NIC IDs as long as the selected network card is always
connected to the computer.

Now you have the right NIC ID you can request a license on the altera website:
Go back to the quatus download page and click "Get Web Edition License"
Download Quartus and get web edition license
Fill out the form, including the NIC ID and a valid emailadres.
You should now get a licensefile by email.
Save the license file somewhere on you vmware virtual C-drive.
Run quartus II from the start menu and choose "have valid license"

You could also choose "request a license now". (This should work within VMware if you have networking setup and working)


I have used the VMware method for a long time now. It works, is stable and the speed is usable.

But I don't like having to install a complete windows inside my linux machine just to run one program.
The same disadvantage goes for Qemu. (although Qemu itself is a very nice opensource product which I can recommend to anyone.)

The wine method doesn't need any microsoft components.
It is less stable though and only works if you emulate windows 98, which is not supported anymore by quartus II 6.0 and later.
I had a few crashes already, but also succesfull compiles (both with version 5.1SP1 and 6.0SP1)

I hope this is of help to others trying to develop opensource verilog code but who are forced to running closed-source windows programs.

Martin


Release 3.0 is the first release with the new repository, new build system, new Wiki, etc.


Next bug fix release.


Bux fix release.


Bug fix release.


Next feature release. This release will contain:
  • A new implementation of hierarchical blocks, where hierarchical blocks are "first class objects".
  • "old style" hierarchical blocks will be deprecated in this release and will be removed in 3.2

New features:

First maintenance release for 3.2 series.


GNU Radio Release 3.0.x (Stable Branch)

Latest Official Release Tarballs

Latest Unofficial Release Tarballs

The BuildGuide has the instructions for compiling and installing GNU Radio on your system.

Browse Source Code Repository

source:/gnuradio/branches/releases/3.0

Releases tagged:

Release History

Changes in Release 3.0.4 since 3.0.3

  • Updated license to GPLv3 or newer (r6076, r6077)
  • Updated to latest config.guess, config.sub (r6073)
  • Fixec gr_crc32 header prototype (r6072)
  • Updated AUTHORS (r5181, r6071)
  • Fixed gain setting for BasicTX and LFTX in digital examples (r6070)
  • Fixed wfm_rcv_pll stereo operation (r6069)
  • Fixed incorrect itemsize in gr_kludge_copy (r6068)
  • Fixed USRP stop() ordering (r6067)
  • Fixed realtime priority calculation (r6066)
  • Fixed USB kernel memory issues (r6065)
  • Fixed USRP "disappearing" with Linux kernel 2.6.20 (r5182, #148)
  • Fixed autoconf update issue (r5180, #143)

Changes in Release 3.0.3 since 3.0.2

Bug Fixes:

  • Fixed false sync problem with digital packet code (r4641)
  • Fixed gr.firdes.band_reject tap calculation (r4077, #113)
  • Fixed initial value problem with gr_oscope_guts.cc (r4404, #104)
  • Fixed USB read failure for MSYS/Cygwin platform (r4405, #115)
  • Fixed Powermate import operation MSYS/Cygwin platform (r4406, #102)
  • Fixed shared memory leak on NetBSD (r4420)

Minor Enhancements:

  • Merged trunk (@4071) versions of dqpsk and dbpsk modulators (r4072)
  • Stuff zeros in head of FPGA Tx pipeline when Tx FIFO is empty (r4446)

Documentation:

  • Clarified/updated READMEs (r4024, r4028, r4408, r4410, r4421)
  • Doxygen documentation now covers whole tree (r4422, #4)

Build System:

  • Use autoconf discovered path for $PYTHON in build (r4415,r4416,r4419,r4423,r4599 #133)
  • Fixed python usage in build check (r4026)
  • Fixed Python installation path failure on FC5 and FC6 (r4630,r4643, #39)
  • Fixed PYTHONPATH portability for MSYS platform (r4076, #110)
  • Fixed MSYS/Cygwin portability issues (r4403,r4426 #117)
  • Removed non-portable make rules in build system (r4027, r4074, #107, #108)
  • Removed non-portable 'ln -s' usage in usrp (r4075, #109)
  • Fixed OS/X 'make check' failure (r4598, #140)
  • Use PORTAUDIO_CFLAGS in gr-audio-portaudio build (r4029)
  • Cleaned up build system linking macro usage (r4649)

Miscellaneous:

  • Remove extraneous includes in gr-video-sdl (r4073, #99)
  • Fixed compilation warning in usrper.cc (r4409)
  • Added QA test for gr.noise_source_f (r4412)
  • Removed obsolete bus_interface.v file (r4411)
  • Removed obsolete dbs_tx.py (r4413)

Changes in 3.0.2 since 3.0.1

  • Improve help on usrp_siggen.py (r3964)
  • Fix missing files in distribution tarball (r3965, r3966, #97, #98)

Changes in 3.0.1 since 3.0.1rc1

  • Clarify bug fix for #95 (r3942)
  • Fix undefined type for MinGW platform (r3956, #93)

Changes in 3.0.1rc1 since 3.0

  • Updated AUTHORS file (r3740, r3750)
  • Changed line ending style on config/*.m4 and configure.ac (r3751, r3776, r3929, r3931, #88)
  • Improved gr-video-sdl configuration error message (r3752, #84)
  • Fixed 'make clean' breakage in gr-trellis using BSD make (r3753, #87)
  • Fixed non-portable constructs in build (r3775, r3839, r3840)
  • Remove bashisms in build system (r3797, r3838)
  • Updated gr-how-to-write-a-block README (r3841)
  • Improved error message on size mismatch in fg.connect (r3849)
  • Eliminate compiler warnings (r3854)
  • Fix for systems missing include/linux/compiler.h (r3914)
  • Fixes for working with automake >= 1.10.0 (r3923, r3925, r3926, #92, #94)
  • Fix semaphore error handling for MinGW (r3937, #95)

GNU Radio Release 3.1.x (Release Branch)

Latest Official Release Tarballs

Latest Unofficial or Pre-Release Tarballs

(none)

The BuildGuide has the instructions for compiling and installing GNU Radio on your system.

Browse Source Code Repository

source:/gnuradio/branches/releases/3.1

Releases tagged:

Changes in release 3.1.3 from release 3.1.2

New Signal Processing Blocks

  • Added new block: gr.repeat (Johnathan Corgan) (r8263)
  • Added new block: gr.integrate_XX (Johnathan Corgan) (r8265)
  • Added new block: gr.cpfsk_bc(), continuous phase FSK modulator (Johnathan Corgan) (r8267)
  • Added new block: blks2.stream_to_vector_decimator (Johnathan Corgan) (r9127)
  • Added new block: blks2.logpwrfft_c,f (Johnathan Corgan) (r9128)
  • Added new block: gr.moving_average_XX (Matt Ettus) (r9134)

Other New Functionality

  • Added R1/2, K=7 convolutional encoder and viterbi decoder (Johnathan Corgan) (r8699)
  • Added new daughterboard support for dtt754 and dtt768 (Matt Ettus) (r9131)
  • Added missed gr_clip() from r7389 (Tom Rondeau) (r9141)
  • Added alternative integrate & dump to gr-gpio (Johnathan Corgan) (r9139, r9393)
  • Added CIC compensation filter tap calculator (Johnathan Corgan) (r8262)
  • Added gru.daemonize() for running apps as daemons (Johnathan Corgan) (r8266)
  • Added concurrent peak hold for fftsink2 (Johnathan Corgan) (r8333, r8336)
  • Added FFT sink control panel (Josh Blum) (r8707)
  • Added flowgraph dump method (Johnathan Corgan) (r8704)
  • Added random noise seed to channel model (Eric Blossom) (r8705)
  • Added 'omni_time' class to omnithreads (Eric Blossom) (r9107)
  • Added dynamic configuration to gr.costas_loop_cc (Johnathan Corgan) (r9135)
  • Allow odd decimation with halfband disabled (Firas Abbas) (r9136)
  • Added SSE test predicates in gr_cpu (Jason Coy)

Important Bug Fixes

  • Fixed dynamic reconfiguration failure (Johnathan Corgan) (#241, r8332)
  • Fixed gr.top_block start/stop behavior (Eric Blossom) (r9125)
  • Fixed C++ hierarchical blocks (Eric Blossom) (r9130)
  • Fixed gr.repeat() to actually work (Dean Armstrong) (r8706)
  • Updated for GCC 4.3 compatibility (Marek Mahut) (r8340, r8341)
  • Fixed signed/unsigned error in gr_fxpt_nco (Stefan Bruens, Phillip Ballister) (#258) (r9388)
  • Fixed compilation bug (log2) on Win32 (Don Ward) (#243) (r9391)

Other Bug Fixes

  • Fixed audio module list for Win32 (Bob McGwier) (#71, r8260)
  • Fixed endianness issue with wavefile source/sink (Tim Meehan) (#238, r8261)
  • Fixed gr.arg_max and gr.max_XX issue (Bob McGwier) (r8264)
  • Fixed race condition in fftsink2 (Josh Blum) (r8339)
  • Fixed busy wait in fusb_linux (Eric Blossom) (r8342)
  • Fixed potential invalid read in gr_complex_to_xxx (Dan Halperin) (r8343)
  • Fixed missing initialization in gr-atsc (Dan Halperin) (r8344)
  • Fixed invalid memcpy in gr-atsc (Dan Halperin) (r8345)
  • Fixed PATH modification in sdl.m4 (Don Ward) (r8346)
  • Fixed qa_wavefile.py make check failure (Don Ward) (r8346)
  • Fixed libusrp build in OSX 10.4 (Michael Dickens) (r8700)
  • Fixed channel model functions (Josh Blum) (r8701)
  • Fixed version requirement in gr-howto (Eric Blossom) (r8701)
  • Fixed obsolete import in usrp_flex.py (Eric Blossom) (r9108)
  • Fixed SDCC configuration error (Eric Blossom) (r9122)
  • Fixed algorithm URL in filterbank code (Bob McGwier) (r9126)
  • Fixed typo in gr_sync_interpolator (Dominik Auras) (#250) (r9129)
  • Fixed flowgraph QA failure (Martin Dvh) (r9386)

Miscellaneous Changes

  • Refactored FFT blocks (Eric Blossom) (r8329)
  • Distribute bootstrap script with tarballs (Eric Blossom) (r8703)
  • Allow use of libtool 2.2 or 1.5. Implements #249. (Don Ward) (r9106)
  • Improved SIMD code profiling output (Eric Blossom ) (r9123)
  • Renamed dot product benchmark (Eric Blossom) (r9124)
  • Updated comment in usrp.py (Eric Blossom) (r9140)
  • Cleaned up gr_flowgraph code (Johnathan Corgan ) (r9387)

Changes in Release 3.1.2 from Release 3.1.1

New features

  • Added AM BCB receive demo (Martin Dvh) (r7298)
  • Added mouse hover display to fftsink2 (Johnathan Corgan) (r7280,r7282,r7283)
  • Added 'double-click to recenter' to usrp_fft.py (Johnathan Corgan) (r7284)
  • Added 'ctrl-double-click moves max power to center' to usrp_fft.py (Johnathan Corgan) (r7287,r7288)
  • Added gr.peak_detector2 and branchless clipping (Tom Rondeau) (r7654)
  • Added SciPy based plotting utilities to gr-utils (Tom Rondeau) (r7655,r7656,r7657,r7996)
  • Added variable number of vertical ticks to fftsink2 (Matt Ettus) (r7803)
  • Changed usrp_fft.py to show 100dB dynamic range (Matt Ettus) (r7804)
  • Added gr.wavfile_source and gr.wavfile_sink blocks (Martin Braun) (r7805)
  • Added set of boolean operator blocks (Tim Meehan) (r7809)
  • Added gr-gpio: Streaming digital GPIO aligned with RF (Johnathan Corgan) (r7817)
  • Added reference scaling to fftsink2, calibrated usrp_fft.py for dBFS (Johnathan Corgan) (r7878,r7885)
  • Added --avg-alpha parameter to usrp_fft.py (Johnathan Corgan) (r7879)
  • Added --with-* build configuration implementation (Michael Dickens) (#186, r7946)

Bug fixes

  • Fixed missing library in gnuradio-omnithread.pc (Eric Blossom) (r7293)
  • Fixed VPATH build issue with USRP firmware (Eric Blossom) (r7658)
  • Fixed Debian package conflict with release 3.0 (Johnathan Corgan) (r7286)
  • Fixed fftsink2 center frequency display (Johnathan Corgan) (r7281)
  • Fixed firmware vector numbering (Michele Bavaro) (r7294)
  • Fixed 8-bit receive mode (Matt Ettus, Martin Dvh) (r7289,r7299)
  • Fixed include file specification for USRP for Darwin/OSX (Michael Dickens) (r7301)
  • Fixed std:min/max issue on Win32 (#145) (Don Ward) (r7296)
  • Fixed OSX 10.5 threading issues (Michael Dickens) (r7507)
  • Fixed weak-reference error in db code (Johnathan Corgan) (r7508,r7510)
  • Fixed UDP and PPIO handling in FreeBSD (Diane Bruce) (r7511)
  • Fixed exceptions turning into aborts issue (#181) (Johnathan Corgan) (r7512,r8099)
  • Fixed segfault in set_taps() (#227) (Don Ward) (r7513)
  • Fixed blks2.synthesis_filterbank wiring (Beezle Bub) (r7514)
  • Fixed noise floor issue in RFX daughterboards (Johnathan Corgan) (r7515,r7516)
  • Fixed NBFM filter constants in demos (Johnathan Corgan) (r7653)
  • Fixed abort in gr.top_block() (Johnathan Corgan) (r7659)
  • Fixed return value in gr.peak_detector (Tom Rondeau) (r7660)
  • Fixed waterfallsink2 display for wxGTK-2.8 (Tobias Gresch) (r7810)
  • Fixed waterfallsink2 display update on Win32 (Don Ward) (r7875)
  • Fixed some parameter checking in new flowgraph code (Dan Halperin) (r7811)
  • Fixed missing gr.sample_and_hold files in distribution (Dan Halperin) (r7876)
  • Fixed potential segfault in gr.test (Andrew Rose) (r7877)
  • Fixed VPATH build error with qa_wavfile.py (Michael Dickens) (r7880)
  • Fixed indeterminate parallel make (Eric Blossom) (#236, r7993,r8094)
  • Fixed missing flowgraph connection in fm_tx4.py (Johnathan Corgan) (#237, r7994)
  • Fixed incorrect FFT size compensation in fftsink2.py (Tim Meehan) (r7999)
  • Fixed Subversion configuration check (Greg Troxel) (r8052)
  • Fixed RANDOM_MAX definition (Greg Troxel) (r8053)
  • Fixed missing header file include (Jason Potterf) (#193, r8054)
  • Fixed missing symlink in Debian package (Johnathan Corgan) (r8055)
  • Fixed missing peak hold initialization in numbersink2 (Josh Blum) (r8098)
  • Fixed gr.udp_source,sink for Win32 (Don Ward) (#194, r8100)

Documentation updates

  • Updated top-level README with current information (Eric Blossom) (r7291)
  • Added Python docstrings to generated documentation (Firas Abbas) (r7509)
  • Updated numerous header file comments (Firas Abbas) (r7517)
  • Updated gr.hier_block2 documentation (Johnathan Corgan) (r7806,r7807)

Miscellaneous updates

  • Cleaned up omnithread header file (Eric Blossom) (r7300)
  • Cleaned up distribution tools (Eric Blossom) (r7285, r7290)
  • Removed unfinished filter blocks (Johnathan Corgan) (#165, r7874)
  • Reorganized C++/Python exception handling (Eric Blossom) (r7295)
  • Updated Ubuntu Gutsy helper script to use python-wxgtk2.8 (Johnathan Corgan) (r7292)
  • Updated pkgsource configuration (Greg Troxel) (r7518)
  • Updated Debian packaging (Johnathan Corgan) (r7824)

Changes in Release 3.1.1 from Release 3.1.0

  • Updated autotools, cleanup (r6819, r6820, r6822)
  • Fixed regression in tunnel.py (#198, r6801)
  • Fixed "benchmark_rx not working" issue (#196, r6787)
  • Fixed "weird sideband" (I/Q phase offset) on multi-channel RX (#195, r6785)
  • Fixed intermittent I/Q swap on transmit (#179, r6784)
  • Fixed pktno warning in examples/digital (r6739)
  • Fixed loopback bug in gr-sounder (r6738)
  • Added complex and dual-channel options for Basic RX and LFRX (r6737)

Changes in Release 3.1.0 from Release 3.1.0rc0

  • Updated autotools, clean up (r6677, r6679)
  • Fix gr.top_block to allow proper subclassing (r6673)
  • Updated Debian packaging to reflect stable series, clean up (r6671, r6672)
  • Added workaround for broken libtool on Win32 (r6645)
  • Added missing include file (affects Win32 builds) (r6635)

Changes in Release 3.1.0rc0 from development trunk

Removed the wobbly bits (r6622:6624, r6626:6627):

  • gr-qtgui (incomplete)
  • gr-cvsd-vocoder and examples (buggy)
  • OFDM blocks and examples (incomplete)
  • DECT example (incomplete)
  • C++ dial tone example (incomplete)
  • USRP in-band signaling (incomplete)
  • libpmt and libmblock (incomplete)
  • Miscellaneous cruft (limbo, etc.)

GNU Radio Release 3.2.x (Release Branch)

Latest Official Release Tarballs

Latest Unofficial or Pre-Release Tarballs

The BuildGuide has the instructions for compiling and installing GNU Radio on your system.

Browse Source Code Repository

source:/gnuradio/branches/releases/3.2

Releases tagged:

Unreleased changes in repository (3.2.3svn)

  • PMT: Optimizations, switched from omnithreads to Boost (Stephan Bruens) (r11482)
  • CORE: Added build configuration API and utility (Johnathan Corgan) (r11477)

Changes in release 3.2.2 from release 3.2.1

  • CORE: Added new gru.msgq_runner convenience class (Johnathan Corgan) (r11428)
  • EXAMPLES: Fixed broken digital examples from 3.2.1 (Josh Blum) (r11429)
  • QTGUI: Fixed USRP and USRP2 display programs (Tom Rondeau) (r11426)
  • GRC: Added short CLI argument capability (Johnathan Corgan) (r11427)
  • BUILD: Fixed missing files from packaging (Johnathan Corgan) (r11430)

Changes in release 3.2.1 from release 3.2

  • ALL: Fixed gcc 4.4 compatibility issues (Achilleas Anastasopoulos) (r11301)
  • CORE: Fixed QPSK phase error detector (Ben Green) (r11300)
  • CORE: Fixed ofdm_cp.i base class (Eric Blossom) (r11222)
  • EXAMPLES: Improved QT digital comms example (Tom Rondeau) (r11367)
  • EXAMPLES: Fixed dual-FM radio receiver (Johnathan Corgan) (#372) (r11349)
  • EXAMPLES: Improved USRP1/USRP2 auto-sense (Josh Blum) (r11298)
  • EXAMPLES: New QT-based digital comms example (Tom Rondeau) (r11298)
  • USRP2: Updated firmware for revision 4 hardware (Matt Ettus) (r11220)
  • WXGUI: Created new forms module (Josh Blum) (r11296)
  • GRC: Added new notebook display widget (Josh Blum) (r11366)
  • GRC: Fixed standard squelch wrapper (Josh Blum) (r11348)
  • GRC: Restored screenshot capability (Josh Blum) (r11348)
  • GRC: Fixed gr_argmax wrapper (Josh Blum) (r11348)
  • GRC: Fixed Python 2.5 incompatibility (Josh Blum) (r11303)
  • GRC: Assorted performance improvements (Josh Blum) (r11302)
  • GRC: Make block paths configurable (Josh Blum) (r11302)
  • GRC: Generated apps use new forms module (Josh Blum) (r11296)
  • GRC: Make block definition locations configurable through environment (Josh Blum) (r11219)
  • GRC: Add tooltips to category window (Josh Blum) (r11219)
  • GRC: Fixed chained variable evaluation (Josh Blum) (r11219)
  • GRC: Fixed deprecated number sink param (Josh Blum) (r11219)
  • GRC: Fixed random source example (Josh Blum) (r11177)
  • GRC: Removed Python 2.6 deprecations (Josh Blum) (r11176)
  • BUILD: Fixed missing files from gr-radar-mono Ubuntu Package (Nick Withers) (r11355)
  • BUILD: Fixed erroneous Makefile entry (Josh Blum) (r11348)
  • BUILD: Use common system configuration directory (Josh Blum) (r11297)
  • BUILD: Fixed typos and dependencies in Ubuntu packaging (Johnathan Corgan) (r11223, r11370)
  • BUILD: Fixed --with-usrp configuration for OSX (Michael Dickens) (r11128)

GNU Radio has a steep learning curve

GNU Radio is a large, complex project. Working with it requires patience and skill. The GNU Radio community are helpful people, but they expect you to try to help yourself. Questions that demonstrate that you've done your homework are more likely to elicit a response. Also, please remember that no one gets paid to answer your questions. Your question might go unanswered for days or even weeks, or even forever, even if it's a good question.

There's a lot of advice in this document. It might seem unfair to be expected to put so much work into asking questions in a specific way. However, consider this: Questions you ask on this list reach hundreds of expert engineers with decades of experience in communication, signal processing, and related fields. If you have a good question and ask it well, you are likely to get many of them to spend a lot of time thinking it through, responding, and possibly doing additional work for you, all for free. Consultants with the same levels of experience are quite expensive.

Things to try before asking questions on the mailing list

First, install a clean installation of the current GNU Radio trunk code from Subversion, using the exact steps given in the documentation at the following two links, and see if your issue persists. At this point, most of the people on the GNU Radio mailing list are interested in improving the state of the art, not in supporting earlier releases or debugging integration issues caused by unusual customized installations.

Next, check whether you can help yourself or someone else has had the same issue that you're dealing with.

  • Read all output carefully and look for error messages. Most likely you'll get a hint what went wrong.
  • If you've received an error message from a Python program, read it carefully from the bottom up. The last entry is where the error happens; the lines above tell you how the failing part was invoked.
  • Ask someone nearby who understands GNU Radio or communication technology in general: a friend, colleague, professor, etc. This lets you ask many questions and get many answers in a small amount of time.
  • Search the GNU Radio wiki.
  • Search the GNU Radio mailing list archive.
  • Search the Web.
  • Read the source code that you're working on.

If nothing listed above helps you address your specific question or problem, your next step is to make sure that you're generally familiar with GNU Radio and the USRP. If you ask a question from the FAQ or documentation on the mailing list, it will probably be ignored.

Finally, you should have some understanding of the components involved in GNU Radio and their theoretical underpinnings. Your problem might be that you need to learn more about the things that GNU Radio uses, rather than an issue with GNU Radio itself. If it turns out that you have a general question about Python, C++, Unix, basic signal processing, FPGA design, analog RF electronics, or some other technology, please consider asking your question in a forum dedicated to the engineering discipline that you need help with. If your question is specifically about GNU Radio, the USRP series, or closely related concepts in software-defined radio, discuss-gnuradio is probably the best forum you can ask, but try to answer your question using textbooks and the Web first. A list of reference texts is available at SuggestedReading.

I've done everything above, and I still have a question. How do I ask it?

You're most likely to get a helpful response on the mailing list if you ask nicely and provide enough information for us to diagnose the problem. Read and understand How To Ask Questions The Smart Way. At the very least, we need to know: * How did you invoke the code that isn't working? (If you ran a program, we need to know the entire command line, and the output of "printenv" might help; if you're calling preexisting code from your own program, we need your code or at the very least the lines of code that are failing; if your problem is with a GRC flowgraph, please provide both the .grc XML file and the .py code that GRC generates for your flowgraph.) * What error messages did you get, if any? * How did the behavior of your code differ from what you expected? * What GNU Radio software has worked for you so far, if any? Try some of the examples, e.g. usrp_fft.py. * If you got abnormal output from a GUI program, save it or make a screen shot, put it on a Web or FTP server, and give us a link to it.

Some GNU-Radio-specific things that we'll need to know are:

  • What operating system are you using? (Linux, BSD, Mac OS X, Windows, or other? Which distribution? Which version? 32- or 64-bit?)
  • What specific kind of computer are you running GNU Radio on? (Which CPU architecture? Single-processor or SMP?)
  • If you're using an USRP, what daugherboard(s) are you using? If you're not using a USRP, what digitizer hardware are you using?
  • What analog hardware (antennas, amplifiers, filters, etc.) is connected to the inputs of your digitizer hardware?

How should I format my message?

How To Ask Questions The Smart Way has excellent guidance on this question. The following are the most commonly violated principles. These rules might differ from what you're used to at work or at school, particularly if your organization uses Outlook or PDAs. They are conventions that Unix users and Usenet have followed since at least the 1980s, and your messages are more likely to be answered if you follow them.

  • Don't send large attachments to the list. The gnu.org servers have limited bandwidth. If you need to show some big files, put them on a Web- or FTP-server.
  • Don't send entire python scripts or block source files in your message. If you have a short, relevant snippet of code you can include it inline, but please include long blocks of code or entire source files as an attachment; or even better, post them to a public web or FTP site.
  • Don't send HTML email. Many users use text-based email readers, and it is therefore considered bad practice to use HTML formatting on mailing lists. Aggressive formating like colours will most likely get lost.
  • Don't top-post. It makes following the discussion in longer threads difficult.
  • Trim your replies. When replying to a message, remove content that is not relevant to your reply, such as signatures and questions that you don't answer.
  • Don't reply to other unrelated messages to create a new topic/thread. This creates confusion with threaded mail readers. Create a new message.
  • Conversely, when replying to a message in an existing thread, use your email program's Reply feature rather than composing a new message with the same subject. Threaded mail readers rely on the In-Reply-To header, which will be preserved by your Reply button/menu but will not be there if you create a new message.
  • If your message includes Web links to particular posts or threads on discuss-gnuradio, also include the subject lines of the posts that you're referring to. Try to link to the official gnu.org archive rather than sites like ruby-forums.org or Nabble - those site are likely to randomly disappear or change URL paths, thus making your link meaningless.
  • If you intend to participate in discussions on discuss-gnuradio, please be subscribed to the list using the format option that sends individual messages for each incoming message, not the daily digest format. Reply to individual messages, not to the digest. Send mail to the list from a real email address that you can receive replies at, not using a Web tool like ruby-forums.org.

I asked a question and I haven't gotten an answer yet. What can I do?

Questions often don't receive an answer until days after they were posted. While you are waiting, please continue to work on your problem yourself; mail the list if you find a solution. Don't re-post the same question to the list and don't ask it directly to someone whose email address you got from the list. Do not "bump" your message either.

Often the reason the question has not been answered is that it appears as if the questioner has not followed the suggestions on this page. By following the suggestions on this page, you will increase your chances of getting an answer.

If you're in a serious hurry or your question to the mailing list has gone a couple weeks without an answer and you're completely stumped, your only recourse is to hire a consultant. This will be expensive. There are quite a few communications sytem design and signal processing consultants out there; GNU Radio does not specifically endorse any of them, but at least one of the maintainers of GNU Radio is sometimes available for consulting work: Corgan Enterprises.

Sharing your Solution

If you could solve your problem, it would be more than welcome if you share it with others. Just post a closing message with your solutions. This has multiple benefits:
  • It helps others who have the same problem to find the right solution.
  • It shows all helpers that their help had some positive result and thus increases motivation to help again.
  • It gives additional information about the structure of your problems, which can be useful in other cases

Saying Thank You

Helpers need some candy from time to time. If you found some support helpful, say so. You'll get extra karma points for thanking.


RF Channel Simulation

Though GNU Radio was first thought of for being a software defined radio (SDR) platform capable of receiving or transmitting arbitrary waveforms such as to take the airwaves back to the people, the development of the software has lent itself very useful for the possiblity of abstracting statistical RF channel models for simulations.

For what purpose would this be a good idea? Who needs simulation, you ask?

When designing adaptive equalizers or RAKE receivers, it might be good to know the typical performance given a specific channel type. For some cases - such as dense areas like urban settings it might be better to use one setting versus another.

I think that RF channel simulation blocks, though boring and possibly not quite as exciting as some of the other blocks, will bring GNU Radio to the forefront of SDR development and might possibly lead to the software package being used more commercially.


Changing the RFX400 Frequency Range

The Flex400 uses 2 of the ADF4360-7 VCO/PLL chips from Analog Devices, one on TX and one on RX. The way the board is designed, the output frequency of the VCO/PLL is divided by 2 to give the actual channel frequency. For example, since the RFX400 covers 400-500 MHz, the VCO/PLL actually tunes from 800-1000 MHz. If you want to cover 136-174MHz, you would have to design for 272-348 MHz.

The frequency range of the ADF4360-7 is controlled by 2 inductors, L31 and L32 on RX, and L105 and L116 on TX. They are 0402-sized, and ship with 4.3nH installed. The ADF4360-7 datasheet has instructions on how to select the inductors for your desired frequency range. If you are ordering the inductors, I would suggest not only ordering the value you think you need, but also ordering at least one bigger and one smaller value since the calculations in the datasheet are not exact.

Other things to note:

  • The fractional bandwidth covered is approximately constant, so if we cover about 120 MHz when at 450 MHz, then you can probably only cover 40 MHz or so around 150 MHz. At 800 MHz, you should be able to cover about 200 MHz.
  • There is a low pass filter on the TX/RX connector with a cutoff around 550MHz. If you are going higher in frequency, you should make these changes:
    • L224 and L225 should be zero ohm resistors (0603 size)
    • C221, C222, and C223 should all be removed.

This page links to various source of sample data.
Please add more!

NOAA-12 Weather Satellite

bzip2'd NOAA-12 data, binary little endian complex<float>, Fs = 250kS/s,

Date: Sun, 10 Dec 2006 12:11:55 +1030
From: Berndt Josef Wulf <wulf@ping.net.au>
Subject: Re: [Discuss-gnuradio] APT signals
To: discuss-gnuradio@gnu.org
Organization: NTC-Electronics
Sender: discuss-gnuradio-bounces+eb=comsec.com@gnu.org

G'day,

I managed to capture the spectrum emitted by NOAA-12 for its entire pass; not
quite sure anymore which one it was. Using a Diamond D130 discone antenna and
a low noise broadband power amplifier (10-2000MHz, g=20dB, nf=3.5,
po=+20dbm!!!) the signal was recorded utilizing the usrp_rx_cfile.py python
script, a  gain of 100, and decimation of 250 centered on 137.5MHz. It
produced a very large file

-rw-r--r--  1 root  wheel  1117519872 Dec  9 20:01 noaa-12.dat

This a little more than 1GB!!!! and 419MB zipped. Do we have a place were it
can be uploaded for other list members that are interested? My bandwidth
isn't large enough to offer it to public from here.

I was surprised how loud the signal was, considering the equipment used here,
and how well the TVRX card performed. Now I'm really looking forward to
shooting the big birds  = geostationary satellites.

BTW: Do we have an AFC block to compensate for doublershift or is this
something we still need to implement? I looked through the documentation but
failed to find anything there.

cheerio Berndt

Installing SDCC on Windows

If you have a USRP, you will need the Small Device C Compiler (SDCC) in order to build the firmware. (If you don't have a USRP, you can skip this step.) The SDCC is available as a self-installing binary package for Windows. To install it:

(1) Download sdcc-2.9.0-setup.exe (2.9.0 under sdcc-win32) from http://sourceforge.net/projects/sdcc/files/ to a directory of your choice.

(2) Run sdcc-2.9.0-setup.exe. You must have administrator privileges; it is easiest if you use the same account you will use to build GNU Radio.

(3) Log into the account you will use to build GNU Radio (if you are already logged into that account, log out and log in again). Enter the command
$ which sdcc

If the path to sdcc is displayed, you are done. Otherwise you need to add the path to sdcc to your PATH environment variable.
You can do this in your ~/.bash_profile (assuming you are using a bash shell) or by adding it to your Windows path. The command you need to add to your ~/.bash_profile is
$ PATH="$PATH:/cygdrive/c/Program Files/SDCC/bin" 

if you are using Cygwin and
$ PATH="$PATH:/c/Program Files/SDCC/bin" 

if you are using MSYS (assuming that you installed SDCC in C:\Program Files\SDCC). To add sdcc to your Windows path: * open the Windows control panel: * go to Performance and Maintenance -> System to get the "System Properties" window * click the "Advanced" tab and click "Environment Variables" * select "Path" in the top pane and click "Edit" * add C:/Program Files/SDCC/bin to the end of the variable value; if there is already something there, separate the new text from the old with ";" * click "OK" in the "Edit Variable", "Environment Variables", and "System Properties" windows * log out and log back in again
Whichever way you use to set your PATH, you should start a new command window and repeat the which sdcc command to be sure that SDCC is found.

Notes:

VPATH builds and make distcheck on Cygwin

Windows SDCC as installed above will not work for VPATH builds (i.e., configure run from another directory) or make distcheck because Cygwin symbolic links are not recognized by the Windows version of SDCC. If you want to do a VPATH build or make distcheck you can do one of the following:
  • Build and install a Cygwin version of SDCC from source; this is straightforward (configure; make; make install); you will need the Cygwin flex and bison packages.
  • Add scripts for the SDCC components to check for symbolic links (e.g., with readlink) and substitute copies of the target files (not tried, but should work).
  • Modify usrp/firmware/src/usrp2/Makefile.am to change "ln -s" and/or "$(LN_S)" to "cp -p" in the .a51.rel target.

GNU Radio Specific

Software Radio in General

Digital Signal Processing

  • "Understanding Digital Signal Processing" by Richard Lyons. Great practical intro to DSP. ISBN 0201634678. 2nd ed (2004) ISBN 0131089897.
  • "Digital Signal Processing, A Practical Approach", Ifeachor and Jervis. Another good intro with a little more depth than Lyons. ISBN 020154413X.
  • "The Scientist and Engineer's Guide to Digital Signal Processing" by Stephen W. Smith Ph.D, available for free download at http://www.dspguide.com/. Also available in soft cover: ISBN 0-7506-7444-X.
  • DSPLinks A great tool for learning DSP. Comes with lots of examples.
  • The comp.dsp FAQ is also good.

Digital Comms

  • MIT 6.450 Principles of Digital Communications I. Full course available on OCW.
  • "Digital Signal Processing in Communication Systems" by Marvin E. Frerking. Practical engineering focus. Lots of great examples. Frerking often provides mulitiple solutions for a given transmitter or receiver design problem. ISBN 0442016166.
  • "Digital Communications, Fundamentals and Applications, 2nd ed.", Sklar. Good coverage of all aspects digital comms. ISBN 0130847887.
  • "Digital and Analog Communication Systems" by Leon W. Couch II. Pretty good balance of theory and application. Covers many of the analog modulations that aren't covered in other comms books. ISBN 0135225833.
  • "Digital Communications, 3rd ed", by John Proakis. Popular textbook. ISBN 0070517266.
  • "Multirate Signal Processing for Communication Systems", by fredric j harris. ISBN 0131465112.
  • "Wireless Digital Communications: Design and Theory", by Tom McDermott, N5EG. Good high level overview of the basics of digital comms. Published by TAPR, available at http://www.tapr.org. ISBN 0-9644707-2-1.
  • "Communication System Design Using DSP Algorithms: With Laboratory Experiments for the TMS320C6701 and TMS320C6711", by Steven Tretter. Very good book on basics of modems and real-life implementation. Auther is the man behind voice-band modem standards like V.34. ISBN 0306474298.
  • Communications Tutorials

Radio and RF Design

Introductions to theory, etc.
  • "The Science of Radio" by Paul J Nahin. Accessable intro to the the physics of radio, with specific treatment of the superhetrodyne receiver. It's also got some great history intermixed. 2nd edition: ISBN 0387951504. (First edition: ISBN 1563963477)
  • "The Electronics of Radio" by David B. Rutledge. Walks through the theory and operation of the NorCal 40A CW transceiver. Quite interesting. ISBN 0-521-64645-6.
  • "RF Circuit Design" by Chris Bowick. This compact book covers lots of what you really need to know for RF. It covers the mysterious Smith Chart, matching circuits, filter design, small signal amplifier design (LNA's) and RF power amps. ISBN 0-7506-9946-9.
  • "Experimental Methods in RF Design" by Wes Hayward, Rick Campbell, Bob Larkin. Good practical book from ARRL. The authors are experienced amateur radio homebrewers. Published by American Radio Relay League (ARRL). ISBN: 0-87259-879-9
    Amateur Radio specific
  • "The ARRL Handbook." A kind of hodge-podge of stuff. If you already know what you're looking for, you might be able to find it here. http://www.arrl.org

Electronics

  • "The Art of Electronics" by Horowitz and Hill. Truly a classic. A great introduction to electronics that works to help you build an intuitive understanding of what's going on. Great techniques for "back of the envelope design", how to think about circuits, etc. If you're interested in electronics, this is a book to have! ISBN 0521370957. There's a student workbook too.
  • "Lessons In Electric Circuits", http://www.ibiblio.org/obp/electricCircuits/
  • http://en.wikibooks.org/wiki/Electronics (really basic, work in progress)
    Books on OpAmp's
  • "IC Op-Amp Cookbook" by Walter Jung. ISBN 0672224534
  • "Intuitive Operational Amplifiers" by Thomas Frederiksen. ISBN 0070219672
  • "Analog Electronics with Op Amps" by Peyton and Walsh. ISBN 052133604X

Programming in General

C++

  • "C++ Primer" by Stanley Lippman, Josee LaJoie ISBN 0201824701
  • "The C++ Standard Library, a Tutorial and Reference", Nicolai M. Josuttis, ISBN 0-201-379260. Excellent coverage of the Standard Library. Very useful! I keep it near my desk.
  • boost.org C++ libraries. We use many of these libraries, though some of it falls into the category of "C++ Template Metaprogramming from Hell." They're about 25% of the way to what Lisp had 30 years ago.
  • "Effective C++, 2nd ed.", Scott Meyers. 50 ways to avoid blowing your foot off with C++. ISBN 0-201-02488-9.
  • "Large-Scale C++ Software Design", John Lakos. After you've got a pretty good grip on C++, this runs through some techniques for building big systems. We use a lot of them in GnuRadio. ISBN 0-201-63362-0.
  • The Standard Template Library (STL) docs http://www.sgi.com/tech/stl (is there a better link than this?)
  • Bruce Eckel's "Thinking in C++": http://mindview.net/Books/TICPP/ThinkingInCPP2e.html

Python

Auto-tools

  • "GNU Autoconf, Automake, and Libtool" book found here http://sources.redhat.com/autobook/, available also as paper book. This book covers only autoconf v2.13, which is a bit different than autoconf 2.50+ GNU Radio is using. Anyway, it's a good introduction.ISBN 1-57870-190-2.

Verilog

  • ""Verilog HDL Synthesis: A Practical Primer"":http://www.amazon.com/Verilog-HDL-Synthesis-Practical-Primer/dp/0965039153, J. Bhasker, ISBN 0-9650391-5-3. Covers the subset of Verilog HDL applicable for synthesizing synchronous and asynchronous logic in hardware, with many example pairings of code and synthesized net lists.

Amateur Radio Licensing

How to get a ham license in the US
  • "Now You're Talking!", ARRL. Read this, pass a 35 question multiple choice test, and you're legal to operate on the ham bands >= 50 MHz. No Morse code required. ISBN 0-87259-881-0.
    ----
    CategoryFaq

Commercial support and training


This information should work for openSUSE 11.1, and also hopefully SuSE 10.1.

If you choose to use downloadable packages, get the most recent package version, then use rpm to install (rpm -ivh package_filename).

To install dependencies using the YAST2 package manager, issue "sudo /sbin/yast2" and a GUI will be brought up. Search for each package to install, find the correct package name, then hit the spacebar to mark it for installation.

  • gnuradi-core:
    As of GNU Radio 3.2, in order for 'configure' to execute, you need the following YAST2 packages, if they are not already installed:
    • autoconf, automake, libtool, make
    • python-devel
    • swig
    • fftw3-devel
    • cppunit-devel
    • boost-devel
    • guile
    • gsl-devel
      In order to execute some parts of gnuradio-core (a runtime dependency), you will need to install NUMPY either from package or from source (http://numpy.scipy.org/). If from source, after extracting execute "sudo python setup.py install".
  • GRC: Install the following using YAST2:
    • python-lxml
    • python-gtk
    • libxslt-python
      You will also need to install Cheetah from source (http://www.cheetahtemplate.org/). After extracting, execute "sudo python setup.py install".
  • USRP and related components:
    • Install the following using yast2:
      • libusb-devel (the 0.1 series, not the 1.0 series)
    • You will need also install SDCC either from package or source (http://sdcc.sourceforge.net/). If from source, then you also need to install using yast2:
      • bison
      • flex
        before doing the usual "./configure && make && sudo make install".
  • SDL-video: Install the following using YAST2:
    • SDL-devel
  • WXGUI: Install the following using YAST2:
    • python-wxGTK
  • JACK audio: Install the following using YAST2:
    • libjack-devel
  • PortAudio audio: Install the following using YAST2:
    • libportaudio-devel
  • ALSA audio: Install the following using YAST2:
    • alsa-devel
* QTGUI: Install the following using YAST2: *** libqt4-devel
You will also need to install from package or source QWT (http://qwt.sourceforce.net/) and QwtPlot3d (http://qwtplot3d.sourceforge.net/). For QWT for the usual Linux installation, you need to edit qwtconfig.pri and change the 'INSTALLBASE' to '/usr/local', and 'headers.path' to '$$INSTALLBASE/include/qwt'; then execute 'qmake && make && sudo make install'. For QwtPlot3d, ignore the error when unpacking the tarball; issue "qmake && make" to make. To install, use the following script from the qwtplot3d top-level directory:
sudo mkdir /usr/local/include/qwtplot3d
(cd include; tar cf - . | (cd /usr/local/include/qwtplot3d; sudo tar xf -))
tar cf - lib | (cd /usr/local; sudo tar xf -)

Then follow instructions at BuildGuide.

Accessing the USRP as a non-root user

SuSE 10.1 uses "udev" rather than "hotplug" to automatically handle plug/unplug events for usb devices. To allow users other than root to use the USRP, follow these directions.


Test Page

pic


Placeholder for open tickets until dispositioned.


Fine grained permissions

Before Trac 0.11, it was only possible to define fine-grained permissions checks on the repository browser sub-system.

Since 0.11, there's a general mechanism in place that allows custom permission policy plugins to grant or deny any action on any kind of Trac resources, even at the level of specific versions of such resources.

Permission Policies

AuthzPolicy

An example policy based on an Authz-style system has been added. See
[source:trunk/sample-plugins/permissions/authz_policy.py] for details. (See also [source:trunk/sample-plugins/permissions] for more samples.) - Install ConfigObj (required).
- Copy authz_policy.py into your plugins directory.
- Put a authzpolicy.conf file somewhere (preferably on a secured location on the server, not readable for others than the webuser.
- Update your trac.ini:
[trac]
...
permission_policies = AuthzPolicy, DefaultPermissionPolicy, LegacyAttachmentPolicy

[authz_policy]
authz_file = /some/trac/env/conf/authzpolicy.conf

[components]
...
authz_policy = enabled

Note that the order in which permission policies are specified is quite critical,
as policies will be examined in the sequence provided.

A policy will return either True, False or None for a given permission check.
Only if the return value is None will the next permission policy be consulted.
If no policy explicitly grants the permission, the final result will be False
(i.e. no permission).

For example, if the authz_file contains:
WikiStart@*
* = WIKI_VIEW

PrivatePage@*
john = WIKI_VIEW
* =

and the default permissions are set like this:
john           WIKI_VIEW
jack           WIKI_VIEW
# anonymous has no WIKI_VIEW

Then:
- All versions of WikiStart will be viewable by everybody (including anonymous)
- PrivatePage will be viewable only by john
- other pages will be viewable only by john and jack

mod_authz_svn-like permission policy

At the time of this writing, the old fine grained permissions system from Trac 0.10 and before used for restricting access to the repository has not yet been converted to a permission policy component, but from the user point of view, this makes little if no differences.

That kind of fine-grained permission control needs a definition file, which is the one used by Subversion's mod_authz_svn.
More information about this file format and about its usage in Subversion is available in the Subversion Book.

Example:
[/]
* = r

[/branches/calc/bug-142]
harry = rw
sally = r

[/branches/calc/bug-142/secret]
harry =
  • */* = Everyone has read access by default
  • /branches/calc/bug-142 = harry has read/write access, sally read only
  • /branches/calc/bug-142/secret = harry has no access, sally has read access (inherited as a sub folder permission)

Trac Configuration


<pre>
[trac]
authz_file = /path/to/svnaccessfile
</pre>

if you want to support the use of the @[@_modulename_@:/@_some_@/@_path_@]@ syntax within the @authz_file@, add 

<pre>
authz_module_name = modulename
</pre>

where _modulename_ refers to the same repository indicated by the @repository_dir@ entry in the @[trac]@ section.

*Note:* Usernames inside the Authz file +must+ be the same as those used inside trac. 

h4. Subversion Configuration

The same access file is typically applied to the corresponding Subversion repository using an Apache directive like this:
<pre>
<Location /repos>
  DAV svn
  SVNParentPath /usr/local/svn

  # our access control policy
  AuthzSVNAccessFile /path/to/svnaccessfile
</Location>
</pre>

For information about how to restrict access to entire projects in a multiple project environment see [trac:wiki:TracMultipleProjectsSVNAccess]

----
See also: TracPermissions


Trac Navigation

Starting with Trac 0.11, it is now possible to customize the main and meta navigation entries in some basic ways.

The new [mainnav] and [metanav] configuration sections can now be used to customize the text and link used for the navigation items, or even to disable them.

[mainnav] corresponds to the main navigation bar, the one containing entries such as Wiki, Timeline, Roadmap, Browse Source and so on. This navigation bar is meant to access the default page of the main modules enabled in Trac and accessible for the current user.

[metanav] corresponds to the meta navigation bar, by default positioned above the main navigation bar and below the Search box. It contains the Log in, Logout, Help/Guide etc. entries. This navigation bar is meant to access some global information about the Trac project and the current user.

Note that it is still not possible to customize the contextual navigation bar, i.e. the one usually placed below the main navigation bar.

Example

In the following example, we rename the link to the Wiki start "Home", and hide the "Help/Guide" link.
We also make the "View Tickets" entry link to a specific report.

Relevant excerpt from the TracIni:
[mainnav]
wiki.label = Home
tickets.href = /report/24

[metanav]
help = disabled

----
See also: TracInterfaceCustomization, the TracHacks:NavAddPlugin (still needed for adding entries)


The Trac Ticket Workflow System

TracGuideToc

The Trac issue database provides a configurable workflow.

The Default Ticket Workflow
Environments upgraded from 0.10 =
When you run trac-admin &lt;env&gt; upgrade, your trac.ini will be modified to include a [ticket-workflow] section.
The workflow configured in this case is the original workflow, so that ticket actions will behave like they did in 0.10.

Graphically, that looks like this:

../common/guide/original-workflow.png)

There are some significant "warts" in this; such as accepting a ticket sets it to 'assigned' state, and assigning a ticket sets it to 'new' state. Perfectly obvious, right?
So you will probably want to migrate to "basic" workflow; contrib/workflow/migrate_original_to_basic.py may be helpful.

Environments created with 0.11

When a new environment is created, a default workflow is configured in your trac.ini. This workflow is the basic workflow (described in basic-workflow.ini), which is somewhat different from the workflow of the 0.10 releases.

Graphically, it looks like this:

../common/guide/basic-workflow.png)

Additional Ticket Workflows

There are several example workflows provided in the Trac source tree; look in contrib/workflow for .ini config sections. One of those may be a good match for what you want. They can be pasted into the [ticket-workflow] section of your trac.ini file.

Basic Ticket Workflow Customization

Create a [ticket-workflow] section in trac.ini.
Within this section, each entry is an action that may be taken on a ticket.
For example, consider the accept action from simple-workflow.ini:
accept = new,accepted -> accepted
accept.permissions = TICKET_MODIFY
accept.operations = set_owner_to_self

The first line in this example defines the accept action, along with the states the action is valid in (new and accepted), and the new state of the ticket when the action is taken (accepted).
The accept.permissions line specifies what permissions the user must have to use this action.
The accept.operations line specifies changes that will be made to the ticket in addition to the status change when this action is taken. In this case, when a user clicks on accept, the ticket owner field is updated to the logged in user. Multiple operations may be specified in a comma separated list. The available operations are:
- del_owner -- Clear the owner field.
- set_owner -- Sets the owner to the selected or entered owner.
- actionname@.set_owner@ may optionally be set to a comma delimited list or a single value.
- set_owner_to_self -- Sets the owner to the logged in user.
- del_resolution -- Clears the resolution field
- set_resolution -- Sets the resolution to the selected value.
- actionname@.set_resolution@ may optionally be set to a comma delimited list or a single value.
Example:

resolve_new = new -> closed
resolve_new.name = resolve
resolve_new.operations = set_resolution
resolve_new.permissions = TICKET_MODIFY
resolve_new.set_resolution = invalid,wontfix

- leave_status -- Displays "leave as <current status>" and makes no change to the ticket.
Note: Specifying conflicting operations (such as set_owner and del_owner) has unspecified results.
resolve_accepted = accepted -> closed
resolve_accepted.name = resolve
resolve_accepted.permissions = TICKET_MODIFY
resolve_accepted.operations = set_resolution

In this example, we see the .name attribute used. The action here is resolve_accepted, but it will be presented to the user as resolve.

For actions that should be available in all states, * may be used in place of the state. The obvious example is the leave action:
leave = * -> *
leave.operations = leave_status
leave.default = 1

This also shows the use of the .default attribute. This value is expected to be an integer, and the order in which the actions are displayed is determined by this value. The action with the highest .default value is listed first, and is selected by default. The rest of the actions are listed in order of decreasing .default values.
If not specified for an action, .default is 0. The value may be negative.

There are a couple of hard-coded constraints to the workflow. In particular, tickets are created with status new, and tickets are expected to have a closed state. Further, the default reports/queries treat any state other than closed as an open state.

While creating or modifying a ticket workfow, contrib/workflow/workflow_parser.py may be useful. It can create .dot files that GraphViz understands to provide a visual description of the workflow.

This can be done as follows (your install path may be different).
cd /var/local/trac_devel/contrib/workflow/
sudo ./showworkflow /srv/trac/PlannerSuite/conf/trac.ini

And then open up the resulting trac.pdf file created by the script (it will be in the same directory as the trac.ini file).

After you have changed a workflow, you need to restart apache for the changes to take effect. This is important, because the changes will still show up when you run your script, but all the old workflow steps will still be there until the server is restarted.

Example: Adding optional Testing with Workflow

By adding the following to your [ticket-workflow] section of trac.ini you get optional testing. When the ticket is in new, accepted or needs_work status you can choose to submit it for testing. When it's in the testing status the user gets the option to reject it and send it back to needs_work, or pass the testing and send it along to closed. If they accept it then it gets automatically marked as closed and the resolution is set to fixed. Since all the old work flow remains, a ticket can skip this entire section.

testing = new,accepted,needs_work -> testing
testing.name = Submit to reporter for testing
testing.permissions = TICKET_MODIFY

reject = testing -> needs_work
reject.name = Failed testing, return to developer

pass = testing -> closed
pass.name = Passes Testing
pass.operations = set_resolution
pass.set_resolution = fixed

Example: Limit the resolution options for a new ticket

The above resolve_new operation allows you to set the possible resolutions for a new ticket. By modifying the existing resolve action and removing the new status from before the -> we then get two resolve actions. One with limited resolutions for new tickets, and then the regular one once a ticket is accepted.

resolve_new = new -> closed
resolve_new.name = resolve
resolve_new.operations = set_resolution
resolve_new.permissions = TICKET_MODIFY
resolve_new.set_resolution = invalid,wontfix,duplicate

resolve = assigned,accepted,reopened -> closed
resolve.operations = set_resolution
resolve.permissions = TICKET_MODIFY

Advanced Ticket Workflow Customization

If the customization above is not extensive enough for your needs, you can extend the workflow using plugins. These plugins can provide additional operations for the workflow (like code_review), or implement side-effects for an action (such as triggering a build) that may not be merely simple state changes. Look at [trac:source:trunk/sample-plugins/workflow sample-plugins/workflow] for a few simple examples to get started.

But if even that is not enough, you can disable the ConfigurableTicketWorkflow component and create a plugin that completely replaces it.

some ideas for next steps

New enhancement ideas for the workflow system should be filed as enhancement tickets against the ticket system component. If desired, add a single-line link to that ticket here.

If you have a response to the comments below, create an enhancement ticket, and replace the description below with a link to the ticket.

  • the "operation" could be on the nodes, possible operations are:
    • preops: automatic, before entering the state/activity
    • postops: automatic, when leaving the state/activity
    • actions: can be chosen by the owner in the list at the bottom, and/or drop-down/pop-up together with the default actions of leaving the node on one of the arrows.
      This appears to add complexity without adding functionality; please provide a detailed example where these additions allow something currently impossible to implement.
  • operations could be anything: sum up the time used for the activity, or just write some statistical fields like
    A workflow plugin can add an arbitrary workflow operation, so this is already possible.
  • set_actor should be an operation allowing to set the owner, e.g. as a "preop":
    • either to a role, a person
    • entered fix at define time, or at run time, e.g. out of a field, or select.
      This is either duplicating the existing set_owner operation, or needs to be clarified.
  • Actions should be selectable based on the ticket type (different Workflows for different tickets)
    This is becoming a frequent request, with clear usecases. The closest the current implementation will allow is to have a plugin provide a triage action that sets the next state based on the ticket type, so a new ticket would move to new_task, new_defect, etc., and the workflow graph would separate at that point.

Notes and Status on Repository Trunk Development

Repository location:

source:/gnuradio/trunk

Last release branch created:

source:/gnuradio/branches/releases/3.0

Latest SVN tarballs:

  • (not yet implemented)
  • (not yet implemented)

Next release branch version:

milestone:release-3.1

Changeset History Since Release 3.0 Branch

  • (not yet updated)

Defects Being Worked on For Next Feature Release

TicketQuery(status!=closed&

Enhancements Being Worked on For Next Feature Release

TicketQuery(status!=closed&

Fixes Planned For Next Feature Release With No Owners Assigned

(Please feel free to volunteer!)

TicketQuery(status!=closed&

Enhancements Planned For Next Feature Release With No Owners Assigned

(Please feel free to volunteer!)

TicketQuery(status!=closed&


Tutorials

WritePythonApplications - A tutorial on how to develop Python GNU Radio applications. Some DSP and programming background required.

QTGUI Tutorial - A tutorial on how to develop Python GNU Radio applications. Some DSP and programming background required.


Tutorial - Using the QT GUI Blocks in GNU Radio

Basics

This document demonstrates how to use the QT GUI features in GNU Radio. There is one main QT interface defined that comes as either a complex sink or floating point sink, they are called:

  • complex sink: qtgui.sink_c
  • float sink: qtgui.sink_f

As this shows, the sinks are located in the module gnuradio.qtgui and is imported into Python with:

1 from gnuradio.qtgui import qtgui

Both the complex and floating point versions of the sink take the same arguments using the following class constructor:

1 
2 qtgui_make_sink_X (int fftsize, int wintype, double fc=0, 
3                    double bandwidth=1.0, const std::string &name="Spectrum Display",
4                    bool plotfreq=true, bool plotwaterfall=true, bool plotwaterfall3d=true,
5                    bool plottime=true, bool plotconst=true, bool use_openGL=true,
6                    QWidget *parent=NULL)

The following describes the arguments meanings more:

  • fftsize: initial FFT size
  • wintype: initial FFT window type. These can be taken from gr.firdes as WIN_BLACKMAN, WIN_BLACKMAN_hARRIS, WIN_HAMMING, WIN_HANN, WIN_KAISER, WIN_RECTANGULAR WIN_BLACKMAN_hARRIS is recommended if you don't have specific windowing needs
  • fc: center frequency for the x-axis display
  • bandwidth: sets the x-axis range around fc
  • name: The title of the GUI object in the title bar
  • plotfreq: Display frequency window?
  • plotwaterfall: Display waterfall window?
  • plotwaterfall3d: Display 3D waterfall window?
  • plottime: Display time window?
  • plotconst: Display constellation window?
  • parent: a parent widget for this object to be put into as a child

Prerequisites

If you have successfully installed the gr-qtgui module with GNU Radio, then all of the prerequisites should be installed. Just in case, the Python modules you will need to run a QT GUI application are:

  • PyQt4
  • SIP

It is also recommended that you get PyQWT5 to be able to build more extensive and nicer looking GUIs.

Example 1: Seeing the GUI

The first step is to be able to create a qtgui sink and display it on screen. This is both the simplest and most useful for debugging. By understanding how this example works, you can go and easily add a GUI to any existing GNU Radio application to see the signals at any point in the flow graph.

Here is the full code:

 1 #!/usr/bin/env python
 2 
 3 from gnuradio import gr
 4 from gnuradio.qtgui import qtgui
 5 
 6 from PyQt4 import QtGui
 7 import sys, sip
 8 
 9 class my_tb(gr.top_block):
10     def __init__(self):
11         gr.top_block.__init__(self)
12 
13         # Make a local QtApp so we can start it from our side
14         self.qapp = QtGui.QApplication(sys.argv)
15 
16         fftsize = 2048
17 
18         self.src = gr.sig_source_c(1, gr.GR_SIN_WAVE, 0.1, 1)
19         self.nse = gr.noise_source_c(gr.GR_GAUSSIAN, 0.1)
20         self.add = gr.add_cc()
21         self.thr = gr.throttle(gr.sizeof_gr_complex, 100*fftsize)
22         self.snk = qtgui.sink_c(fftsize, gr.firdes.WIN_BLACKMAN_hARRIS)
23 
24         self.connect(self.src, (self.add, 0))
25         self.connect(self.nse, (self.add, 1))
26         self.connect(self.add, self.thr, self.snk)
27 
28         # Tell the sink we want it displayed
29         self.pyobj = sip.wrapinstance(self.snk.pyqwidget(), QtGui.QWidget)
30         self.pyobj.show()
31 
32 def main():
33     tb = my_tb()
34     tb.start()
35     tb.qapp.exec_()
36 
37 if __name__ == "__main__":
38     try:
39         main()
40     except KeyboardInterrupt:
41         pass

Lines 1 - 7 just set up the environment and modules, including the PyQT modules we require. Lines 9 - 11 simply set up the "my_tb" class as a GNU Radio top block class and initialize it.

Line 14 is the first deviation from normal GNU Radio flow graphs. This line gets a reference to the qApp, which is QT global application element. Right now, it is enough to know that we require it, but we won't do anything with it until later.

Line 16 just sets a variable for the FFT size. Lines 18 - 22 build the blocks of the flow graph, including the qtgui block. In this flow graph, we create a sine wave and add noise to it. The noise is to make sure the signal is constantly changing in the display as a simple sine wave looks like nothing changes between frames. There is a threshold block so the GUI is not trying to run at full speed, too. Finally, the sink is a complex qtgui sink with just the first two arguments given. As can be seen in the class constructor listed above, all of the other arguments have defaults, so we will use these for now.

Lines 24 - 26 just connect all of the blocks. Like any other block, the qtgui sink is added as just another connection.

Lines 29 and 30 are specific to making the qtgui blocks visible. We have to use the "show" operation on the qtgui block, but first, we have to convert it to a Python object. Line 29 does the conversion by using the SIP wrapper interface to go from a PyObject in C++ to a native Python object as a QWidget. The "pyqwidget" method of the qtgui sink passes the proper object pointer back to allow this handling. Now, the Python object has the "show()" method required to display the sink that is called in Line 30. Without this, the code would run, but we would see nothing displayed.

The final bit of tickery that deviates from a normal flow graph is how we tell the class to run. Line 33 instantiates an object of our "my_tb" class. Instead of calling "run()" on this object, though, we only call "start()" in line 34, which is non-blocking (run() performs both a start() and wait() call). We then tell the qApp that we got a reference to in Line 10 to execute with the "exec_()" method on line 35. This starts the QT runtime engine to handle the display and controls of the QT widgets. Now, when we run the program, we should see a QT application with a widget displaying the frequency domain. [SHOWPCITURE]

The big take-aways message here is the relatively minor changes required to make a qtgui application from a flow graph.

  • Get a reference to the qApp pointer
  • Build and connect the qtgui sink
  • Use sip to get a wrapped instance in Python of the block and call "show()" on it
  • Use the "start()" method of the top block class followed by a call to "exec_()" on the qApp to run the QT application

PageOutline

Introduction

Welcome, GNU Radio beginners. If you are reading this tutorial, you probably already have some very basic knowledge about how GNU Radio works, what it is and what it can do - and now you want to enter this exciting world of Open Source digital signal processing (DSP) yourself.

This is a tutorial on how to write applications for GNU Radio in Python. It is no introduction to programming, software radio or signal processing, nor does it cover how to extend GNU Radio by creating new blocks or adding code to the source tree. If you have some background in the mentioned topics and are starting to work with GNU Radio, this probably is the correct tutorial for you. If you don't know what a Software Radio is or what a FIR filter does, you should probably go a few steps back and get a more solid background on signal processing theory. But don't let this discourage you - the best way to learn something is by trying it out.

Although this tutorial is designed to make your introduction to GNU Radio as easy as possible, it is not a definitive guide. In fact, I might sometimes simply not tell the real truth to make explanations easier. I might even contradict myself in later chapters. Usage of brain power is still necessary to develop GNU Radio applications.

Preliminaries

Before you get started with this tutorial, make sure your GNU Radio installation is ready and working. You don't necessarily need a USRP, but some kind of source and sink (USRP or audio) is helpful, although not strictly required. If the GNU Radio examples work (such as dial_tone.py in gnuradio-examples/python/audio), you're ready to go.

You should also have some background in programming - but don't worry if you've never programmed Python, it is a very easy language to learn.

Understanding flow graphs

Before we start banging out code, first we need to understand the most basic concepts about GNU Radio: flow graphs (as in graph theory) and blocks. Many GNU Radio applications contain nothing other than a flow graph. The nodes of such a graph are called blocks, and the data flows along the edges.

Any actual signal processing is done in the blocks. Ideally, every block does exactly one job - this way GNU Radio stays modular and flexible. Blocks are written in C++; writing new blocks is not very difficult (but explained elsewhere).

The data passing between blocks can be of any kind - practically any type of data you can define in C++ is possible. In practice, the most common data types are complex and real short or long integers and floating point values as most of the time, data passing from one block to the next will either be samples or bits.

Examples

In order to illuminate this diffuse topic a little, let's start with some examples:

Low-pass filtered audio recorder
  +-----+  +-----+  +----------------+
  | Mic +--+ LPF +--+ Record to file |
  +-----+  +-----+  +----------------+

First, an audio signal from a microphone is recorded by your PCs sound card and converted into a digital signal. The samples are streamed to the next block, the low pass filter (LPF), which could be implemented as an FIR filter. The filtered signal is passed on to the final block, which records the filtered audio signal into a file.

This is a simple, yet complete flow graph. The first and last block serve a special purpose: they operate as source and sink. Every flow graph needs at least one source and sink to be able to function.

Dial tone generator
  +------------------------+
  | Sine generator (350Hz) +---+
  +------------------------+   |   +------------+
                               +---+            |
                                   | Audio sink |
                               +---+            |
  +------------------------+   |   +------------+
  | Sine generator (440Hz) +---+
  +------------------------+

This simple example is often called the "Hello World of GNU Radio". Other than the first example, it has two sources. The sink, on the other hand, has two inputs - in this case for the left and right channel of the sound card. Code for this example is available at gnuradio-examples/python/audio/dial_tone.py.

QPSK Demodulator
   +-------------+  +----------------+  +------------------+
   | USRP Source +--+ Frequency sync +--+ Matched filter   |
   +-------------+  +----------------+  +-----------+------+
                                                    |           COMPLEX SAMPLES
                                      +-------------+------+
                                      | Symbol demodulator |
                                      +-------------+------+
                                                    |           COMPLEX SYMBOLS
   +-----------------+  +-----------------+  +------+------+
   | Source decoder  +--+ Channel decoder +--+ Bit mapping |
   +--------+--------+  +-----------------+  +-------------+
            |                                                   BITS
   +--------+--------+
   | Application     |                                          DATA
   +-----------------+

This example is a bit more sophisticated, but should look quite familiar to RF engineers. In this case, the source is a USRP which is connected to an antenna. This kind of source sends complex samples to the following blocks.

The interesting part about this kind of flow graph is that the data types change during the flow graph: at first, complex baseband samples are passed along. Then, complex symbols are gathered from the signal. Next, these symbols are turned into bits which again are processed further. Finally, the decoded bits are passed to some application which makes use of the data.

Walkie Talkie
  +--------------+  +------------------+  +---------+  +------------+
  | USRP Source  +--+ NBFM Demodulator +--+ Squelch +--+ Audio Sink |
  +--------------+  +------------------+  +---------+  +------------+
  +--------------+          +----------------+         +------------+
  | Audio Source +----------+ NBFM Modulator +---------+  USRP Sink |
  +--------------+          +----------------+         +------------+

This applications consists of two separate flow graphs, both running in parallel. One of them deals with the Tx path, the other with the Rx path. This kind of application would require some extra code (outside the flow graphs) to mute one path while the other is active. Both flow graphs still require at least one source and sink, each. You can find a GNU Radio application that does this (only a bit more sophisticated) at gnuradio-examples/python/usrp/usrp_nbfm_ptt.py.

Summary

This concludes the chapter about flow graphs. Here's a quick summary about the most vital points you really need to know:

  • All signal processing in GNU Radio is done through flow graphs.
  • A flow graph consists of blocks. A block does one signal processing operation, such as filtering, adding signals, transforming, decoding, hardware access or many others.
  • Data passes between blocks in various formats, complex or real integers, floats or basically any kind of data type you can define.
  • Every flow graph needs at least one sink and source.

A FIRST WORKING CODE EXAMPLE

Next step is to find out how to write those flow graphs in real Python. Let's start by examining some code line-by-line. If you are familiar with Python, you can probably skip some of the explanations, but don't rush to the next section yet - the explanations are both for Python and GNU Radio beginners.

The following code example represents the flow graph from example 2. It is actually a slightly modified version of the code example you can find in gnuradio-examples/python/audio/dial_tone.py.

 1 #!/usr/bin/env python
 2 
 3 from gnuradio import gr
 4 from gnuradio import audio
 5 
 6 class my_top_block(gr.top_block):
 7     def +init+(self):
 8         gr.top_block.+init+(self)
 9 
10         sample_rate = 32000
11         ampl = 0.1
12 
13         src0 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 350, ampl)
14         src1 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 440, ampl)
15         dst = audio.sink (sample_rate, "")
16         self.connect (src0, (dst, 0))
17         self.connect (src1, (dst, 1))
18 
19 if +name+ == '+main+':
20     try:
21         my_top_block().run()
22     except KeyboardInterrupt:
23         pass

The first line should look familiar to anyone with some Unix or Linux background: It tells the shell that this file is a Python file and to use the Python interpreter to run this file. You need this line if you want to run this file directly from the command line.

Lines 3 and 4 import necessary Python modules to run GNU Radio. The import command is similar to the #include directive in C/C++. Here, two modules from the gnuradio-package are imported: gr and audio. The first module, gr, is the basic GNU Radio module. You will always have to import this to run a GNU Radio application. The second loads audio device blocks. There are many GNU Radio modules, a short list of modules will be presented later on.

Lines 6-17 define a class called my_top_block which is derived from another class, gr.top_block. This class is basically a container for the flow graph. By deriving from gr.top_block, you get all the hooks and functions you need to add blocks and connect them.

Only one member function is defined for this class: the function +init+(), which is the constructor of this class. In the first line of this function (line 8), the parent constructor is called (in Python, this needs to be done explicitly. Most things in Python need to be done explicitly; in fact, this is one main Python principle).
Next, two variables are defined: sample_rate and ampl. These will control sampling rate and amplitude of the signal generators.

Before explaining the next lines, have another look at the sketched flow graph chart in the previous section: it consists of three blocks and two edges. The blocks are defined in lines 13-15: Two signal sources are generated (called src0 and src1). These sources continuously create sine waves at given frequencies (350 and 440Hz) and a given sampling rate (here 32kHz). The amplitude is controlled by the ampl variable and set to 0.1. The prefix "f" of the block type gr.sig_source_f indicates the output is of type float, which is a good thing because the audio sink accepts floating point samples in the range between -1 and +1. These kind of things must be taken care of by the programmer: although GNU Radio does some checks to make sure the connections make sense, there is still some things that must be taken care of manually. For example, if you wanted to feed integer samples to audio.sink, GNU Radio would throw an error - but if you would set the amplitude in the above example to anything larger than 1, you would get a distorted signal without receiving an error.
The signal sink is defined in line 15: audio.sink() returns a block which acts as a soundcard control and plays back any samples piped into it. As in the blocks beforehand, the sampling rate needs to be set explicitly, even though this was set already for the signal sources. GNU Radio cannot guess the correct sampling rate from the context, as it is not part of the information flow between blocks.

Lines 16 and 17 connect the blocks. The general syntax for connecting blocks is self.connect(block1, block2, block3, ...) which would connect the output of block1 with the input of block2, the output of block2 with the input of block3 and so on. You can connect as many blocks as you wish with one connect() call. Here, a special syntax is necessary because we want to connect src0 with the first input of dst and src1 with the second one. self.connect (src0, (dst, 0)) does exactly this: it specifically connects src0 to port 0 of dst. (dst, 0) is called a "tuple" in Python jargon. In the self.connect() call it is used to specify the port number. When the port number is zero, the block may be used alone. An equivalent command to the one in line 16 would thus have been

1 self.connect((src0, 0), (dst, 0))

That's all there is to create a flow graph. The last 5 lines do nothing but start the flow graph (line 22). The try and except statements simply make sure the flow graph (which would otherwise run infinitely) are stopped when Ctrl+C is pressed (which triggers a KeyboardInterrupt Python exception).

For Python-beginners, two more remarks should not be left out: As you might have noticed, the class my_top_block is run without creating an instance beforehand. In Python, this is a quite common thing to do, especially if you have a class which would only get one instance anyway. However, you could just as well create one or more instances of the class and then call the run() method on the instance(es).

Second, the indenting is part of the code and not, like in C++, simply for the programmers convenience. If you try and modify this code, make sure you don't start mixing tabs and spaces. Every level must be consistently indented.
If you want to go on with this tutorial, you should first get a more solid Python background. Python documentation can be found at the Python web site http://www.python.org/, or a library of your choice. A good place to start for people with prior programming experience is http://wiki.python.org/moin/BeginnersGuide/Programmers .

Summary

  • You need to import required GNU Radio modules with the from gnuradio import command. You always need the module gr.
  • A flow graph is contained in a class which itself is derived from gr.top_block.
  • Blocks are created by calling functions such as gr.sig_source_f() and saving the return value to a variable.
  • Blocks are connected by calling self.connect() from within the flow graph class
  • If you don't feel comfortable writing some basic Python code now, have a break and go through some Python tutorials.

The next section will give a more detailed overview about writing GNU Radio applications in Python.

Coding Python GNU Radio Applications

The example above already covers quite a lot of how to write Python GNU Radio applications. This chapter and the next will try to show the possibilites of GNU Radio applications and how to use them. From now on, there is no need to linearly read these chapters section-for-section, it probably makes more sense to go over the titles and find out what you want to know.

GNU Radio Modules

GNU Radio comes with quite a lot of libraries and modules. You will usually include modules with the following syntax:

1 from gnuradio import MODULENAME

Some modules work a bit differently, see the following list on the most common modules.

gr The main GNU Radio library. You will nearly always need this.
usrp USRP sources and sinks and controls.
audio Soundcard controls (sources, sinks). You can use this to send or receive audio to the sound cards, but you can also use your sound card as a narrow band receiver with an external RF frontend.
blks2 This module contains additional blocks written in Python which include often-used tasks like modulators and demodulators, some extra filter code, resamplers, squelch and so on.
optfir Routines for designing optimal FIR filters.
plot_data Some functions to plot data with Matplotlib
wxgui This is actually a submodule, containing utilities to quickly create graphical user interfaces to your flow graphs. Use from gnuradio.wxgui import * to import everything in the submodule or from gnuradio.wxgui import stdgui2, fftsink2 to import specific components. See the section 'Graphical User Interfaces' for more information.
eng_notation Adds some functions to deals with numbers in engineering notation such as @100M' for 100 * 10^6'.
eng_options Use from gnuradio.eng_options import eng_options to import this feature. This module extends Pythons optparse module to understand engineering notation (see above).
gru Miscellaneous utilities, mathematical and others.

This is by far not a complete list, nor are the descriptions of the modules very useful by themselves. GNU Radio code changes a lot, so creating a static documentation would not be very sensible.

Instead, you will have to use the good old Star Wars motto to delve further into the details of the modules: "Use the source!". If you feel GNU Radio should really already have some functionality you want to use, either browse through the module directory Python uses or go through the source directory of GNU Radio. In particular, pay attention to the directories starting with gr- in the source directory, such as gr-sounder or gr-radar-mono. These produce their own code and, consequently, their own modules.

Of course, Python itself comes with a lot of modules, some of which are extremely useful - if not necessary - to write GNU Radio applications. Check the Python documentation and the SciPy website for more information.

Choosing, defining and configuring blocks

GNU Radio comes with an abundance of pre-defined blocks, so for beginners, it is often quite confusing to find the correct blocks for their applications and set them up correctly.

As with modules, the GNU Radio code changes around quite a bit, so a static documentation doesn't really make sense. However, the situation is a bit different with blocks. First of all, there's the unofficial GNU Radio manual (based on GNU Radio 3.1.1) which can be downloaded at

http://rapidshare.com/files/72169239/Simple-Gnuradio-User-Manual-v1.0.pdf

Thanks to the author for the massive effort!

Then, there's the automatically generated documentation. This is created by Doxygen from the source code. I recommend making these docs the same time as building the rest. Run ./configure with the --enable-doxygen switch for to create the docs when running make. The latter is particularly useful as it consists of multiple HTML documents which can be browsed easily. If you don't want to create the documents yourself or don't have to possibility to do so, you can find a version (although not an up-to-date one) on the web at http://gnuradio.org/doc/doxygen/hierarchy.html. The auto-generated docs are in your source directory beneath gnuradio-core/doc/html.
Learning how to use these documentations is a major part of learning how to use GNU Radio!

Let's get practical. Here's the three lines from the previous example which define the blocks:

1 src0 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 350, ampl)
2 src1 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 440, ampl)
3 dst  = audio.sink (sample_rate, "")

Here's a simplified version of what happens when this code is executed: First, a function called sig_source_f in the module gr is executed. It receives four function arguments:

  • sample_rate, which is a Python variable,
  • gr.GR_SIN_WAVE, which is a constant defined in the @gr' module,
  • 350, a normal literal constant,
  • ampl, another variable.

This function creates a class which is subsequently assigned to src0. The same happens on the other two lines, although the sink is fetched from a different module (audio).

So how did I know which block to use and what to pass to gr.sig_source_f()? This is where the documentation comes in. If you use the Doxygen-generated docs, click on the top left tab called "Modules". Proceed to "Signal Sources". You will find a list of signal generators, including the sig_source_* family. The suffix defines the data type at the output:

  • f = float
  • c = complex float
  • i = int
  • s = short int
  • b = bits (actually an integer type)

These suffixes are used for all types of blocks, e.g. gr.fir_filter_ccf() will define an FIR filter with complex input, complex output and float taps, and gr.add_const_ss() will define a block which adds incoming short values with another, constant, short int.

A list of all classes with a short description can be obtained by clicking on the top tab called "Classes". The unofficial GNU Radio manual lists all classes sorted by module and can be searched using your PDF reader of choice.
Most blocks you'll be using at the beginning are either from the gr, audio or usrp modules. So if you find a class called gr_sig_source_f in the auto-generated docs, you can create this class in Python by calling gr.sig_source_f().

At this point it is worth having a closer look behind the curtains of GNU Radio. The reason you can easily use the blocks - written in C++ - in your Python code is because GNU Radio uses a tool called SWIG to create an interface between Python and C++. Every block in C++ comes with a creating function, called gr_make_*** (gr_make_sig_source_f() in the example mentioned above). This function is always documented on the same page as the matching class, and this function is what gets exported to Python, so gr.sig_source_f() in Python calls gr_make_sig_source_f() in C++. For the same reason, it takes the same arguments - that's how you know how to initialise a block in Python.

Once you're browsing the Doxygen documentation of the class gr_sig_source_f, you might notice many other class methods, such as set_frequency(). These functions get exported to Python as well. So if you have created a signal source and want to change the frequency (say your application has a user frequency control) you can use this method on your Python defined block:

1     # We're in some cool application here
2 
3         src0 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 350, ampl)
4     # Other, fantastic things happen here
5 
6     src0.set_frequency(880) # Change frequency

will change the frequency of the first signal generator to 880Hz.

Hopefully, GNU Radio documentation will grow and become more and more complete. But to completely understand the workings of blocks in detail, you will probably have to have a look at the code sooner or later, no matter how good the documentation gets.

Connecting blocks

Use the connect() method of gr.top_block to connect blocks. Some things are worth mentioning:

  • You can only connect inputs and outputs if the data types match. If you try to connect a float output with a complex input, you will get an error.
  • One output can be connected to several inputs; you don't need an extra block to duplicate signal paths.

These are basic rules for connecting blocks and they work in most cases. However, when mixing data types some more notes are worth mentioning.

  • GNU Radio checks if input and output types match by checking their size. If you happen to connect up ports with different types but the same size, you will most definitely get data junk.
  • When processing single bits, be careful. In some cases, you will work with binary data in a usual sense, in other cases you want to handle a specific number of bits at a time. Have a look at the packed_to_unpacked* and unpacked_to_packed* blocks for this.
  • Be careful with dynamic ranges. When you're using float or complex data types, you have a larger range than you'll ever need concerning the machine, but some sinks and sources have specific ranges you need to stick to. For example, audio sinks require samples within +-1 and will clip anything outside this interval. The USRP sink on the other hand needs samples in the +-32767 range (signed 16 bit values) because that's the dynamic range of the DAC.

Hierarchical blocks

Sometimes it makes sense to combine several blocks into a new block. Say you have several applications which all have a common signal processing component which consists of several blocks. These blocks can be combined into a new block, which in turn can be used in your applications is if it were a normal GNU Radio block.

Example: Say you have two different flow graphs, FG1 and FG2. Both use - among others - the blocks B1 and B2. You want to combine them to a hierarchical block called HierBlock:

  +-------------------+
  |  +-----+  +----+  |
--+--+ B1  +--+ B2 +--+---
  |  +-----+  +----+  |
  |     HierBlock     |
  +-------------------+

This is what you do: create a flow graph which derives from gr.hier_block2 and use self as source and sink:

 1 class HierBlock(gr.hier_block2):
 2     def +init+(self, audio_rate, if_rate):
 3         gr.hier_block2.+init+(self, "HierBlock",
 4                        gr.io_signature(1, 1, gr.sizeof_float),
 5                        gr.io_signature(1, 2, gr.sizeof_gr_complex))
 6 
 7         B1 = gr.block1(...) # Put in proper code here!
 8         B2 = gr.block2(...)
 9 
10         self.connect(self, B1, B2, self)

As you can see, creating a hierarchical block is very similar to creating a flow graph with gr.top_block. Apart from using self as source and sink, there is another difference: the constructor for the parent class (called in line 3) needs to receive additional information. The call to gr.hier_block2.+init+() takes four parameters:

  • self (which is always passed to the constructor as first argument),
  • a string with an identifier for the hierarchical block (change at your convenience),
  • an input signature and an
  • output signature.

The last two require some extra explanation unless you have already written your own blocks in C++. GNU Radio needs to know what types of input and output the block uses. Creating an input/output signature can be done by calling gr.io_signature(), as is done here. This function call takes 3 arguments:

  • minimum number of ports,
  • maximum number of ports and
  • size of the input/output elements.

For the hierarchical block HierBlock, you can see that it has exactly one input and one or two outputs. The incoming objects are of size float, so the block processes incoming real float values. Somewhere in B1 or B2, the data is converted to complex float values, so the output signature declares outgoing objects to be of size gr.sizeof_gr_complex. The 'gr.sizeof_float@ and gr.sizeof_gr_complex are equivalent to the C++ return values of the sizeof() call. Other predefined constants are

  • gr.sizeof_int
  • gr.sizeof_short
  • gr.sizeof_char

Use gr.io_signature(0, 0, 0) to create a null IO signature, i.e. for defining hierarchical blocks as sources or sinks.

That's all. You can now use HierBlock as you would use a regular block. For example, you could put this code in the same file:

 1 class FG1(gr.top_block):
 2     def +init+(self):
 3         gr.top_block.+init+(self)
 4 
 5     ... # Sources and other blocks are defined here
 6     other_block1 = gr.other_block()
 7     hierblock    = HierBlock()
 8     other_block2 = gr.other_block()
 9 
10     self.connect(other_block1, hierblock, other_block2)
11 
12     ... # Define rest of FG1

Of course, to make use of Pythons modularity, you could also put the code for HierBlock in an extra file called hier_block.py. To use this block from another file, simply add an import directive to your code:

1 from hier_block import HierBlock

and you can use HierBlock as mentioned above.

Examples for hierarchical blocks:

gnuradio-examples/python/usrp/fm_tx4.py
gnuradio-examples/python/usrp/fm_tx_2_daughterboards.py
gnuradio-examples/python/digital/tx_voice.py

Multiple flow graphs

In some cases, you might want to have completely separate flow graphs, e.g. for receive and transmit paths (see the example 'Walkie-Talkie' above). Currently (June 2008), it is not possible to have multiple top_blocks running at the same time, but what you can do is create full flow graphs as hierarchical blocks using gr.hier_block2 like in the section above. Then, create a top_block to hold the flow graphs.

Example:

 1 class transmit_path(gr.hier_block2):
 2     def +init+(self):
 3                 gr.hier_block2.+init+(self, "transmit_path",
 4                                 gr.io_signature(0, 0, 0), # Null signature
 5                                 gr.io_signature(0, 0, 0))
 6 
 7         source_block = gr.source()
 8         signal_proc  = gr.other_block()
 9         sink_block   = gr.sink()
10 
11         self.connect(source_block, signal_proc, sink_block)
12 
13 class receive_path(gr.hier_block2):
14     def +init+(self):
15                 gr.hier_block2.+init+(self, "receive_path",
16                                 gr.io_signature(0, 0, 0), # Null signature
17                                 gr.io_signature(0, 0, 0))
18 
19         source_block = gr.source()
20         signal_proc  = gr.other_block()
21         sink_block   = gr.sink()
22 
23         self.connect(source_block, signal_proc, sink_block)
24 
25 class my_top_block(gr.top_block):
26     def +init+(self):
27         gr.top_block.+init+(self)
28 
29     tx_path = transmit_path()
30 
31     rx_path = receive_path()
32 
33     self.connect(tx_path)
34     self.connect(rx_path)

Now, when you start my_top_block, both flow graphs are started in parallel. Note that the hierarchical blocks have explicitly no inputs and outputs defined, they have a null IO signature. Consequently, they don't connect to self as source or sink; they rather define their own sources or sink (just as you would do when defining a hierarchical block as source or sink). The top block simply connects the hierarchical blocks to itself, but does not connect them up in any way.

Examples for multiple flow graphs:

gnuradio-examples/python/usrp/usrp_nbfm_ptt.py

GNU Radio extensions and tools

GNU Radio is more than blocks and flow graphs - it comes with a lot of tools and code to help you write DSP applications.

A collection of useful GNU Radio applications designed to aid you is in gr-utils/.
Browse the source code in gnuradio-core/src/python/gnuradio to find utilities you can use in your Python code such as filter design code, modulation utilities and more.

Controlling flow graphs

If you have followed the tutorial so far, you will have noticed that a flow graph has always been implemented as a class, derived from gr.top_block. The question remains on how to control one of these classes.

As mentioned before, deriving the class from gr.top_block brings along all the functionality you might need. To run or stop an existing flow graph, use the following methods:

run() The simplest way to run a flow graph. Calls start(), then wait(). Used to run a flow graph that will stop on its own, or to run a flow graph indefinitely until SIGINT is received.
start() Start the contained flow graph. Returns to the caller once the threads are created.
stop() Stop the running flow graph. Notifies each thread created by the scheduler to shutdown, then returns to caller.
wait() Wait for a flow graph to complete. Flowgraphs complete when either (1) all blocks indicate that they are done, or (2) after stop has been called to request shutdown.
lock() Lock a flow graph in preparation for reconfiguration.
unlock() Unlock a flow graph in preparation for reconfiguration. When an equal number of calls to lock() and unlock() have occurred, the flow graph will be restarted automatically.

See the documentation for gr_top_block for more details.

Example:

 1 class my_top_block(gr.top_block):
 2     def +init+(self):
 3         gr.top_block.+init+(self)
 4     ... # Define blocks etc. here
 5 
 6 if +name+ == '+main+':
 7     my_top_block().start()
 8     sleep(5) # Wait 5 secs (assuming sleep was imported!)
 9     my_top_block().stop()
10     my_top_block().wait() # If the graph is needed to run again, wait() must be called after stop
11     ... # Reconfigure the graph or modify it
12     my_top_block().start() # start it again
13     sleep(5) # Wait 5 secs (assuming sleep was imported!)
14     my_top_block().stop()  # since (assuming) the graph will not run again, no need for wait() to be called

These methods help you to control the flow graph from the outside. For many problems this might not be enough: you don't simply want to start or stop a flow graph, you want to reconfigure the way it behaves. For example, imagine your application has a volume control somewhere in your flow graph. This volume control is implemented by inserting a multiplier into the sample stream. This multiplier is of type gr.multiply_const_ff. If you check the documentation for this kind of of block, you will find a function gr.multiply_const_ff.set_k() which sets the multiplication factor.
You need to make the settings visible to the outside in order to control it. The simplest way is to make the block an attribute of the flow graph class.

Example:

 1 class my_top_block(gr.top_block):
 2     def +init+(self):
 3         gr.top_block.+init+(self)
 4     ... # Define some blocks
 5     self.amp = gr.multiply_const_ff(1) # Define multiplier block
 6     ... # Define more blocks
 7 
 8         self.connect(..., self.amp, ...) # Connect all blocks
 9 
10     def set_volume(self, volume):
11     self.amp.set_k(volume)
12 
13 if +name+ == '+main+':
14     my_top_block().start()
15     sleep(2) # Wait 2 secs (assuming sleep was imported!)
16     my_top_block.set_volume(2) # Pump up the volume (by factor 2)
17     sleep(2) # Wait 2 secs (assuming sleep was imported!)
18     my_top_block().stop()

This example runs the flow graph for 2 seconds and then doubles the volume by accessing the amp block through a member function called set_volume(). Of course, one could have accessed the amp attribute directly, omitting the member function.

Hint: making blocks attributes of the flow graph is generally a good idea as it makes extending the flow graph with extra member functions easier.

Non-flow graph centred applications

Up until now, GNU Radio applications in this tutorial have always been centred around the one class derived from gr.top_block. However, this is not necessarily how GNU Radio needs to be used. GNU Radio was designed to develop DSP applications from Python, so there's no reason to not use the full power of Python when using GNU Radio.

Python is an extremely powerful language, and new libraries and functionalities are constantly being added. In a way, GNU Radio extends Python with a powerful, real-time-capable DSP library. By combining this with other libraries you have immense functionality right there at your fingertips. For example, by combining GNU Radio with SciPy, a collection of scientific Python libraries, you can record RF signals in real time and do extensive mathematical operations off line, save statistics to a database and so on - all in the same application. Even expensive engineering software such as Matlab might become unnecessary if you combine all these libraries.

http://www.scipy.org/

Advanced Topics

If you have really read the previous sections, you already know enough to write your first Python GNU Radio applications. This section will adress some slightly more advanced functionalities for Python GNU Radio applications.

Dynamic flow graph creation

For most cases, the aforementioned way to define flow graphs is completely adequate. If you need more flexibility in your application, you might want to have even more control over the flow graph from outside the class.
This can be achieved by taking the code out of the +init+() function and simply using gr.top_block as a container. Example:

 1     ... # We are inside some application
 2     tb = gr.top_block() # Define the container
 3 
 4     block1 = gr.some_other_block()
 5     block2 = gr.yet_another_block()
 6 
 7     tb.connect(block1, block2)
 8 
 9     ... # The application does some wonderful things here
10 
11     tb.start() # Start the flow graph
12 
13     ... # Do some more incredible and fascinating stuff here

If you are writing some application which needs to dynamically stop a flow graph (reconfigure it, re-start it and so) on this might be a more practical way to do it.

Examples for this kind of flow graph setup:

gnuradio-examples/python/apps/hf_explorer/hfx2.py

Command Line Options

Python has its own libraries to parse command line options. See the documentation for the module optparse to find out how to use it.

GNU Radio extends optparse by new command line option types. Use @from gnuradio.eng_option import eng_option' to import this extension. With eng_option, you have the following types:

eng_float Like the original float option, but also accepts engineering notation like 101.8M
subdev Only accepts valid subdevice descriptors such as A:0 (To specify a daughterboard on a USRP)
intx Only accepts integers

If your application supports command line options, it would be ever so nice if you could stick to the GNU Radio conventions for command line options. You can find these (along with more hints for developers) in README.hacking.

Nearly every GNU Radio example uses this feature. Try dial_tone.py for an easy example.

Graphical User Interfaces

If you are a Python expert and also have some experience in writing GUIs for Python (using whatever GUI toolkit you like), you might not even need this section. As mentioned before, GNU Radio merely extends Python with DSP routines - so if you like, just go ahead and write a GUI application, add a GNU Radio flow graph to it and define some interfaces to carry GNU Radio information to your application and vice versa. If you want to plot your data, you could use Matplotlib or Qwt.

However, sometimes you simply want to write a quick GUI application without bothering with setting up widgets, defining all the menus etc. GNU Radio comes with some predefined classes to help you write graphical GNU Radio applications.

These modules are based on wxWidgets (or to be precise, wxPython), a platform-independent GUI toolkit. You will need some background in wxPython - but don't worry, it is not that complicated and there are several tutorials available on the net. Check the wxPython website for documentation (http://www.wxpython.org/).

To use the GNU Radio wxWidgets tools, you need to import some modules:

1 from gnuradio.wxgui import stdgui2, fftsink2, slider, form

Here, 4 components were imported from the gnuradio.wxgui submodule. Here's a quick list of the modules (again, not necessarily complete. You will have to browse the modules or the source code in gr-wxgui/src/python).

stdgui2 Basic GUI stuff, you always need this
fftsink2 Plot FFTs of your data to create spectrum analyzers or whatever
scopesink2 Oscilloscope output
waterfallsink2 Waterfall output
numbersink2 Displays numerical values of incoming data
form Often used input forms (see below)

Next, we have to define a new flow graph. This time, we don't derive from gr.top_block but from stdgui2.std_top_block:

1 class my_gui_flow graph(stdgui2.std_top_block):
2         def +init+(self, frame, panel, vbox, argv):
3                 stdgui2.std_top_block.+init+ (self, frame, panel, vbox, argv)

As you can see, there's another difference: the constructor gets a couple of new parameters. This is because a stdgui2.std_top_block does not only include flow graph functionality (it is derived from gr.top_block itself), but also directly creates a window with some basic components (like a menu). This is good news for all of those who just want to quickly hack a graphical application: GNU Radio creates the window and everything, you just need to add the widgets. Here's a list of what you can do with these new objects (this probably won't mean much to you if you have no idea about GUI programming):

frame The wx.Frame of your window. You can get at the predefined menu by using frame.GetMenuBar()
panel A panel, placed in @frame', to hold all your wxControl widgets
vbox A vertical box sizer (wx.BoxSizer(wx.VERTICAL) is how it is defined), used to align your widgets in the panel
argv The command line arguments

Now you have all you need to create your GUI. You can simply add new box sizers and widgets to vbox, change the menu or whatever. Some typical functions have been simplified further in the GNU Radio GUI library form.

form has a great number of input widgets: form.static_text_field() for static text field (display only), form.float_field(), to input float values, form.text_field() to input text, form.checkbox_field() for checkboxes, form.radiobox_field() for radioboxes etc. Check the source code of gr-wxgui/src/python/form.py for the complete list. Most of these calls pass most of their arguments to the appropriate wxPython objects, so the function arguments are quite self-explanatory.
See one of the examples mentioned below on how to add widgets using form.

Probably the most useful part of gnuradio.wxgui is the possibility to directly plot incoming data. To do this, you need one of the sinks that come with gnuradio.wxgui, such as fftsink2. These sinks work just as any other GNU Radio sink, but also have properties needed for use with wxPython. Example:

 1 from gnuradio.wxgui import stdgui2, fftsink2
 2 
 3 # App gets defined here ...
 4 
 5 # FFT display (pseudo-spectrum analyzer)
 6 my_fft = fftsink2.fft_sink_f(panel, title="FFT of some Signal", fft_size=512,
 7              sample_rate=sample_rate, ref_level=0, y_per_div=20)
 8 self.connect(source_block, my_fft)
 9 vbox.Add(my_fft.win, 1, wx.EXPAND)

First, the block is defined (fftsink2.fft_sink_f). Apart from typical DSP parameters such as the sampling rate, it also needs the panel object which is passed to the constructor. Next, the block is connected to a source. Finally, the FFT window (my_fft.win) is placed inside the vbox BoxSizer to actually display it. Remember that a signal block output can be connected to any amount of inputs.

Finally, the whole thing needs to be started. Because we need an wx.App() to run the GUI, the startup code is a bit different from a regular flow graph:

1 if +name+ == '+main+':
2     app = stdgui2.stdapp(my_gui_flow_graph, "GUI GNU Radio Application")
3     app.MainLoop()

stdgui2.stdapp() creates the wx.App with my_gui_flow_graph (the first argument). The window title is set to "GUI GNU Radio Application".

Examples for simple GNU Radio GUIs:

gr-utils/src/python/usrp_fft.py
gr-utils/src/python/usrp_oscope.py
gnuradio-examples/python/audio/audio_fft.py
gnuradio-examples/python/usrp/usrp_am_mw_rcv.py

And many more.

What next?

Young Padawan, no more there is I can teach you. If you have any more questions on how to write GNU Radio applications in Python, there are still a number of resources you can use:

  • Use the source. Especially the examples in gnuradio-examples/ and gr-utils/ can be very helpful.
  • Check the mailing list archives. Chances are very high your problem has been asked before.

Polymorphic Type

A new data type introduced for use with the new m-blocks, is a polymorphic data type. The type can really be used to store anything, but also has simple conversion methods for common data types such as bool, long, or a vector.

The polymorphic type simplifies the data passing between m-blocks, as all of the data is of the same type, including the message.

Overview:

PMT Types

The PMT library supports the following major types. Some of the more complex types have their own wiki page for assistance.
  • bool - just like a C++ boolean, true or false
  • symbol - easiest to think of it as a std::string
  • integer - int, long, unsigned
  • real - double, float
  • complex - gr_complex, std::complex
  • null - NULL
  • pair - a 2-tuple data type
  • list - a list
  • vector - a vector of PMT objects
  • dict - a dictionary (hash) like structure
  • uniform_vector - a vector of typed objects (uint8_t, float, etc...)
  • any - boost:any cast

Making a PMT instance

To make PMT, the data type pmt_t is used just like any other data type.

The following is an example:
pmt_t p_instance;

Constructing/Assigning a PMT

To construct or assign a value to a PMT, a method is available for each type of the following syntax: pmt<type>_.

The following constructors are available, all of which return pmt_t:
  • pmt_bool()
  • pmt_symbol(const std::string &)
  • pmt_integer(long)
  • pmt_real(double)
  • pmt_complex(std::complex<double>)
  • pmt_null()
  • pmt_pair() or pmt_pair(pmt,pmt)
  • pmt_vector(size_t,pmt)
  • pmt_dict()
  • pmt_make_*vector(size_t, *) -- see uniform vectors
  • pmt_any(const boost::any &)
For example, pmt_integer(long) returns a pmt_t, constructed from a long:
pmt_t p_num = pmt_integer(3);

Checking PMT Type

With a polymorphic type, it is useful to have methods to check what type it actually is if unknown.

The following methods are available for testing PMT types, all of which return bool:
  • pmt_is_bool(pmt)
  • pmt_is_symbol(pmt)
  • pmt_is_number(pmt)
  • pmt_is_integer(pmt)
  • pmt_is_real(pmt)
  • pmt_is_complex(pmt)
  • pmt_is_null(pmt)
  • pmt_is_pair(pmt)
  • pmt_is_vector(pmt)
  • pmt_is_uniform_vector(pmt)
  • pmt_is_dict(pmt)
  • pmt_is_any(pmt)
In this example, test_pmt will be assigned the value true:
pmt_t p_num = pmt_integer(3);
bool test_pmt = pmt_is_integer(p_num);

PMT Constants

There are 3 main constant values in the PMT world which can be returned:
  • PMT_T - PMT representation of true
  • PMT_F - PMT representation of false
  • PMT_NIL - PMT NIL/NULL representation

When a PMT is initialized with no value, such as pmt_dict() ... it is equivalent to PMT_NIL until it is assigned elements.

Testing Equality

To test the equality of PMT types, the following methods are available.
  • pmt_eq(pmt_t, pmt_t) - tests strict equality (the two parameters are the same)
  • pmt_eqv(pmt_t, pmt_t) - tests for equivalence (the two parameters have the same value)
  • pmt_equal(pmt_t, pmt_t) - tests for equivalence of multi-value types (pmt_pair, pmt_vector)
The following gives a good overview of equality testing:
pmt_t p1 = pmt_integer(5);
pmt_t p2 = pmt_integer(5);
pmt_t p3 = pmt_integer(1);

pmt_eq(p1, p1);  // Returns true
pmt_eq(p1, p2);  // Returns false

pmt_eqv(p1, p1); // Returns true
pmt_eqv(p1, p2); // Returns true

pmt_t p3 = pmt_pair(p1, p1);
pmt_t p4 = pmt_pair(p1, p2);
pmt_t p5 = pmt_pair(p1, p3);

pmt_equal(p3, p4);  // Returns true, equivalence in values
pmt_equal(p3, p5);  // Returns false, values are different

PMT Conversion Methods

There are simple methods to store common C++ types as PMT for use in passing the data in m-block messages.

All of the conversion methods are of a similar syntax:
  • pmt_from<type>_ - convert a C++ type to a PMT
  • pmt_to<type>_ - convert a PMT to a C++ type
The following C++ types are supported:
  • bool, long, double, complex
For example:
pmt_t p_val = pmt_from_long(3);
long l_val = pmt_to_long(p_val);

Checking PMT Length

For variable length PMT types, such as list and vector, you can use the following method to check how many elements are in the PMT:
  • size_t pmt_length(pmt_t)
pmt_t p1 = pmt_integer(1);
pmt_t p2 = pmt_integer(2);
pmt_t p3 = pmt_integer(3);

pmt_t p_list = pmt_list3(p1, p2, p3);

pmt_length(p_list);  // Returns 3

Detailed Type Information

Lists

PMT lists are as they sound, lists! Each list element is of type pmt_t, and the list can be of infinite length.

To create a base list, you can use the following methods:
  • pmt_list1(pmt_t)
  • pmt_list2(pmt_t, pmt_t)
  • pmt_list3(pmt_t, pmt_t, pmt_t)
  • pmt_list4(pmt_t, pmt_t, pmt_t, ...)
  • pmt_list5(pmt_t, pmt_t, pmt_t, ...)
  • pmt_list6(pmt_t, pmt_t, pmt_t, ...)
Anything beyond 6, use an add, which returns a new list:
  • pmt_t pmt_list_add(pmt_t list, pmt_t object)

List items cannot be removed, as they are implemented as constants.

To access the nth element in a list, the following method is available which returns the nth element:
  • pmt_t pmt_nth(size_t n, pmt_t list)
The following exercises PMT lists:
pmt_t p_list1 = pmt_list1(PMT_T);
p_list1 = pmt_list_add(p_list1, PMT_F);

pmt_t p_list2 = pmt_list2(PMT_T, PMT_F);

pmt_equal(p_list1, p_list2);  // Returns true

pmt_t p_element0 = pmt_nth(0, p_list2);  // Access elements
pmt_t p_element1 = pmt_nth(1, p_list2);

pmt_eqv(p_element0, PMT_T);  // Returns true
pmt_eqv(p_element1, PMT_F);  // Returns true

Uniform Vectors

Uniform PMT vectors are for storing vectors of common C++ types. The following types are supported:
  • uint8_t, int8_t, uint16_t, int16_t, uint32_t, int32_t, uint64_t, int64_t, float, double, std::complex<float>, std::complex<double>
The following methods are used to create a uniform vector, whose return types are pmt_t, where the first parameter is the number of elements to create and the second parameter is a fill parameter for initializing all of the elements to a specific value:
  • pmt_make_u8vector(size_t, uint8_t)
  • pmt_make_s8vector(size_t, int8_t)
  • pmt_make_u16vector(size_t, uint16_t)
  • pmt_make_s16vector(size_t, int16_t)
  • pmt_make_u32vector(size_t, uint32_t)
  • pmt_make_s32vector(size_t, int32_t)
  • pmt_make_u64vector(size_t, uint64_t)
  • pmt_make_s64vector(size_t, int64_t)
  • pmt_make_f32vector(size_t, float);
  • pmt_make_f64vector(size_t, double);
  • pmt_make_c32vector(size_t, std::complex<float>)
  • pmt_make_c64vector(size_t, std::complex<double>)
To get a reference to each vector to access it like an array, you can use the following, which takes a uniform vector as parameter 1, and a pointer to a size_t to return the number of elements in the vector:
  • pmt_<type>vector_ref(pmt_t, size_t)
The following is an example of uniform vectors:
static const int nelements = 64;
pmt_t s16vec = pmt_make_s16vector(nelements, 0);  // Initializes all 64 elements to 0

size_t vec_size;
int16_t *elements = pmt_s16vector_writeable_elements(s16vec, vec_size);  // Returns pointer, vec_size is set to 64

// Now you can access the elements like a standard array
for(int i=0; i<vec_size; i++)
  elements[i] = 1;

Dictionaries

A dictionary behaves exactly like a hash. PMT objects are referenced with a pmt_symbol (string-like PMT type).

To create a dictionary, use:
  • pmt_t pmt_make_dict()
To set items in a dictionary, use:
  • pmt_dict_set(pmt_t dict, pmt_t symbol, pmt_t value)
You can reference items in a dictionary using the following, which returns a specified error_val if the symbol (hash key) did not exist:
  • pmt_dict_ref(pmt_t dict, pmt_t symbol, pmt_t error_val)
It is always useful to check that a pmt_t is a dictionary before trying to reference its elements to prevent exceptions:
  • pmt_is_dict(pmt_t)
The following is an example of using dictionaries:
pmt_t p_dict = pmt_make_dict();  // Empty dictionary

pmt_dict_set(p_dict, pmt_symbol("number of dogs"), pmt_integer(3));
pmt_dict_set(p_dict, pmt_symbol("number of cats"), pmt_integer(5));
pmt_dict_set(p_dict, pmt_symbol("has a dog"), PMT_T);
pmt_dict_set(p_dict, pmt_symbol("has a turtle"), PMT_F);

if(pmt_is_dict(p_dict)) {
  pmt_t p_ndogs = pmt_dict_ref(p_dict, pmt_symbol("number of dogs"), PMT_NIL);
  pmt_t p_ncats = pmt_dict_ref(p_dict, pmt_symbol("number of cats"), PMT_NIL);
  pmt_t p_dog = pmt_dict_ref(p_dict, pmt_symbol("has a dog"), PMT_NIL);
  pmt_t p_turtle = pmt_dict_ref(p_dict, pmt_symbol("has a turtle"), PMT_NIL);

  std::cout << "I have " << pmt_to_long(p_ndogs) << " dogs!\n";
  std::cout << "I have " << pmt_to_long(p_ncats) << " cats!\n";

  if(pmt_eqv(p_dog, PMT_T))
    std::cout << "I have a dog\n";       // This will be outputted
  else
    std::cout << " I do not have a dog\n";

  if(pmt_eqv(p_turtle, PMT_T))
    std::cout << "I have a turtle\n";
  else
    std::cout << "I do not have a turtle\n";  // This will be outputted
}

Any

When there is nothing to store your type, use a pmt_any. This allows you to cast anything into a pmt_t using boost::any cast.

Example:
typedef struct d_frame_hdr_t {
  long src_addr;
  long dst_addr;
} +attribute+((+packed+));

d_frame_hdr_t my_header;
my_header.src_addr = 3;
my_header.dst_addr = 4;

pmt_t p_any = pmt_make_any(my_header);

// After extracting using pmt_any_ref the following will be true:
//   extract_header.src_addr == 3
//   extract_header.dst_addr == 4
d_frame_hdr_t extract_header = boost::any_cast<d_frame_hdr_t> (pmt_any_ref(p_any));

GNU Radio Release 3.2

With the latest GNU Radio release 3.2, binary package installation is available for Ubuntu 9.04 (Jaunty), bypassing the need for manually installing build tool prerequisites and performing a source code installation. In addition, installation and configuration of the USRP and USRP2 is automated. This is fastest and easiest way to get a working GNU Radio platform.

The rest of this page is now somewhat outdated and needs some reorganization.

Installation Options

This page provides information and scripts to compile and install GNU Radio and its required background applications, libraries, and includes on Ubuntu Linux 6.10 ("Edgy") or newer; they can probably be applied to some previous versions, though that hasn't been tested.

Installation on Ubuntu 6.10 ("Edgy") can be completed for the most part using binary packages and a package manager, but some packages must be downloaded and compiled from source.

Installation on Ubuntu 7.04 ("Feisty") or newer systems can be completed entirely using binary packages and a package manager, or may be done by download and source compile.

NOTE: The official releases of GNU Radio, version 3.0.3 or earlier, will *NOT* reliably function on Feisty when using a USRP; the USRP will work once, then fail and require the USRP to be power cycled or Ubuntu to be rebooted. Fixes for correct functionality are available in the SVN trunk.

Pre-Requisites for Source Build

The following packages are required for compiling various parts of GNU Radio on Ubuntu. These packages can be installed via "synaptic", "dselect", or "apt-get". Use the latest versions of all packages unless otherwise noted.

  • Development Tools (need for compilation)
    • g++
    • subversion
    • make
    • autoconf, automake, libtool
    • sdcc (from "universe"; 2.4 or newer)
    • guile (1.6 or newer)
    • ccache (not required, but recommended if you compile frequently)
  • Libraries (need for runtime and for compilation)
    • python-dev
    • FFTW 3.X (fftw3, fftw3-dev)
    • cppunit (libcppunit and libcppunit-dev)
    • Boost 1.35 (or later)
    • libusb and libusb-dev
    • wxWidgets (wx-common) and wxPython (python-wxgtk2.8)
    • python-numpy (via python-numpy-ext) (for SVN on or after 2007-May-28)
    • ALSA (alsa-base, libasound2 and libasound2-dev)
    • Qt (libqt3-mt-dev for versions earlier than 8.04; version 4 works for 8.04 and later)
    • SDL (libsdl-dev)
    • GSL GNU Scientific Library (libgsl0-dev >= 1.10 required for SVN trunk, not in binary repositories for 7.10 and earlier)
  • SWIG (1.3.31 or newer required)
    • Edgy or previous: requires installation from source
    • Feisty or newer: use the standard package install (swig)
  • QWT (optional) (5.0.0 or newer required)
    • Must be installed from source (as of 2008-01-15).
    • qt4 versions should be used for 8.04 and 8.10. DO! : sudo apt-get update and then upgrade for a proper qt4.
  • QWT Plot3d Lib
    • Must be installed for gr-qtgui to work. qt4 version preferred for Ubuntu 8.04 and 8.10
  • Polyphase Filter Bank examples
    • for the examples in gnuradio-examples/python/pfb to work you need to install python-scipy, python-matplotlib, and python-tk
  • Other useful packages
    • doxygen (for creating documentation from source code)
    • octave (from "universe")

Install Scripts

The following are scripts to take most users through a GNU Radio install on a typical Ubuntu install, with the hope that it provides enough guidance such that you can get GNU Radio up and running on your Ubuntu box.

* This section is for Edgy or previous only (no changes are needed on Feisty or newer, except possibly to disable the CDROM entry):
Manually uncomment all repositories to include "universe" and "multiverse" either via direct editing
  sudo <EDITOR> /etc/apt/sources.list

or via the provided GUI: System -> Administration -> Software Sources. Then enter the admin password for access. On the "Ubuntu" tab, make sure all of "main restricted universe multiverse" are checked and the rest unchecked (or deal with those are you deem correct for your setup). Click "Close", then "Reload" to update the package list. The uncommented lines of the file "/etc/apt/sources.list" should read something like (DIST is a string with your particular distribution: edgy, feisty, gusty, etc):
deb http://us.archive.ubuntu.com/ubuntu/ DIST main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ DIST-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ DIST-security main restricted universe multiverse
Update the local dpkg cache:
sudo apt-get update

Install required packages (some are likely already installed by Ubuntu by default; some are likely redundant with others; but these groups cover all of the required packages, except for in Edgy)

* Lucid (10.04):
sudo apt-get -y install libfontconfig1-dev libxrender-dev libpulse-dev swig g++ automake libtool python-dev libfftw3-dev \
libcppunit-dev libboost-all-dev libusb-dev fort77 sdcc sdcc-libraries \
libsdl1.2-dev python-wxgtk2.8 subversion git-core guile-1.8-dev \
libqt4-dev python-numpy ccache python-opengl libgsl0-dev \
python-cheetah python-lxml doxygen qt4-dev-tools \
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools
* Karmic (9.10):
sudo apt-get -y install swig g++ automake libtool python-dev libfftw3-dev \
libcppunit-dev libboost1.38-dev libusb-dev fort77 sdcc sdcc-libraries \
libsdl1.2-dev python-wxgtk2.8 subversion git-core guile-1.8-dev \
libqt4-dev python-numpy ccache python-opengl libgsl0-dev \
python-cheetah python-lxml doxygen qt4-dev-tools \
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools
* Jaunty (9.04): **Package sdcc-nf needs to be installed (instead of sdcc)**
sudo apt-get -y install swig g++ automake1.9 libtool python2.5-dev fftw3-dev \
libcppunit-dev libboost1.35-dev sdcc-nf libusb-dev \
libsdl1.2-dev python-wxgtk2.8 subversion git guile-1.8-dev \
libqt4-dev python-numpy ccache python-opengl libgsl0-dev \
python-cheetah python-lxml doxygen qt4-dev-tools \
libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools

If you are upgrading from an older install, you may have python-wxgtk2.6 installed.
Because python-wxgtk2.6 takes precedence over python-wxgtk2.8, it must be removed: sudo apt-get remove python-wxgtk2.6 * Intrepid (8.10): **Package sdcc-nf needs to be installed (instead of sdcc)**
sudo apt-get -y install swig g++ automake1.9 libtool python-dev fftw3-dev \
libcppunit-dev libboost1.35-dev sdcc-nf libusb-dev \
libsdl1.2-dev python-wxgtk2.8 subversion git guile-1.8-dev \
libqt4-dev python-numpy ccache python-opengl libgsl0-dev \
python-cheetah python-lxml doxygen qt4-dev-tools \
libqwt5-qt4-dev libqwtplot3d-qt4-dev  pyqt4-dev-tools
* Hardy (8.04): **Boost should be installed as explained in README.building-boost file **
sudo apt-get -y install swig g++ automake1.9 libtool python-dev fftw3-dev \
libcppunit-dev sdcc libusb-dev libasound2-dev libsdl1.2-dev \
python-wxgtk2.8 subversion guile-1.8-dev libqt4-dev python-numpy-ext \
ccache python-opengl libgsl0-dev python-cheetah python-lxml doxygen \
libqwt5-qt4-dev libqwtplot3d-qt4-dev qt4-dev-tools
* Gutsy (7.10): **Boost should be installed as explained in README.building-boost file. GSL is required Also **
sudo apt-get -y install g++ automake libtool python-dev fftw3-dev \
libcppunit-dev sdcc libusb-dev libasound2-dev \
libsdl1.2-dev python-wxgtk2.8 subversion guile-1.8-dev libgsl0-dev \
libqt3-mt-dev python-numpy-ext swig ccache
* Feisty (7.04): **Boost should be installed as explained in README.building-boost file. GSL is required Also **
sudo apt-get -y install g++ automake1.9 libtool python-dev fftw3-dev \
libcppunit-dev sdcc libusb-dev libasound2-dev \
libsdl1.2-dev python-wxgtk2.8 subversion guile-1.6-dev\
libqt3-mt-dev python-numpy-ext swig ccache
* Edgy (6.10): **It is strongly recommended that you use one of the newer releases above**
sudo apt-get -y install g++ automake1.9 libtool python-dev fftw3-dev \
libcppunit-dev libboost-dev sdcc libusb-dev libasound2-dev \
libsdl1.2-dev python-wxgtk2.6 subversion guile-1.6-dev \
libqt3-mt-dev python-numpy-ext ccache

Note that above line for Edgy installs python-wxgtk-2.6. While this is good enough for older gnuradio releases, it is too old for recent gnuradio svn snapshots. If you want to build a recent svn snapshot of gnuradio you need wxgtk version 2.8 or later.
You can install more recent wxgtk versions from the wxwidgets debian and ubuntu repository.
See Installing latest wxgtk-2.8 packages on debian or Ubuntu Install optional packages, if desired; some might already be installed from the previous command:
sudo apt-get -y install gkrellm wx-common libwxgtk2.8-dev alsa-base autoconf xorg-dev g77 gawk bison openssh-server emacs cvs usbview octave
For Edgy only: Get, Compile, and Install SWIG
wget http://prdownloads.sourceforge.net/swig/swig-1.3.33.tar.gz
tar zxf swig-1.3.33.tar.gz
cd swig-1.3.33
./configure
make
sudo make install
cd ..
Optional: Get, Compile, Install QWT 5.0.0 (or newer): * NOTE: You should not need to set the environment variables "QTDIR" or "QWT_CFLAGS", so leave them be (for now).
wget http://superb-east.dl.sourceforge.net/sourceforge/qwt/qwt-5.0.2.tar.bz2
tar jxf qwt-5.0.2.tar.bz2
cd qwt-5.0.2
* Now edit qwtconfig.pri: ** Change the unix version of "INSTALLBASE" to "/usr/local" (was "/usr/local/qwt-5.0.2"); ** Change "doc.path" to "$$INSTALLBASE/doc/qwt" (was "$$INSTALLBASE/doc"); ** Save, exit.
The "doc" portion is in both HTML and man-style, but is all in /usr/local/doc/{html,man}. While this isn't the standard path, there doesn't seem to be an easy way to separate them and thus this is left as is. Then:
qmake
make
sudo make install
cd ..

Install Boost

For Ubuntu 8.04 and older, download and install Boost 1.35 or later as follows (see README.building-boost file):

1) Download the latest version of boost from boost.sourceforge.net (boost_1_37_0.tar.bz2 was the latest when this was written).

2) unpack it somewhere and cd into the resulting directory
$ cd boost_1_37_0

3) Pick a prefix to install it into. For example use /opt/boost_1_37_0

$ BOOST_PREFIX=/opt/boost_1_37_0
4) Configure
$ ./configure --prefix=$BOOST_PREFIX --with-libraries=thread,date_time,program_options
5) Compile the package
$ make
6) Install the package
$ sudo make install

$ cd ..

Installing GNU Radio

Download, bootstrap, configure, and compile GNU Radio package:

# Install GNU Radio from git

git clone http://gnuradio.org/git/gnuradio.git

cd gnuradio
export LD_LIBRARY_PATH=$BOOST_PREFIX/lib     # As per the instructions for installing Boost

./bootstrap
./configure --with-boost=$BOOST_PREFIX   # As per the instructions for installing Boost
make
Optionally: Run the GNU Radio software self-check; does not require a USRP.
make check

If any test or tests do not work, GNU Radio might still function properly, but it might be wise to look in the email archives for a fix or to write the email list. If writing to the email list, please include the OS type, OS version, and CPU type (e.g. via "uname -a"), anything special about the computer hardware, software versions (gcc, g++, swig, sdcc, etc) and how installed (standard or non-standard package, source). Now install GNU Radio for general use (default is in to /usr/local ):
sudo make install
Ubuntu uses udev for handling hotplug devices, and does not by default provide non-root access to the USRP. The following script is taken from directions, and sets up groups to handle USRP via USB, either live or hot-plug
sudo addgroup usrp
sudo usermod -G usrp -a <YOUR_USERNAME>
echo 'ACTION=="add", BUS=="usb", SYSFS{idVendor}=="fffe", SYSFS{idProduct}=="0002", GROUP:="usrp", MODE:="0660"' > tmpfile
sudo chown root.root tmpfile
sudo mv tmpfile /etc/udev/rules.d/10-usrp.rules
* At this point, Ubuntu is configured to know what to do if/when it detects the USRP on the USB, except that "udev" needs to reload the rules to include the newly created one. The following might work, but if it doesn't then rebooting the computer will.
sudo udevadm control --reload-rules

or
sudo /etc/init.d/udev stop
sudo /etc/init.d/udev start

or
sudo killall -HUP udevd
You can check if the USRP is being recognized, by examining /dev/bus/usb after plugging in a USRP. Using the command:
ls -lR /dev/bus/usb | grep usrp

should result in one or more lines (one for each USRP) reading something like:
crw-rw---- 1 root usrp 189, 514 Mar 24 09:46 003

Each device file will be listed with group 'usrp' and mode 'crw-rw----'.
  • NOTE: If installing on Feisty or newer, the computer probably needs to be rebooted in order for the GNU Radio software to interface correctly with the USRP hardware. This does not seem to be necessary on Edgy.

Once you've verified that the USRP is available to Ubuntu, now it is time to verify that GNU Radio works with the USRP (if installed; if not, skip this). While "usrp_benchmark_usb" might not return a full 32 MB/s of throughput, the script should at least run properly; if not, either GNU Radio didn't make correctly or the USRP isn't accessible. From the "gnuradio" directory, verify that all of the following work:

* Python interface to the USRP; provides a rough estimate of the maximum throughput (quantized to a power of 2) between the host computer and the USRP.
cd gnuradio-examples/python/usrp
./usrp_benchmark_usb.py
* C++ interface to the USRP; provides a good estimate of the maximum throughput (non-quantized) between the host computer and the USRP.
cd usrp/host/apps
./test_usrp_standard_tx
./test_usrp_standard_rx
Update the rest of the system, after which you might need or want to reboot:
sudo apt-get -y upgrade
Update the Linux distro, after which a reboot is required:
sudo apt-get -y dist-upgrade

Broken libtool on Debian and Ubuntu

Because Debian and Ubuntu apply a poorly implemented "enhancement" to the upstream version of libtool,
they break the ability to test code and libraries prior to installing them. We think that testing before
installation is a good idea. To work around their damage, be sure to include
$PREFIX/lib (and $PREFIX/lib64 on 64-bit machines) in /etc/ld.so.conf.

If you don't include $PREFIX/lib in /etc/ld.so.conf, you will see errors during the linking phase
of the build. There are several places it shows up. The first one is often during the build of
mblocks. It's not an mblock problem. It's a Debian/Ubuntu problem.

Do this to work around this "feature":

1) Make a copy from the current ld.so.conf file and save it in a temp folder:
cp /etc/ld.so.conf /tmp/ld.so.conf
2) Add /usr/local/lib path to it :
echo /usr/local/lib >> /tmp/ld.so.conf
3) If you installed Boost (version 1_37_0 for example) manually, then add its library path to the file:
echo /opt/boost_1_37_0/lib >> /tmp/ld.so.conf
4) Delete the original ld.so.conf file and put the modified file instead:
sudo mv /tmp/ld.so.conf /etc/ld.so.conf
5) Do ldconfig:
sudo ldconfig

The udev daemon is used by some Linux distributions to handle plug/unplug events for usb devices.

Follow these steps to allow users other than root to use the USRP:

Setup udev for the usrp

1. Define a group for the usrp

sudo groupadd usrp

2. Add users to the usrp group

sudo usermod -G usrp [username]

3. Add a new udev rule

echo 'ACTION=="add", BUS=="usb", SYSFS{idVendor}=="fffe", SYSFS{idProduct}=="0002", GROUP:="usrp", MODE:="0660"' > tmpfile
sudo chown root.root tmpfile
sudo mv tmpfile /etc/udev/rules.d/10-usrp.rules

4. Load the new udev rule

sudo udevadm control --reload-rules

Verify the setup

Power cycle the usrp device and:

lsusb | grep fffe:0002

You should see an entry with ID: fffe:0002

ls -lR /dev/bus/usb

You should see a device file with group usrp and mode crw-rw----


USRP Docs

USRP-FAQ

Schematics

The schematics for all Ettus Research products, including the USRP, USRP2, and all daughterboards are available here:

http://code.ettus.com/redmine/ettus/projects/public/documents

Clocking

  • USRPClockingNotes has info about using external clocks with the USRP
  • USRPSerialBelow500 instructions on how to send the USRP clock to the daughterboards, for USRPs with a serial number below 500

FPGA Documentation

  • FPGA including details of USB interface along with RX and TX chains

Daughterboard Docs


FAQs

Features

The USRP2 builds on the success of the original USRP, and adds these new features:

  • Gigabit Ethernet interface
  • 25 MHz of instantaneous RF bandwidth
  • Xilinx Spartan 3-2000 FPGA
  • Dual 100 MHz 14-bit ADCs
  • Dual 400 MHz 16-bit DACs
  • 1 MByte of high-speed SRAM
  • Locking to an external 10 MHz reference
  • 1 PPS (pulse per second) input
  • Configuration stored on standard SD cards
  • Standalone operation
  • The ability to lock multiple systems together for MIMO
  • Compatibility with all the same daughterboards as the original USRP

Not all features are currently ready for production use. The USRP2
is initially supported on Linux, and we anticipate that drivers
for Windows, Mac OS X, and other systems will be developed in the
coming months.


Everything we need to have done before the first shipment of the USRP2.


Using the DBSRX Daughterboard With the USRP2 Hardware

In order to use the DBSRX receive daughterboard with the USRP2, you will need to modify the the DBSRX hardware.

Supported Hardware

According to the manufacturer:

"This will only work if you have a DBSRX which says "Rev 2.2". This
should be most units from 2007, and everything from 2008 or 2009. It
will not work with older DBSRX boards. For those, there is no way to
use them with the USRP2."

Supported Software

Support for the DBSRX in USRP2 requires using at least revision 10524 (February 26, 2009) of the GNU Radio trunk software, the USRP2 FPGA image, and USRP2 firmware. These last two may be obtained at http://gnuradio.org/releases/usrp2-bin/trunk and are installed on the USRP2 SD card.

Process

There are 2 steps to the process:

  • Remove R193 (which is 10 ohms, 0603 size) and put it on R194, which is empty. This is made somewhat more complicated by the fact that the silkscreen is not clear in that area. R193 is on the back, immediately below the large beige connector, J2. R194 is just below, and to the left of R193. The silkscreen for R193 is ok, but for R194, it is upside down, and partially cut off. If you lose R193, you can use anything from 0 to 10 ohms there.
  • Put the firmware called burn_dbsrx_eeprom.bin onto the SD card, and run the USRP2 with that firmware and the DBSRX installed. Then put the original txrx.bin file back on the SD card.

What are the differences between the USRP1 and USRP2?

USRP1 USRP2
Interface USB 2.0 Gigabit Ethernet
FPGA ltera EP1C12 Xilinx Spartan 3 2000
RF Bandwidth to/from host 8 MHz @ 16bits 25 MHz @ 16bits
Cost $700 $1400
ADC Samples 12-bit, 64 MS/s 14-bit, 100 MS/s
DAC Samples 14-bit, 128 MS/s 16-bit, 400 MS/s
Daughterboard capacity 2 TX, 2 RX 1 TX, 1 RX
SRAM None 1 Megabyte
Power 6V, 3A 6V, 3A

What FPGA is used in the USRP2?

XC3S2000-5FGG456, That is the Spartan 3 2000, fast speed grade (-5), 456 pin BGA package.

I know that the USRP2 does not support two transceivers. But does it support 2 coherent receivers?

No, a single USRP2 can only support either
  • 1 RX and 1 TX daughterboard.
    OR
  • 1 Transceiver daughterboard

You would need two USRP2s linked with a MIMO cable in order to have 2 coherent receivers. The exception is if you use your own external RF downconverters, in which case you can connect two of them to one BasicRX.

Can I compile FPGA designs with the free version of the Xilinx tools?

Please note that the USRP2 uses a Spartan 3-2000 chip. This means that if you intend to do your own FPGA development, you need to use the full version of the Xilinx tools in order to generate an image for it. You cannot use the free web pack version. Thus there are several options for you:

  • Just use the prebuilt FPGA images we provide
  • Purchase the full version of ISE from Xilinx
  • Get a 60 day demo version from the Xilinx Web Site
  • Convince your Xilinx apps engineer to get you a free copy
  • Universities often get the tools free of charge
  • Release your changes to the community and we can find some sort of way to build them for you (if anybody wants to work on putting together some scripts to do this automatically, let me know).

What are the different ways MIMO can be set up with more than one USRP2?

There are 3 things necessary to get MIMO working.
1. All systems need to be phase-locked to a common clock (10 MHz in this case)
2. All systems need to have a common time reference (often a 1 PPS signal) so that they know which sample in one system corresponds to which sample in the other
3. All the data needs to come from / go to the same place

The MIMO Expansion interface on the USRP2 carries all 3 of those.

Scenario 1 - Two USRP2 systems connected by a MIMO cable:

The Master USRP2 is the one connected to both ethernet and the MIMO cable.
The Slave USRP2 is the one connected to just the MIMO cable.
The master provides a clock to the slave over the MIMO cable.
The master provides the time reference to the slave over the MIMO cable.
On transmit, the host sends all data over the ethernet to the master.
The master uses the data which is intended for the master, and passes the data for the slave over the MIMO cable.
On receive, the slave sends all data over the MIMO cable to the master, and the master passes it back to the host over ethernet. It also sends its own data over the ethernet to the host.
The firmware and host driver code to do this is not ready yet, but is in progress. (14 November 2008)

Scenario 2 - Up to Four USRP2 systems connected by MIMO cables to the not-yet-in-existence HUB:

The HUB has a big FPGA on it.
The HUB provides clock and time reference to all USRP2 systems.
The HUB communicates with the host computer by ethernet or PCI Express, or operates standalone.
All USRP2 systems send data back and forth to the HUB.
The HUB is not ready yet, but the design is in progress. We hope to have it ready in 9-12 months. (14 November 2008)

Scenario 3 - An arbitrary number of USRP2 systems, no MIMO cables, no HUB:

Some means of providing the same 10 MHz reference to all USRP2 systems must be set up. Typically this would be the 10 MHz output of some lab reference like a GPS-locked reference. That reference would be put through some sort of active splitter, and fed into all the USRP2s by SMA connector on the front panel.
Some means of providing the same time reference to all USRP2 systems is also needed. This would normally be a 1 PPS signal generated by the same reference. It will need to go through some sort of active splitter and send into the PPS input of all the USRP2 systems.
ALL the USRP2 systems will need to be connected to the host computer by gigabit ethernet. You can probably use an ethernet switch, but there will be issues with sharing the bandwidth.
The firmware to do this is ready. The host code to do it is not ready yet. (14 November 2008)

What is the use of the 1 PPS and 10 MHz inputs? These are standard outputs of a GPS unit. Are they external references or are they are used in the Ethernet time stamping?

The USRP2 uses a 100 MHz clock internally. That clock will be locked to the 10 MHz reference you provide.

Samples can be time stamped, and that time can be calibrated to the 1 PPS signal. In the most general case, that 1 PPS input just goes directly to the FPGA, so internally you can do whatever you want with it.

Is the timestamp only tied to (t=0 to) the 1PPS-pulse? I hope to use faster sync pulse like at 1-10kHz, and get the timestamp referenced to them. Is this possible?

The 1 PPS input goes to an FPGA pin, so you can program the FPGA to do whatever you want. This includes accepting faster sync pulses, encoded timestamps, Morse code, etc.

What are the electrical specifications for the 10MHz reference signal?

The Reference input can take a square or sine wave input that is DC-blocked and terminated in 50 ohms. The input should be less than 3V pk-pk.

What are the electrical specifications for the PPS input?

The PPS input is not DC blocked. It is AC terminated in 50 ohms, DC terminated in 1K ohms. The digital signal you put in should be between 0 and 5 V. It should never go below 0V and never above 6V.

What phase relation do you expect between 10MHz and 1PPS?

The PPS signal should be synchronous to the 10 MHz reference. Nearly any GPS frequency reference should work. Everything from http://jackson-labs.com would suffice.

What is the 1 Megabyte SRAM used for?

In the standard FPGA build we provide right now, it isn't used at all. One could set it up for a number of different uses:

  • Large buffers to hold pre-modulated packets, like ACK packets
  • A very large FIFO to hold bursts of samples at rates higher than what the Ethernet would normally allow
  • An auxiliary RAM for either data or instructions (or both) for the RISC processor

All of the above would require some Verilog coding on your part.

How are the connections between USRP2 boxes intended to work? There are a MIMO connector and an frequency reference input.

The MIMO connector brings the frequency reference from one USRP2 to the other. If you wish to use an external frequency reference to lock both USRP2s, you would feed it to the first USRP2, and the MIMO connector will deliver it to the 2nd.

Is it possible to connect more boxes together using the MIM0 connector?

Not directly. Eventually, we will be selling another device to allow you to connect more than 2 USRP2s together (most likely 4), but for now you would be limited to 2.

Where is the limitation of 8 antennas as stated on the datasheet?

When the 4-way USRP2 link device discussed above is used, and each USRP2 is used with 2 separate RF channels via the BasicRX and BasicTX, you would get 8 channels.

How can I use both A/D converters on the USRP2?

Usually the 2 are used for I and Q from the downconverters, but you can use them separately as well by using the BasicRX.

Does the external frequency reference have to be 10 MHz? Can I use 100 MHz?

Actually, you can use 100 MHz as well, you will just need to change one line of the firmware to set the R-divider on the PLL. You can use any frequency for which the following equation has a solution:

   100 MHz / N = Ref / R
       for which N and R are integers and smaller than 32,768

Can an external clock be used instead of the internal 100 MHz VCXO?

The internal clock (a very clean VCXO) is locked to the external reference if one is applied. You have a lot of flexibility in selecting the reference frequency (see previous question), but you cannot pull the VCXO further than a few kHz, and you cannot use the reference as the main system clock. So there is no way, for example, to put in a 120 MHz clock and have everything run off of that. You are basically stuck with 100 MHz unless you are willing to solder.

If you are willing to do some soldering, there are pin-compatible VCXOs in other frequencies which are available. The part is the CVHD950 from Crystek, and you can get them from Mouser. Note than anything over 100 MHz may make it hard to get the FPGA to meet timing requirements. Also, the ADC is only specified to 105 MHz, but there is a pin-compatible version spec'ed to 125 MHz.

What is the Job of 10MHz Reference Clock ?

The 10 MHz reference input on the front is optional. If you connect it and enable locking, the 100 MHz main oscillator will lock to it, otherwise it will free run. Everything inside the FPGA runs at 100 MHz (DSP) or 50 MHz (processor).

There is also a 10 MHz reference clock sent out on the MIMO connector. When turned on, it will be the 100 MHz clock divided down by 10.

What chipset is used in the USRP2 for managing the Gigabit Ethernet interface?

It's done with an open source MAC implemented in the FPGA and a National Semicondutor PHY chip, DP83856.

How does the USRP2 boot? How is the FPGA firmware loaded?

The CPLD (a Xilinx XC9572) reads the first megabyte from the SD card and
writes it to the FPGA config pins in slave-serial mode. Once the FPGA is
configured, it requests the firmware for the aeMB processor from the SD
card. After that, the CPLD is switched over to passthru mode, and the
FPGA has direct access to the SD card under program control.

What is the USRP2 ADC chip? Is there an auxiliary ADC?

The main ADC is the Dual 14-bit LTC2284, used at 100 MS/s. There is an auxiliary 2 channels, 12-bit
ADC (the AD7922) for each dboard connector.

What is the USRP2 DAC chip? Is there an auxiliary DAC?

The main DAC is the Dual 16-bit AD9777 fed with 100 Ms/s and produces 400 Ms/s based analog output. The auxiliary DACs are the dual 12-bit AD5623.

Is there auxiliary Digital I/O?

The same USRP1 16 digital IOs, SPI, and I2C to each daughterboard connector. The whole interface to the daughterboards is the same as the USRP1, except instead of it being implemented all in the AD9862, it is done with the following set:

  • LTC2284
  • AD9777
  • 2x AD5623
  • 2x AD7922

How are the USRP2 DDCs implemented ? How many CIC stages does it contain?

The DDCs are very similar to the USRP1 with a 4 stage CIC but with 2 HBF filters. The CIC can decimate in the range [1..128]. The high rate HBF has 7 taps and it decimates by 2. The low rate HBF has 31 taps and also decimates by 2.

How are the USRP2 DUCs implemented ? How many CIC stages does it contain?

Again, very similar. There us a 4 stage CIC and 2 HBF filters each working in interpolation mode.

What does the magnitude response of the low rate HBF interpolator look like?

And what about the low rate HBF decimator?

It is identical to the one of the interpolator, see above.

What is the magnitude response of the high rate HBF interpolator/decimator?

How is the USRP2 HBF for TX and RX sides are implemented?

I will explain the RX side, the TX side is basically the same.

small_hb_dec is the short filter which works at the higher rate. There are 2 of them instantiated, one for I and one for Q. It has 7 taps. One of those taps is the center tap which only requires a shift and not a multiply, and 2 of those taps are zeros. That leaves 4 taps. The taps are symmetric, which leaves 2 multiplies per output. Since we have at least 2 cycles to produce each output, we can use a single multiplier.

hb_dec is 2nd halfband filter and it works at the lower rate. There are 2 of them instantiated, one for I and one for Q. It has 31 taps. One of those taps is the center tap which only requires a shift and not a multiply, and half of the remainder are zeros. That leaves 16 taps. They are symmetric, so that means we need to do 8 multiplies to produce each output. There are at least 4 cycles to produce each output, so we need to do 2 multiplies at a time.

One of those multipliers does the "outer" coefficients, meaning the ones at the very beginning and end of the impulse response, and one does the "inner" coefficients, meaning the ones around the center of the impulse response. This division is purely an implementation choice, and does not affect the output. I could have put the odd ones on one mult and the even ones on the other, or any other split you could imagine. It doesn't matter.

What are the USRP2 minimum and maximum decimation/interpolation values? Is odd decimation/interpolation possible?

Minimum interpolation and decimation is 4 and maximum is 512. If you use odd decimation or interpolation, you just get a CIC with no halfbands. If you use an even rate but not a multiple of 4, you just get one halfband (the low rate one). If your rate is a multiple of 4, you use both halfbands.

How are the USRP2 DACs fed ?

The FPGA talks to the DAC at 100 MS/s just like it talks to the ADC at 100 MS/s. The interpolation from 100 MS/s to 400 MS/s happens inside the DAC chip itself. Unless you are doing something fancy, you can think of the
DAC as operating at 100 MS/s.

The primary reason for the x4 interpolation to 400 MS/s is to simplify the analog reconstruction filters. It also allows for a coarse modulation up to 150 MHz, but I don't anticipate that being used very often.

What are the default USRP2 IP address and subnet mask?

The standard USRP2 FPGA image does not use IP, just raw ethernet.

Does USRP2 respond to a network ping command?

No, but we have our own, find_usrps

What is the USRP2 reference clock stability?

About 20 ppm unless you lock to an external reference.

With the BasicTX board, the USRP1 can generate a maximum of 44 MHz frequency. What is the USRP2 capable of generating?

44 MHz is the highest frequency in the first Nyquist zone on the USRP1.

Much higher frequencies can be used in the higher zones. The USRP2 takes 100 MS/s rates and interpolates up to 400 MS/s. Direct
frequencies up to ~170 MHz should be usable. The code that initializes the DAC is in u2_init.c

What is the USRP2 overrun message?

Currently, overruns are shown on the UART port and not on the host. They
are shown with a "O". The reality is that you should never see them.
If the host computer can't keep up, you will see an "S" messages in the
terminal on the host that indicates a sequence number error.

What is the USRP2 underrun message?

Under runs are shown on the UART port as "U".

What are the most important (hot) trunk USRP2 code that we need to check to understand USRP2 architecture, configuration, and operation?

In the FPGA code, the tx_control.v and rx_control.v show inband
signalling, dsp_core_rx and dsp_core_tx show the DSP, and u2_core.v is
the top level. In the firmware, start with txrx.c.

How much of the USRP2's FPGA resources are required by the FPGA firmware?

37 out of 40 block RAMs, 16 or 18 of the 40 multipliers, and about 35 to
40% of the logic area.

What is the serial setting needed to talk to the USRP2's UART (Baudrate, parity,...etc) ?

The serial is TTL level with 230400 baud, 8N1 format

Is the processing of set_scale_iq done in the host or in the FPGA?

The scaling itself is done in the DSP pipeline in the FPGA.

What is the purpose of the AeMB processor? What is its clocking speed?

The aeMB processor is a fully synthesized CPU that forms the heart of
the USRP2 FPGA system-on-a-chip design. It performs configuration and
status reporting for all the FPGA peripherals, manages the control
channel for the GbE transport, and handles RF daughterboard operation.
It does not perform any DSP functions; these are done purely in logic
in the DSP RX and TX pipelines. It is clocked at 50 MHz, half the
system clock rate.

Where is the USRP2's MAC address stored ?

The USRP2's MAC address is stored on the USRP2's motherboard EEPROM.


The following is a chart of the status of Gigabit Ethernet cards and how well they seem to work with the USRP2. Some may require special settings, which should be listed below. Please add information about card you have had success or problems with.

Chipset Brand/Motherboard Interface Driver Good/Bad/? Reported By Notes
Agere ET131x StarTech ST1000BTPEX PCIe et131x Bad ematlis Problems on Linux in general
Broadcom BCM5755M Dell motherboards PCIe tg3 Good matt
Intel PRO/1000 Intel MB, Thinkpads PCIe e1000e Good matt
Intel 82566 Intel 82566MM GLAN PCIe e1000 Good Firas
Intel 82572EI PCIe e1000e Good ematlis
Intel 82572L Thinkpad T60 PCIe e1000e Good jcorgan
Intel 82575EB Supermicro 7045A-WTB PCIe igb Good jcorgan
Marvell 88E8001 D-Link DGE-530T PCI skge Ok matt Trouble keeping up at highest data rates
Marvell 88E8052 D-Link DGE-560T PCIe sky2 Good matt Very similar to 88E8056
Marvell 88E8055 Fujitsu-Siemens laptop PCIe sky2 Good azimout
Marvell 88E8056 Common PCIe sky2 Good matt
Marvell 88E8058 Linux on MacBook Pro PCIe sky2 Good geiger
Marvell Yukon2 Belkin Gigabit Express ExpressCard sky2 Good trnewman May require special settings
RealTek 8169 NetGear GA-311, TrendNet TEG-PCITXR PCI r8169 Bad? blt Works for others (ettus, xil, Firas)
RealTek 8168/8111 Realtek RTL 8168/8111 PCI-E Gigabit PCIe r8169 Good Firas
SIS968 ASUS P5S-MX SE MB Southbridge sis968 Bad hl1oap Problems on Linux in general

USRP2 Schematics

The most recent schematics for Ettus Research products can be found here:

http://code.ettus.com/redmine/ettus/projects/public/documents


What is the SD Card for?

The SD Card hold the FPGA configuration and microprocessor firmware. You can also store data on the rest of the card, but that is currently not implemented in the firware.

Is the SD Card necessary?

The USRP2 needs to have the SD card plugged in to operate. And the SD card needs to be programmed with a valid FPGA configuration and firmware build. Without this the USRP2 does nothing but sit there. The SD card is NOT optional. If you put it in the slot on the USRP2 and power up the USRP2, you should see all 6 LEDs flash, and 2 will remain on. If you don't, then the card is not programmed properly.

Does the SD Card come programmed?

The SD card that came with the USRP2 is preprogrammed with a build which was the latest at the time when it shipped. You can always find the latest released versions at http://gnuradio.org/releases/usrp2-bin/trunk/ . To build your own firmware you will need to install the Microblaze tools http://gnuradio.org/tools. To build the FPGA yourself you'll need to use the full (pay) version of Xilinx ISE 10.1.03.

Some SD Cards shipped in Nov and Dec of 2009 (Blue, 2GB Patriot brand) will not work. Go to http://ettus.com/flash for more details on how to get a replacement.

How do I change the firmware and FPGA code on the SD Card?

The SD card does NOT contain a filesystem, and you will NOT be able to read or write it using normal tools.

To change the firmware and FPGA code, you need an SD card programmer. These are available from Ettus Research, or at your local electronics store. Here are the steps to upgrade the firmware:

  1. Build the firmware by running make in the gnuradio/usrp2 directory
  2. Insert the SD card into the card reader, and the card reader into a USB port on your computer
  3. Run
    sudo u2_flash_tool --dev=/dev/XXXX -t s/w usrp2/firmware/txrx.bin -w
  • /dev/XXXX has to be replaced with the device for the SD card reader. If you get this wrong YOU CAN OVERWRITE YOUR WHOLE HARD DRIVE, so be careful. If you are not sure, DON'T DO ANYTHING. On my machine, the device is /dev/sdb, but it is likely to be different on your machine. Before doing this, it is a good idea to run "df" to make sure that the device you are about to use is not mounted.

Here are the steps to upgrade the FPGA code on the SD card:

  1. Build (requires proprietary tools) or download the FPGA bitstream. The current version as of 1 December 2008 is u2_rev3.bin. It can be downloaded from [http://gnuradio.org/releases/usrp2-bin/trunk/
  2. Insert the SD card into your card reader.
  3. Run
    sudo u2_flash_tool --dev=/dev/XXXX -t fpga u2_rev3.bin -w

To find out what XXXX is, you can goto http://vic.gedris.org/linux-UsbMassStorage/ which tells you to do the following steps to determine which device you would like to flash.

  1. Install sg3-utils package
    $sudo apt-get update
    $sudo apt-get install sg3-utils
    
  2. List the raw scsi- devices on your system
    $sudo sg_scan -i
  3. Have a look at the list printed out, and determine which SCSI- device is most likely your USB- card reader/writer.
  4. Run sg_map to see what SCSI- device is associated with the USB sdcard r/w- device.
    $sudo sg_map
    

Does the USRP2 require its own ethernet port? Does it have to be gigabit?

It is strongly recommended that the USRP2 be connected directly to the host computer via gigabit ethernet. You can use a switch, but your system's main network connection should be separate. Also, operation at 10 or 100 mbps instead of 1 Gbps is not currently supported. The hardware is capable, but the current FPGA verilog code disables it for a variety of reasons.

What Gigabit Ethernet Interface do you suggest?

The first question to answer is how you want to attach the gigabit ethernet interface to the computer:

PCI Express (also known as PCIe) Strongly suggested, as it is the fastest interface commonly available.
PCI Plain old PCI is 32 bits wide and 33 MHz. This is not really fast enough to handle the full USRP2 capabilities, but will work for most users. 64 Bit and/or 66 MHz variations of PCI would be better, but are not very common.
PCI-X This is NOT the same as PCI Express. It is faster than plain PCI, and so is preferable to it, but is not very common.
USB 2.0 This is simply nowhere near fast enough for our purposes and its use is strongly discouraged. If you wish to use USB 2.0, we suggest using it with the USRP1.
PCMCIA/CardBUS CardBUS is a plain old PCI bus with a PCMCIA card form factor. See PCI above.
ExpressCard ExpressCard is PCI Express in a card form factor. These should work fine as long as the drivers exist for your card. Some of these cards (perhaps all) will cause the kernel to "oops", or crash your whole machine, if you pull them out while in operation, so be careful.

Most Gigabit Ethernet interfaces built onto a motherboard or into a laptop are either PCI Express (mostly newer systems) or plain PCI (older systems).

For further info, see USRP2GigEReports

When transmitting, my USRP2 runs for a little while and then dies. What is wrong?

Your Ethernet interface is not autonegotiating flow control properly. You can force the correct settings on your ethernet card by running the following command:

ethtool -A eth0 rx on

You should replace "eth0" with the ethernet interface you are actually using, usually eth0 or eth1. You will probably need to run this command every time you boot, and will probably need to run it as root.

Any hints for getting started? In particular, what needs to be done to talk to the usrp2 via the ethernet?

The first step is to update to the latest svn for the entire gnuradio tree, and get it all installed. Then, run:

find_usrps

in the usrp2/host/apps directory. You'll need to tell it which ethernet port to use if the USRP2 is not on eth0. The program should tell you if it found USRP2s.

What is a good basic app to test the USRP2

Run

usrp2_fft.py

which is found in gr-utils and should also be installed in your path if you did a make install on the full tree. This will give you a basic spectrum analyzer display. Run
usrp2_fft.py -h

for a list of options.

When I'm trying to look at more data than the computer can handle, the console prints "S" characters. What does that signify? Do O or U still apply as on the USRP1?

S means that the PC is seeing 2 successive packets which do not have 2 successive sequence numbers. This means that the host computer has dropped the packets in between. It is essentially the equivalent of an overrun. The USRP2 does not actually overrun, however, since it is not throttled by the host computer.

How do I compile the firmware for the aeMB RISC processor?

You'll need to download or build the gcc toolchain first. If you're on x86 or x86_64 linux, we've got a binary tarball that you can download and unpack into /opt.

Downloading and installing prebuilt x86 binary

$ wget http://gnuradio.org/tools/mb-gcc-4.1.1.gr2.i386.tar.gz

Once you've downloaded the tarball,

$ sudo bash
# cd /opt
# tar xzvf <path-to-tarball>

Then add /opt/microblaze/bin to PATH and you're good to go.

NOTE -- This may not work on Fedora 10 x64_64. See below.

Building the toolchain from source

If you want to build from source you'll need to download the EDK source and our patch, and compile away.
Note that compilation of the compiler fails if using gcc 4.3. We're not planning on fixing this bug.
$ svn export http://gnuradio.org/svn/gnuradio/trunk/dtools/microblaze/mb-gcc-4.1.1-gr-1.patch
$ wget http://gnuradio.org/tools/EDK101_GPL_GNU_src.tar.gz
$ tar -xzvf EDK101_GPL_GNU_src.tar.gz
$ patch -p1 <mb-gcc-4.1.1-gr-1.patch
$ cd Xilinx_EDK_GNU_10.1i/mb
$ /bin/bash ./build_binutils.sh
$ /bin/bash ./build_gcc.sh
$ cp -r release/lin/mb /opt/microblaze

(Older directions at http://www.aeste.net/index.php?q=node/16. Doesn't include patch that reduces size of libgcc 64-bit support routines.)

On Fedora 10, you will need to install compat-gcc-34-3.4.6-9.x86_64 and then run the build commands like this:

$ CC=/usr/bin/x86_64-redhat-linux-gcc34 /bin/bash ./build_binutils.sh
$ CC=/usr/bin/x86_64-redhat-linux-gcc34 /bin/bash ./build_gcc.sh

Can you also provide details concerning the debug port?

The debug port is a standard Mictor connector which is often used with logic analyzers from Agilent and Tektronix. It has 2 clock pins and 32 data pins. All 34 of those are directly connected to the FPGA, so you can do whatever you want with them.

If you plug in a BasicRX (or LFRX) and a BasicTX (or LFTX), you will have an additional 32 bits of IO which can also be used for debugging. This gives a total of 64 bits plus 2 clocks for debug.

Is there a JTAG port?

Yes, there is a standard JTAG header on the board connected to the FPGA and a CPLD, but you may not need it. Since the FPGA is programmed from the SD Card by the bootstrapping CPLD, the main utility of the JTAG port is to reprogram the CPLD. You may be able to use the JTAG port with ChipScope.

I would like to interface to the expansion port, and connect the USRP2 to a Virtex 5 SXT eval board. I am looking for any documentation concerning this port, especially how it is tied into the the FPGA, if that is the case.

The expansion port is pretty straightforward. It uses a serial-attached SCSI (mini-SAS) cable. The cable has 4 lanes. Each lane consists of 1 differential pair input and 1 differential pair output. All lanes are AC (capacitor) coupled. The 4 lanes are allocated as follows:

1 - High-speed SERDES, 2 gbps 8B10B encoded. This interface is handled by a TLK2701 from TI, and it connects to the FPGA. You should be able to connect this interface to the RocketIO GTP/GTX transceivers on the virtex 5. Also, see the usrp2/fpga/serdes directory in the SVN repository to see how we handle the interface and protocol, framing, and flow control.

2 - 10 MHz clock reference

3 - Digital IO, connected directly to LVDS IOs on the FPGA. We currently have this set up to do time syncing, but you can do whatever you like with it.

4 - Unused

Can the USRP2 be used by a non-root user?

The code that talks to the USRP2 uses raw socket access (SOCK_RAW) on the ethernet port. This allows the use of a custom ethertype rather than building on a higher level protocol like IP or UDP. The kernel does not allow anyone but root to use raw sockets. This is unlikely to change any time soon. Other tools that use raw sockets must also be run as root or are suid (like ping).

It is possible to allow suid access to the USRP2 by making usrp2_socket_opener suid root. This allows us to use the least privileges possible on all other programs, and usrp2_socket_opener is a nice short program that can easily be audited. Example:

sudo chmod u+s /usr/local/bin/usrp2_socket_opener

Note that if you do a make install again it may overwrite your usrp2_socket_opener, and then it won't have the permissions set anymore. You can avoid this by putting the suid copy in your ~/bin directory, which won't be overwritten every time.

To enable real-time scheduling for non-root users, edit /etc/security/limits.conf and add this line:
@usrp  - rtprio 50

make sure that your user is a member of group usrp, then logout and back in.

How do I use the DBSRX receive daughterboard with the USRP2?

In order to use the DBSRX receive daughterboard with the USRP2, you will need to modify the the DBSRX hardware and reprogram its eeprom. Here are instruction for how to do so.


USRP Class

This document details the current USRP base class, and as we proceed will contain details on the new USRP base class with support for in-band signaling. The current USRP base class is found in [source:/gnuradio/trunk/usrp/host/lib/usrp_basic.cc usrp_basic.cc] as usrp_basic. More information about the class can be found in the usrp_basic doxygen documentation. The inheritance diagram for the usrp_basic class is as follows:

http://gnuradio.org/doc/doxygen/classusrp+basic+inherit+graph.png

Some functionality that the base class gives access to are the FPGA registers, AD9862 registers, I2C peripheral, DAC/ADC, and the EEPROMs for the motherboard and daughterboards.

Initialization of usrp_basic

1. Load the USRP firmware with usrp_load_firmware_nth()
1. Load the FPGA bitstream with usrp_load_fpga()
1. Initialize the common RX and TX AD9862 registers

Initialization of usrp_standard_rx

1. Set the format of the RX data via the control register (FR_RX_FORMAT)
1. Set the number of channels (FR_TX_MUX)
1. Set the decimal rate between 4 and 256 (FR_DECIM_RATE)
1. Set the mux (FR_RX_MUX)
1. Set the FPGA mode (FR_MODE)
1. For each channel, initialize the RX frequencies and the DDC phases to 0 (FR_RX_FREQ_* FR_RX_PHASE_*)

Initialization of usrp_standard_tx

1. Initialize AD9862 TX registers
1. Set the number of channels (FR_TX_MUX)
1. Set transmission interpolation rate from 4 to 512, a multiple of 4 (FP_INTERP_RATE)
1. Set the mux (FR_TX_MUX)
1. For each channel, initialize the TX frequency to 0 (FR_TX_FREQ_*)

USRP Clocking Notes

Having synchronized clocks throughout the entire transceiver chain allows you to build MIMO systems, smart antennas, phased arrays, and interferometers. The USRP was designed with this capability in mind. Below are some notes on how to use it.

Synchronizing all daughterboard LOs

If you have multiple daughterboards in a system, and desire phase coherence, you will have to take these steps, depending on your daughterboards

  • BasicRX, BasicTX, LFRX, LFTX
  • These boards have no LOs, so nothing is necessary.
  • If you have your own external RF sections, you are on your own
  • TVRX -- The TVRX is not suitable for synchronized multi-antenna applications.
  • The TVRX has its own oscillator inside the can.
  • There is no way to make these boards phase-coherent.
  • DBSRX
  • The DBSRX always uses the main USRP clock, so it is always phase-coherent
  • Flex400, Flex900, Flex2400
  • Early boards were shipped configured to use their own crystal oscillators, but newer ones (since late 2006) are configured to use the USRP motherboard oscillator
  • To modify these boards for coherent applications if you have USRP rev 2, 3, or 3B boards:
    • On the daughterboard, Move R64 to R84, Move R142 to R153
      • This disables the daughterboard clocks
    • On the daughterboard, Move R35 to R34, Move R117 to R116
      • This connects the boards to the FPGA clock output
    • Plug the board into side A of your USRP and execute one of the following commands to reprogram the dboard EEPROM:
      • usrp/host/apps/burn-db-eeprom -A -t rfx400_mimo_a --force
      • usrp/host/apps/burn-db-eeprom -A -t rfx900_mimo_a --force
      • usrp/host/apps/burn-db-eeprom -A -t rfx2400_mimo_a --force
  • To modify these boards for coherent applications if you have USRP rev 4 boards:
    • Recent boards don't need these mods, only early RFX-boards
    • Move R64 to R84, Move R142 to R153
      • This disables the daughterboard clocks
    • Move R35 to R36, Move R117 to R115
      • This connects the boards to the motherboard clock
      • These are all 0-ohm, so if you lose one, just short across the appropriate pads
    • Plug the board into side A of your USRP and execute one of the following commands to reprogram the dboard EEPROM:
      • usrp/host/apps/burn-db-eeprom -A -t rfx400_mimo_b --force
      • usrp/host/apps/burn-db-eeprom -A -t rfx900_mimo_b --force
      • usrp/host/apps/burn-db-eeprom -A -t rfx2400_mimo_b --force

Synchronizing multiple USRPs

To usefully synchronize multiple USRP boards, there are 2 factors you need to consider.
  • Clock synchronization, which is detailed below
  • Matching samples between boards. Martin DvH has done work on this. Contact him for more info.

To synchronize the clocks on multiple USRPs, you must convert them to use a common reference clock. This is done as follows:

  • Rev 3 USRPs
  • Cut the traces coming from X2
  • Replace R2027 with a 0 Ohm resistor (size 0603)
  • Put an SMA connector in J2001
    • Note that you won't be able to fit a TVRX in the RXB slot anymore once you do this
  • Feed your master clock in on this SMA connector. It should be between 10 and 64 MHz, and it will become your sample clock
  • Rev 3B USRPs
  • Desolder the clock board from J2001
  • Put an SMA connector in J2001
    • Note that you won't be able to fit a TVRX in the RXB slot anymore once you do this
  • Feed your master clock in on this SMA connector. It should be between 10 and 64 MHz, and it will become your sample clock
  • Rev 4 USRPs
  • Rev 4 USRPs introduced an enhancement to allow one board to be the master clock, and all other boards will slave to it.
  • For the master clock board:
    • Solder an SMA connector into J2002. This is the master clock output. Be careful when soldering the SMA connector so you don't break the delicate trace from J2002 to R2028.
    • Note that you won't be able to fit a TVRX in the RXB slot anymore once you do this.
  • For the slave boards:
    • Solder an SMA connector into J2001. This is the clock input. Be careful when soldering the SMA connector so you don't break the delicate trace from J2001 to C927.
      • Note that you won't be able to fit a TVRX in the RXB slot anymore once you do this.
    • Move R2029 to R2030. This disables the onboard clock. R2029/R2030 is a 0-ohm resistor.
    • Move C925 to C926.
    • Remove C924.
    • If you want to chain another USRP off of this one, you can use J2002 to provide a clock out

USRP Daugherboard: BasicRX

Specifications

RX: 1MHz - 250MHz

TX: N/A

The BasicTX and BasicRX are designed for use with external RF frontends as an intermediate frequency (IF) interface. The ADC inputs
and DAC outputs are directly transformer-coupled to SMA connectors (50Ω impedance) with no mixers, filters, or amplifiers.

The BasicTX and BasicRX give direct access to all of the signals on the daughterboard interface (including 16 bits of high-speed digital I/O, SPI and I2C buses, and the low-speed ADCs and DACs), and as such are useful for developing your own daughterboards or custom FPGA designs.

NOTE: It is possible for the BasicRX board to go down to 100kHz, but YMMV.

Subdevices

While the BasicRX has two antennas (A and B), the driver presents 3 subdevices: 0, 1 and 2.

Subdevice0 is the antenna A, Subdevice1 is the antenna B. You can use both subdevice 0 and 1 at the same time on two different ddc inputs and tune them separately. These subdevices are used as real inputs, and the Q inputs to the ddc are set to zero.

The third possibility is to use subdevice2 which treats the antenna A and B as a single complex input (I and Q), and connects them to the I and Q inputs of the DDC input0. When using subdevice2, you cannot use subdevice 0 and 1.

(Thanks to Josh Blum for the clarification)


USRP Daugherboard: BasicTX

Specifications

RX: N/A

TX: 1MHz - 250MHz

The BasicTX and BasicRX are designed for use with external RF frontends as an intermediate frequency (IF) interface. The ADC inputs and DAC outputs are directly transformer-coupled to SMA connectors (50Ω impedance) with no mixers, filters, or amplifiers.

The BasicTX and BasicRX give direct access to all of the signals on the daughterboard interface (including 16 bits of high-speed digital I/O, SPI and I2C buses, and the low-speed ADCs and DACs), and as such are useful for developing your own daughterboards or custom FPGA designs.

NOTE: It is possible for the BasicTX board to go down to 100kHz, but YMMV.


USRP Daugherboard: DBSRX

Specifications

RX: 800MHz - 2.4GHz

TX: N/A

Notes

This section contains a collection of notes regarding the DBSRX daughterboard.

The frequency range and maximum and minimum bandwidth given in the MAX2118 is different from the one stated in the datasheet from www.ettus.com. Matt Ettus explains the differences:

Frequency Range

The MAX2118 datasheet says that it covers 925 to 2175 MHz. They spec that because it is the range that their typical customer needs (for small satellite dish IFs). However, I have never found one which doesn't work to the larger 800 MHz to 2400 MHz range. Maxim guarantees 925 to 2175, I guarantee the larger range.

Bandwidth

When Maxim states that their maximum LPF bandwidth is 33 MHz, they mean one-sided bandwidth (i.e. 0 to 33 MHz). Since it is used in a direct conversion IQ system, that actually gives a 66 MHz bandwidth (-33 MHz to +33 MHz). Since that is beyond Nyquist for our ADC, I spec to 60 MHz (+/- 30 MHz).

On the low end, they specify 4 MHz, which is really 8 MHz (+/-4 MHz) of RF bandwidth. The filter is actually capable of going to a much narrow frequency, but it is outside of Maxim's specs, since nobody in the small satellite dish market cares about less than 8 MHz of BW. So I spec that it goes down to 1 MHz wide. It should be noted that when you go below 4 MHz wide (2 MHz in Maxim-speak) that your noise floor will rise a bit and phase noise may also rise.

Tuning

Taken from an email to discuss-gnuradio on 27 Mar 2007 from Gregory W Heckler:

Tuning the down-converter on the DBS-RX card consists of programming the values of 2 dividers. The R divider divides down the reference clock frequency (4 MHz, which derives from the 64 MHz board clock). The N divider divides down the LO frequency. The R divider has a range from 2 to 256, the N divider from 256 to 32768. The Max2118 phase locks the divided LO frequency to the divided reference clock frequency, or:

LO = N*(Refclk_Freq/R)

However, the PLL in the Max2118 is unstable if you divide down the reference clock frequency to below 250 kHz, this effectively limits the frequency resolution at which you can command the LO frequency.

Block Diagram

Nice Block diagram produced by Gregory W Heckler.


USRP Daugherboard: LFRX

Specifications

RX: DC - 30MHz

TX: N/A

Subdevices

While the LFRX has two antennas (A and B), the driver presents 3 subdevices: 0, 1 and 2.

Subdevice0 is the antenna A, Subdevice1 is the antenna B. You can use both subdevice 0 and 1 at the same time on two different ddc inputs and tune them separately. These subdevices are used as real inputs, and the Q inputs to the ddc are set to zero.

The third possibility is to use subdevice2 which treats the antenna A and B as a single complex input (I and Q), and connects them to the I and Q inputs of the DDC input0. When using subdevice2, you cannot use subdevice 0 and 1.

(Thanks to Josh Blum for the clarification)


USRP Daugherboard: LFTX

Specifications

RX: N/A

TX: DC - 30MHz


USRP Daugherboard: RFX1200

Specifications

RX: 1150MHz - 1450MHz

TX: 1150MHz - 1450MHz @ 200+mW


USRP Daugherboard: RFX1800

Specifications

RX: 1.5GHz - 2.1GHz

TX: 1.5GHz - 2.1GHz @ 100+mW


USRP Daugherboard: RFX2400

Specifications

RX: 2.3GHz - 2.9GHz

TX: 2.3GHz - 2.9GHz @ 10+mW


USRP Daugherboard: RFX400

Specifications

RX: 400MHz - 500MHz

TX: 400MHz - 500MHz @ 100+mW

Changing the RFX400 Frequency Range

The RFX400 uses 2 of the ADF4360-7 VCO/PLL chips from Analog Devices, one on TX and one on RX. The way the board is designed, the output frequency of the VCO/PLL is divided by 2 to give the actual channel frequency. For example, since the RFX400 covers 400-500 MHz, the VCO/PLL actually tunes from 800-1000 MHz. If you want to cover 136-174MHz, you would have to design for 272-348 MHz.

The frequency range of the ADF4360-7 is controlled by 2 inductors, L31 and L32 on RX, and L105 and L116 on TX. They are 0402-sized, and ship with 4.3nH installed. The ADF4360-7 datasheet has instructions on how to select the inductors for your desired frequency range. If you are ordering the inductors, I would suggest not only ordering the value you think you need, but also ordering at least one bigger and one smaller value since the calculations in the datasheet are not exact.

Other things to note:

  • The fractional bandwidth covered is approximately constant, so if we cover about 120 MHz when at 450 MHz, then you can probably only cover 40 MHz or so around 150 MHz. At 800 MHz, you should be able to cover about 200 MHz.
  • There is a low pass filter on the TX/RX connector with a cutoff around 550MHz. If you are going higher in frequency, you should make these changes:
    • L224 and L225 should be zero ohm resistors (0603 size)
    • C221, C222, and C223 should all be removed.

Images


USRP Daugherboard: RFX900

Specifications

RX: 800MHz - 1000MHz

TX: 800MHz - 1000MHz @ 200+mW

The board features an ISM band filter that suppresses the RF signal outside the 902-928 MHz band and attenuates it within such band by one dB or two.

If usage of the board outside the ISM band is required (and authorized by terms of applicable law in the country of operation), the filter can be bypassed by cutting the traces to the filter FIL.1 and soldering a 100pF capacitor in parallel to it.


USRP Daugherboard: TVRX

Specifications

RX: 50MHz - 860MHz

TX: N/A


USRP Daugherboard: WBX

Specifications

RX: 50MHz - 2.2GHz

TX: 50MHz - 2.2GHz


USRP - Frequently Asked Questions

This section intends to clarify various issues that might arise while using the USRP. This section has been prepared based on the document The USRP under 1.5X Magnifying Lens.


1 <table width="100%" border="0">
2 <tr>
3 <th class="wikipage" scope="col" align="right">

[ [[UsrpFAQFpgaVerilog|<< FPGAVerilog Questions ] [wikiUsrpFAQ ^ Top ^ ] [wikiUsrpFAQFpgaRegs Controlling FPGA Registers >> ] ]]
1 </th></tr></table>

AD9862 Codec Questions

  • * I was looking at the AD9862 data sheet, and it seems that in the transmit path, there is only one 14bit input but the chip outputs 2 TX signals. Does this mean that if we want to output two signals, the data has to be interleaved before being sent to the AD chip? I am not sure why there are 2 outputs but only 1 input? *

    The data sent to the AD9862 is interleaved, IQIQIQIQIQ.

  • * I am trying to figure out how the AD9862 MxFE is setup:
    RX Side:
    1. Is the internal DLL used to sample faster than 64MSPS? If so, what is the DLL rate? Is it possible this would ever want to be used?
    2. Is the Hilbert Filter ever used?

TX Side:
1. Is the Hilbert Filter ever used?
2. Is the NCO ever used?
3. Is the interpolation filter ever used?
4. Is the fixed [Fs/4,Fs/8] selectable mixer ever used?
5. Is the TX data ever sent as real-only instead of I/Q from the FPGA when it is actually a complex signal?

Aux Side:
Are any of the auxiliary ADC/DACs used for AGC/VCO setting? *
RX Side:
1- The DLL is used to double the sample rate so that the DACs can sample at 128MHz. The ADCs stay at 64MHz.
2- No
TX Side:
1- No
2- Yes, all the time (both coarse and fine). In the up converter (in the AD9862, from figure 3 in the 9862 datasheet), they split the complex multiply into 2 parts -- coarse and fine. The fine part (block D) runs at 1/4 of the sample rate. This means that it can only move the freqency 1/4th as far. The block is then followed by the 4x interpolation (Block C), and then the coarse modulation, Block B. Block B only moves the signal +/- fs/4 or fs/8.
3- Yes, always.
4- Yes
5- No, we always send I/Q to the 9862. There are a couple of use cases, where you might want to send real data, but we don't implement them.
Aux: 
Yes, all of them. Details depend on the specific daughterboard. The aux DAC/ADC's are all run to the daughterboards.
  • * How are the AD9862 registers maintained? *

    The AD9862 is controlled over SPI. The code that sets up the AD9862's is contained in usrp_basic.cc and usrp_standard.cc. Most of it is in the constructors. You may also want to take a look at the USRP motherboard schematic to see how everything is wired together.

  • * I have two Basic_Tx daughterboards, so each one uses different AD9862. Are the 2 AD9862 both get there clock in from the usrp motherboard, and that is the same clock? *

    The AD9862s (which are on the motherboard) both get the same clock from AD9513 clock distribution IC. The only difference is that the clock signal goes through separate (but identical) filters on its way to each AD9862.

  • * Would you please iterate more on the concept of AD9862 PGA? *

    It's an analog amplifier with a software controllable gain. On the Rx path it has steps of 1.0 dB before ADC. On the TX path, the steps are 0.1 dB after the DAC. See the AD9862 datasheet for details. The PGA is controlled over the SPI serial bus from the FX2 (as are all the AD9862 registers).

  • * I need a way to update the AUX_DAC port on the 9862, but apparently that is handled by the USB microcontroller! Is that correct? To set up the AUX_DAC do I have to waste USB bandwidth? *

    The USRP is wired such that only the FX2 can control the AD9862s and you cannot change it from FPGA. However, you can change this hardware wiring by adding R2001, R2004, and R2005 to the USRP. All should be Zero-ohm resistors. Be careful, because you will now have multiple drivers of these nets. You'll need to have the FX2 STOP driving them before you make the FPGA drive them.

    This will allow the FPGA to control the AD9862s. You can also make the FPGA control the tuning of the RFX-series daughterboards.

1 <table width="100%" border="0">
2 <tr>
3 <th class="wikipage" scope="col" align="right">

[ [[UsrpFAQFpgaVerilog|<< FPGAVerilog Questions ] [wikiUsrpFAQ ^ Top ^ ] [wikiUsrpFAQFpgaRegs Controlling FPGA Registers >> ] ]]
1 </th></tr></table>

1 <table width="100%" border="0">
2 <tr>
3 <th class="wikipage" scope="col" align="right">

[ [[UsrpFAQClocking|<< Motherboard Re-Clocking ] [wikiUsrpFAQ ^ Top ^ ] [wikiUsrpFAQLatency Timing Latency >> ] ]]
1 </th></tr></table>

FPGA Bit Stream Questions

* * How the USRP FPGA configuration bit stream file loaded? * When using GNU Radio USRP functions, the host library takes care of loading the “.rbf” file into the FPGA for you. This takes place over the USB. However, you can manually load the .rbf using the usrper command:
 $ usrper --help 
 usage: 
   usrper [-v] [-w <which_board>] [-x] ... 
   usrper load_standard_bits 
   usrper load_firmware <file.ihx> 
   usrper load_fpga <file.rbf> 
   usrper write_fpga_reg <reg8> <value32> 
   usrper set_fpga_reset {on|off} 
   usrper set_fpga_tx_enable {on|off} 
   usrper set_fpga_rx_enable {on|off} 
   ----- diagnostic routines ----- 
   usrper led0 {on|off} 
   usrper led1 {on|off} 
   usrper set_hash0 <hex-string> 
   usrper get_hash0 
   usrper i2c_read i2c_addr len 
   usrper i2c_write i2c_addr <hex-string> 
   usrper 9862a_write regno value 
   usrper 9862b_write regno value 
   usrper 9862a_read regno 
   usrper 9862b_read regno 

 $ usrper load_fpga <name of your .rbf file> 
will load the .rbf file into the FPGA. Please note that it is possible to permanently damage the USRP by loading buggy code into the FPGA.
  • * When we program the FPGA using python programs (eg. usrp_fft.py), are the same .rbf files generated? Where? *

    The files aren't generated, they are loaded. By default, an rbf is loaded from /usr/local/share/usrp/rev{2,4}. The one used unless you specify the fpga_filename constructor argument when instantiating a usrp source or sink is std_2rxhb_2tx.rbf. FYI, we load std.ihx, standard firmware for the Cypress FX2 USB controller, before loading the FPGA .rbf file. We load the FX2 firmware over the USB. That firmware implements additional control endpoint commands, including those that know how to load an .rbf into the FPGA.

1 <table width="100%" border="0">
2 <tr>
3 <th class="wikipage" scope="col" align="right">

[ [[UsrpFAQClocking|<< Motherboard Re-Clocking ] [wikiUsrpFAQ ^ Top ^ ] [wikiUsrpFAQLatency Timing Latency >> ] ]]
1 </th></tr></table>

1 <table width="100%" border="0">
2 <tr>
3 <th class="wikipage" scope="col" align="right">

[ [[UsrpFAQRSSI|<< RSSI Measurement ] [wikiUsrpFAQ ^ Top ^ ] [wikiUsrpFAQBitstream Loading FPGA Bit Stream >> ] ]]
1 </th></tr></table>

Motherboard Re-Clocking Questions

* * I would like to run my USRP off a 44 MHz clock instead of the 64 MHz clock that is currently used. Can I generate a 44 MHz clock from the 64 MHz or do I have to change the crystal? If I change over to the 44 MHz will everything else still work? Especially the DBSRX and RFX2400 boards? * You need a new crystal or an external oscillator. You'll need to change the definition of
1    /*! 
2 **** \brief return frequency of master oscillator on USRP 
3     */ 
4    long  fpga_master_clock_freq () const { return 64000000; } 
in [source:gnuradio/trunk/usrp/host/lib/legacy/usrp_basic.h usrp_basic.h]. Procedure: I purchased a 44 MHz oscillator from digi-key (p/n 300-7254-1-ND, CSX750FJC44) for $3.38. The first attempt to remove the USRP 64 MHz failed miserably with a pen iron. I purchased a heat gun from digi-key (MA1008-ND) for $52, set it to the 1000 degree setting and the old oscillator came up in about 10 seconds. Installed the new oscillator and checked the 44 MHz clock with a scope. I am using the std_4rx_0tx.rbf FPGA image. I then tried to run my customized dbs application that records 8-bit I/Q data to a file for me from any of the 802.11b channels. I got all zeros in the data. Then remembered Eric told me to change the clock in [source:gnuradio/trunk/gr-usrp/src/db_dbs_rx.py db_dbs_rx.py]. My code is a little older than current but here are my modifications: In [source:gnuradio/trunk/gr-usrp/src/db_dbs_rx.py gr-usrp/src/db_dbs_rx.py] changed line 88 from
 self.refclk_divisor = 16 

to
 self.refclk_divisor = 11 

and changed line 108 from
 return 64e6/self.refclk_divisor 

to
 return 44e6/self.refclk_divisor 
then in /gr-usrp I did
 make clean
 make 
 make check 
 make install 
Rerun my custom dbs program and it worked fine. I used a decimation of 4 so I'm recording at 11 MSsamples per second.(#FIXME# is this correct ?)
  • * Is there another way to achieve 10 MSample/second without changing USRP clock? *

    I have been working with fractional rate decimeter/interpolators inside the USRP FPGA. You can put a fractional rate decimeter inside the FPGA which decimates by 6.4.

    It is a bit hard to get them to fit but you get a lot of flexibility out of them without changing the clocks. .(#FIXME# is this correct ?)

* * The file usrp_basic.h has the following member: *
  long  fpga_master_clock_freq () const { return 64000000; } 
** If I want my system to work at 50 MHz, will I need to change this constant? * Yes. The idea was that there was a single place in the code (fpga_master_clock_freq) that "knows" the actual frequency.
  • * I've got a USRP v4 board that I'm planning to run off of a 13 MHz external clock. However, I'm intending to use a pair of RFX 900 daughterboards, and I’m wondering if there are any known modifications needed to allow these daughterboards to operate with a 13 MHz clock? *

    You need to go into the [source:gnuradio/trunk/gr-usrp/src/db_flexrf.py db_flexrf.py] and [source:gnuradio/trunk/gr-usrp/src/db_flexrf_mimo.py db_flexrf_mimo.py] files in the [source:gnuradio/trunk/gr-usrp/src gr-usrp/src] directory. Any references to 64 MHz need to be changed to 13 MHz. You also need to make sure that you tell the usrp object what its sampling rate is.

  • * What is the voltage level for the USRP external clock? Is 1.0V peak to peak ok? Do I need to add a dc offset to my external clock to prevent the negative swings? *

    Yes 1V p-p for USRP rev 4. Use 3.3V for rev 2 and 3.

  • * What are the limits on the USRP external clock? Will using a “non-standard" clock frequency break any parts of Gnuradio? *

    You can drive the clock line anywhere between about 10MHz and 65MHz. Be sure to edit usrp_basic: :fpga_master_clock_freq() to return the new value.

  • * I re-clocked my USRP from 64 to 65.536 MHz and have recently discovered that I & Q samples are no longer orthogonal, rather they seem to be only 70 degrees or so apart. I would guess this is due to some hard coded values in the CIC or HB filters? Is there a USRP command to correct for this phase imbalance? *

    That's an odd problem. Sounds like a timing issue. Keep in mind that the ADCs are only specified to work to 64 MHz and the FPGA image is compiled to meet timing at 64 MHz. You might need to recompile it with the stricter timing numbers. All of the DSP stuff in the FPGA should not care about the absolute frequency as long as it meets timing.

1 <table width="100%" border="0">
2 <tr>
3 <th class="wikipage" scope="col" align="right">

[ [[UsrpFAQRSSI|<< RSSI Measurement ] [wikiUsrpFAQ ^ Top ^ ] [wikiUsrpFAQBitstream Loading FPGA Bit Stream >> ] ]]
1 </th></tr></table>

1 <table width="100%" border="0">
2 <tr>
3 <th class="wikipage" scope="col" align="right">

[ [[UsrpFAQDBoards|<< Daughterboards ] [wikiUsrpFAQ ^ Top ^ ] [wikiUsrpFAQRSSI RSSI Measurement >> ] ]]
1 </th></tr></table>

C++ Interfacing Questions

* * How we can write Linux C++ application program to interface with USRP? * Here it how we can do it: 1) The gnuradio project provides a complete USRP interface library. When compiling the interface program, these library must be linked with our code by using G++ library command (-lusrp). 2) To show the used procedure, suppose we have written a C++ USRP interface program called usrp_test_c++.cpp. To compile this program, we use the following command:
 $ g++ usrp_test_c++.cpp -o testusrp -lusrp

where g++ is the GNU C++ compiler, usrp_test_c++.cpp is our c++ source file, testusrp is our output file, -lusrp is the USRP C++ library. Note: The following USRP two header files should be in the same compilation directory: fpga_regs_common.h, fpga_regs_standard.h 3) To run the output file from Linux command line:
 ./testusrp
* * Is there a simple C++ USRP interfacing demonstration program? * Below is the list for such program
 // Simple C++ USRP interfacing demonstration program
 //
 //
 // This program was derived and modified from test_usrp_standard_rx.cc 

 /* -*- c++ -*- */
 /*
** Copyright 2003,2006,2007,2008 Free Software Foundation, Inc.
** 
** This file is part of GNU Radio
** 
** GNU Radio is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 3, or (at your option)
** any later version.
** 
** GNU Radio is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
** 
** You should have received a copy of the GNU General Public License
** along with GNU Radio; see the file COPYING.  If not, write to
** the Free Software Foundation, Inc., 51 Franklin Street,
** Boston, MA 02110-1301, USA.
  */

 #include "usrp_standard.h"           

 // Dummy Function to process USRP data
 void process_data(int *buffer)
 {
 /*
 Each buffer element, for example bufferr0 contains 4 bytes 
 2 bytes For (I) and 2 bytes for (Q). 
 */
 }

 #define SAMPELS_PER_READ     (512)         // Must be a multiple of 128

 /*
 SAMPELS_PER_READ :Each sample is consists of 4 bytes (2 bytes for I and 
 2 bytes for Q. Since the reading length from USRP should be multiple of 512 
 bytes see "usrp_basic.h", then we have to read multiple of 128 samples each 
 time (4 bytes * 128 sample = 512 bytes)  
 */

 int
 main (int argc, char **argv)
 {
   bool      loopback_p = false;
   bool   counting_p = false;
   bool      width_8_p = false;
   int      which_board = 0;
   int      decim = 8;            // 32 MB/sec
   double center_freq = 0;
   int      fusb_block_size = 0;
   int      fusb_nblocks = 0;
   int    nchannels = 1;
   int    gain = 0;
   int    mode = 0;
   int    noverruns = 0;
   bool   overrun;
   int    total_reads = 10000;
   int    i;
   int    buf[SAMPELS_PER_READ];
   int    bufsize = SAMPELS_PER_READ*4; // Should be multiple of 512 Bytes

  if (loopback_p)    mode |= usrp_standard_rx::FPGA_MODE_LOOPBACK;

  if (counting_p)    mode |= usrp_standard_rx::FPGA_MODE_COUNTING;

   usrp_standard_rx_sptr urx =  usrp_standard_rx::make (which_board, decim, 1, -1, mode,
                 fusb_block_size, fusb_nblocks);

   if (!urx)
     {
     fprintf (stderr, "Error: usrp_standard_rx::make\n");
       exit (1);
     }

   if (width_8_p)
 {
     int width = 8;
     int shift = 8;
     bool want_q = true;
     if (!urx->set_format(usrp_standard_rx::make_format(width, shift, want_q)))
       {
     fprintf (stderr, "Error: urx->set_format\n");
       exit (1);
       }
   }

   // Set DDC center frequency
   urx->set_rx_freq (0, center_freq);

 // Set Number of channels
   urx->set_nchannels(1);

 // Set ADC PGA gain
   urx->set_pga(0,gain);

 // Set FPGA Mux
   urx->set_mux(0x32103210); // Board A only

 // Set DDC decimation rate
   urx->set_decim_rate(decim);

 // Set DDC phase 
   urx->set_ddc_phase(0,0);

   urx->start();        // Start data transfer

   printf("USRP Transfer Started\n");

     // Do USRP Samples Reading 
     for (i = 0; i < total_reads; i++)
     {
         urx->read(&bufr0, bufsize, &overrun); 

         if (overrun)
             {
             printf ("USRP Rx Overrun\n");
             noverruns++;
                 }

         // Do whatever you want with the data
         process_data(&bufr0);

     }

   urx->stop();  // Stop data transfer
   printf("USRP Transfer Stoped\n");
   delete urx;
   return 0;
 }

  • * Currently, all USRP daughterboards control is handled from Python. Where I can find the C++ drivers for these boards? *

    The gnuradio team is developing an all C++ daughterboards drivers [I don’t know if they finished it]. There are some gnuradio users that developed their own C++ drivers but they did not publish it yet [I Think They Should].

    The only published C++ driver is for DBSRX daughterboard by Gregory W Heckler.

* * Where can I obtain Gregory DBSRX driver ? How to use the driver ? * The DBSRX C++ driver can be obtained from GPS-SDR code repo. We can use:
 $ g++ db_dbs_rx.cpp usrp_sdr.cpp -o testdriver -lm  -lusrp -lpthread 
Note: The following files should be in the same compilation directory: db-dbs_rx.cpp, db_dbs_rx.h, fpga_regs_common.h, fpga_regs_standard.h.
1 <table width="100%" border="0">
2 <tr>
3 <th class="wikipage" scope="col" align="right">

[ [[UsrpFAQDBoards|<< Daughterboards ] [wikiUsrpFAQ ^ Top ^ ] [wikiUsrpFAQRSSI RSSI Measurement >> ] ]]
1 </th></tr></table>

<< Digital IO Pins Control ^ Top ^ C++ Interfacing >>

Daughterboards Questions

If I want to apply the output (50 ohm) from a function generator directly to the BasicRX inputs, what is the allowed voltage range that can be applied?

  1. Without damaging anything? 3V p-p should be safe, since it won't exceed the 3.3V supply voltage.
  2. Without exceeding the range of the ADC? The full-scale range of the ADC is 2V p-p.
  3. Is the input signals need to be DC offset so as never to go below ground? No, the transformer handles the biasing. You put in a signal that is +/-1V.

I tried to install my newly purchased USRP. When I connected the daughterboards, it became hot and the USRP doesn't work. What is the ptoblem?

When you plug-in daughterboards, follow these rules:

  • If the standoffs don't line up, you have the boards installed incorrectly.
  • TX daughterboards cannot go in RX slots and vice versa.
  • Daughterboards on TX-A and RX-A should be installed right-side up.
  • Daughterboards on TX-B and RX-B should be installed upside-down (i.e. rotated 180 degrees).
  • The side edge of the daughterboard should align with the side edge of the USRP PCB.
  • The TVRX must be installed with the big F connector sticking off the edge of the USRP. If the USRP is in the enclosure this means that the TVRX will only fit in slot RX-B.
  • Never power the board up if any of the above is violated. If you power it up and the led doesn't blink, immediately power down and remove all daughterboards before trying again.

I have a radio with 10.7MHz real IF (not complex) output that I would like to connect to the basic Rx daughter board directly.

Just connect the real input to the input connector, and use 0xf0f0f0f0 setting for the mux value of the USRP source. This feeds a zero into each of the DDC Q inputs and ADC0 into the DDC I inputs. For your receiver with the 10.7 MHz IF, set the DDC frequency to -10.7e6 and you'll get complex baseband across the USB. Pick the decimation value to set the width of the the channel you're interested in. The ADC sample rate is 64e6 (adc_freq()). Divide that by the decimation factor and that will give you the sample rate across the USB. The USB samples are 16-bit I and 16-bit Q. i.e., 4 bytes/sample. There's a fourth-order CIC filter in the FPGA, so there's some roll-off across the band.

If we apply maximum none distorted input signal to the BasicRX board, what is the USRP DDC output value?*

Using high accuracy function generator and USRP with Basic-RX at 0 dB gain with decimation of 8.

a) With Sine wave signal at frequency 250 KHz and 0dBm input power to BasicRX we get:

Theoretical calculations:
When 0dBm signal injected into 50 Ohm load, then we should have signal RMS = 0.225Volt and Signal voltage P-P = 0.636396103Volt.

USRP readings:
The maximum counting obtained from USRP for this signal was 4845.

b) With Sine wave signal at frequency =250 KHz and 5dBm input power to BasicRX we get:

Theoretical calculations:
When +5dBm signal injected into 50 Ohm load, then signal RMS = 0.4Volt and Signal P-P = 1.13137085Volt.

USRP readings:
The maximum counting obtained from USRP for this signal was 8337.

c) With Sine wave signal at frequency =250 KHz and 9dBm input power to BasicRX we get:

Theoretical calculations :
When +9dBm signal injected into 50 Ohm load, then signal RMS = 0.64Volt and Signal P-P = 1.81019336Volt.

USRP readings:
The maximum counting obtained from USRP for this signal was 13096.

d) With Sine wave signal at frequency =250 KHz and 10dBm input power to BasicRX we get:

Theoretical calculations:
When +10dBm signal injected into 50 Ohm load, then signal RMS = 0.71Volt and Signal P-P = 2.008183259Volt.

USRP readings:
The maximum counting obtained from USRP for this signal was 13570 (Saturated).

From the above results we see that the BASIC-RX is saturated when the input signal power was +10dBm. This is logical, since the maximum input signal to the USRP ADC AD9862 is 2Volt P-P (according to its data sheets). The value obtained from USRP FPGA for input signal of 2V P-P was about 13570.

How is RF tuning accomplished in daughterboards?

We have to understand the comments about tuning being a "two-step process"? First we ask the front-end to tune as close to the desired frequency as it can (For example, on the RFX boards, the PLL step size is 4 MHz.). Then we use the result of that operation and our target_frequency to determine the value for the digital down converter.

The return value from tune software function is an instance of tune_result which can be examined to see how everything was setup:

  • baseband_freq is the RF frequency that corresponds to DC in the RF front-end IF output (the input to the A/D's and from there to the digital down-converter). Note that this isn't necessarily the location of the signal of interest. Some daughterboards have the signal of interest at a non-zero IF frequency.
  • dxc_freq is the frequency value used in the digital down or up converter.
  • residual_freq is a very small number on the order of 1/100 of a Hz. It can be ignored.
  • inverted is true if the spectrum is inverted, and we weren't able to fix it for you.

On the receive path, the end result of tune is that the signal at the given target RF frequency ends up at DC in the complex baseband input from the USRP.

Note: Abstractly, TX and RX daughterboards can be split into two general categories: those that use both converters as a pair (boards doing quadrature up or down conversion) and those that can use the converters independently.

Because we're using the digital up converter in the AD9862 in "Dual Channel Complex DAC Data Mode", both D/A outputs are related (I&Q) and as a result, all TX daughterboards are "quadrature" boards. On the receive side we've got a bit more variation. The TV_RX board (for example) is not a quadrature board, since it only uses a single A/D.

On the RFX transceiver boards (400, 900, 1200 and 2400), both the Tx side and Rx side are quadrature.

What is a subdevice?

The TX or RX daughterboard consists of either one or two subdevices. Quadrature boards have a single subdevice. Non-quadrature boards have one or two subdevices and it is depending on the daughterboard design.

The fundamental capabilities of a subdevice are the ability to tune and set gain. Each subdevice has a daughterboard specific class that is derived from db_base.py (in gr-usrp).

The visible methods are:
    def dbid(self):
         """ 
         Returns integer daughterboard ID from EEPROM
         """ 

     def name(self):
         """ 
         Name of daughterboard.  E.g., "TV Rx" 
         """ 

     def freq_range(self):
         """ 
         Return range of frequencies in Hz that can be tuned by this daughterboard.

         @returns (min_freq, max_freq, step_size)
         @rtype tuple
         """ 

     def set_freq(self, target_freq):
         """ 
         Set the frequency.

         @param freq:  target RF frequency in Hz
         @type freq:   float

         @returns (ok, actual_baseband_freq) where:
            ok is True or False and indicates success or failure,
            actual_baseband_freq is the RF frequency that corresponds to DC in the IF.
         """ 

     def gain_range(self):
         """ 
         Return range of gain that can be set by this daughterboard.

         @returns (min_gain, max_gain, step_size)
         Where gains are expressed in decibels (your mileage may vary)
         """ 

     def set_gain(self, gain):
         """ 
         Set the gain.

         @param gain:  gain in decibels
         @returns True/False
         """ 

     def is_quadrature(self):
         """ 
         Return True if this daughterboard does quadrature up or down conversion.
         That is, return True if this board requires both I & Q analog channels.

         This bit of info is useful when setting up the USRP Rx mux register.
         """ 

When we create an instance of a usrp source or sink, we now get an additional attribute, "db", that lets us control the daughterboard subdevices.

 u = usrp.source_c(0, 64)

 u.db is a tuple of length 2.  

 u.dbr0 contains a tuple of the subdevices for "side A" 
 u.dbr1 contains a tuple of the subdevices for "side B" 

The tuples of subdevices each have either 1 or 2 elements depending on the daughterboard installed on the respective side. Each subdevice is an instance of a class that's derived from db_base and exports the methods listed above. When we're tuning, there are really at least two knobs to twist:

  1. Some kind of PLL on the daughterboard that determines what RF frequency appears in the IF.
  2. The digital down converter that extracts the band of interest from the digitized IF.
Given a target frequency, we control them both like this:
     def set_freq(self, target_freq):
         """ 
         Set the center frequency we're interested in.

         @param target_freq: frequency in Hz
         @rtype: bool

         Tuning is a two step process.  First we ask the front-end to
         tune as close to the desired frequency as it can.  Then we use
         the result of that operation and our target_frequency to
         determine the value for the digital down converter.
         """ 

         # self.subdev is the subdevice we are controlling
         ok, baseband_freq = subdev.set_freq(target_freq)

         ddc_freq, inverted = usrp.calc_dxc_freq(target_freq, baseband_freq, self.u.converter_rate())

         ok &= self.u.set_rx_freq(0, ddc_freq)

The Local Oscillator (LO) frequency of the RFX boards is set automatically when we set the frequency of reception or transmission. The LO is a multiple of 2 or 4 MHz depending on which RFX board we have. We can change that to be a multiple of 1MHz, but we will have worse phase noise.

In LFRX board, with the input open, I measure 108 mV on the SMA connector and a DC component from the ADC. What is the problem?

If you connect a 50 ohm resistor across the SMA, you do indeed get 62mV at the connector, but 0V at the ADC, which is what we really care about. If you leave the SMA open, you do get a small voltage being read at the ADC.

So yes, the LFRX does have DC bias on its input, but as long as you drive it with a 50 ohm load, you get the right answer at the ADC. The LFRX wasn't designed for measuring DC voltages, although it can as long as you have a 50 ohm source. And if your source is not 50 ohms, you can do the calculations necessary to scale the gain. Also, please note that the amp is inverting, so if you put 1V through 50 ohms into the SMA, the ADC will tell you that it is -1V.

The gEDA PCB layout program returns illegal file format when opening RFX boards, however, it reads the basic RX/TX daughter boards, why?

The RFX daughterboard PCBs were designed using a commercial program called PADS, not using PCB from the gEDA suite.

Can any one tell me how far apart the SMA connectors are set on the basic TX daughter board; I’m trying to design a PCB to match up with it.

0.570 inches

How we can know what our daughterboard type is?

You can find out what version you have by running usrp_print_db.py in the gr-utils/src/python directory.

What is the input impedance for the TVRX and DBSRX daughterboards?

The TVRX is really 75 ohms, but putting in 50 ohms is not a problem. The DBSRX tuner chip is 75 ohms, but we have a 50 ohm input impedance because of the LNA ahead of it.

What is involved in changing an RFX2400 to an RFX1200?

To convert to an RFX1200, you need to:

  1. Cut the traces which FIL1
  2. Put a capacitor in C204, anything between about 50pF and 1000pF is fine, size 0603
  3. Put the board on side A of a USRP, power it up, and reburn the EEPROM using the command
 usrp/host/apps/burn-db-eeprom -A -f -t rfx1200_mimo_b

You can also change some of the final amp tuning components if the power out is a little low.This is not always necessary, but sometimes gets another dB of extra power.

What is involved in changing an RFX900 to an RFX1800?

To convert the you only have to do 3 things:

  1. Cut the traces which go to FIL1.
  2. Put a capacitor in C204.
  3. Run the following command:
 ./burn-db-eeprom -A --force -t rfx1800_mimo_b

If you cut the filter out you need to complete the signal path by populating C204 with a capacitor in roughly the 100pF to 10,000pF range (#FIXME#). Very high capacitor values have bad parasitic effects -- 0.1uF is fine but don't use 10uF.

To turn it back into a RFX900 again, or to turn your RFX1800 into a RFX900, you can run the command:
 ./burn-db-eeprom -A --force -t rfx900_mimo_b

I couldn't find any documentation on what is stored in the USRP daughterboards EEPROMs?

The EEPROMs on the daughterboards basically store an identifier for the type of board, and can store some DC offsets and the like. The daughterboard EEPROM format is defined in [source:gnuradio/trunk/usrp/firmware/include/usrp_i2c_addr.h usrp/firmware/include/usrp_i2c_addr.h].

I would like to develop a user daughter card, to interface with the USRP motherboard, Please give me some clues (pointer to information) to know what should be written in the ROM (EEPROM) and consequences in the devices programming?

The format of the ROM is documented in [source:gnuradio/trunk/usrp/firmware/include/usrp_i2c_addr.h usrp/firmware/include/usrp_i2c_addr.h]. Just be sure that bytes 0x00 through 0x02 make sense. You can set the remainder to 0x00, but be sure to set the checksum correctly in 0x1f. There's a script that will do this for you over the USB. See [source:gnuradio/trunk/usrp/host/apps/burn-db-eeprom usrp/host/apps/burn-db-eeprom].

The relevant portion is:
 // format of daughterboard EEPROM 
 // 00: 0xDB code for @@I'm a daughterboard_ 
 // 01:   .. Daughterboard ID (LSB) 
 // 02:   .. Daughterboard ID (MSB) 
 // 03:   .. io bits  7-0 direction (bit set if it's an output from motherboard) 
 // 04:   .. io bits 15-8 direction (bit set if it's an output from motherboard) 
 // 05:   .. ADC0 DC offset correction (LSB) 
 // 06:   .. ADC0 DC offset correction (MSB) 
 // 07:   .. ADC1 DC offset correction (LSB) 
 // 08:   .. ADC1 DC offset correction (MSB) 
 // ... 
 // 1f:   .. negative of the sum of bytes [0x00, 0x1e] 

 #define DB_EEPROM_MAGIC 0x00 
 #define  DB_EEPROM_MAGIC_VALUE 0xDB 
 #define DB_EEPROM_ID_LSB 0x01 
 #define DB_EEPROM_ID_MSB 0x02 
 #define DB_EEPROM_OE_LSB 0x03 
 #define DB_EEPROM_OE_MSB 0x04 
 #define DB_EEPROM_OFFSET_0_LSB 0x05 // offset correction for ADC or DAC 0 
 #define DB_EEPROM_OFFSET_0_MSB 0x06 
 #define DB_EEPROM_OFFSET_1_LSB 0x07 // offset correction for ADC or DAC 1 
 #define DB_EEPROM_OFFSET_1_MSB 0x08 
 #define DB_EEPROM_CHKSUM 0x1f 

 #define DB_EEPROM_CLEN 0x20 // length of common portion of EEPROM 

You can use the existing "Experimental Rx" daughterboard id, 0xffff, or define a new one. See [source:gnuradio/trunk/usrp/host/lib/usrp_dbid.dat usrp/host/lib/usrp_dbid.dat].

The dbid is read from the daughterboards and is use to instantiate the correct daughterboard code. You can see what you've got by calling u.daughterboard_id(0) and u.daughterboard_id(1) to retrieve the dbid's from slots 0 and 1.

To talk to your daughterboard using our standard interface, you'll need to write a bit of python. Take a look at gr-usrp/src/db_*.py. Start with db_base.py, then maybe db_basic.py

<< Digital IO Pins Control ^ Top ^ C++ Interfacing >>


<< Controlling FPGA Registers^ Top ^Digital Up Converter >>

Digital Down Converter Questions

In the FPGA DDC, are I and Q samples being generated from complex samples? The adc_interface module just seems to multiplex the same complex sample to 2 lines?

The ADC interface module takes care of demuxing the received signal into I and Q signals. Then every pair of IQ is routed to a DDC.

What is the purpose of multiplexer in the FPGA receive path?

The MUX is like a router or a circuit switcher. It determines which ADC (or constant zero) is connected to each DDC input. There are 4 DDCs. Each has two inputs. We can control the MUX using usrp.set_mux() method in Python.

The Mux value is calculated by:
     3                   2                   1
   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  +-------+-------+-------+-------+-------+-------+-------+-------+
  |   Q3  |   I3  |   Q2  |   I2  |   Q1  |   I1  |   Q0  |   I0  |
  +-------+-------+-------+-------+-------+-------+-------+-------+

Each 4-bit I field is either ADC 0,1,2,3
Each 4-bit Q field is either ADC 0,1,2,3 or 0xf (input is const zero)
All FPGA DDC Q's must be 0xf or none of them may be 0xf.

We tell each input DDC input (I0, Q0, I1 ... I3, Q3) which ADC is connected to it by using 4 bits (0, 1, 2, 3 or 0xf). So a 32-bit integer would be enough for all 8 inputs to know which ADC is connected. Of course an integer in hexadecimal system will be more convenient if we want to use the set_mux() method. For most real sampling applications, the Q input of each DDC is constant zero. So quite often we don't need to modify the standard configuration of the FPGA. Actually it is anticipated that the majority of USRP users will never need to use anything other than the standard FPGA configuration.

I want to insert a filter FIR pass band after the output of ADC and before the input of DDC. What's the sampling frequency for this filter FIR? Is correct to insert this filter?

The sample rate of the ADC is 64Msps. The samples then go through the CORDIC to generate complex pairs, then through a CIC with minimum decimation of 4, and then through a halfband 2:1 decimating filter. The lack of hardware multipliers inside the FPGA requires you to run a relatively simple filter unless you are running at "low" sample rates which allow you to serialize the data going through one or two multipliers and accumulate the output.

How the FPGA halfband filter implemented, and why we cannot decimate by less than 8 in standard FPGA configuration?

It has 31 taps. The current implementation of the halfband filter in the FPGA requires 8 clocks to process the 31 taps. See the comments about timing in source:gnuradio/trunk/usrp/fpga/sdr_lib/hb/halfband_decim.v.

This works fine with decimation 8 or higher. To run at decimation 4, you'll need to use a build of the FPGA that does not contain the halfband filter, or you'll need to re-implement the halfband, such that it uses two multipliers instead of one. In addition to the standard 2 Rx (with halfband) 2 Tx build, the current code contains an FPGA image with 4 RX paths (without the halfband) and with 0 transmit paths. It's not installed by default.

ADC samples at 64MHz, and passes through both I and Q channels over the 24-bit RX bus. Internal to the FPGA, the CIC automatically decimates by a value of at least 4. The halfband decimating FIR filter internal to the FPGA decimates by a fixed value of 2. This gives a minimum decimation rate of 8, leaving 8Msps going over the USB of the USRP. Is this correct?

Yes. Note that some FPGA builds don't contain the half-band.
With 16-bit I & Q decim = 8 -> 8MS/sec -> 32MB/sec.
With 8-bit I & Q decim = 4 -> 16MS/sec -> 32MB/sec