Difference between revisions of "GNURadio: Ubuntu Install"

From OnnoWiki
Jump to navigation Jump to search
Line 149: Line 149:
 
  ImportError: libgnuradio-core-3.3.0.so.0: cannot open shared object file: No such file or directory
 
  ImportError: libgnuradio-core-3.3.0.so.0: cannot open shared object file: No such file or directory
  
Sebaiknya mengcompile ulang [[gnuradio]] dari nol.
+
Ketik
 +
 
 +
sudo ldconfig
  
 
==Verifikasi USRP==
 
==Verifikasi USRP==

Revision as of 09:32, 7 February 2012

Sumber: http://gnuradio.org/redmine/wiki/gnuradio/UbuntuInstall

Development Tool yang dibutuhkan:

  • g++
  • subversion
  • make
  • autoconf, automake, libtool
  • sdcc
  • guile
  • ccache

Library yang dibutuhkan untuk runtime dan proses compile

  • 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)

Instal Library

Update

sudo apt-get update

Instal untuk Maverick (10.10)

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 \
libpcre3 libpcre3-dbg libpcre3-dev libpcrecpp0

Instalasi WxWidget

Jika ingin menginstall WxWidget yang lebih baru. Tapi ini tidak fatal, kita bisa skip jika tidak terlalu membutuhkan. Jika ingin melakukan juga dapat menjalankan langkah berikut.

Edit /etc/apt/sources.list

# wxWidgets/wxPython repository at apt.wxwidgets.org
deb http://apt.wxwidgets.org/ DIST-wx main
deb-src http://apt.wxwidgets.org/ DIST-wx main  

Contoh untuk gutsy

# wxWidgets/wxPython repository at apt.wxwidgets.org
deb http://apt.wxwidgets.org/ gutsy-wx main
deb-src http://apt.wxwidgets.org/ gutsy-wx main  

Jalankan

sudo apt-get update  

Install

sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-i18n
sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-i18n libwxgtk2.8-dev libgtk2.0-dev

Instal SWIG

Install secara manual SWIG

Download dari http://sourceforge.net/projects/swig/files/swig/
cp swig-2.0.4.tar.gz /usr/local/src/
cd /usr/local/src/
tar zxvf swig-2.0.4.tar.gz 
cd /usr/local/src/swig-2.0.4/
./configure
make
make install

Instal QWT

Install secara manual QWT

Download dari http://sourceforge.net/projects/qwt/files/
cp qwt-6.0.1.tar.bz2 /usr/local/src/
cd /usr/local/src/
tar jxvf qwt-6.0.1.tar.bz2 
cd /usr/local/src/qwt-6.0.1/
qmake
make
make install

Handling USRP

Ubuntu menggunakan udev untuk menangani hotplug devices, dan secara default tidak memberikan akses non-root ke USRP. Script berikut akan memberikan akses bagi user untuk menghandel USRP via USB baik secara live atau 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

Pada titik ini, Ubuntu telah di konfigurasi untuk tahu apa yang harus di kerjakan jika medeteksi USRP di USB tapi "udev" perlu me-reload rules untuk memasukan rules yang baru kita buat. Langkah berikut dapat dilakukan sehingga kita tidak perlu me-reboot komputer.

sudo udevadm control --reload-rules

atau

sudo /etc/init.d/udev stop
sudo /etc/init.d/udev start

atau

sudo killall -HUP udevd

Kita dapat mencek jika USRP telah di kenali dengan mengamati /dev/bus/usb setelah USRP di pasang menggunakan perintah

ls -lR /dev/bus/usb | grep usrp

Harusnya akan keluar seperti

crw-rw---- 1 root usrp 189, 1 2010-12-09 17:38 002


Setiap USRP yang terpasang akan terdaftar pada group 'usrp' dan mode 'crw-rw----'.

Install GNURadio

Sebaiknya pada saat melakukan instalasi GNURadio, kita pasang USRP ke USB port-nya.

Download aplikasi GNURadio dari

http://gnuradio.org/redmine/wiki/gnuradio/Download

Install GNURadio

cp gnuradio-3.3.0.tar.gz /usr/local/src/
cd /usr/local/src/
tar zxvf gnuradio-3.3.0.tar.gz 
cd /usr/local/src/gnuradio-3.3.0/
./configure
make clean
make all
make
make check
make install

Jika saat menjalankan aplikasi gnuradio ada error seperti

ImportError: libgnuradio-core-3.3.0.so.0: cannot open shared object file: No such file or directory

Ketik

sudo ldconfig

Verifikasi USRP

Selanjutnya kita perlu memverifikasi apakah GNURadio dapat bekerja dengan USRP. Untuk tahapan ini kita perlu menyambungkan USRP ke komputer.

Cek kecepatan sambungan USB ke USRP

cd /usr/local/src/gnuradio-3.3.0/gnuradio-examples/python/usrp
./usrp_benchmark_usb.py

Akan keluar sbb:

Testing 2MB/sec... usb_throughput = 2M
ntotal    = 1000000
nright    = 999918
runlength = 999918
delta     = 82
OK
Testing 4MB/sec... usb_throughput = 4M
ntotal    = 2000000
nright    = 1999492
runlength = 1999492
delta     = 508
OK
Testing 8MB/sec... usb_throughput = 8M
ntotal    = 4000000
nright    = 3998860
runlength = 3998860
delta     = 1140
OK
Testing 16MB/sec... usb_throughput = 16M
ntotal    = 8000000
nright    = 7997680
runlength = 7997680
delta     = 2320
OK
Testing 32MB/sec... usb_throughput = 32M
ntotal    = 16000000
nright    = 15995986
runlength = 15995986
delta     = 4014
OK
Max USB/USRP throughput = 32MB/sec

Error libgnuradio-core

Jika ada error

ImportError: libgnuradio-core-3.3.0.so.0: cannot open shared object file: No such file or directory

Tampaknya lebih aman untuk mengcompile ulang gnuradio

Cek C++ Interface ke USRP

C++ interface ke USRP, memberikan estimasi throughput maksimum antara PC ke USRP

cd /usr/local/src/gnuradio-3.3.0/usrp/host/apps
./test_usrp_standard_tx
./test_usrp_standard_rx

hasil dari USRP_standard_tx test

which:    0
interp:   16
rf_freq:  -1
amp:      10000.000000
nsamples: 3.2e+07
Subdevice name is Flex 900 Tx MIMO B
Subdevice freq range: (7.5e+08, 1.05e+09)
mux: 0x000098
baseband rate: 8e+06
target_freq:     900000000.000000
ok:              true
r.baseband_freq: 904000000.000000
r.dxc_freq:      -4000000.000000
r.residual_freq: 0.000000
r.inverted:      0
tx_underrun
tx_underrun
tx_underrun
tx_underrun
tx_underrun
tx_underrun
tx_underrun
tx_underrun
tx_underrun
xfered 3.2e+07 bytes in 1.01 seconds.  3.154e+07 bytes/sec.  cpu time = 0.16
9 underruns

hasil USRP standard RX test

xfered 1.34e+08 bytes in 4.19 seconds.  3.2e+07 bytes/sec.  cpu time = 0.8681
noverruns = 0

Jika di butuhkan, kita dapat mengupgrade seluruh sistem. Tapi ini lumayan riskan.

sudo apt-get -y upgrade

Kemudian reboot dan upgrade distro.

sudo apt-get -y dist-upgrade

Referensi

Pranala Menarik

Catatan Sejarah