Our server to control some monitoring units of the main experiment.
A flask server that should simplify the logging of our experimental components. Most of the time the components are Arduinos. The website assumes that the Arduinos are connected via ethernet (preferred) or serial. For the moment we have to following abilities:
If you would like to give it a simple test drive, you can access the current build on heroku.
On the technical side we use the following ingredients:
The project serves as a boilerplate for our other sensors too.
Further, we will most likely never install saving of the data on the server as this would make the whole thing MUCH more complicated (where and who to store the data. Which data should we show etc.). A better approach will be to use the devices directly from within BLACS of the labscriptsuite …
Here it is most likely the best to use the docker image. So install the docker community edition and then get the docker file through:
docker pull synqs/devicecontrolserver
The next step is to run the file through:
docker run -p 8000:5000 devicecontrolserver:latest
git clone …
conda create -n YOURNAME python=3.6
source activate YOURNAME
pip install -r requirements.txt
or if you are at the kip:
pip –proxy http://proxy.kip.uni-heidelberg.de:8080 install –ignore-installed -r requirements.txt
- set up the database through
flask db upgrade
start.sh
- open it in a brower on ‘localhost:5000’
This is the new simplest way, __ but the data will be lost at each update__. You simply run locally after downloading it:
docker run -p 8000:5000 devicecontrolserver:latest
If you insist on the python approach
If you want to test the serial port without having an Arduino, you should just start another terminal, and run the simSerialPort.py file through ‘python simSerialPort.py’
If you are changing the properties of the models.py files, it is likely, that you are messing the the tables of the sqlite file in the background of the script. To keep it simple we are using flask-migrate to keep track. You then have to create the update command through:
flask db migrate
It creates a new python file in the migrations folder. You then update the sqlite database through a:
flask db upgrade
If you would like to create the dockerfile locally, you might run
docker build -t devicecontrolserver:latest .
[x] Allow for changing the parameters of the feedback loop through some serial communication.
[x] Allow for a cleaner communication between the arduino and flask. Basically, the arduino should only answer to a question be flask.
[x] Move the information about communications and users into a local database. I think that would make it much more robust.
[] Allow to change the different axis by hand in the plotly stuff.
[] Tidy up the connections and also the code in the back-end.
[] Always make it look cuter.
[] Error logger to communicate with slack or via email.
[] make this readme the about page.