Cannot run server through commandline

Hi, I’m having issues getting the server to run correctly after having updated. Here is the error code I get. I also cannot get the GUI to work for looking at my experiment - I keep getting a Java error

Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/220930_KW274_expt/0/

Django Version: 1.8.6
Python Version: 3.9.6
Installed Applications:
(‘django.contrib.admin’,
‘django.contrib.auth’,
‘django.contrib.contenttypes’,
‘django.contrib.sessions’,
‘django.contrib.messages’,
‘django.contrib.staticfiles’,
‘crispy_forms’)
Installed Middleware:
(‘django.contrib.sessions.middleware.SessionMiddleware’,
‘django.middleware.common.CommonMiddleware’,
‘django.middleware.csrf.CsrfViewMiddleware’,
‘django.contrib.auth.middleware.AuthenticationMiddleware’,
‘django.contrib.auth.middleware.SessionAuthenticationMiddleware’,
‘django.contrib.messages.middleware.MessageMiddleware’,
‘django.middleware.clickjacking.XFrameOptionsMiddleware’,
‘django.middleware.security.SecurityMiddleware’)

Traceback:
File “/Users/copleylab/Documents/dpu/dpu-env/lib/python3.9/site-packages/django/core/handlers/base.py” in get_response
132. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/Users/copleylab/Documents/dpu/graphing/src/cloudevolution/views.py” in vial_num
101. p.legend.orientation = “top_right”
File “/Users/copleylab/Documents/dpu/dpu-env/lib/python3.9/site-packages/bokeh/models/plots.py” in setattr
816. return super().setattr(attr, value)
File “/Users/copleylab/Documents/dpu/dpu-env/lib/python3.9/site-packages/bokeh/models/plots.py” in setattr
787. setattr(x, attr, value)
File “/Users/copleylab/Documents/dpu/dpu-env/lib/python3.9/site-packages/bokeh/core/has_props.py” in setattr
230. return super().setattr(name, value)
File “/Users/copleylab/Documents/dpu/dpu-env/lib/python3.9/site-packages/bokeh/core/property/descriptors.py” in set
283. value = self.property.prepare_value(obj, self.name, value)
File “/Users/copleylab/Documents/dpu/dpu-env/lib/python3.9/site-packages/bokeh/core/property/bases.py” in prepare_value
365. raise ValueError(f"failed to validate {obj_repr}.{name}: {error}")

Exception Type: ValueError at /220930_KW274_expt/0/
Exception Value: failed to validate Legend(id=‘2204’, …).orientation: invalid value: ‘top_right’; allowed values are horizontal or vertical

Can you make sure the libraries you have installed are the following:

scipy>=1.2.1
numpy>=1.16.1
Django==1.8.6
django-crispy-forms>=1.7.2
matplotlib>=3.0.2
socketIO-client>=0.7.2
bokeh==0.10.0

If so, try uninstalling bokeh and reinstalling bokeh (to version 0.10.0). We’ve found that for some reason, the order at which the libraries are installed matters in if it installs properly.

Brandon

Thank you, that solved that. Another problem I am having is with the Evolver app. When I click EXPT MANGER, I get a completely black screen. This happened after I had to close the app due to a javascript error. I have tried deleting it and reinstalling and still have the same problem. Is there anything else I can try to fix this?

Hi @kawidney, can you elaborate on the javascript error you saw, or recreate it and post a screenshot here?

Thanks,
Zack

Screen Shot 2022-10-04 at 11.51.12 AM
This occurred when I tried to start experiment

Thanks, could you scroll down in that pop up window? I’ll make an update to the file editor soon that should address this. In the meantime you can run your experiment via the command line and still view your data in the expt viewer via the GUI.

Zack

Hi there,

I ran into a similar javascript error when starting or stopping experiment on Mac GUI, and will follow this thread to get eVOLVER working.

