\begin{lstlisting}[label=dhcp-request,caption=Sample of DHCP request]
# you must run following command as a root
-\$ watch tail /var/log/messages # it may be different for your system, AYA
+watch tail /var/log/messages # it may be different for your system, AYA
# now restart your TRB3 and watch incoming messages, you should see something like this
Nov 29 10:55:18 localhost dhcpd: DHCPDISCOVER from 02:00:be:d9:21:90 via eth0
# if there is another DHCP in the network then you will see its answer
Here is example how to start TRBnet and get IDs of all FPGAs on the TRB3
\begin{lstlisting}[label=,caption=Testing TRBnet for multi TRB3 system]
-\$ TRB3_SERVER=trb033 trbnetd -i 1
-\$ DAQOPSERVER=localhost:1 trbcmd i 0xffff
+TRB3_SERVER=trb033 trbnetd -i 1
+DAQOPSERVER=localhost:1 trbcmd i 0xffff
0xf3c0 0x7c0000039021d928 0x05
0xf306 0x9e00000390195f28 0x00
0xf306 0x5100000390195528 0x01
can easily find them with following commands
\begin{lstlisting}[label=,caption=Identifying of TRBnet daemons]
-\$ ps ax | grep trbnetd
+ps ax | grep trbnetd
2556 ? S 1:15 trbnetd -i 33
21818 pts/21 S+ 0:00 /bin/grep trbnetd
-\$ cat /proc/\$(pgrep -f "trbnetd -i 33")/environ | strings | grep TRB3
+cat /proc/\$(pgrep -f "trbnetd -i 33")/environ | strings | grep TRB3
TRB3_SERVER=trb033
\end{lstlisting}
If you are using only one TRB3 then you can also export variables globally
\begin{lstlisting}[label=lst:rawtrbnet,caption=Recommended way to run TRBnet for single TRB3 system]
-\$ export TRB3_SERVER=trb033
-\$ trbnetd -i 1
-\$ export DAQOPSERVER=localhost:1
-\$ trbcmd i 0xffff
+export TRB3_SERVER=trb033
+trbnetd -i 1
+export DAQOPSERVER=localhost:1
+trbcmd i 0xffff
0xf3c0 0x7c0000039021d928 0x05
0xf306 0x9e00000390195f28 0x00
0xf306 0x5100000390195528 0x01
column is the FPGA number (0x05 is the central FPGA). To set proper addresses
execute following command
\begin{lstlisting}[label=,caption=Updating addresses and serial numbers]
-\$ ~/trbsoft/trb3/merge_serial_address.pl ~/trb3/base/serials_trb3.db ~/trb3/base/addresses_trb3.db > /dev/null
+~/trbsoft/trb3/merge_serial_address.pl ~/trb3/base/serials_trb3.db ~/trb3/base/addresses_trb3.db > /dev/null
\end{lstlisting}
It will load proper configuration to your TRB3. After this we can check whether our changes made expected result.
\begin{lstlisting}[label=,caption=Results of addresses changes]
-\$ trbcmd i 0xffff
+trbcmd i 0xffff
0x8000 0x7c0000039021d928 0x05
0x1000 0x9e00000390195f28 0x00
0x1001 0x5100000390195528 0x01
After this your changes should be saved, for this commit changes to the
repository (requires password).
\begin{lstlisting}[label=,caption=Commiting changes to repository]
-\$ cvs commit -m "Description of your changes" addresses_trb3.db
+cvs commit -m "Description of your changes" addresses_trb3.db
\end{lstlisting}
\begin{warning}
Be sure that everything is OK, your changes may break system of all
set the same string key. So in the first terminal we run
\begin{lstlisting}[label=,caption=Running Event Builder{,} part 1]
-\$ cd ~
-\$ daq_evtbuild -m 1 -o /hldfiles -x te -I 1 --ebnum 1 -q 32 -S test -d file
+cd ~
+daq_evtbuild -m 1 -o /hldfiles -x te -I 1 --ebnum 1 -q 32 -S test -d file
# To generate small files with event builder you need to add these options to command above:
# --resdownscale 20 --resnumevents 2000 --respath /shldfiles --ressizelimit 80
\end{lstlisting}
When daq\_evtbuilder is working we need to run daq\_netmem to start capture data
to file. For this run
\begin{lstlisting}[label=,caption=Running Event Builder{,} part 2]
-\$ daq_netmem -m 1 -i UDP:0.0.0.0:50000 -q 32 -d 1 -S test
+daq_netmem -m 1 -i UDP:0.0.0.0:50000 -q 32 -d 1 -S test
\end{lstlisting}
where value for parameter \verb+-S+ should be the same like for
\begin{lstlisting}[label=,caption=Preparation of TRB3 tools]
-$ cd ~/trbsoft/trbnettools
-$ cat HOWTO_COMPILE.TXT # now you can see all posible ways to compile software
+cd ~/trbsoft/trbnettools
+cat HOWTO_COMPILE.TXT # now you can see all posible ways to compile software
# we compile for TRB3
-$ make distclean
-$ make TRB3=1
-$ sudo make TRB3=1 install # you need root to install the perl library part
+make distclean
+make TRB3=1
+sudo make TRB3=1 install # you need root to install the perl library part
# now export your binaries to PATH
-$ export PATH=${HOME}/trbnettools/bin:${PATH}
+export PATH=${HOME}/trbnettools/bin:${PATH}
# to make life easier add this line above to your profile to to env script
\end{lstlisting}
% \begin{verbatim}
\begin{lstlisting}[label=,caption=Preparation of Event Builder]
-$ cd ~/
-$ git clone git://jspc29.x-matter.uni-frankfurt.de/projects/daqdata
-$ ./make_script.pl
-$ export PATH=${PATH}:${HOME}/daqdata/bin
+cd ~/
+git clone git://jspc29.x-matter.uni-frankfurt.de/projects/daqdata
+./make_script.pl
+export PATH=${PATH}:${HOME}/daqdata/bin
# this exports also can be added to profile or init script
\end{lstlisting}
% \end{verbatim}
must run following
\begin{lstlisting}[label=lst:trb3user,caption=User scripts preparation]
-$ cd ~
-$ mkdir userscripts
+cd ~
+mkdir userscripts
\end{lstlisting}
\begin{lstlisting}[label=,caption=~/userscripts/startup.sh - Variables to be adjusted]
export TRB3_SERVER=trb046
-pkill -f ``trbnetd -i 11''
+pkill -f "trbnetd -i 11"
$HOME/trbnettools/trbnetd/server/trbnetd -i 11
\end{lstlisting}