]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
setup for E12 CTS added
authorLudwig Maier <lmaier@zardoz.e12.ph.tum.de>
Wed, 9 Oct 2013 11:18:10 +0000 (13:18 +0200)
committerLudwig Maier <lmaier@zardoz.e12.ph.tum.de>
Wed, 9 Oct 2013 11:18:10 +0000 (13:18 +0200)
users/tum_e12/HOWTORUN.TXT [new file with mode: 0644]
users/tum_e12/configure_cts.sh [new file with mode: 0755]
users/tum_e12/configure_eb.sh [new file with mode: 0755]
users/tum_e12/cts-dump.sh [new file with mode: 0755]
users/tum_e12/setenv.sh [new file with mode: 0755]
users/tum_e12/start_trbnet.sh [new file with mode: 0755]
users/tum_e12/trbdhcp.conf [new file with mode: 0644]
web/httpi

diff --git a/users/tum_e12/HOWTORUN.TXT b/users/tum_e12/HOWTORUN.TXT
new file mode 100644 (file)
index 0000000..8b98b1b
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+cd /home/rich/TRB/trbsoft/daqtools/users/tum_e12
+. ./setenv.sh
+start_trbnet.sh
+trbcmd reset
+trbdhcp
+configure_eb.sh
+configure_cts.sh
+
+xterm -e "cd ../../web; cts_gui --port 1234 --noopenxterm --quiet" &
diff --git a/users/tum_e12/configure_cts.sh b/users/tum_e12/configure_cts.sh
new file mode 100755 (executable)
index 0000000..26a189b
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+trbcmd w 0x8000 0x8300 0x8000
+trbcmd w 0x8000 0x8301 0x00020001
+trbcmd w 0x8000 0x8302 0x00030062
+trbcmd w 0x8000 0x8303 0xea60
+trbcmd w 0x8000 0x8304 0x2260
+trbcmd w 0x8000 0x8305 0x1
+trbcmd w 0x8000 0x8306 0x0
+trbcmd w 0x8000 0x8307 0x0
+trbcmd w 0x8000 0x8308 0xffffff
+trbcmd w 0x8000 0x830b 0x7
+trbcmd w 0x8000 0x830d 0x0
+
+# Pulser #0 Settings
+trbcmd w 0x8000 0xa137 0x0001869f #0x3e7
+trbcmd clearbit 0x8000 0xa101 0x2
diff --git a/users/tum_e12/configure_eb.sh b/users/tum_e12/configure_eb.sh
new file mode 100755 (executable)
index 0000000..ff02b4a
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# MAC Address of the EB
+# i.e. 6C:F0:49:02:D7:45
+trbcmd w 0x8000 0x8100 0x4902d745   # Lower 32 bits of EB MAC
+trbcmd w 0x8000 0x8101 0x6cf0       # Bit 15..0: Higher 16 bit of EB MAC,
+
+# IP Adress and Port of EB: (10.152.8.107:50000)
+trbcmd w 0x8000 0x8102 0x0a98086b   # Destination IP
+trbcmd w 0x8000 0x8103 0xc350       # Bit 15..0: Destination UDP Port
+
+# MAC Adress of Source (trb3)
+trbcmd w 0x8000 0x8104 0xdead8001   # Lower 32 bits of Source MAC
+trbcmd w 0x8000 0x8105 0x0230       # Bit 15..0: Higher 16 bit of Source MAC
+
+# IP and Port of Source (10.152.8.17:50000)
+trbcmd w 0x8000 0x8106 0x0a980811   # Source IP
+trbcmd w 0x8000 0x8107 0xc350       # Bit 15..0: Source UDP Port 
+trbcmd w 0x8000 0x8108 0x0578       # Bit 15..0: MTU size
diff --git a/users/tum_e12/cts-dump.sh b/users/tum_e12/cts-dump.sh
new file mode 100755 (executable)
index 0000000..f9552d9
--- /dev/null
@@ -0,0 +1,43 @@
+# CTS Configuration dump
+#  generated:        2013-08-15 21:16
+#  CTS Compile time: 2013-02-28 18:25
+#
+# trbcmd Dev.   Reg.   Value
+trbcmd w 0x8000 0xa137 0x0001869f  # trg_pulser_config0: low_duration=99999
+trbcmd w 0x8000 0xa126 0x00000000  # trg_input_config2: delay=0, invert=false, override=off, spike_rej=0
+trbcmd w 0x8000 0xa132 0x000f0000  # trg_coin_config0: 
+                            # coin_mask=0000 0000, inhibit_mask=0000 0000
+                            # window=15
+trbcmd w 0x8000 0xa13f 0x00000000  # trg_cbm_control: value=0
+trbcmd w 0x8000 0xa008 0xffffffff  # cts_fsm_limits: ro=65535, td=65535
+trbcmd w 0x8000 0xa127 0x00000000  # trg_input_config3: delay=0, invert=false, override=off, spike_rej=0
+trbcmd w 0x8000 0xa135 0x000f0000  # trg_coin_config3: 
+                            # coin_mask=0000 0000, inhibit_mask=0000 0000
+                            # window=15
+trbcmd w 0x8000 0xa134 0x000f0000  # trg_coin_config2: 
+                            # coin_mask=0000 0000, inhibit_mask=0000 0000
+                            # window=15
+trbcmd w 0x8000 0xa139 0xffffffff  # trg_pulser_config2: low_duration=4294967295
+trbcmd w 0x8000 0xa133 0x000f0000  # trg_coin_config1: 
+                            # coin_mask=0000 0000, inhibit_mask=0000 0000
+                            # window=15
+trbcmd w 0x8000 0xa124 0x00000000  # trg_input_config0: delay=0, invert=false, override=off, spike_rej=0
+trbcmd w 0x8000 0xa125 0x00000000  # trg_input_config1: delay=0, invert=false, override=off, spike_rej=0
+trbcmd w 0x8000 0xa138 0x00000003  # trg_pulser_config1: low_duration=3
+trbcmd w 0x8000 0xa101 0xffff0000  # trg_channel_mask: edge=1111 1111 1111 1111, mask=0000 0000 0000 0000
+trbcmd w 0x8000 0xa13a 0xffffffff  # trg_pulser_config3: low_duration=4294967295
+trbcmd w 0x8000 0xa142 0x11111111  # _trg_trigger_types1: 
+                            # type10=0x1_physics_trigger, type11=0x1_physics_trigger
+                            # type12=0x1_physics_trigger, type13=0x1_physics_trigger
+                            # type14=0x1_physics_trigger, type15=0x1_physics_trigger
+                            # type8=0x1_physics_trigger, type9=0x1_physics_trigger
+trbcmd w 0x8000 0xa009 0x00000001  # cts_readout_config: 
+                            # channel_cnt=false, idle_dead_cnt=false, input_cnt=true
+                            # timestamp=false, trg_cnt=false
+trbcmd w 0x8000 0xa00c 0x00000000  # cts_throttle: enable=false, stop=false, threshold=0
+trbcmd w 0x8000 0xa141 0x11111111  # _trg_trigger_types0: 
+                            # type0=0x1_physics_trigger, type1=0x1_physics_trigger
+                            # type2=0x1_physics_trigger, type3=0x1_physics_trigger
+                            # type4=0x1_physics_trigger, type5=0x1_physics_trigger
+                            # type6=0x1_physics_trigger, type7=0x1_physics_trigger
+trbcmd w 0x8000 0xa13c 0x00000000  # trg_random_pulser_config0: threshold=0
diff --git a/users/tum_e12/setenv.sh b/users/tum_e12/setenv.sh
new file mode 100755 (executable)
index 0000000..52f620f
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+. /etc/e12functions.sh 
+
+BASEDIR=/home/rich/TRB/trbsoft
+
+expath ${BASEDIR}/trbnettools/bin
+
+export PERL5LIB=${BASEDIR}/trbnettools/perllib/usr/local/lib64/perl5:${BASEDIR}/daqtools/web/CtsPlugins:${BASEDIR}/daqtools/web/include
+
+export TRB3_SERVER=trb3
+#export DAQOPSERVER=bia:12
+export DAQOPSERVER=bia
+
+
+export TRBNETID=12
diff --git a/users/tum_e12/start_trbnet.sh b/users/tum_e12/start_trbnet.sh
new file mode 100755 (executable)
index 0000000..36bf812
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# searching for proper environment
+which trbnetd 2&> /dev/null
+exstat="$?"
+
+if [ "$exstat" -ne "1" ]; then
+       echo "No path trbnetd found, please prepare environment first!"
+       kill -SIGINT $$
+else
+       echo "Path to trbnetd found!"
+fi
+
+trbquery="trbnetd -i ${TRBNETID}"
+trbpgrep=$(pgrep -f "${trbquery}")
+
+# searching for existing trbnetd instances
+if [ -n "${trbpgrep}" ]; then
+       echo "Found running trbnetd daemons with ID=${TRBNETID}."
+       read -n1 -p "Do you want to kill existing instances? (y/n) "
+       echo
+       if [[ $REPLY = [yY] ]]; then
+               pkill -f "trbnetd -i ${TRBNETID}";
+               echo "Old instances of trbnetd killed"
+       else
+               echo "You didn't answer yes, I can't proceed.";
+               kill -SIGINT $$
+       fi
+fi
+
+# running fresh trbnetd
+trbnetd -i ${TRBNETID}                 # (again it is the trb3 number)
+TRBNETDPID=$(pgrep -f "${trbquery}")
+
+echo "DAQ op server is running on ${DAQOPSERVER} (PID: ${TRBNETDPID})"
+
+# checking TRB3 conenctions
+echo -e "\n\$ trbcmd i 0xffff"
+trbcmd i 0xffff
diff --git a/users/tum_e12/trbdhcp.conf b/users/tum_e12/trbdhcp.conf
new file mode 100644 (file)
index 0000000..a4e1c71
--- /dev/null
@@ -0,0 +1,5 @@
+0x8000  0x12000002e2d98d28  0x05
+0x8900  0xcf000003480d8a28  0x00
+0x8901  0x99000002e30e5728  0x01
+0x8902  0x4e000002e2e24c28  0x02
+0x8903  0x6a000002e2e24328  0x03
index 1a26aeb6ed842ab4c93250ce9f1eaeb5191ea5b6..e9a278c6df37608ed409be60c9d696278869e84c 100755 (executable)
--- a/web/httpi
+++ b/web/httpi
@@ -431,7 +431,7 @@ exit;
 sub nsecmodel {
        &log;
        ($x,$x,$x,$x,$uid,$gid) = stat(S);
-       (!$uid || !$gid || $uid < 10) &&
+       (!$uid || !$gid || $uid < 100) &&
                die "resource is root-owned, secured or not stat-able\n";
        if (!$<) {
                ($) = "$gid $gid") || die "can't set egid to $gid";