Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sam demo (for discussion) #25

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open

Sam demo (for discussion) #25

wants to merge 28 commits into from

Conversation

granawkins
Copy link
Collaborator

This branch is the culmination of:

  1. Greg adding support for specific sensors
  2. the sam-educational branch
  3. Ezio's config file
  4. Greg and Grant's work at SAM with the Vernier Sensors
    *) It's also the backend for simoc-web #156 (above)

We discussed redoing these commits with some optimizations. Why don't we use this initially for review/comments/discussion, and then someone can create a new branch/PR to redo the commits.

GregRRoss and others added 28 commits February 18, 2022 21:38
use a single instance of godirect (outside of gdx)
parse available devices and pass directly to sensor classes
use gdx_lite class to function names/attributes are retained
create new start_sensors script for multiple asyncio processes - INCOMPLETE
@granawkins granawkins requested a review from ezio-melotti June 5, 2022 01:48
@granawkins
Copy link
Collaborator Author

Seems like there should be one function to:

  • Scan usb ports on device
  • If a sensor is found, try to match it with an existing sensor class (e.g. VernierO2) and config.cfg label. If not found, log the details.
  • If a matching class and config are found, boot the sensor and begin broadcasting.

This could be run on a like a ~5s loop, in a shell script on Raspberry Pi and/or in the server loop on sioserver.

Right now sensors are added manually/individually, e.g. python3 mocksensor.py -v --port 8081 -- except in the case of multiple vernier sensors, in which case they use asyncio.gather, or MCPRunner which uses threading. I believe Ezio had a better idea in mind for running multiple sensors together.

I think this way things could just work out-of-the-box, either in Gretchen's situation or for SAM, and replace a lot of redundant/case-specific tmux scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants