Skip to content

Commit

Permalink
Merge pull request #130 from Negusbuk/master
Browse files Browse the repository at this point in the history
scheduled upload of pump station data to DESY cloud
  • Loading branch information
Negusbuk authored Aug 9, 2017
2 parents 1c51add + c702022 commit 9d9e629
Show file tree
Hide file tree
Showing 13 changed files with 288 additions and 143 deletions.
12 changes: 12 additions & 0 deletions assembly/assemblyCommon/AssemblyAssembler.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/////////////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2011-2017 - The DESY CMS Group //
// All rights reserved //
// //
// The CMStkModLab source code is licensed under the GNU GPL v3.0. //
// You have the right to modify and/or redistribute this source code //
// under the terms specified in the license, which may be found online //
// at http://www.gnu.org/licenses or at License.txt. //
// //
/////////////////////////////////////////////////////////////////////////////////

#include <vector>
#include <iostream>
#include <sstream>
Expand Down
12 changes: 12 additions & 0 deletions assembly/assemblyCommon/AssemblyAssembler.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/////////////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2011-2017 - The DESY CMS Group //
// All rights reserved //
// //
// The CMStkModLab source code is licensed under the GNU GPL v3.0. //
// You have the right to modify and/or redistribute this source code //
// under the terms specified in the license, which may be found online //
// at http://www.gnu.org/licenses or at License.txt. //
// //
/////////////////////////////////////////////////////////////////////////////////

#ifndef ASSEMBLYASSEMBLER_H
#define ASSEMBLYASSEMBLER_H

Expand Down
12 changes: 12 additions & 0 deletions assembly/assemblyCommon/AssemblyAutoFocus.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/////////////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2011-2017 - The DESY CMS Group //
// All rights reserved //
// //
// The CMStkModLab source code is licensed under the GNU GPL v3.0. //
// You have the right to modify and/or redistribute this source code //
// under the terms specified in the license, which may be found online //
// at http://www.gnu.org/licenses or at License.txt. //
// //
/////////////////////////////////////////////////////////////////////////////////

#include <vector>
#include <iostream>
#include <sstream>
Expand Down
12 changes: 12 additions & 0 deletions assembly/assemblyCommon/AssemblyAutoFocus.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/////////////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2011-2017 - The DESY CMS Group //
// All rights reserved //
// //
// The CMStkModLab source code is licensed under the GNU GPL v3.0. //
// You have the right to modify and/or redistribute this source code //
// under the terms specified in the license, which may be found online //
// at http://www.gnu.org/licenses or at License.txt. //
// //
/////////////////////////////////////////////////////////////////////////////////

#ifndef ASSEMBLYAUTOFOCUS_H
#define ASSEMBLYAUTOFOCUS_H

Expand Down
12 changes: 12 additions & 0 deletions assembly/assemblyCommon/AssemblyScanner.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/////////////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2011-2017 - The DESY CMS Group //
// All rights reserved //
// //
// The CMStkModLab source code is licensed under the GNU GPL v3.0. //
// You have the right to modify and/or redistribute this source code //
// under the terms specified in the license, which may be found online //
// at http://www.gnu.org/licenses or at License.txt. //
// //
/////////////////////////////////////////////////////////////////////////////////

#include <vector>
#include <iostream>
#include <sstream>
Expand Down
12 changes: 12 additions & 0 deletions assembly/assemblyCommon/AssemblyScanner.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/////////////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2011-2017 - The DESY CMS Group //
// All rights reserved //
// //
// The CMStkModLab source code is licensed under the GNU GPL v3.0. //
// You have the right to modify and/or redistribute this source code //
// under the terms specified in the license, which may be found online //
// at http://www.gnu.org/licenses or at License.txt. //
// //
/////////////////////////////////////////////////////////////////////////////////

#ifndef ASSEMBLYSCANNER_H
#define ASSEMBLYSCANNER_H

Expand Down
12 changes: 12 additions & 0 deletions assembly/assemblyCommon/AssemblyThresholdTuner.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/////////////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2011-2017 - The DESY CMS Group //
// All rights reserved //
// //
// The CMStkModLab source code is licensed under the GNU GPL v3.0. //
// You have the right to modify and/or redistribute this source code //
// under the terms specified in the license, which may be found online //
// at http://www.gnu.org/licenses or at License.txt. //
// //
/////////////////////////////////////////////////////////////////////////////////

#include <vector>

#include <QVBoxLayout>
Expand Down
12 changes: 12 additions & 0 deletions assembly/assemblyCommon/AssemblyThresholdTuner.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/////////////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2011-2017 - The DESY CMS Group //
// All rights reserved //
// //
// The CMStkModLab source code is licensed under the GNU GPL v3.0. //
// You have the right to modify and/or redistribute this source code //
// under the terms specified in the license, which may be found online //
// at http://www.gnu.org/licenses or at License.txt. //
// //
/////////////////////////////////////////////////////////////////////////////////

#ifndef ASSEMBLYTHRESHOLDTUNER_H
#define ASSEMBLYTHRESHOLDTUNER_H

Expand Down
12 changes: 12 additions & 0 deletions assembly/assemblyCommon/ConradManager.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/////////////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2011-2017 - The DESY CMS Group //
// All rights reserved //
// //
// The CMStkModLab source code is licensed under the GNU GPL v3.0. //
// You have the right to modify and/or redistribute this source code //
// under the terms specified in the license, which may be found online //
// at http://www.gnu.org/licenses or at License.txt. //
// //
/////////////////////////////////////////////////////////////////////////////////

#include "ConradManager.h"


Expand Down
12 changes: 12 additions & 0 deletions assembly/assemblyCommon/ConradManager.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/////////////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2011-2017 - The DESY CMS Group //
// All rights reserved //
// //
// The CMStkModLab source code is licensed under the GNU GPL v3.0. //
// You have the right to modify and/or redistribute this source code //
// under the terms specified in the license, which may be found online //
// at http://www.gnu.org/licenses or at License.txt. //
// //
/////////////////////////////////////////////////////////////////////////////////

#ifndef CONRADMANAGER_H
#define CONRADMANAGER_H

Expand Down
20 changes: 19 additions & 1 deletion documentation/docs/pumpstation/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ In addition, please install the following packages via
`sudo apt-get install libapache2-mod-webauth`<br/>
`sudo apt-get install libapache2-mod-php5`<br/>
`sudo apt-get install udev`</br>
`sudo apt-get install davfs2`</br>

## Installation

Expand All @@ -26,4 +27,21 @@ The deamon communicating with the devices in the background requires the devices
be correctly found. The Leybold GraphixThree controller is supposed to accessable via `/dev/ttyLeybold`,
and the Conrad relay card via `/dev/ttyConrad`. A udev rules file `99-usb-serial.rules` is
available in the `pumpstation` directory of the repository. Please copy it to the directory
`/etc/udev/rules.d/` and restart the system.
`/etc/udev/rules.d/` and restart the system.

In order to automatically synchronise the data to the DESY cloud, perform the following steps:

- create a directory to be used as a mount point for the DESY cloud via</br>
`sudo mkdir /media/desyCloud`</br>

- add the following line to `/etc/fstab`</br>
`https://desycloud.desy.de/remote.php/webdav /media/desyCloud davfs noauto,user 0 0`</br>

- add the user `pi` to the group `davfs2` via</br>
`sudo usermod -a -G davfs2 pi`</br>

- add the DESY cloud credentials to `davfs2` by adding the following line to the file `~/.davfs2/secrets`</br>
`https://desycloud.desy.de/remote.php/webdav USER PASSWORD`</br>

- add the following entry to the crontab for the user `pi`</br>
`0 7,19 * * * /home/pi/cmstkmodlab/pumpstation/cloudSync.sh > /dev/null 2>&1`
7 changes: 7 additions & 0 deletions pumpstation/cloudSync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

mount /media/desyCloud

rsync -rtvuc /home/pi/cmstkmodlab/pumpstation/data/ /media/desyCloud/DAF/25c/PumpStation/

umount /media/desyCloud
Loading

0 comments on commit 9d9e629

Please sign in to comment.