Ubuntu with GNU radio

首先更新ubuntu到最新版    本篇說明是以10.04為主

更新的好處是......等一下指令可以打短一點

        壞處是......我不知道

1. 修改apt-get的來源伺服器

 

$ sudo vim /etc/apt/sources.list

在裡面加上

deb http://us.archive.ubuntu.com/ubuntu jaunty main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu jaunty-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu jaunty-security main restricted universe multiverse

如果你跟我說你不會用vim

那也可以用gedit

如果沒有vim

請自行找尋安裝的方式

2. 安裝一大堆GNU radio所需要的套件

安裝 GNU RADIO 前要讓 Ubuntu 有下列程式:
    * Development Tools (need for compilation)
          o g++
          o subversion
          o make
          o autoconf, automake, libtool
          o sdcc (from "universe"; 2.4 or newer)
          o guile (1.6 or newer)
          o ccache (not required, but recommended if you compile frequently)
    * Libraries (need for runtime and for compilation)
          o python-dev
          o FFTW 3.X (fftw3, fftw3-dev)
          o cppunit (libcppunit and libcppunit-dev)
          o Boost 1.35 (or later)
          o libusb and libusb-dev
          o wxWidgets (wx-common) and wxPython (python-wxgtk2.8)
          o python-numpy (via python-numpy-ext) (for SVN on or after 2007-May-28)
          o ALSA (alsa-base, libasound2 and libasound2-dev)
          o Qt (libqt3-mt-dev for versions earlier than 8.04; version 4 works for 8.04 and later)
          o SDL (libsdl-dev)
          o 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)
          o Edgy or previous: requires installation from source
          o Feisty or newer: use the standard package install (swig)
    * QWT (optional) (5.0.0 or newer required)
          o Must be installed from source (as of 2008-01-15).
          o 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
          o Must be installed for gr-qtgui to work. qt4 version preferred for Ubuntu 8.04 and 8.10
    * Polyphase Filter Bank examples
          o for the examples in gnuradio-examples/python/pfb to work you need to install python-scipy, python-matplotlib, and python-tk
    * Other useful packages
          o doxygen (for creating documentation from source code)
          o octave (from "universe")

這樣排版比較清楚

以上說明感謝學長支援

版權沒有   請自行抄襲

然後下面就是一大串指令

在下指令之前先說一下

可以先裝qt4

因為很多套件都跟qt有關

又可以少打幾個字了

安裝qt4      http://wiki.ubuntu.org.cn/index.php?title=Qt&variant=zh-tw

安裝其他哩哩摳摳ㄟ

$ sudo apt-get update
$ sudo apt-get -y install kernel-package fakeroot tofrodos gitweb git git-svn qgit subversion autoconf automake libtool sdcc sdcc-nf octave3.2
$ sudo apt-get -y install  python-dev python-numpy-ext python-wxgtk2.8 python-cheetah python-scipy python-matplotlib python-tk python-lxml
$ sudo apt-get -y install  qt4-creator libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools doxygen guile-1.8-dev fftw3 fftw3-dev wx-common
$ sudo apt-get -y install libcppunit-dev libcppunit-doc libboost1.35-dev libboost-thread-dev libusb-dev libsdl1.2-dev libsdl-dev libgsl0-dev swig

qt4-creator只是我順便裝來試試寫qt也順便少打幾個字

以上不保證不重複或是不需要裝卻打在上面

之後要記得更改一個東西

 

$ sudo dpkg-reconfigure dash 

選否把 Ubuntu 用的 dash 改為 bash

3. 安裝boost C++ library

以下感謝      http://ubuntuforums.org/showthread.php?t=1180792

我是裝1.44.0版本的

1.37版本的裝法太長了就跳過

 

步驟a)安裝g++

應該10.04版有裝

請按

$ g++ --version

檢查是否有裝

如果沒裝就照下面指令安裝

 

$ sudo aptitude install build-essential g++

步驟b)編譯圖書館!?(誤

切到存放boost_1_XX_X.tar.bz2的資料夾

XX跟X都是數字

然後愉悅的解壓縮他

 

$ sudo tar -jxvf 存放的路徑/boost_1_XX_X.tar.bz2

接著進去解壓縮的資料夾內

就開始了麻煩的工程

 

$ sudo ./bootstrap.sh --exec-prefix=/usr/local --with-libraries=filesytem,program_options,system --libdir=/usr/lib/boost --includedir=/usr/include/boost --show-libraries

全部的路徑都可以自己爽

只是這樣最方便

之後要用也不需要更改環境變數

步驟c)安裝

