📖
eVOLVER
  • eVOLVER Documentation Wiki
  • General
    • About Us
    • eVOLVER Community
      • Code of Conduct
  • Getting Started
    • Buying eVOLVER
    • Part Sourcing
    • Unboxing and Setting Up
    • Software Installation
      • DPU Installation
      • Electron App (GUI) Installation
    • Configuring Computer and Networking
      • Router Setup
    • Calibrations
      • Temperature Calibration
      • Optical Density Calibration
      • Pump Calibration
      • Manual Calibration - calibrate.py
  • Upgrade Base eVOLVER Hardware
  • Experiments
    • Starting an Experiment
      • Carboy Media Prep
      • Preparing Vials
      • Setup Waste Carboy
      • Sterilizing Lines
      • Loading Vials and Setting Initial Conditions
      • OD Blank
      • GUI Start Guide
      • Command Line Start Guide
      • Cleaning Up After Experiment
    • Growth Curve
    • Chemostat
    • Turbidostat
    • FAQs
    • Tips and Tricks
  • Guides
    • Use the GUI to Control Parameters
    • Building a Smart Sleeve
    • Making media bottles and splitters
    • Emergency Efflux
    • View the Server Log and Restart Server
    • Updating the eVOLVER Server
    • Change Your conf.yml File
    • Arduino Software Installation
    • Raspberry Pi Configuration
    • Command Line Usage
    • Millifluidics Guides
      • Designing Millifluidics Using Eagle
      • Constructing Laser Cut Millifluidics
      • Constructing Millifluidics via SLA Printing
      • Calibrating IPPs
      • Operating Millifluidics
  • Troubleshooting
    • Troubleshooting Overview
    • Experiment Troubleshooting
      • Contamination
      • Vial Overflow, Pump Failure, and Spills
      • Tubing and Connector Blockage and Bursting
    • Optical Density (OD) Readings
    • Vial Troubleshooting
      • Replacing Photodiodes and LEDs
      • Heating Element
      • Stirring
    • Server Troubleshooting
    • Vial Platform Troubleshooting
      • Motherboard Troubleshooting/Replacement
      • 12V Power Supply Troubleshooting/Replacement
    • GUI Troubleshooting
    • eVOLVER Maintenance
  • Hardware
    • Overview of Hardware Architecture
    • Overview of Fluidics
      • Tubing and connectors
      • Peristaltic Pumps
      • Fluidics box
    • Overview of Millifluidics
      • IPPs (Integrated Peristaltic Pumps)
      • Pressure Regulator
    • Vial Caps
      • Universal Vial Cap Construction Guide (Luer Connectors Only)
      • 5 and 7 Port Nylon Tubing Caps Construction Protocol
    • Smart Sleeve
      • Vial Board
      • 🌪️Stirring
      • Temperature
      • Optical Density
        • OD90 vs OD135
    • Motherboard Layout and Circuitry
      • 🌡️Arduino
      • Sensor/Actuator Board Slots
      • Pulse Width Modulation (PWM) Boards
      • Analog-to-Digital Converter (ADC) Boards
    • Raspberry Pi
    • Chassis
    • Light Blocker / Splash Guard
    • Known Issues
  • Software
    • Overview of Software Architecture
    • DPU
      • Calibration
      • custom_script.py
      • Experiment Data Files
      • eVOLVER.py
    • Arduino
    • Server (Raspberry Pi)
      • Calibration Files
      • Configuration Files (conf.yml)
    • Known Issues
  • Extensions
    • Adding A New Experimental Parameter
      • Power Supply
      • Specific Applications
      • Custom Calibration Code
    • Custom Experiments
      • ePACE
        • ATTiny1634 Writing
        • LUX Board Troubleshooting
      • Morbidostat
      • Extractor Column
        • Extractor Volume Maintenance
        • Experiment Start
          • Sterilizing Extractor Fluidics
          • Setting up your experiment
          • Using the extractor script
        • Extractor Analysis
        • Troubleshooting
        • Example protocols
      • Phototroph Growth
        • Setup Phototroph eVOLVER
        • Photo-eVOLVER Smart Sleeves
          • Photo-eVOLVER Smart Sleeve Construction Guide
        • Experiment Guide
    • Custom Fluidics
      • Adding a Third Pump Rack
      • Bubblers / In-Vial Aeration
        • Bubbler Construction Protocol
        • Bubbler Cleaning Protocol
      • Running the slow pumps
    • min-eVOLVER
      • About
      • min-eVOLVER Construction
        • Parts
        • Construction Protocol
      • Fluidics Setup
      • Software Installation and Startup
      • send_command.py
      • Calibrations
      • Starting an Experiment
      • ePACE with min-eVOLVER
        • [v1.1] ePACE with min-eVOLVER
      • Troubleshooting
    • Interfacing with Other Systems
  • Contributing
    • Guidelines for Contribution
    • Reporting a Bug / Hardware Failure
    • Documentation
      • Making a Forum Post
      • How to Edit the Wiki
    • Software Development
    • Hardware Development
