\section{Epics}
-\paragraph*{If CTS monitor in Epics does not work}
-\begin{verbatim}
-ssh to scs@lxhadesdaq
-password is ??? (ask Burkhard)
-
-test for processes:
-ps U scs
- PID TTY STAT TIME COMMAND
-7728 pts/83 R+ 0:00 ps U scs
-24174 ? S 0:00 sshd: scs@pts/83
-25656 pts/83 Ss 0:00 -bash
-30793 ? S 0:00 procServ 4813 ../../bin/linux-x86/trb st.cmd
-30800 pts/88 Ssl+ 0:02 ../../bin/linux-x86/trb st.cmd
-30847 pts/88 S+ 0:00 caRepeater
+\subsection{Code Repository}
+\begin{itemize}
+ \item CVS Root: :ext:lx-pool.gsi.de:/misc/hadesprojects/daq/cvsroot
+ \item CVS Repository: EPICS/\ldots
+\end{itemize}
+
+\subsection{CPU nodes}
+Starting from the main EPICS screen, the button ``\emph{cpus}'' gives an overview on
+the status of the EPICS host cpus of HADES detector control system, as shown in
+figure \ref{fig:epicsDetectorControlSystemNodes}. The eventbuilder nodes are not
+yet included.
-if only the procServ process is running but not its subprocess trb
-then telnet to procServ
-then <CTRL>R will restart the trb IOC
-then <CTRL>]
-quit
-the telnet session.
+\begin{figure}[htp]
+\begin{center}
+ \includegraphics[width=.8\textwidth]{epics_cpus_adl.png}
+ \caption[EPICS CPU nodes]{EPICS Detector Control System Nodes}
+ \label{fig:epicsDetectorControlSystemNodes}
+\end{center}
+\end{figure}
+A running EPICS node looks like it is shown in figure
+\ref{fig:epicsDetectorControlSystemRunningNode}.
-to start from scratch:
+\begin{figure}[htp]
+\begin{center}
+ \includegraphics[width=.8\textwidth]{epics_cpus_adl_running.png}
+ \caption[EPICS CPU nodes]{example of a running EPICS Detector Control System
+ Node}
+ \label{fig:epicsDetectorControlSystemRunningNode}
+\end{center}
+\end{figure}
+
+%%%%%%
+%% Main IOC
+\subsection{``\emph{Main}'' IOC}
+Although the dectector control system EPICS cpu nodes run on their own,
+providing their controls, the ``\emph{Main}'' IOC located at
+``\emph{hadesdaq02}'' collects all informations, duplicates them and
+provides the informations and controls in a ``\emph{channeled}'' manner to the
+users.
-cd EPICS/apps/trb/iocBoot/ioclxhadesdaq/
-procServ 4813 ../../bin/linux-x86/trb st.cmd
+It is \textbf{not} recommended to by-pass this, since you could overload the
+small cpus easily by too many requests.
-to check (only on lxhadesdaq):
+\subsubsection{Startup}
+At reboot a scs crontab entry assures the automatic restart of the EPICS IOCs
+using \emph{procserv}
+\begin{itemize}
+ \item Check \emph{scs}'s crontab: \small \begin{verbatim}
+ crontab -l
+
+ # DO NOT EDIT THIS FILE - edit the master and reinstall.
+ # (/tmp/crontab.b8ak69 installed on Tue Jan 31 17:11:30 2012)
+ # (Cronie version 4.2)
+ # m h dom mon dow command
+ @reboot cd ~scs/procServ && ./ioc-cave.sh
+ \end{verbatim} \normalsize
+ \begin{itemize}
+ \item If it is missing then edit scs's crontab
+ \begin{itemize}
+ \item Automatic \scriptsize \begin{verbatim}
+ cmd=$(echo '@reboot cd ~scs/procServ && ./ioc-cave.sh') && \
+ echo -e "$(crontab -l 2>/dev/null | grep -F -v -e "$cmd")\n$cmd" | crontab -
+ \end{verbatim} \normalsize
+ \item by-hand \small \begin{verbatim}
+ crontab -e \end{verbatim} \normalsize
+ \end{itemize}
+ \end{itemize}
+\end{itemize}
-telnet localhost 4813
-<CR> ==> you should see epics> prompt.
-dbl ==> gives you list of PVs.
-<CTRL>] to get back to the telnet prompt
-then
-quit
+\subsubsection{\emph{Main} IOC failure}
+ \paragraph{Check and Restart}
+ \begin{itemize}
+ \item ssh to scs@hadesdaq02 (password is ??? (ask Peter / Burkhard)) \begin{verbatim}
+ ssh scs@hadesdaq02 \end{verbatim}
+ \item test for processes, the call chain is:\\
+ \emph{procServ} $\Rightarrow$ \emph{ startEpicsIoc\_includingHVSemaphoreCheck.sh } $\Rightarrow$ \emph{hades}
+ \begin{verbatim}
+ ps U scs \end{verbatim} \tiny \begin{verbatim}
+ [...] COMMAND
+ [...] [...]/procServ [options] ./startEpicsIoc\_includingHVSemaphoreCheck.sh ../../bin/linux-x86/hades st.cmd
+ [...] /bin/bash ./startEpicsIoc\_includingHVSemaphoreCheck.sh ../../bin/linux-x86/hades st.cmd
+ [...] ../../bin/linux-x86/hades st.cmd
+ \end{verbatim} \normalsize
+ \item if only the ``\emph{procServ}'' process is running but not its subprocesses\\
+ ``\emph{trb}'' then locally telnet to procServ and restart the EPICS IOC
+ \begin{verbatim}
+ telnet localhost 4813
+ # then <CTRL> + R will restart the trb IOC
+ # then <CTRL> + ] to bet back to the telnet prompt
+ # then type
+ quit
+ # to quit the telnet session.
+ \end{verbatim}
+ \end{itemize}
+ \paragraph{To start from scratch:}
+ \begin{itemize}
+ \item ssh to scs@hadesdaq02 (password is ??? (ask Peter / Burkhard)) \begin{verbatim}
+ ssh scs@hadesdaq02 \end{verbatim}
+ \item make sure none of these processes are running:
+ \begin{itemize}
+ \item ``\emph{procServ}''
+ \item ``\emph{startEpicsIoc\_includingHVSemaphoreCheck.sh }''
+ \item ``\emph{hades}''
+ \end{itemize}
+ \item start ``\emph{procServ}'' using the crontab scripts used at reboot
+ \begin{verbatim}
+ cd ~scs/procServ && ./ioc-cave.sh
+ \end{verbatim}
+ \item to check locally (only on hadesdaq02):
+ \begin{verbatim}
+ telnet localhost 4813
+ #<CR> ==> you should see epics> prompt.
+ #dbl ==> gives you list of PVs.
+ #<CTRL> + ] to get back to the telnet prompt
+ # then type
+ quit
+ # to quit the telnet session.
+ \end{verbatim}
+ \end{itemize}
+
+\subsubsection{External Documentation}
+\begin{itemize}
+ \item \href{http://hades-wiki.gsi.de/cgi-bin/view/DaqSlowControl/SCSLinuxIoc}{HADES wiki: SCS Linux IOC}
+\end{itemize}
-\end{verbatim}
+%%%%%%
+%% HadCon
+\subsection{HadCon(1) / a.k.a. HadShoPoMo}
+%%%%%%
+%% Dreamplug
\subsection{DreamPlug}
+\href{http://wiki.gsi.de/Epics/HadesHadcon2SystemsDreamplug}{Hadcon2 \& Dreamplug based systems}
+
+\subsubsection{Startup}
+At reboot a scs crontab entry assures the automatic restart of the EPICS IOCs
+using \emph{procserv}
+
+\subsubsection{Failure of the DreamPlug}
+\paragraph{IOC Failure}
+ In case the IOC isn't responding, but the system is still accessible:
+ \begin{itemize}
+ \item ssh to scs@dreamp\emph{XY} (password is ??? (ask Peter / Burkhard), \emph{XY} number of dreamplug) \begin{verbatim}
+ ssh scs@dreampXY \end{verbatim}
+ \item test for processes, the call chain is:\\
+ \emph{procServ} $\Rightarrow$ \emph{ startEpicsIoc\_includingHVSemaphoreCheck.sh } $\Rightarrow$ \emph{hades}
+ \begin{verbatim}
+ ps U scs \end{verbatim} \tiny \begin{verbatim}
+ [...] COMMAND
+ [...] [...]/procServ [options] ../../bin/linux-arm/streamHadcon st.cmd
+ [...] ../../bin/linux-arm/streamHadcon st.cmd
+ \end{verbatim} \normalsize
+ \item if only the ``\emph{procServ}'' process is running but not its subprocesses\\
+ ``\emph{streamHadcon}'' then locally telnet to procServ and restart the EPICS IOC
+ \begin{verbatim}
+ telnet localhost 4813
+ # then <CTRL> + R will restart the trb IOC
+ # then <CTRL> + ] to bet back to the telnet prompt
+ # then type
+ quit
+ # to quit the telnet session.
+ \end{verbatim}
+ \end{itemize}
+
+\paragraph{System Failure, Crash\newline}
+ \vspace{1 cm}
+ In the case of a failure of the DreamPlug system itself:
+\begin{enumerate}
+ \item Please reboot several times.
+ \item If this is not successful: \textbf{Check and Reinstall Complete System}
+\end{enumerate}
-In the case of a failure of the DreamPlug, please reboot several times.
-If this is not successful, then attach then please attach the
-``GuruPlug JTAG board'', only the smaller connector (``UART'').
-Then you can start on a laptop
+\subparagraph{Check, \emph{optional} }
+ \vspace{1 cm}
+ For the \textbf{optional} checking you need to have an external ``\emph{GuruPlug JTAG board}'' attached to the
+ dreamplug and a mobile PC running a terminal program e.g. \emph{picocom}.
+ For reinstalling the dreamPlugs this is not necessary, since the current \emph{uboot} configuration already contain a multi boot system.
+
+ \begin{itemize}
+ \item check with an external ``\emph{GuruPlug JTAG board}'' attached to the
+ dreamplug, only the smaller connector (``\emph{UART}''), and your PC/Laptop.\\
+ Then you can start on a laptop:
+ \begin{verbatim}
+ #picocom (exit via: ctrl-a + ctrl-x)
+ picocom -b 115200 /dev/ttyUSB0
+ \end{verbatim}
+ and reboot again: use the commands \emph{help}, \emph{reset}, \emph{printenv} for a first check and analysis
+ \begin{verbatim}
+ Hit any key to stop autoboot: 1
+ Marvell>>
+ Marvell>> help
+ Marvell>> reset
+ Marvell>> printenv
+ \end{verbatim}
+ \end{itemize}
+
+\subparagraph{Reinstall Complete System}{\footnote{\href{http://wiki.gsi.de/Epics/DreamplugRollbackSystemAndUImage}{http://wiki.gsi.de/Epics/DreamplugRollbackSystemAndUImage: Dreamplug Rollback System And UImage}}}
+
+\begin{itemize}
+ \item Requirements:
+ \begin{itemize}
+ \item \textbf{\emph{uboot} configuration}:
+ At least a dual boot system which tries at last the internal disk,
+ e.g. \href{http://wiki.gsi.de/Epics/DreamplugTweakUBootFasterMultiBoot}{Dreamplug Tweak UBoot Faster Multi Boot}, which is already installed on all HADES dreamplugs
+ \item \textbf{Sources}:
+ \begin{itemize}
+ \item offline: the prepared USB stick / SD card, (ask Peter)
+ \item online:
+ \begin{itemize}
+ \item ``\emph{das u-boot}'' uimage file, $\approx 3 MB$:\\
+ \small\href{http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplug-uimage-04112013.tar.xz}{http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplug-uimage-04112013.tar.xz} \normalsize
+ \item system tar ball, $\approx 1 GB$: \\
+ \small\href{http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplug-system-04112013.tar.xz}{http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplu-system-04112013.tar.xz}\normalsize
+ \end{itemize}
+ \end{itemize}
+ \end{itemize}
+ \item Prepare your external usb stick / SD card: \\ If you don't have a prepared system available you have to prepare a new stick / SD card.
+ \scriptsize \begin{verbatim}
+ target=<Your Target Device, e.g. sdd> &&
+ cd $(mktemp -u) &&
+ wget -N http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplug-uimage-04112013.tar.xz &&
+ wget -N http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplug-system-04112013.tar.xz &&
+ scr=$(tar atf dreamplug-system-04112013.tar.xz | grep -w dreamplugCreateBootDeviceFunctionSet.sh) &&
+ tar axf dreamplug-system-04112013.tar.xz $scr &&
+ mv $scr $(basename $scr) && unset scr &&
+ . ./dreamplugCreateBootDeviceFunctionSet.sh &&
+ createBootDevicePartition &&
+ createBootDeviceMounts &&
+ tar Jxvf dreamplug-uimage-04112013.tar.xz -C /mnt/${target}1 &&
+ tar Jxvf dreamplug-system-04112013.tar.xz -C /mnt/${target}2 &&
+ createBootDeviceUmounts
+
+ #optional
+ cd && rm -rf $OLDPWD
+ \end{verbatim} \normalsize
+ \item Restoring from external USB stick / SD card
+ \begin{enumerate}
+ \item Plug your prepared USB device / SD card into the Dreamplug
+ \item Restart your system
+ \item Login to the dreamplug with root privileges:\\
+ user/pw: restore/nosoup4u \\
+ becomes automatically: root \\
+ \item \scriptsize \begin{verbatim}
+ #if dreamplugRestoreLocalSystemFromExternal.sh is not on the system or you want to get the newest
+ dpScript=dreamplugRestoreLocalSystemFromExternal.sh
+ wget -N http://wiki.gsi.de/pub/Epics/DreamplugRollbackSystemAndUImage/${dpScript}
+
+ #optional source
+ source=<Your source Device, e.g. sdb>
+
+ chmod u+x ./${dpScript} &&
+ ./${dpScript}
+ \end{verbatim} \normalsize
+ \item reboot your device, with no boot device connected
+ \end{enumerate}
+\end{itemize}
\end{verbatim}
+\paragraph{External Documentation}
+\begin{itemize}
+ \item \href{http://wiki.gsi.de/Epics/DreamplugRollbackSystemAndUImage}{http://wiki.gsi.de/Epics/DreamplugRollbackSystemAndUImage}
+ \item \href{http://wiki.gsi.de/Epics/DreamplugTweakDualFasterUBoot}{http://wiki.gsi.de/Epics/DreamplugTweakDualFasterUBoot}
+\end{itemize}
+
+%%%%%%
+%% Channel Archvier
+\subsection{Channel Archiver}
+
+%%%%%%
+%% CTS monitor
+\subsection{CTS monitor}
+Located on lxhadesdaq, but currently not used anymore.
+\subsubsection{If CTS monitor in Epics does not work}
+\begin{itemize}
+ \item Check and Restart
+ \begin{itemize}
+ \item ssh to scs@lxhadesdaq (password is ??? (ask Peter / Burkhard))
+ \begin{verbatim}
+ ssh scs@lxhadesdaq
+ \end{verbatim}
+ \item test for processes \footnotesize
+ \begin{verbatim}
+ ps U scs
+
+ PID TTY STAT TIME COMMAND
+ 30793 ? S 0:00 procServ 4813 ../../bin/linux-x86/trb st.cmd
+ 30800 pts/88 Ssl+ 0:02 ../../bin/linux-x86/trb st.cmd
+ 30847 pts/88 S+ 0:00 caRepeater
+ \end{verbatim} \normalsize
+ \item if only the ``\emph{procServ}'' process is running but not its subprocess\\
+ ``\emph{trb}'' then locally telnet to procServ and restart the EPICS IOC
+ \begin{verbatim}
+ telnet localhost 4813
+ # then <CTRL> + R will restart the trb IOC
+ # then <CTRL> + ] to bet back to the telnet prompt
+ # then type
+ quit
+ # to quit the telnet session.
+ \end{verbatim}
+ \end{itemize}
+ \item To start from scratch:
+ \begin{itemize}
+ \item ssh to scs@lxhadesdaq (password is ??? (ask Peter / Burkhard))
+ \begin{verbatim}
+ ssh scs@lxhadesdaq
+ \end{verbatim}
+ \item make sure nor ``\emph{procServ}'' neither ``\emph{trb}'' are
+ running
+ \item start ``\emph{procServ}'' starting ``\emph{trb}''
+ \begin{verbatim}
+ cd EPICS/apps/trb/iocBoot/ioclxhadesdaq/ &&
+ procServ 4813 ../../bin/linux-x86/trb st.cmd
+ \end{verbatim}
+ \item to check locally (only on lxhadesdaq):
+ \begin{verbatim}
+ telnet localhost 4813
+ #<CR> ==> you should see epics> prompt.
+ #dbl ==> gives you list of PVs.
+ #<CTRL> + ] to get back to the telnet prompt
+ # then type
+ quit
+ # to quit the telnet session.
+ \end{verbatim}
+ \end{itemize}
+ \end{itemize}
+