-
Notifications
You must be signed in to change notification settings - Fork 30
Description
Motivation
For the v2.3 software release, two separate SD card images were provided - one to provide hardware support for the Adafruit HAT, and the other to provide hardware support for the PlanktoScope HAT. As a result, we had to provide special guidance to users about which SD card image to use. Additionally, the v2.3 version of the Python backend maintained Adafruit HAT support on the main branch of this repo and PlanktoScope HAT support on the pscopehat branch of this repo, which meant the process for building the SD card image for each HAT was slightly different (i.e. the repo had to be downloaded to the SD card from a different URL). This adds complexity to the process for building and releasing SD card images. In particular, after #416 (because the GitHub Actions workflow for building OS images involves a QEMU VM step which occasionally freezes for no good reason), building many SD card images makes our CI workflows flaky.
The Node-RED dashboard already has a menu to select which HAT to use - so we could just use that as the one and only way to select which HAT is used, and simplify away everything else related to which HAT the software uses. However, currently there are actually two different Node-RED dashboards (one version for the Adafruit HAT, and the other for the pscopehat), so until we can merge them back into the same dashboard (which would be a big project in and of itself), we should just have either an external UI to switch the Node-RED dashboard or an internal UI in the Node-RED dashboard which switches the flows.json file and restarts the Node-RED server.
Goals
- Make a single SD card image which can run the Python backend and Node-RED dashboard for either HAT.
- Make an easy way to set and change the supported hardware version.
Steps
- Move the Adafruit HAT version of the Python backend to a separate repository from the SD card setup scripts
- Split the segmenter from the hardware controller
- Move the pscopehat HAT version of the Python backend from the PlanktoScope repository's pscopehat branch into a separate subdirectory of the device-backend repository
- Provide a user-friendly way to switch the hardware version (e.g. in forklift or in a first-boot wizard and admin panel)
- Update the software setup documentation to provide instructions for choosing the hardware version as part of first-time software setup
Unresolved Questions
Do we need to drop support for the waveshare HAT?Yes, we need to drop support- How might we unify the codebases of the two Python backends for the two HATs? (this will be saved for future PRs)
- How will we configure which Python backend runs when we package the backend in Forklift? Will we have two different packages, or a single package which receives configuration from Node-RED in some other way? (this will be addressed in a future PR to containerize the Python backends; ideally the adafruithat version's Forklift package or Forklift feature flag would be mutually exclusive with the Forklift package or Forklift feature flag for the pscopehat version of the Python backend, or it would be toggled via a config file rather than via Forklift)
- What work is needed for us to be able to unify the Node-RED dashboards?
Implementation History
- Move the Adafruit HAT version of the Python backend to a separate repository: Properly manage versions of the backend's direct & indirect dependencies #175, everything from the creation of the https://github.com/PlanktoScope/device-backend repository up to PlanktoScope/device-backend@49241ae
- Split the segmenter from the hardware controller: Split backend by hardware control vs. data processing PlanktoScope/device-backend#1, Unify support for different HAT types into the same branch of the repo #187
- Move the pscopehat HAT version of the Python backend from the PlanktoScope repository's pscopehat branch into a separate subdirectory of the device-backend repository: Add support for the PlanktoScope HATÂ PlanktoScope/device-backend#2
- Add hardware version selection into the home page of the Node-RED dashboard of the planktoscopehat version of the OS, for first-time setup: Show dialog on homepage when
config.json's hw version is null #432 - Select hardware based on
config.jsonfile #602 - Use runtime to select the hardware variant #583