fynch-bio / evolver Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
evolver_config.json contains:
{"ip": "192.168.1.37", "mac": "b8:27:eb:34:55:8a", "deviceName": "evolver-darwin"}
calibrations.json contains:
{"activeCalibration": {"temp": {"filename": "sample_tempcal.txt"}, "od": {"filename": "sample_odcal.txt"}}}
Could be consolidated into one file to simplify file structure
I find this error when updating the code. Seems like there's still some thing I'm not setting up properly.
I'm currently using Master in both the DPU and Arduino branches.
od_135r,1000,_!
Traceback (most recent call last):
File "/home/pi/evolver/evolver/evolver_server.py", line 246, in run_commands
returned_data = serial_communication(command['param'], command['value'], command['type'])
File "/home/pi/evolver/evolver/evolver_server.py", line 284, in serial_communication
raise EvolverSerialError('Error: Response has incorrect address.\n\tExpected: ' + param + '\n\tFound:' + address)
evolver_server.EvolverSerialError: Error: Response has incorrect address.
Expected: od_135
Found:
od_90r,1000,_!
od_90b,32114,31657,31284,31869,31740,31508,
Traceback (most recent call last):
File "/home/pi/evolver/evolver/evolver_server.py", line 246, in run_commands
returned_data = serial_communication(command['param'], command['value'], command['type'])
File "/home/pi/evolver/evolver/evolver_server.py", line 286, in serial_communication
raise EvolverSerialError('Error: Response did not have valid serial communication termination string!\n\tExpected: ' + evolver_conf['serial_end_incoming'] + '\n\tFound: ' + response[len(response) - 3:])
evolver_server.EvolverSerialError: Error: Response did not have valid serial communication termination string!
Expected: end
Found: 08,
od_ledr,2500,2500,2500,2500,2500,2500,2500,2500,2500,2500,2500,2500,2500,2500,2500,2500,_!
od_lede,2500,2500,2500,2500,
Traceback (most recent call last):
File "/home/pi/evolver/evolver/evolver_server.py", line 246, in run_commands
returned_data = serial_communication(command['param'], command['value'], command['type'])
File "/home/pi/evolver/evolver/evolver_server.py", line 286, in serial_communication
raise EvolverSerialError('Error: Response did not have valid serial communication termination string!\n\tExpected: ' + evolver_conf['serial_end_incoming'] + '\n\tFound: ' + response[len(response) - 3:])
evolver_server.EvolverSerialError: Error: Response did not have valid serial communication termination string!
Expected: end
Found: 00,
stirr,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,_!
Traceback (most recent call last):
File "/home/pi/evolver/evolver/evolver_server.py", line 246, in run_commands
returned_data = serial_communication(command['param'], command['value'], command['type'])
File "/home/pi/evolver/evolver/evolver_server.py", line 284, in serial_communication
raise EvolverSerialError('Error: Response has incorrect address.\n\tExpected: ' + param + '\n\tFound:' + address)
evolver_server.EvolverSerialError: Error: Response has incorrect address.
Expected: stir
Found:
tempr,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,_!
tempb,1967,1948,1938,1935,
Traceback (most recent call last):
File "/home/pi/evolver/evolver/evolver_server.py", line 246, in run_commands
returned_data = serial_communication(command['param'], command['value'], command['type'])
File "/home/pi/evolver/evolver/evolver_server.py", line 286, in serial_communication
raise EvolverSerialError('Error: Response did not have valid serial communication termination string!\n\tExpected: ' + evolver_conf['serial_end_incoming'] + '\n\tFound: ' + response[len(response) - 3:])
evolver_server.EvolverSerialError: Error: Response did not have valid serial communication termination string!
Expected: end
Found: 35,
Broadcasting data
{'data': {}, 'config': {'lxml': {'fields_expected_incoming': 17, 'fields_expected_outgoing': 17, 'recurring': False, 'value': ['4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095']}, 'od_135': {'fields_expected_incoming': 17, 'fields_expected_outgoing': 2, 'recurring': True, 'value': '1000'}, 'od_90': {'fields_expected_incoming': 17, 'fields_expected_outgoing': 2, 'recurring': True, 'value': '1000'}, 'od_led': {'fields_expected_incoming': 17, 'fields_expected_outgoing': 17, 'recurring': True, 'value': ['2500', '2500', '2500', '2500', '2500', '2500', '2500', '2500', '2500', '2500', '2500', '2500', '2500', '2500', '2500', '2500']}, 'pump': {'fields_expected_incoming': 49, 'fields_expected_outgoing': 49, 'recurring': False, 'value': None}, 'stir': {'fields_expected_incoming': 17, 'fields_expected_outgoing': 17, 'recurring': True, 'value': ['15', '15', '15', '15', '15', '15', '15', '15', '15', '15', '15', '15', '15', '15', '15', '15']}, 'temp': {'fields_expected_incoming': 17, 'fields_expected_outgoing': 17, 'recurring': True, 'value': ['4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095', '4095']}}}
on_start
on_stop
on_pause
on_create
on_update
Noticed after doing a temperature calibration that the setup page was no longer updating values. Most likely caused by the broadcasting thread crashing due to serial communication issues with the server.
In evolver_server.py
, the reformat_parameters
function should be generalized
Token for cloud communication should probably be set separately on the device, and integrate with HAPI auth (if possible). When creating a new device on the cloud, get a session token for it and input that through the touch screen of the evolver.
Token to communicate to DPU could be part of config file? Both evolver and DPU have to contain same token.
Line 25 in a3213d7
https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation
use: yaml.safe_load()
During temperature calibration, during updating the temperature, the server freezes up. This is the output log from the server.
Output to arduino: xrNaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN, ! Received from arduino: temp2018,1980,1986,1997,1983,1961,1973,1972,1986,1954,1919,1956,1994,1957,1943,1969,end Output to arduino: we4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095, ! Received COMMAND Output to arduino: xr1517,1478,1484,1492,1481,1461,1472,1470,1485,1454,1419,1456,1492,1458,1442,1467, ! Error in running commands - relinquishing serial an integer is required (got type NoneType) Got command from BROADCAST Output to arduino: we4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095, ! Error in running commands - relinquishing serial 'utf-8' codec can't decode byte 0xfe in position 0: invalid start byte Got command from BROADCAST
When trying to send fluidic commands via the GUI. In this case, printed the value variable.
Received COMMAND
['13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '13', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
13
Task exception was never retrieved
future: <Task finished coro=<AsyncServer._handle_event_internal() done, defined at /usr/local/lib/python3.6/site-packages/python_socketio-3.0.0-py3.6.egg/socketio/asyncio_server.py:296> exception=TypeError("'NoneType' object does not support item assignment",)>
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/python_socketio-3.0.0-py3.6.egg/socketio/asyncio_server.py", line 297, in _handle_event_internal
r = await server._trigger_event(data[0], namespace, sid, *data[1:])
File "/usr/local/lib/python3.6/site-packages/python_socketio-3.0.0-py3.6.egg/socketio/asyncio_server.py", line 325, in _trigger_event
ret = await self.handlers[namespace][event](*args)
File "/home/pi/evolver/evolver/evolver_server.py", line 51, in on_command
evolver_conf['experimental_params'][param]['value'][i] = value[i]
TypeError: 'NoneType' object does not support item assignment
Received COMMAND
If multiple fluidic commands are sent in rapid succession (say, at ~1 second intervals), some are currently (server version 1.1.1) being dropped. I have done limited testing, but I think in those cases the server send the previous command to the arduinos instead of the new one. The solution from the DPU side is to write the custom function so that all required fluidic events are collated and fired only once (which is how the example custom_script.py
is written anyway).
Not sure what a good solution could be, apart from adopting a parsimonious approach at sending commands. Might be good to explicitly warn the users too (with a comment in the custom_script.py
template).
To be able to go to errors at specific times should they happen
New GUI react component for pump cals - entering numbers for flow rates for each pump, and how much time.
IP addresses are currently hard-coded, and should be loaded from a config file.
The queue is cleared of all broadcast events when immediate commands come in right now. To fix this (1) Immediate commands clears all broadcast commands of only of the same class and (2) don't have broadcast events reset the timer
xrNaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN, !
File "/home/pi/evolver/evolver/evolver_server.py", line 417, in broadcast
data = run_commands()
File "/home/pi/evolver/evolver/evolver_server.py", line 279, in run_commands
data = ping_arduino(config)
File "/home/pi/evolver/evolver/evolver_server.py", line 379, in ping_arduino
config_to_arduino(key, value, PARAM[key][0], ENDING_SEND, PARAM[key][2])
File "/home/pi/evolver/evolver/evolver_server.py", line 350, in config_to_arduino
SERIAL.write(bytes(output, 'UTF-8'))
File "/usr/local/lib/python3.6/site-packages/pyserial-3.4-py3.6.egg/serial/serialposix.py", line 537, in write
TypeError: an integer is required (got type NoneType)
Test with a long command to ensure it works.
Increase serial_timeout to 1.0
Increase time.sleep(x) to 0.1
serial_timeout
is in conf.yml
time.sleep(x)
in evolver_server.py
. Move x
into the conf file as serial_delay
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.