Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
eVOLVER Server Code
===================

This code sits on the eVOLVER raspberry pi and handles communications between the DPU and the SAMD21 microcontrollers that monitor and actuate experimental parameters. Calibrations, experiment commands, and data transmission are all handled by this code using `python socket-io <https://python-socketio.readthedocs.io/en/latest/>`_ and `pyserial <https://pythonhosted.org/pyserial/>`_.
This code sits on the eVOLVER Raspberry Pi and handles communications between the DPU and the SAMD21 microcontrollers that monitor and actuate experimental parameters. Calibrations, experiment commands, and data transmission are all handled by this code using `python socket-io <https://python-socketio.readthedocs.io/en/latest/>`_ and `pyserial <https://pythonhosted.org/pyserial/>`_.

For more information check the `wiki <https://khalil-lab.gitbook.io/evolver/software/server-code-structure>`_.

Installation
============

eVOLVER units should come with this software pre-installed. If you need to, you can install all dependencies by running the following command:

``python3.6 setup.py install``

NOTE: You must use python3.6 at this point in time - some of the dependencies currently do not work on 3.7.
eVOLVER units should come with this software pre-installed.

Running the server
==================

We use `supervisor <http://supervisord.org/running.html>`_ to run and manage the logs for the eVOLVER server. eVOLVERs should come pre-configured. We also provide a utility monitoring and restart script, ``evolvercron`` and ``server_monitor.sh``. To use, add the crontab job line in ``evolvercron`` into your cron installation.
If you are making an eVOLVER from scratch or are replacing a broken Raspberry Pi, you can follow these guides:
* `Raspberry Pi configuration <https://khalil-lab.gitbook.io/evolver/guides/raspberry-pi-configuration>`_
* `Updating the eVOLVER server <https://khalil-lab.gitbook.io/evolver/guides/updating-the-evolver-server>`_

Calibration Conversion
======================

If you desire to update an older evolvers calibrations to the current release formatting, use the script located at ``utls/calibration_transformation.py``. To run:

``python3.6 utils/calibration_transformation.py -d evolver/calibrations -f evolver/calibrations.json``


32 changes: 4 additions & 28 deletions evolver/alternate_conf_files/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,9 @@ Server Configuration Files (conf.yml)

Configuration files (conf.yml) contain the parameters for the server to run.

More complex conf.yml files including 'pre' and 'post' commands are complicated to repeatedly alter, so storing them allows easy switching to files for different purposes.

## Definitions
subcommand = a command added to the command queue when another command is run

An example subcommand:
```
- param: 'od_led'
value: ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
```

'pre' or 'post' command = a list of subcommands to be added to the command queue before or after the main parameter command

'values' = a keyword referencing the current value of a parameter in the conf file (for example, the subcommand)
```
- param: 'temp'
value: 'values'
```

'wait' = a special type of subcommand that makes the server pause for that many seconds (for example so that a command can execute)
```
- param: 'wait'
value: 15
```

For more information check the wiki [page](https://khalil-lab.gitbook.io/evolver/software/server-code-structure/configuration-files-conf.yml).

## Examples of potential alternate conf files
Calibration conf - broadcast_timing parameter should be low to speed up calibration

Experiment conf - the OD LED might need to be normally off unless OD is read to prevent the light affecting sensors
- Calibration conf - (default conf) broadcast_timing parameter should be low to speed up calibration
- stir_pause_on_od - prevents stirring from affecting OD. Important if bubbling or in low volume applications
- odled_normally_off - OD LED will be normally off unless OD is read to prevent the IR light affecting other light sensors
73 changes: 73 additions & 0 deletions evolver/alternate_conf_files/stir_pause_on_OD/conf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
# eVOLVER experimental parameter configurations
experimental_params:
od_90:
recurring: true
fields_expected_outgoing: 2
fields_expected_incoming: 17
value: '1000'
pre:
- param: 'stir'
value: ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
- param: 'wait'
value: 15
post:
- param: 'stir'
value: 'values'
od_135:
recurring: true
fields_expected_outgoing: 2
fields_expected_incoming: 17
value: '1000'
od_led:
recurring: true
fields_expected_outgoing: 17
fields_expected_incoming: 17
value: ['4095','4095','4095','4095','4095','4095','4095','4095','4095','4095','4095','4095','4095','4095','4095','4095']
temp:
recurring: true
fields_expected_outgoing: 17
fields_expected_incoming: 17
value: ['4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095']
stir:
recurring: false
fields_expected_outgoing: 17
fields_expected_incoming: 17
value: ['8', '8', '8', '8', '8', '8', '8', '8', '8', '8', '8', '8', '8', '8', '8', '8']
pump:
recurring: false
fields_expected_outgoing: 49
fields_expected_incoming: 49
value: null
lxml:
recurring: false
fields_expected_outgoing: 17
fields_expected_incoming: 17
value: ['4095','4095','4095','4095','4095','4095','4095','4095','4095','4095','4095','4095','4095','4095','4095','4095']

# eVOLVER server parameter configurations
broadcast_timing: 60
num_sleeves: 16
port: 8081

# RPi file locations and names
device: evolver-config.json
calibration: calibration.json
calibrations_directory: calibrations
fitted_data_directory: fittedCal
raw_data_directory: rawCal
od_calibration_directory: od
temp_calibration_directory: temp

# Serial communication
serial_end_outgoing: "_!"
serial_end_incoming: end
serial_port: '/dev/ttyAMA0'
serial_baudrate: 9600
serial_timeout: 0.3

recurring_command_char: r
immediate_command_char: i
echo_response_char: e
data_response_char: b
acknowledge_char: a