As a new user, i guess the main job to do to run experiment via command line is to configure parameters for an experiment in custom_script.py, right? Is there an instruction or example of how to configure parameters for an experiment in custom_script.py?

Also, is the growth_curve function in file custom_script.py completed? I’d like to try to run growth_curve mode, any tips how to configure parameters for growth_curve mode in file custom_script.py?

@yqlan custom_script.py has comments throughout that should guide you through the process of configuring parameters. You should only need to modify a couple of variables.

And yes, the growth curve function is complete - growth curves don’t require any logic. The only parameters are stir and temp, which are set at the top of the file. Data collection and transformation is handled elsewhere in eVOLVER.py.

I’ll try to fix the javascript error soon you are both seeing soon. For now, I recommend running the scripts via the command line. @yqlan in your other post you mentioned these files were empty - if you place the files manually and do not use the File Editor, and follow the directions here, it should work. I suspect the file editor has an issue I need to resolve. Please note you must click the SAVE EXPT button on the BOTTOM RIGHT of the screen for the GUI to save the parameters.

If you still have issues let me know - I’m happy to help out over zoom if needed.

Hi Zack,

Pretty appreciate your help. The problem of generating empty files has been fixed by opening the app and creating new experiment with internet connection the first time.

Then, i tried running experiments via command line as described below, and ran into some issues.

Before the experiments, i changed to the DPU directory (~/Desktop/dpu-2.0.1/) and activated virtual environment by command source dpu-env/bin/activate, then changed to experiment directory (cd ./experiment)

Then, for the first experiment:

  1. i created a new experiment named expt_growth_curve by copying template folder:
    cp -r template expt_growth_curve
  2. changed to expt_growth_curve directory and modifed the custom_script.py by changing the vaule of variable OPERATION_MODE to ‘growth_curve’ (line 32 below) to run an experiment using growth_curve mode.
  3. then ran the experiment: python3 eVOLVER -i 192.168.0.100, and i ran into an error like this:

    here is the evolver.log file in folder data

For the second experiment, i got similar error:

  1. i created a new experiment named expt_turbidostat by copying template folder:
    cp -r template expt_turbidostat
  2. changed to expt_turbidostat directory and modifed the custom_script.py (screen shot below, comment out line 45, 50, 51 and add line 46, 52, 53) to run a turbidostat experiment using just vial 0.
  3. then ran the experiment: python3 eVOLVER -i 192.168.0.100, and got similar hangs up similar error in the first experiment

my remarks

  1. my boken version is 2.4.3, other libraries @bgwong mentioned above are ok mentioned above

  2. I didn’t do any calibration, just use default calibration files. see below

    image

Any tips? Did i modify all the variables required to be modified for the 2 experiments?Thank you.

Yongqing

Hi @yqlan ,

Can you post a screenshot of the server log as you run the experiment? You can access this by ssh’ing to the RPi and running sudo supervisorctl then tail -f evolver

Zack

Hi @heinsz,

Here is the screenshot. Thanks.

Yongqing

Ok cool, so it’s pretty clear here that something is wrong in the communications between the arduinos and the RPi. Are all the arduino boards fully plugged in in the correct orientation? And did you upload the code to them yourself? If you attempt to run the pumps through the GUI do those work?

Zack

Hi @heinsz

I think the arduino boards should be plugged in correctly, as i can run all the pumps through both Mac and touchscreen GUI.

and, what do you mean by uploading code to them? I just updated server following the instructions here. Do you mean i also need to upload some code for arduino? is there a post regarding this?

Thanks,
Yongqing

The pump arduino board is on a separate module from the others. The pumps working confirms that the RPi is working correctly. Can you check that the RS-485 board is plugged in snugly on the motherboard?

There is a guide for updating the arduinos located here, but first check that the RS-485 is not loose.

Zack

After discussing with @yqlan directly, it appeared like the RS-485 board had fallen out, which caused the arduinos controlling stir, heat, and OD to be unable to communicate.

Zack

1 Like