#!/bin/bash
+perl -e '$cmd = q|LANG=C zenity --question --title "Automatic Restart of DAQ?" --text "During the cosmic beam time an additional question is asked:\nDo you want to enable automatic restart of DAQ if a failure happens?"|; $r=system($cmd); print "r: $r\n"; if($r==0) {$answer="yes"} else {$answer="no"}; $c2=qq!echo $answer | ssh hadesp33 "cat >/tmp/enable_automatic_restart"!; $r=qx($c2); print $r '
+
+
+
export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "restart the DAQ")
if [ $myvar == "256" ]; then exit; fi
export myvar=$(doyoureallywant.pl "to powercycle the Triggerbox and Beam Monitoring?")
if [ $myvar == "256" ]; then exit; fi
-
xterm -e bash --login -c '
ssh hadaq@lxhadesdaqp "
- source /home/hadaq/.bash_profile
+ source /home/hadaq/.bash_profile
+ echo Switch off beam abort
+ ssh hadeswrp01 \"echo \"W3000000010\" >/dev/ttyUSB0\"
+ sleep .1
echo \"Starting a power cycle of CTS...\"
cd /home/hadaq/hadesdaq/utils;
bash Powercycle_CTS.sh;
#!/bin/bash
ssh hadaq@hadesp33 "killall -USR1 speakdaemon.pl"
-ssh hadaq@hadesp57 "killall -USR1 speakdaemon.pl; pkill -f espeak"
-
xterm -e bash --login -c '
ssh hadaq@lxhadesdaqp "
- source /home/hadaq/.bash_profile
+ source /home/hadaq/.bash_profile
+ echo Switch off beam abort
+ ssh hadeswrp01 \"echo \"W3000000010\" >/dev/ttyUSB0\"
+ sleep .1
echo \"Starting a RPC/ECAL power cycle...\"
cd /home/hadaq/hadesdaq/utils;
PERLLIB=/home/hadaq/EPICS/EPICS-3.15.6/base/lib/perl ./ECAL_Powercycle.pl;
xterm -e bash --login -c '
ssh hadaq@lxhadesdaqp "
source /home/hadaq/.bash_profile
+ echo Switch off beam abort
+ ssh hadeswrp01 \"echo \"W3000000010\" >/dev/ttyUSB0\"
+ sleep .1
echo \"Starting a MDC/TOF/Central power cycle...\"
cd /home/hadaq/hadesdaq/utils;
PERLLIB=/home/hadaq/EPICS/EPICS-3.15.6/base/lib/perl ./MdcTofCentral_Powercycle.pl;
export myvar=$(doyoureallywant.pl "to powercycle the Triggerbox and Beam Monitoring?")
if [ $myvar == "256" ]; then exit; fi
-
xterm -e bash --login -c '
ssh hadaq@lxhadesdaqp "
- source /home/hadaq/.bash_profile
+ source /home/hadaq/.bash_profile
+ echo Switch off beam abort
+ ssh hadeswrp01 \"echo \"W3000000010\" >/dev/ttyUSB0\"
+ sleep .1
echo \"Starting a power cycle of Triggerbox and Beam Monitoring...\"
cd /home/hadaq/hadesdaq/utils;
bash Powercycle_Trigger.sh;
#!/bin/bash
-export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "reboot many boards ")
+export myvar=$(/home/hadaq/trbsoft/hadesdaq/utils/doyoureallywant.pl "reboot TOF, FW, RICH, RPC, ECAL and Start boards ")
if [ $myvar == "256" ]; then exit; fi
-notifyall.sh "DAQ" "<I> The boards of TOF and FW are going to be rebooted." "STARTUP" &
-
+notifyall.sh "DAQ" "<I> The boards of TOF, FW, RICH, RPC, ECAL and Start are going to be rebooted." "STARTUP" &
xterm -geometry 80x24 -bg orange -fg black -e bash --login -c '
ssh hadaq@lxhadesdaqp "
+ source /home/hadaq/.bash_profile
+ echo Switch off trigger
+ timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400
+
cd ~/trbsoft/trbnettools/binlocal
echo \"This does not include MDC, Extra Boards, Hubs, CTS!\"
echo RPC
+ echo Switch off beam abort
+ ssh hadeswrp01 \"echo \"W3000000010\" >/dev/ttyUSB0\"
+ sleep .1
for TRB3_SERVER in trb3sc317 trb3sc319 trb3sc320 trb3sc315 trb3sc318 trb3sc316;
do
ping \$TRB3_SERVER -c 1 -w 1 >/dev/null 2>&1 || echo \"ERROR contacting \$TRB3_SERVER\"
notifyall.sh "DAQ" "<I> The ECal boards are going to be rebooted." "STARTUP" &
+timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400 # Switch off trigger
xterm -geometry 80x24 -bg orange -fg black -e bash --login -c '
ssh hadaq@lxhadesdaqp "
source /home/hadaq/.bash_profile
+ echo Switch off trigger
+ timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400
# trbcmd reload 0xfe71
trbcmd reload 0x120
do
ping \$TRB3_SERVER -c 1 -w 1 >/dev/null 2>&1 || echo \"ERROR contacting \$TRB3_SERVER\"
TRB3_SERVER=\$TRB3_SERVER ./trbcmd reload 0xffff
- sleep .3
+ sleep .6
done
echo \"Done - Check for Error messages above, then do a DAQ restart!\"
notifyall.sh "DAQ" "<I> Auxiliary boards are going to be rebooted." "STARTUP" &
-
xterm -geometry 80x24 -bg orange -fg black -e bash --login -c '
ssh hadaq@lxhadesdaqp "
source /home/hadaq/.bash_profile
+ echo Switch off trigger
+ timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400
# trbcmd reload 0x8d00
trbcmd reload 0x0010
notifyall.sh "DAQ" "<I> The central Hubs are going to be rebooted." "STARTUP" &
-
xterm -geometry 80x24 -bg orange -fg black -e bash --login -c '
ssh hadaq@lxhadesdaqp "
source /home/hadaq/.bash_profile
+ echo Switch off trigger
+ timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400
# trbcmd reload 0xfffe
trbcmd reload 0x8011
xterm -geometry 80x24 -bg orange -fg black -e bash --login -c '
export DAQOPSERVER=hadesp31
+ echo Switch off trigger
+ timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400
trbcmd reset
trbcmd reload 0xfe11
trbcmd reload 0xfe15
notifyall.sh "DAQ" "<I> OEPs are going to be rebooted." "STARTUP" &
xterm -geometry 80x24 -bg orange -fg black -e bash --login -c '
+ echo Switch off trigger
+ timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400
~/bin/rebootoep_x11.sh
sleep 2
'
notifyall.sh "DAQ" "<I> The RICH boards are going to be rebooted." "STARTUP" &
-
xterm -geometry 80x24 -bg orange -fg black -e bash --login -c '
ssh hadaq@lxhadesdaqp "
+ source /home/hadaq/.bash_profile
+ echo Switch off trigger
+ timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400
cd ~/trbsoft/trbnettools/binlocal
ping \$TRB3_SERVER -c 1 -w 1 >/dev/null 2>&1 || echo \"ERROR contacting \$TRB3_SERVER\"
TRB3_SERVER=\$TRB3_SERVER ./trbcmd reload 0xfe51 #to prevent a race condition between reset issued by combiner and Dirich not rebooting afterwards
TRB3_SERVER=\$TRB3_SERVER ./trbcmd reload 0xffff
- sleep .3
+ sleep .6
done
notifyall.sh "DAQ" "<I> The RPC boards are going to be rebooted." "STARTUP" &
-
xterm -geometry 80x24 -bg orange -fg black -e bash --login -c '
ssh hadaq@lxhadesdaqp "
source /home/hadaq/.bash_profile
+ echo Switch off trigger
+ timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400
+ echo Switch off beam abort
+ ssh hadeswrp01 \"echo \"W3000000010\" >/dev/ttyUSB0\"
+ sleep .1
cd ~/trbsoft/trbnettools/binlocal
for TRB3_SERVER in trb3sc317 trb3sc319 trb3sc320 trb3sc315 trb3sc318 trb3sc316;
do
ping \$TRB3_SERVER -c 1 -w 1 >/dev/null 2>&1 || echo \"ERROR contacting \$TRB3_SERVER\"
TRB3_SERVER=\$TRB3_SERVER ./trbcmd reload 0xffff
- sleep .3
+ sleep .6
done
# TRB3_SERVER=trb3sc317 ./trbcmd reload 0xffff
notifyall.sh "DAQ" "<I> The Start boards are going to be rebooted." "STARTUP" &
-
xterm -geometry 80x24 -bg orange -fg black -e bash --login -c '
ssh hadaq@lxhadesdaqp "
source /home/hadaq/.bash_profile
+ echo Switch off trigger
+ timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400
for TRB3_SERVER in trb3sc438;
notifyall.sh "DAQ" "<I> The boards of TOF and FW are going to be rebooted." "STARTUP" &
-
xterm -geometry 80x24 -bg orange -fg black -e bash --login -c '
ssh hadaq@lxhadesdaqp "
+ source /home/hadaq/.bash_profile
+ echo Switch off trigger
+ timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400
cd ~/trbsoft/trbnettools/binlocal
notifyall.sh "DAQ" "<I> FPGA are being reprogrammed." "STARTUP" &
+timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400 # Switch off trigger
+
xterm -geometry 80x24 -bg orange -fg black -e bash --login -c '
ssh -X hadaq@lxhadesdaqp "
+ source /home/hadaq/.bash_profile
+ echo Switch off trigger
+ timeout 1s trbcmd setbit 0x0003 0xa0c0 0x400
cd ~/trbsoft/hadesdaq/main/
./startup.pl -f main_hades.script -o file -m TOF -m RPC -m WALL -m RICH -m STARTCTS -m MDC -m MDCDATASET --eb off
#echo \"First config run\"
#set -xv
xterm -e bash --login -c '
- ssh hadaq@lxhadesdaqp "
+ ssh hadaq@lxhadesdaq "
source /home/hadaq/.bash_profile
#set -xv
-( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
+#( which epics >/dev/null 2>&1 && . epics -q ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-3.15.6/base/
+( . ~/EPICS/bin/epics -q 7.0.2 ) || export EPICS_BASE=/home/hadaq/EPICS/EPICS-7.0.2/base/
PERLLIB=\${EPICS_BASE}lib/perl:~/trbsoft/hadesdaq/nettools:~/trbsoft/daqtools/perllibs
cd ~/trbsoft/hadesdaq/utils && ./MDC_Powercycle_2PSx.pl -P 1 -S 1