pyelixys is a library for communicating with the Sofie Biosciences Elixys hardware. The the hardware is a design based upon the mbed development board. It communicates with the hardware using the websocket protocol. This library abstracts the hardware to python objects.
It is distributed under the 3-Clause BSD License
First, install pip.
sudo apt-get install python-setuptools
Next, install the virtual environment - virtualenv.
pip install virtualenv
Now setup the pyelixys sandbox environment
virtualenv pyelixys
cd pyelixys
Active the sandbox environment
source bin/activate
Clone the repository
git clone git@github.com:henryeherman/pyelixys.git
cd pyelixys
Install the python dependencies by executing the install dependencies script in the root of pyelixys
./install_dependencies.sh
If installing on linux, you will need numpy. (This should be installed by running the install dependencies script). To install numpy in a virtualenv requires the python dev package. Before installing the requirements with pip run the following command.
sudo apt-get install python2.7-dev
To run the Elixys host server and gain access
to system object, which gives access to all
features the Elixys Robot, run the following
command from the root of the virtual environment.
The system object will be loaded as the variable
s
.
python -m pyelixys.hal.system
The simulator is automatically started if
configured the controlbox and/or synthesizer
options are set to True
The hardware simulator object and all corresponding
status information is accessible from the variable
s.simulator
.
By default pyelixys is configured to use a sqlite file based database. It will appear in the root of your virtual environment as soon as you initialized it. To initialize it run:
sudo python -m pyelixys.web.database.model
If the database does not exist, it will now!
The filename of the database is located in
the dbconf.ini and can be fount in database
directory.
This will execute the setup of the database and return
the user in an Ipython terminal upon completion. At this
point, a user may run additional scripts or commands.
To exit Ipython, type exit
.
The database is accessed through the wonderful sqlalchemy library, and the models can be found in model.py
Developers might like to start with some default data. This can be done by populating the database with data. In order to populate the database with data, simply run:
python -m pyelixys.web.database.populatedb
This shall store a user with default settings onto the database.
If the database did not already exist it will now!
The user shall be returned to an an Ipython terminal upon completion.
At this point, a user may run additional scripts or commands.
To exit Ipython, type exit
.
The Sequence Manager pyelixys.sequence.sequencemanager
allows the host to load sequences from the database and
run them on the elixys robot. It has access to the
database model pyelixys.web.database.model
and the
system hardware pyelixys.hal.system
.
The webserver sequence requests should be sent to
the sequencemanager
.
To run the sequencemanager simply run:
python -m pyelixys.sequence.sequencemanager
Doing so will load the a sequence and start an
IPython shell. The sequencemanager is load as
sm
.
To run the Elixys web server, perform the following command in the root of the virtual environment. The runserver shall run on port 80 and requires sudo permissions to execute.
sudo python runserver.py
The webserver shall handle all web requests to and
from the Elixys server. To access the webserver, open
a browser and visit the URL: localhost
. You will be
required to enter your creditionals.
Examples of URLs to visit include:
localhost/state
localhost/config
localhost/runstate