Powered by GitBook
On this page
  • General Information
  • EvolverNamespace Class
  • broadcast event

Was this helpful?

Edit on GitHub
Export as PDF
  1. Software
  2. DPU

eVOLVER.py

Detailed description of the eVOLVER.py file.

This file is where the main function resides for the experimental DPU code, ie it is the script that is run to carry out an experiment on eVOVLER.

To start an experiment on the command line, run the following command:

python3 eVOLVER.py

If you would like to see the help menu:

python3 eVOLVER.py -h

Which will bring up something similar to the following:

usage: eVOLVER.py [-h] [-y] [-l LOG_NAME] [-i IP_ADDRESS] [-v | -q]

Run an eVOLVER experiment from the command line

optional arguments:
  -h, --help            show this help message and exit
  -y, --always-yes      Answer yes to all questions (i.e. continues from existing experiment, overwrites existing data and blanks OD measurements)
  -l LOG_NAME, --log-name LOG_NAME
                        Log file name directory (default: /Users/heinsz/git_repos/dpu/experiment/template/data/evolver.log)
  -i IP_ADDRESS, --ip-address IP_ADDRESS
                        IP address of eVOLVER to run experiment on.
  -v, --verbose         Increase logging verbosity level to DEBUG (default: INFO)
  -q, --quiet           Disable logging to file entirely

If an eVOLVER_parameters.json file is present, eVOLVER will use this file for all t-stat/c-stat paremeters, including temp and stir. If not, it will default to the variable inside the script that the user can specify manually.

General Information

This file contains the lower level functions that deal with communications and carrying out commands that the user specifies in the custom_script. Additionally, this file handles experiment initialization and data collection, setting up data directories, and doing data transformations based on calibrations.

The eVOLVER code then enters a infinite loop which does nothing except reset the socketio conection occasionally to prevent buildup of broadcast messages. Because the custom_functions are tied to the broadcast even to the server, the main thread does not need to do anything besides wait for server websocket events.

EvolverNamespace Class

This is a socketio class responsible for handling communications with the server on the RPi. Each function beginning with on_ is called when the corresponding event occurs on the websocket connection. For example, if the connect event occurs, the on_connect function will run.

This class is also being used as the eVOLVER experiment class. TODO: Ideally this would be a second class and not be tacked onto the socketio class - it will be updated in a future version.

The start time and OD blank information is stored as a class variable. Additionally, all low level functions for interacting with the eVOLVER RPi are located here.

broadcast event

Upon receipt of a broadcast event and new data from the eVOLVER RPi, the on_broadcast function is called. This will log the experiment time, do data transformations based on calibration data, save the resulting data, and then call the custom_functions in custom_script.py. This function is set within custom_script.py.

PreviousExperiment Data FilesNextArduino

Last updated 1 year ago

Was this helpful?

When the script is ran, a connection is first established with the server, then the initialize_exp function is run which creates all data directories and requests the active calibrations from the server. Active calibrations are calibrations with the active field set to true. There should be only 1 active calibration of a given type. Active calibrations are set via the GUI, but they can be set programatically (see the event on the server).

setactivecal