終於到達最後一站!

只是boost的最後一站   0rz

 

$ sudo ./bjam
$ sudo ./bjam install

執行./bjam的時候有很長一段時間你會懷疑電腦是掛了嗎?

毫無反應

只是個沒有訊息的終端機

等一陣子就有反應了

4. 安裝GNU radio

一行KO

$ sudo apt-get install gnuradio

將usrp加入群組,讓非系統管理員也能熱插拔。

 

$ sudo usermod -G usrp -a openbts     # 用你登入 ubuntu 的帳號來替代 open
$ su
$ echo 'ACTION=="add", BUS=="usb", SYSFS{idVendor}=="fffe", SYSFS{idProduct}=="0002", GROUP:="usrp", MODE:="0660"' > tmpfile
$ exit
$ sudo chown root.root tmpfile
$ sudo mv tmpfile /etc/udev/rules.d/10-usrp.rules
重新啟動udev

 

$ sudo /etc/init.d/udev stop
$ sudo /etc/init.d/udev start
插入USRP,看是否有抓到。

 

$ ls -lR /dev/bus/usb | grep usrp
有抓到的話會顯示

 

 crw-rw---- 1 root usrp 189, 514 Mar 24 09:46 003
如果沒抓到,可以重開機試試看。

 

測試usrp

 

$ cd /usr/src/openBTS/gnuradio/gnuradio-examples/python/usrp
$ ./usrp_benchmark_usb.py
$ cd /usr/src/openBTS/gnuradio/usrp/host/apps
$ ./test_usrp_standard_tx
$ ./test_usrp_standard_rx

5. 安裝osip2

http://www.gnu.org/software/osip/
==============================================
OpenBTS 使用 osip2 的 SIP protocol 建立通話與整合PBX功能,
2.5 版以上需要 osip2 3.3版,早期版本需要 osip2 3.0版。
Ubuntu 9.04可直接安裝 (apt-get install) 3.1版 package,
Ubuntu 9.10 版則可安裝3.3版。若有需要不同版本,可自行取得原始碼編譯。

再度複製貼上

再度感謝學長辛苦的說明

$ cd /usr/src/
$ sudo wget http://ftp.gnu.org/gnu/osip/libosip2-3.3.0.tar.gz
$ sudo tar -zxvf libosip2-3.3.0.tar.gz
$ cd libosip2-3.3.0
$ su
$ ./configure
$ make
$ make install; exit

6. 安裝RTP libary oRTP

RTP libary oRTP

http://savannah.inetbridge.net/linphone/ortp/sources/
==============================================
OpenBTS底層的VoIP 使用 oRTP 的 RTP protocol 進行語音封包傳送,應使用 0.15 版以上。
Ubuntu 9.04版直接安裝 2.1.1 版 package,Ubuntu 9.10 版則可取得 3.1.2 版。
版本與 OpenBTS 描述有出入,建議可以取得原始碼加以編譯並安裝 (make install)。

繼續複製貼上

http://download.savannah.gnu.org/releases/linphone/ortp/sources/下載

 

$ sudo tar -zxvf ortp-0.16.1.tar.gz
$ cd ortp-0.16.1
$ sudo ./configure
$ sudo make
$ sudo make install

7. 安裝asterisk

再度一行KO

 

$ sudo apt-get install asterisk sox asterisk-mysql asterisk-mp3
設定請參照     https://wiki.ubuntu.com/AsteriskOnUbuntu/Current

8. 安裝OpenBTS

 

$ sudo cd /usr/src/
$ sudo wget http://sourceforge.net/projects/openbts/files/openbts-2.5.3Lacassine.tar.gz/download
$ cd openBTS/
$ sudo tar -zxvf ../openbts-2.5.3Lacassine.tar.gz
$ export LIBS=-lpthread
$ 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
$ cd /usr/src/openBTS/openbts-2.5.3Lacassine
$ ./configure
$ make
$ sudo make install
$ sudo mv /etc/asterisk/sip.conf        /etc/asterisk/sip.ori_conf
$ sudo mv /etc/asterisk/extensions.conf /etc/asterisk/extensions.ori_conf
$ sudo cp AsteriskConfig/sip.conf        /etc/asterisk/sip.conf
$ sudo cp AsteriskConfig/extensions.conf /etc/asterisk/extensions.conf
$ cd apps/
收工

 

結論:我很懶得打安裝記錄

转载于:https://www.cnblogs.com/dforce/articles/1815393.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值