-
Notifications
You must be signed in to change notification settings - Fork 17
Home
The eVOLVER server runs on the raspberry pi on the eVOLVER unit. It acts as the "brains" of the eVOLVER, controlling and collecting data from attached experimental parameters (Arduinos) such as OD, temperature, stir rate, and fluidics. We are currently using websockets to allow the server to interact with users and other applications. When you run an experiment on your computer or use the desktop or touchscreen application, this is how the commands get sent to the arduino and how that application receives data.
To send a command to the server, emit a an event called command
, passing JSON in the following format:
{
"param": "<parameter_name>",
"value": "<value_to_be_sent>",
"immediate": true
}
If you would also like to change how that experimental parameter is formatted, just add the fields to the json, like this:
{
"param": "<parameter_name>",
"value": "<value_to_be_sent>",
"recurring": true,
"fields_expected_outgoing": 2,
"fields_expected_incoming": 17
}
Adding the immediate
field tells the server to immediately send the command to the Arduino. Otherwise, it will apply the new values/configurations on the next broadcast event.
The recurring
field tells the server whether the values should be sent to the Arduino every time it broadcasts (a good thing to do for a parameter like temperature or OD), or if it only should accept one off commands (useful for fluidics).
The other two fields tell the server how many fields to send to and expect from the Arduino. This is used for error checking, letting it know if any problems occurred during serial communications.
The server emits a broadcast
event over websockets with the data it collects every query from the experimental paramters connected and with it"s current configurations for itself and for the experimental parameters connected. It will look like this:
{
"config": {
"od_90": {
"recurring": true,
"fields_expected_incoming": 17,
"fields_expected_outgoing": 2,
"value": "1000"
},
"od_135": {
"recurring": true,
"fields_expected_incoming": 17,
"fields_expected_outgoing": 2,
"value": "1000"
},
"temp": {
"recurring": true,
"fields_expected_incoming": 17,
"fields_expected_outgoing": 17,
"value": [
"30",
"30",
"30",
"30",
"30",
"30",
"30",
"30",
"30",
"30",
"30",
"30",
"30",
"30",
"30",
"30"
]
},
"od_led": {
"recurring": true,
"fields_expected_incoming": 17,
"fields_expected_outgoing": 17,
"value": [
"2500",
"2500",
"2500",
"2500",
"2500",
"2500",
"2500",
"2500",
"2500",
"2500",
"2500",
"2500",
"2500",
"2500",
"2500",
"2500"
]
},
"lxml": {
"recurring": false,
"fields_expected_incoming": 17,
"fields_expected_outgoing": 17,
"value": [
"4095",
"4095",
"4095",
"4095",
"4095",
"4095",
"4095",
"4095",
"4095",
"4095",
"4095",
"4095",
"4095",
"4095",
"4095",
"4095"
]
},
"pump": {
"recurring": false,
"fields_expected_incoming": 49,
"fields_expected_outgoing": 49,
"value": None
},
"stir": {
"recurring": true,
"fields_expected_incoming": 17,
"fields_expected_outgoing": 17,
"value": [
"8",
"8",
"8",
"8",
"8",
"8",
"8",
"8",
"8",
"8",
"8",
"8",
"8",
"8",
"8",
"8"
]
}
},
"data": {
"temp": [
"2744",
"2746",
"2744",
"2759",
"2736",
"2740",
"2740",
"2749",
"2721",
"2729",
"2727",
"2749",
"4095",
"2703",
"2726",
"2749"
],
"od_90": [
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"65418",
"0",
"0",
"0"
],
"od_135": [
"24541",
"24364",
"24256",
"24424",
"24382",
"24441",
"24283",
"24417",
"24430",
"24384",
"24418",
"24370",
"24374",
"24574",
"24387",
"24378"
]
}
}