This is based on the new install instructions on the TRIUMF website
Make sure you have something like the following set in .bashrc
## MIDAS
export MIDASSYS=/home/daq/midas/packages/midas
export PATH=$PATH:$MIDASSYS/bin
export MIDAS_EXPTAB=/home/daq/midas/online/exptab
export MIDAS_EXPT_NAME=v785
export ROOTANASYS=/home/daq/midas/packages/rootana- Everything in the standard install
apache2-utils
- Get the source
cd ~ mkdir -p midas/packages cd midas/packages git clone https://bitbucket.org/tmidas/midas --recursive cd midas
- Checkout a release version
git checkout release/midas-2020-08 git submodule update --init --recursive - Build midas
mkdir build cd build cmake .. make make install - Rootana is needed
cd $HOME/midas/packages git clone https://bitbucket.org/tmidas/rootana cd rootana
- Rootana needs
-fPICto work with EngeSpec - Edit
Makefileto include-fPICin theCXXFLAGSdefinition at the top - compile (without ROOT support)
make NO_ROOT=1 - Rootana needs
- Install JSROOT just in case we need it (for browser views of root files)
cd $HOME/midas/packages git clone https://github.com/linev/jsroot.git
- See if the exptab file below already exists. make sure it looks like the 5th line below:
cd mkdir midas/online cd midas/online cat > exptab v785 /home/daq/midas/online/ daq
(Press ctrl-c to exit the cat command)
- Make the directory structures (data is a link to the storage partition)
cd ~/midas/online mkdir -p /data/midas/data ln -s /data/midas/data data mkdir elog mkdir history mkdir src
- To separate experiments I like to create a link in the data directory (see below for more)
cd /data/midas/data mkdir TestExperiment ln -s TestExperiment v785 ls -l - Test the system
odbedit lsYou should see the following:
[local:v785:S]/>ls Experiment System Programs Logger Runinfo Alarms [local:v785:S]/>
Press
ctrl-cto exit
- The DAQ is already written (probably with some improvements that should be made)
cd $HOME/midas/online/src git clone https://github.com/TUNL-Enge/MIDAS-v785.git v785 cd v785 make clean
- With the new version of MIDAS, some work need to be done to get the DAQ working. The following command may fail
makeIf so, see: https://midas.triumf.ca/MidasWiki/index.php/Changelog#Upgrade_guide
- The corrected version is on the c++ branch:
git checkout c++ make clean make
- Run the httpd server
mhttpd - The first time you run the MIDAS http server it’ll give you some errors. Do what it tells you:
cd $MIDASSYS openssl req -new -nodes -newkey rsa:2048 -sha256 -out ssl_cert.csr -keyout ssl_cert.key -subj "/C=/ST=/L=/O=midas/OU=mhttpd/CN=localhost" openssl x509 -req -days 365 -sha256 -in ssl_cert.csr -signkey ssl_cert.key -out ssl_cert.pem cat ssl_cert.key >> ssl_cert.pem
- Try again
mhhtpdand do what it tells you (almost! - but put the password somewhere else and use thedaqusertouch /home/daq/midas/online/htpasswd.txt htdigest /home/daq/midas/online/htpasswd.txt v785 daqUse the usual
daqpassword when prompted - Try one more time!
mhttpdYou should now be able to open a browser and go tolocalhost:8080(feel free to tell the browser you trust the website!)
This saves the data! So make sure it works and then tell MIDAS that it’s absolutely needed!
mloggerCheck for errors
- Set up MIDAS to make sure mlogger is always running
- Start the http server:
mhttpd - In a browser, go to
localhost:8080 - From MIDAS page go to “ODB” -> “Programs” -> “Logger”
- Set Required to “y”, Start Commant to “mlogger -D”, Alarm class to “Alarm”
- Start the http server:
- Go to the v785 source directory, make sure everything compiles
cd ~/midas/online/src/v785 make ls -ltr
One of the recent files should be
fedemo - There should be a shell script that starts MIDAS with this demo. It should look something like:
#!/bin/sh export MIDAS_EXPT_NAME='v785' # First make sure the DAQ is stopped ./kill_daq.sh # Clean the ODB (Online DataBase) odbedit -c clean # Start the logger, which does the saving of information mlogger -D sleep 2 # Start the web control mhttpd -D -a localhost # Start the analyser konsole -e ./analyzer& make clean make fedemo konsole -e ./fedemo& #end file
- Try running that:
./start_demo.shSeveral windows should open! - The first time it’s run you’ll see some analyzer errors about a missing “last.root” file. Don’t worry about that!
- Open the web browser at
localhost:8080. Look to make sure everything works. Try starting and stopping a run. The demo runs at about 100 Hz.
- Take veto (O1) out of VM-USB module in VME crate
- Plug the twisted pair cable into busy of ADC (red on bottom)
- Data is saved in
/home/daq/midas/online- link points to
/data/midas/data
- link points to
- Run files saved at
v785(symbolic link) - v785 points to specific directory (eg.
/2017-11-14_DAQTests) - Actual DAQ code is in
/home/daq/midas/online/src/v785- ‘v785’ is the experiment name
- See what experiment is active
echo $MIDAS_EXPT_NAME
- If it’s not ‘v785’, do this:
export MIDAS_EXPT_NAME=v785 - Move into the experiement directory
cd /home/daq/midas/online/src/v785 - To start the DAQ
./start_daq.shThe analyzer should pop up (there may be a couple of errors but ignore them)
- Open google chrome
- Click on MIDAS bookmark
- If there’s an error about security, go to Advanced -> proceed anyway
- Username: daq
- Password: the usual ;)
- Click on “EngeRun” to go to the Enge-specific run page
- Logger and analyzer should be green
- Click on “ODB” at the top
- Click on “Run info”
- Click on “Run Number”, set to zero if this is a new experiment
- Start the frontend
- In a terminal, open a new window or tab
cd /home/daq/midas/online/src/v785
./sync
ssh engesbc
cd midas/online/src/v785
make clean
make
./start_fe.shYou should see a bunch of things in the terminal that make it look like everything’s working (running clock, run status, etc.)
- “Frontend” should now be green in browser
- Start the root analyzer
- Go to the original terminal
cd rootana
./anaDistplay.exe- Close the graph window that opened
- Resize the other window (silly fix for window wize issues)
- “Root Analyzer” should now be green in browser
- Quit root analyzer by pressing the “quit” button
- Go to
src/v785directory./kill_daq.sh - F5 on webpage should show that it disappeared
- Do a fresh install of CentOS 7
- Somehow connect it to the internet (I used a wifi dongle and the CraneLabWireless)
- Do the following commands
yum update yum groupinstall 'Development Tools' yum install epel-release yum install cmake3 kernel-devel kernel-headers openssl-devel sqlite-devel ln -s /usr/bin/cmake3 /usr/bin/cmake - Reboot to use the correct kernel
- This is a simplified version of the instructions above, but only
install what’s needed on the SBC
cd ~ mkdir -p midas/packages cd midas/packages git clone https://bitbucket.org/tmidas/midas --recursive cd midas
- Checkout a release version (the same version as on the DAQ machine)
git checkout midas-2020-08-a - Build midas
mkdir build cd build cmake .. make make install - Put the following in ~~/.bashrc~
## MIDAS export MIDASSYS=/home/daq/midas/packages/midas export PATH=$PATH:$MIDASSYS/bin export MIDAS_EXPTAB=/home/daq/midas/online/exptab export MIDAS_EXPT_NAME=v1730 #export ROOTANASYS=/home/daq/midas/packages/rootana export MIDAS_SERVER_HOST=10.0.0.1:1175
- Based on instructions in
https://daq.triumf.ca/DaqWiki/index.php/VME-CPU#V7865_and_XVB-602_:_Setup_gefvme.2Ftsi148_VME_drivers
git clone https://ladd00.triumf.ca/~olchansk/git/kernel-module-gefvme.git cd kernel-module-gefvme make sudo make install sudo sh /etc/rc.local dmesg - If this worked properly,
dmesgshould show some stuff about[ 18.703633] tsi148: VME master control register VMCTRL: 0x00000003 [ 18.703637] tsi148: VME control register VCTRL: 0x00000008 [ 18.703641] tsi148: VME status register VSTAT: 0x00000100 [ 18.703644] tsi148: DMA channel 0 status: 0x02000000 [ 18.703648] tsi148: DMA channel 1 status: 0x02000000 [ 18.703651] tsi148: Interrupt enable register INTEN: 0x03ff20fe [ 18.703655] tsi148: Interrupt enable out register INTEO: 0x03ff20fe [ 18.703658] tsi148: Control and status register GCTRL: 0x10000001
- Make sure that runs on boot
sudo chmod +x /etc/rc.d/rc.local - Reboot and check
dmesgagain - Install the test software
cd ~/midas/packages svn checkout https://ladd00.triumf.ca/svn/daqsvn/trunk/vme # username svn, password svn cd vme make -k # some programs will fail to build, this is expected.
- Run test software
./vmescan_gef.exe
(This may be a little trial and error)
- Edit the network using
nmtui- I’m editing port
enp9s0 - IP4 Configuration =
<Manual> - Address =
10.0.0.5/24 - Make sure
Automatically ConnectandAvailable to all usersare checked
- I’m editing port
- Edit the hostname:
sudo vi /etc/hostnameengesbc - Edit the hosts:
sudo vi /etc/hosts127.0.0.1 localhost 127.0.0.1 engesbc 10.0.0.1 engedaq-dev - Make sure the firewall is set up as expected
sudo firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="10.0.0.1/32" port protocol="tcp" port="0-65535" accept" sudo firewall-cmd --reload sudo firewall-cmd --list-all
- Reboot
- Copy a frontend over (eg
/midas/online/src/v785) - Make sure it compiles
cd ~/midas/online/src/v785 make clean make
- Make sure the connection works
odbedit - Troubleshoot!