[[TOC(Documentation/dSDR*, depth=3)]] == Installation of GNU radio software on a orbit node with the baseline.ndz image == === Binary Packages === Baseline.ndz installs a slimed version of Debian, for image speed. There is a binary package of GNU radio in the Debian repository, but it is very old and not maintained. The package that is now being maintained is made for Ubuntu 9.04. Its not part of the Ubuntu repository. It is maintained by gnuraido.org, if you want to install it you will need to add their repository to your list of sources ([http://www.mepis.org/node/569 reference]). The paths are: {{{ Stable release branch: deb http://gnuradio.org/ubuntu stable main deb-src http://gnuradio.org/ubuntu stable main Unstable development branch: deb http://gnuradio.org/ubuntu unstable main deb-src http://gnuradio.org/ubuntu unstable main }}} It should be noted that these packages are for Ubuntu. Although they might install on baseline image, the probably won't work correctly. The GNU Radio website for these packages is http://gnuradio.org/redmine/wiki/1/DebianPackages === Building from sources === This section explains how to build the GNU Radio software from sources. It is loosely modeled after the instructions from http://gnuradio.org/redmine/wiki/gnuradio/UbuntuInstall . As noted before, however, we're installing on a Debian system, so the process is a little different. ==== Prerequisites ==== Before we build the actual Gnu radio we must satisfy this list of prerequisites: * sdcc-libraries_2.6.0-5 * boost-build * wx-common * libqt3-mt-dev * libgsl0-dev * guile-1.8 * libcomedi-0.7.22 * locales * Python * build-essentials * auto-make Most of these are can be installed with apt-get ([http://newbiedoc.sourceforge.net/tutorials/apt-get-intro/apt-and-install.html.en reference]). You may need to modify your source list to include: {{{ deb http://ftp.at.debian.org/debian/ etch main non-free contrib }}} You may find it usefull to run the following two commands: {{{ apt-get build-dep gnuradio apt-get build-dep usrp }}} These commands would install any of the packages that the gnuradio and usrp packages depend on. Although we will not be installing the gnuraido and usrp packages, there is probably some packages that are common to both the package installation and source build of GNU Radio. One noteable exception is sdcc-library which had to be installed via a deb package, because the repository version does not support a feature we need (asx8051). We will have to downgrade to version sdcc 2.6.0-5: {{{ wget http://ftp.egr.msu.edu/debian/pool/main/s/sdcc/sdcc-libraries_2.6.0-5_all.deb dpkg -i sdcc-libraries_2.6.0-5_all.deb }}} It may be necessary to modify the compiler and documentation packages as well. [[BR]] http://packages.debian.org/etch/all/sdcc-doc/download [[BR]] http://packages.debian.org/etch/i386/sdcc/download [[BR]] '''Note:''' Our architecture is i686, but the only debs for i386. We have used the i386 ones sucessfully. The install process was the same as for the libraries. ==== Sources ==== Once we have all the dependencies in place, we can begin building the actual GNU Radio software. There are many ways to get the sources. The most straight forward is to download the file from http://gnuradio.org/redmine/wiki/gnuradio/Download. If you are using the node's console you can use [http://en.wikipedia.org/wiki/Wget wget]. As an alternative you can download the file to some other machine, and them copy file to the node with [http://help.ischool.washington.edu/faqs/30_32_en.html scp]. Once you have the source on your node you'll need to extract it ([http://www.tech-recipes.com/rx/65/decompress-and-extract-a-tgz-or-targz-archive-in-a-single-step/ refrence]). ==== Building ==== If you copied from the development repositories (svn or git) you man need to run '''./bootstrap'''. Once bootstrap completes you will need to run '''./configure'''. Once completed a list of components being built will be displayed: {{{ ********************************************************************* The following GNU Radio components have been successfully configured: config omnithread gnuradio-core usrp gr-usrp gr-audio-alsa gr-audio-jack gr-audio-oss gr-audio-portaudio 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-osx gr-audio-windows gr-comedi These components will not be built. }}} It should be checked for the components you are interested in. A file named ''config.log'' is created when the configure script is being built. If there are any missing components, this file should have useful information. At a minimum, gr-usrp will be needed. This component steers the USRP, and is vital to the rest of the process. Once the configure process completes, we can simply run '''make''' sequence. If all the dependencies are satisfied the build process should be as simple as this sequence: {{{ $ ./bootstrap # Do NOT perform this step if you are building from a tarball. $ ./configure $ make $ make check $ sudo make install }}} ==== Post Build setup ==== Once you have correctly built executables, there are a few modification to be made before you can run the examples. These may all be optional, if you encounter errors when you try to use the executables one of these changes may fix it. ===== Create USRP Group ===== Follow these steps to create a usrp group. This is need to have udev ([http://en.wikipedia.org/wiki/Udev reference]) enumerate the USRP properly. {{{ sudo addgroup usrp sudo addgroup usrp 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 }}} Reboot the machine after this change. You should see a usrp device in the list of usb devices: {{{ node1-1:~# ls -lR /dev/bus/usb | grep usrp crw-rw---- 1 root usrp 189, 385 Jan 28 14:20 002 }}} ===== Adding PYTHONPATH ===== This path is needed for some of the examples. (and perhaps your own blocks) {{{ export PYTHONPATH=/usr/local/lib/python2.5/site-packages/gnuradio/ }}} ===== libtool modification ===== There was a problem with earlier versions of Debian/Ubuntu's linker ([http://en.wikipedia.org/wiki/GNU_linker refrence]). It was resolved with this fix: {{{ cp /etc/ld.so.conf /tmp/ld.so.conf echo /usr/local/lib >> /tmp/ld.so.conf mv /tmp/ld.so.conf /etc/ld.so.conf ldconfig }}} You can check the ld.so.conf to make sure that /usr/local/lib/ is included: {{{ node1-1:~# more /etc/ld.so.conf include /etc/ld.so.conf.d/*.conf ... /usr/local/lib/ }}} ==== Running Examples ==== Assuming you have x11 exports correctly configured ([http://solaris.reys.net/how-to-x11-forwarding-using-ssh-putty-and-xming/ reference]) you can use the live FFT to see some interesting graphs. Once you have successfully compiled the GNU Radio software, you should take an [wiki:Tutorial/HowToImage image]. Once you have the image on two nodes you can run: {{{ sender node:path.../gnuradio/gnuradio-examples/python/digital# ./benchmark_tx.py -f 5M -r 250k -T A -v receiver node:path.../gnuradio/gr-utils/src/python# ./usrp_fft.py -R A -f 5M -d 128 }}} If you're X11 exports are working on the receiver you should see:[[BR]] [[Image(usrp-gmsk-250kbps-fft.jpg)]] You can decode the transmitted waveform by using the command: {{{ receiver node:path.../gnuradio/gnuradio-examples/python/digital# ./benchmark_rx.py -f 5M -r 125k -R A -v >>> gr_fir_fff: using SSE bits per symbol = 1 M&M clock recovery omega = 2.000000 M&M clock recovery gain mu = 0.175000 M&M clock recovery mu = 0.500000 M&M clock recovery omega rel. limit = 0.005000 frequency error = 0.000000 Receive Path: Using RX d'board A: Basic Rx Rx gain: 10 modulation: gmsk_demod bitrate: 125kb/s samples/symbol: 2 decim: 256 Rx Frequency: 5M ok = True pktno = 1 n_rcvd = 1 n_right = 1 ok = True pktno = 2 n_rcvd = 2 n_right = 2 ok = True pktno = 3 n_rcvd = 3 n_right = 3 ok = True pktno = 4 n_rcvd = 4 n_right = 4 ok = True pktno = 5 n_rcvd = 5 n_right = 5 ok = True pktno = 6 n_rcvd = 6 n_right = 6 ok = True pktno = 7 n_rcvd = 7 n_right = 7 ok = True pktno = 8 n_rcvd = 8 n_right = 8 }}} And you will see the decoded packet count as output.