Changeset 5868

Show
Ignore:
Timestamp:
11/28/07 16:28:15 (6 years ago)
Author:
jgaeddert
Message:

using lstlistings for code snippets

Location:
documentation/ossie/user-guide-0.6.2
Files:
1 removed
1 modified

Legend:

Unmodified
Added
Removed
  • documentation/ossie/user-guide-0.6.2/UserGuide.tex

    r5866 r5868  
    1313\usepackage{url} 
    1414\usepackage{listings} 
    15 \usepackage{fancybox} 
    1615% due to magic hacks, hyperref must be right before document begin 
    1716\usepackage[pdftex]{hyperref} 
     
    2928\definecolor{MyCommentColor}{rgb}{0.1,0.4,0.1} 
    3029\definecolor{MyCodeBackgroundColor}{rgb}{0.95,0.95,0.95} 
     30%\definecolor{MyCodeFrameRuleColor}{rgb}{0.9,0.9,0.9} 
    3131\definecolor{MyStringColor}{rgb}{0.6,0.1,0.1} 
    3232\definecolor{MyKeywordColor}{rgb}{0.6,0.1,0.1} 
     
    4444    %showstringspaces=false,     % no special string spaces 
    4545    backgroundcolor=\color{MyCodeBackgroundColor}, 
     46    frame=none, 
     47    %framerule=0.5pt, 
     48    %framexleftmargin=2pt, 
     49    %framexrightmargin=2pt, 
     50    %framexbottommargin=2pt, 
     51    %framextopmargin=2pt, 
     52    %rulecolor=\color{MyCodeFrameRuleColor}, 
     53    nolol=true,     % suppress listoflistings entry 
    4654    tabsize=4, 
    47     xleftmargin=10pt, 
    48     xrightmargin=10pt, 
    49     caption=\lstname 
     55    linewidth=\linewidth, 
     56    breaklines=false, 
     57    xleftmargin=6pt, 
     58    xrightmargin=6pt 
    5059} 
    5160 
     
    5766 
    5867\tableofcontents 
     68\lstlistoflistings 
    5969 
    6070\section{Quick Start Guide} 
     
    95105Tools$\rightarrow$Terminal. The first thing that needs to be started is the 
    96106naming service. Type as root: 
    97 \begin{LVerbatim} 
    98 # omniNames.sh 
    99 \end{LVerbatim} 
     107\begin{lstlisting}[] 
     108 # omniNames.sh 
     109\end{lstlisting} 
    100110 
    101111%[USE INITSCRIPT!] 
     
    110120The next service that needs to be started is the Node Booter. Open a new tab or 
    111121a completely new terminal and type: 
    112 \begin{LVerbatim} 
     122\begin{lstlisting}[] 
    113123$ cd /sdr/ 
    114124$ nodeBooter -D -d nodes/default_GPP_node/DeviceManager.dcd.xml 
    115 \end{LVerbatim} 
     125\end{lstlisting} 
    116126 
    117127The terminal should look like the following screen shot: 
     
    125135 
    126136Now load the waveform using wavLoader. In a third tab or terminal, type in: 
    127 \begin{LVerbatim} 
     137\begin{lstlisting}[] 
    128138$ cd /sdr/waveforms/ossie_demo 
    129139$ wavLoader.py ossie_demo_DAS.xml 
    130 \end{LVerbatim} 
     140\end{lstlisting} 
    131141 
    132142The terminal should look similar to this:%Figure ~\ref{screen:wavLoader} 
     
    141151Now select the QPSK demonstration waveform, 
    142152//waveforms/ossie\_demo/ossie\_demo.sad.xml: 
    143 \begin{LVerbatim} 
     153\begin{lstlisting}[] 
    144154$ 1 
    145 \end{LVerbatim} 
     155\end{lstlisting} 
    146156 
    147157The tab or terminal window in which nodeBooter was started will now contain the 
    148158output of the demo. The lines will update with output similar to this: 
    149 \begin{LVerbatim} 
     159\begin{lstlisting}[] 
    150160RxDemo errors:  X  / 1024 
    151 \end{LVerbatim} 
     161\end{lstlisting} 
    152162 
    153163Where X denotes the number of bit errors out of 1024 that have been detected 
     
    206216brackets with the appropriate information. 
    207217 
    208 \begin{LVerbatim} 
    209 subscribe <list name (ossie-discuss or ossie-dev)>  <your first name>  <your last name>  
    210 \end{LVerbatim} 
     218\begin{lstlisting}[] 
     219subscribe <list name>  <your first name>  <your last name>  
     220\end{lstlisting} 
    211221 
    212222To send a message to all subscribers to the list, simply send it to 
     
    242252\section{Installation} 
    243253\label{section:installation} 
    244  
    245254Two methods of installation are currently available: VMware 
    246255image and a source tarball. We are working on packages for the Yum 
     
    255264method preference. 
    256265 
     266\subsection{Notes on Linux Installation} 
     267\label{section:installation:notesonlinux} 
     268This section on installation assumes that the user is familiar with basic 
     269Linux commands such as {\tt cd} and {\tt ls}. 
     270Commands run with root permissions are prefixed with {\tt \#}, while others 
     271are prefixed with {\tt \$}. 
     272Additionally this guide assumes that the target system has basic development 
     273tools necessary for compiling sources. 
     274 
    257275\subsection{Dependencies} 
    258276\label{section:installation:dependencies} 
     
    263281\label{section:installation:dependencies:xerces} 
    264282This is a C++ XML parser.  The framework uses this package to interpret the XML files that define your resources and waveforms (among other things). 
    265 \begin{LVerbatim} 
    266 # yum install xerces-c-devel 
    267 \end{LVerbatim} 
     283\begin{lstlisting}[] 
     284 # yum install xerces-c-devel 
     285\end{lstlisting} 
    268286 
    269287\subsubsection{omniORB} 
    270288\label{section:installation:dependencies:omniorb} 
    271289This package handles most of the CORBA implementation for your system. 
    272 \begin{LVerbatim} 
    273 # rpmbuild --rebuild \ 
     290\begin{lstlisting}[] 
     291 # rpmbuild --rebuild \ 
    274292    http://www.fourpalms.org/pub/omniORB/SRPMS/omniORB-4.1.0-1.src.rpm 
    275 # cd /usr/src/redhat/RPMS/i386 
    276 # rpm -Uhv omniORB-4.1.0-1.i386.rpm 
    277 # rpm -Uhv omniORB-devel-4.1.0-1.i386.rpm 
    278 # rpm -Uhv omniORB-utils-4.1.0-1.i386.rpm 
    279 # rpm -Uhv omniORB-servers-4.1.0-1.i386.rpm 
    280 # rpm -Uhv omniORB-bootscripts-4.1.0-1.i386.rpm 
    281 \end{LVerbatim} 
     293 # cd /usr/src/redhat/RPMS/i386 
     294 # rpm -Uhv omniORB-4.1.0-1.i386.rpm 
     295 # rpm -Uhv omniORB-devel-4.1.0-1.i386.rpm 
     296 # rpm -Uhv omniORB-utils-4.1.0-1.i386.rpm 
     297 # rpm -Uhv omniORB-servers-4.1.0-1.i386.rpm 
     298 # rpm -Uhv omniORB-bootscripts-4.1.0-1.i386.rpm 
     299\end{lstlisting} 
    282300 
    283301Configure omniORB: 
    284 \begin{LVerbatim} 
    285 # vim /etc/omniORB.cfg 
    286 \end{LVerbatim} 
     302\begin{lstlisting}[] 
     303 # vim /etc/omniORB.cfg 
     304\end{lstlisting} 
    287305Around line 313 you should see 
    288 \begin{LVerbatim} 
    289 InitRef = NameService=corbaname::my.host.name 
    290 \end{LVerbatim} 
     306\begin{lstlisting}[] 
     307 InitRef = NameService=corbaname::my.host.name 
     308\end{lstlisting} 
    291309Uncomment the line and change to 
    292 \begin{LVerbatim} 
    293 InitRef = NameService=corbaname::localhost 
    294 \end{LVerbatim} 
     310\begin{lstlisting}[] 
     311 InitRef = NameService=corbaname::localhost 
     312\end{lstlisting} 
    295313 
    296314 
     
    299317This package provides a Python interface for omniORB.  It is used for both the 
    300318Python tools (OWD, ALF, wavLoader.py) and Python components. 
    301 \begin{LVerbatim} 
    302 # rpmbuild --rebuild \ 
    303     http://www.fourpalms.org/pub/omniORB/SRPMS/omniORBpy-3.0-1.src.rpm 
    304 # cd /usr/src/redhat/RPMS/i386 
    305 # rpm -Uhv omniORBpy-3.0-1.i386.rpm 
    306 # rpm -Uhv --force omniORBpy-standard-3.0-1.i386.rpm 
    307 # rpm -Uhv omniORBpy-devel-3.0-1.i386.rpm 
    308 \end{LVerbatim} 
     319\begin{lstlisting}[] 
     320 # rpmbuild --rebuild \ 
     321     http://www.fourpalms.org/pub/omniORB/SRPMS/omniORBpy-3.0-1.src.rpm 
     322 # cd /usr/src/redhat/RPMS/i386 
     323 # rpm -Uhv omniORBpy-3.0-1.i386.rpm 
     324 # rpm -Uhv --force omniORBpy-standard-3.0-1.i386.rpm 
     325 # rpm -Uhv omniORBpy-devel-3.0-1.i386.rpm 
     326\end{lstlisting} 
    309327 
    310328\subsubsection{wxPython} 
     
    313331well as many graphical Python components, utilize the wxPython package to 
    314332create their graphical user interfaces. 
    315 \begin{LVerbatim} 
    316 # yum install wxPython-devel 
    317 \end{LVerbatim} 
     333\begin{lstlisting}[] 
     334 # yum install wxPython-devel 
     335\end{lstlisting} 
    318336 
    319337\subsubsection{numpy} 
     
    321339numpy is a python numerical library that the tools use.  This is only 
    322340necessary for running the tools. 
    323 \begin{LVerbatim} 
    324 # yum install numpy 
    325 \end{LVerbatim} 
     341\begin{lstlisting}[] 
     342 # yum install numpy 
     343\end{lstlisting} 
    326344 
    327345At this time you will need to restart your machine. 
     
    341359As root, edit the 'sudoers' file\footnote{By default the sudoers file must be 
    342360edited with the {\tt visudo} command} 
    343 \begin{LVerbatim} 
    344 # /usr/sbin/visudo 
    345 \end{LVerbatim} 
     361\begin{lstlisting}[] 
     362 # /usr/sbin/visudo 
     363\end{lstlisting} 
    346364 
    347365At the end of the file, add the following line: 
    348 \begin{LVerbatim} 
    349 ALL ALL = NOPASSWD: /usr/bin/make install 
    350 \end{LVerbatim} 
     366\begin{lstlisting}[] 
     367 ALL ALL = NOPASSWD: /usr/bin/make install 
     368\end{lstlisting} 
    351369 
    352370Save and quit ({\tt :wq}).  If you made an error, visudo will tell you. 
     
    357375run source from this directory without root permissions you need to create and 
    358376change ownership of {\tt /sdr}. 
    359 \begin{LVerbatim} 
    360 # mkdir /sdr 
    361 # chown -R username.username /sdr 
    362 \end{LVerbatim} 
     377\begin{lstlisting}[] 
     378 # mkdir /sdr 
     379 # chown -R username.username /sdr 
     380\end{lstlisting} 
    363381where {\tt username} is your user name. 
    364382 
     
    367385The included {\tt build.py} script automates installation of the OSSIE 
    368386packages. 
    369 Because OSSIE is built as a set of independent libraries it is 
    370 necessary to build and install each one separately. 
     387Because OSSIE is built as a set of dependent libraries it is 
     388necessary to build and install each one separately and individually so that 
     389they can link properly. 
    371390 
    372391To run the script, navigate to the {\tt ossie-0.6.2} directory and run 
    373 \begin{LVerbatim} 
    374 $ python build.py 
    375 \end{LVerbatim} 
     392\begin{lstlisting}[] 
     393 $ python build.py 
     394\end{lstlisting} 
    376395If successful the prompt should say something like ``Complete installation 
    377396successful.'' 
     
    387406/usr/local/lib/python2.X/site-packages} to your {\tt ossie.pth} file (where X 
    388407corresponds to the specific version of Python installed on your system)} 
    389 \begin{LVerbatim} 
    390 /sdr/tools 
    391 \end{LVerbatim} 
    392  
     408% 
     409\begin{lstlisting}[caption={{\tt ossie.pth} file}, nolol=false] 
     410 /sdr/tools 
     411\end{lstlisting} 
     412% 
    393413Once the file is created, it needs to be moved to the {\tt site-packages} 
    394414Python subdirectory. 
    395 \begin{LVerbatim} 
    396 # mv ossie.pth /usr/lib/python2.X/site-packages 
    397 \end{LVerbatim} 
     415\begin{lstlisting}[] 
     416 # mv ossie.pth /usr/lib/python2.X/site-packages 
     417\end{lstlisting} 
    398418where X corresponds to the specific version of Python installed on your 
    399419system. 
     
    405425Once the OSSIE libraries are installed, they need to be linked. 
    406426As root edit the file {\tt /etc/ld.so.conf} and add the line 
    407 \begin{LVerbatim} 
    408 /usr/local/lib 
    409 \end{LVerbatim} 
     427\begin{lstlisting}[] 
     428 /usr/local/lib 
     429\end{lstlisting} 
    410430Now run 
    411 \begin{LVerbatim} 
    412 # /sbin/ldconfig 
    413 \end{LVerbatim} 
     431\begin{lstlisting}[] 
     432 # /sbin/ldconfig 
     433\end{lstlisting} 
    414434 
    415435\subsection{Using a VMware Image on Any Platform} 
     
    439459% To access the ebuilds, install and configure layman if you haven't already: 
    440460% \begin{figure} 
    441 % \begin{LVerbatim} 
     461% \begin{lstlisting}[] 
    442462% # emerge layman 
    443463% # echo "source /usr/portage/local/layman/make.conf" >> /etc/make.conf 
    444 % \end{LVerbatim} 
     464% \end{lstlisting} 
    445465% \end{figure} 
    446466%  
    447467% Then, add ossie-overlay to your locally-stored overlays: 
    448468% \begin{figure} 
    449 % \begin{LVerbatim} 
     469% \begin{lstlisting}[] 
    450470% # layman -a -o https://ossie.wireless.vt.edu/repos/ossie/experimental/scripts/gentoo/ossie-overlay.xml 
    451 % \end{LVerbatim} 
     471% \end{lstlisting} 
    452472% \end{figure} 
    453473%  
    454474% You can then proceed with installing OSSIE: 
    455475% \begin{figure} 
    456 % \begin{LVerbatim} 
     476% \begin{lstlisting}[] 
    457477% # emerge -av ossie 
    458 % \end{LVerbatim} 
     478% \end{lstlisting} 
    459479% \end{figure} 
    460480%  
     
    486506 
    487507\begin{figure} 
    488 \begin{LVerbatim} 
    489 $ cd /sdr/tools/WaveDev/wavedev 
    490 $ python wd.py 
    491 \end{LVerbatim} 
     508\begin{lstlisting}[] 
     509 $ cd /sdr/tools/WaveDev/wavedev 
     510 $ python wd.py 
     511\end{lstlisting} 
    492512\caption{Starting OWD} 
    493513\label{code:start_owd} 
     
    509529To start the stand-alone component builder, run {\tt ComponentFrame.py} from 
    510530within the wavedev directory: 
    511 \begin{LVerbatim} 
    512 $ cd /sdr/tools/WaveDev/wavedev/ 
    513 $ python ComponentFrame.py 
    514 \end{LVerbatim} 
     531\begin{lstlisting}[] 
     532 $ cd /sdr/tools/WaveDev/wavedev/ 
     533 $ python ComponentFrame.py 
     534\end{lstlisting} 
    515535 
    516536Generating a new component automatically adds it to your waveforms layout, but 
     
    590610/home/mydir/src/components}). Four commands must be executed (in order) in 
    591611order to install the component to the {\tt /sdr} directory: 
    592 \begin{LVerbatim} 
    593 $ ./reconf 
    594 $ ./configure 
    595 $ make 
    596 $ make install #\(may require root permissions\) 
    597 \end{LVerbatim} 
     612\begin{lstlisting}[] 
     613 $ ./reconf 
     614 $ ./configure 
     615 $ make 
     616 $ make install #\(may require root permissions\) 
     617\end{lstlisting} 
    598618 
    599619In this version, OWD must be restarted for the installed component to appear in 
     
    620640 
    621641In one tab or terminal: 
    622 \begin{LVerbatim} 
    623 $ nodeBooter -D -d nodes/default_GPP_node/DeviceManager.dcd.xml 
    624 \end{LVerbatim} 
     642\begin{lstlisting}[] 
     643 $ nodeBooter -D -d nodes/default_GPP_node/DeviceManager.dcd.xml 
     644\end{lstlisting} 
    625645 
    626646(Where {\tt default\_GPP\_node} can change if your waveform requires) 
     
    628648Once nodeBooter is started, open a second tab or terminal, 
    629649navigate to the {\tt alf} directory, and start ALF: 
    630 \begin{LVerbatim} 
    631 $ cd /sdr/tools/alf 
    632 $ python ALF.py 
    633 \end{LVerbatim} 
     650\begin{lstlisting}[] 
     651 $ cd /sdr/tools/alf 
     652 $ python ALF.py 
     653\end{lstlisting} 
    634654 
    635655On the left hand side of the ALF display you will see a list of available 
     
    717737\addappheadtotoc 
    718738 
    719 \section{Creating omniNames.sh} 
    720  
    721 Create a file called omniNames.sh and put the following in it: 
    722 \begin{lstlisting}[frame=single, framerule=0pt, caption={omniNames.sh}, 
    723 nolol=true, frame=single] 
    724 $!/bin/sh 
    725  
    726 killall omniNames 
    727 rm /sdr/logs/omninames* 
    728  
    729 omniNames -start -logdir /sdr/logs & 
     739\section{Creating {\tt omniNames.sh}} 
     740Installing omniORB from rpms automatically starts the naming service when the 
     741system boots. 
     742If omniORB was {\it not} installed using rpms, the naming service will 
     743probably need to be started manually. 
     744To do so, create a file called {\tt omniNames.sh} containing the following 
     745\begin{lstlisting}[caption={{\tt omniNames.sh} file}, nolol=false] 
     746 $!/bin/sh 
     747  
     748 killall omniNames 
     749 rm /sdr/logs/omninames* 
     750  
     751 omniNames -start -logdir /sdr/logs & 
    730752\end{lstlisting} 
    731753 
    732754Once this file is created, the file must be given executable permissions: 
    733 \begin{LVerbatim} 
    734 $ chmod 755 omniNames.sh 
    735 \end{LVerbatim} 
    736  
    737 To run the omniNames.sh script, navigate to wherever the file is located and type "./omniNames.sh" into the terminal. 
    738  
    739 \section{Configuring the USRP} 
    740 The universal software radio peripheral (USRP) is produced by Ettus Research 
    741 LLC and is supported by OSSIE. Daughterboards for the USRP are available for a 
    742 variety of bands. Information on the USRP is available at 
    743 \href{http://www.ettus.com}{http://www.ettus.com}. 
    744  
    745 \subsection{Firmware Installation} 
    746 First, install the SDCC (small device C compiler). Download the 2.6.0 source 
    747 tarball from \\ 
    748 \href{http://sdcc.sourceforge.net/} \\ 
    749 and execute the following commands: 
    750 \begin{LVerbatim} 
    751 $ tar -xvf sdcc-src-2.6.0.tar.gz 
    752 $ cd sdcc-src-2.6.0 
    753 $ ./configure 
    754 $ make 
    755 # make install 
    756 \end{LVerbatim} 
    757  
    758 Now install the USRP source. Download \\ 
    759 \href{ftp://ftp.gnu.org/gnu/gnuradio/gnuradio-3.1.1.tar.gz} \\ and execute the 
    760 following commands: 
    761 \begin{LVerbatim} 
    762 $ tar -xvf gnuradio-3.1.1.tar.gz 
    763 $ cd gnuradio-3.1.1 
    764 $ ./configure 
    765 $ cd usrp 
    766 $ make 
    767 # make install 
    768 \end{LVerbatim} 
    769  
    770 For sound card support, you should also have the Advanced Linux Sound 
    771 Architecture (ALSA) libraries installed on you system. ALSA can be added with 
    772 the package manager for your distribution or can be found at: 
    773 \href{http://www.alsa-project.org/}{http://www.alsa-project.org/}. You'll need 
    774 the standard libraries and development libraries. 
    775  
    776 \begin{LVerbatim} 
    777 $ cd <path to USRP> 
    778 $ ./reconf (skip this step if you are using tarballs) 
    779 $ ./configure 
    780 $ make 
    781 $ su ­-c "make install" 
    782 $ cd <path to USRP_Ctrl> 
    783 $ ./reconf (skip this step if you are using tarballs) 
    784 $ ./configure 
    785 $ make 
    786 $ su ­-c "make install" 
    787 $ cd <path to Sound_Out> 
    788 $ ./reconf (skip this step if you are using tarballs) 
    789 $ ./configure 
    790 $ make 
    791 $ su ­-c "make install" 
    792 $ cd <path to FM_Demodulator> 
    793 $ ./reconf (skip this step if you are using tarballs) 
    794 $ ./configure 
    795 $ make 
    796 $ su ­-c "make install" 
    797 $ cd <path to am_demod> 
    798 $ ./reconf (skip this step if you are using tarballs) 
    799 $ ./configure 
    800 $ make 
    801 $ su ­-c "make install" 
    802 $ cd <path to Decimator> 
    803 $ ./reconf (skip this step if you are using tarballs) 
    804 $ ./configure 
    805 $ make 
    806 $ su ­-c "make install" 
    807 \end{LVerbatim} 
    808  
    809 \subsection{USRP Permissions} 
    810 To be able to run a waveform that uses the USRP you will either need to have 
    811 root permissions or give access to your user to use the USRP. The process for 
    812 each distribution is different but for Fedora 7, define a group named usrp and 
    813 add yourself to the group. 
    814 (as root) 
    815 \begin{LVerbatim} 
    816 # /usr/sbin/groupadd usrp 
    817 # /usr/sbin/usermod -a usrp [username] 
    818 \end{LVerbatim} 
    819  
    820 or, if your copy of usermod does not support this syntax try: 
    821 \begin{LVerbatim} 
    822 # /usr/sbin/usermod -G usrp -a [username] 
    823 \end{LVerbatim} 
    824  
    825 Create a file named /etc/udev/rules.d/10­usrp.rules with the following 
    826 contents, and be sure to include the : in {\tt MODE:="0660"} otherwise the 
    827 default usb\_device rule will override MODE to "0640". This also applies to 
    828 the GROUP setting. 
    829  
    830 \begin{figure} 
    831 \begin{LVerbatim} 
    832 # rule to grant read/write access on USRP to group named usrp. 
    833 # to use, install this file in /etc/udev/rules.d as 10-usrp.rules 
    834 ACTION=="add", BUS=="usb", SYSFS{idVendor}=="fffe", SYSFS{idProduct}=="0002", 
    835 GROUP:="usrp", MODE:="0660" 
    836 \end{LVerbatim} 
    837 \end{figure} 
    838  
    839 Restart the udev daemon to enable the changes.  
    840 \begin{LVerbatim} 
    841 $ sudo killall -HUP udevd 
    842 \end{LVerbatim} 
    843  
    844 You can check if this is working by examining /dev/bus/usb after plugging in a USRP: 
    845 \begin{LVerbatim} 
    846 $ ls -lR /dev/bus/usb 
    847 \end{LVerbatim} 
    848  
    849 You should see a device file with group usrp and mode crw­rw­­­­. 
     755\begin{lstlisting}[] 
     756 $ chmod 755 omniNames.sh 
     757 # cp omniNames.sh /usr/local/bin 
     758\end{lstlisting} 
     759 
     760Create a directory for the logs: 
     761\begin{lstlisting}[] 
     762 $ mkdir /sdr/logs 
     763\end{lstlisting} 
     764 
     765The script can now be run by executing {\tt omniNames.sh} in any terminal. 
     766You can check to see if {\tt omniNames} is running by executing 
     767\begin{lstlisting}[] 
     768 $ ps ax | grep omniNames 
     769\end{lstlisting} 
    850770 
    851771%\section{Known Bugs}