Skip to content

software: Gitify node-red-dashboard - #573

Merged
sonnyp merged 11 commits into
masterfrom
git-node-red-frontend
Apr 17, 2025
Merged

sonnyp merged 11 commits into
masterfrom
git-node-red-frontend

Conversation

@sonnyp

@sonnyp sonnyp commented Apr 16, 2025 •

Copy link
Copy Markdown
Collaborator

Configure node-red to use the git repository as userDir so that changes to flows are visible in git.

Here is the output of git status after making changed in the node-red editor:

Screenshot From 2025-04-16 13-36-41

settings.js file was copied from https://github.com/PlanktoScope/pallet-standard/blob/8fd23fded73b71d391d47a14ca79684cfcb6aeb7/packages/core/apps/planktoscope/node-red-dashboard/overlays/etc/nodered/settings.js

Previously the setting file was setup using forklift https://github.com/PlanktoScope/pallet-standard/blob/8fd23fded73b71d391d47a14ca79684cfcb6aeb7/packages/core/apps/planktoscope/node-red-dashboard/overlays/etc/systemd/system/nodered.service.d/20-override.conf

This is "bypassing" forklift as I'm not familiar with it yet, it is unclear if it will remain and in any case dashboard 2 will likely deprecate this.

image

@sonnyp
sonnyp marked this pull request as ready for review April 17, 2025 08:49
@sonnyp
sonnyp merged commit 33a97d5 into master Apr 17, 2025
@sonnyp
sonnyp deleted the git-node-red-frontend branch April 17, 2025 11:22
sonnyp added a commit that referenced this pull request Apr 17, 2025
Fixes #322

**planktoscopehat**

This can be safely removed as documented in
#322 (comment)

It also fixes this nodered log spamming every 5s

`Apr 17 11:22:22 pkscope-secret-authority-46635 Node-RED[124382]: 17 Apr
11:22:22 - [error] [rpi-gpio out:Fan] nrgpio python command not running`

**adafruithat**

The `flows.json` file was left untouched.

---

Besides the removed package, `package-lock.json` was updated by `npm
update` and staged to remove several unused dependencies.

I used #573 to perform
this update.
github-merge-queue Bot pushed a commit to PlanktoScope/pallet-standard that referenced this pull request Apr 17, 2025
This PR follows up on
fairscope/PlanktoScope#573 by removing the
pallet's export of files which that PR overrides with a higher-priority
drop-in file, to avoid confusion about the actual configuration of the
system.
@ethanjli ethanjli mentioned this pull request Apr 24, 2025
3 of 8 tasks
@ethanjli ethanjli mentioned this pull request May 8, 2025
3 of 5 tasks
ethanjli added a commit that referenced this pull request May 20, 2025
As part of #182, this PR enables the user to switch between the
adafruithat vs. planktoscopehat program variants by editing the SD
card's `~/PlanktoScope/config.json` file and then rebooting (or
restarting `nodered.service` and then restarting
`planktoscope-org.device-backend.controller.service` after Node-RED
becomes ready to receive MQTT messages, without a full system reboot). A
minor caveat here is that GPS functionality is not available on
planktoscopehat-based images running the adafruithat program variants
(because of #591); but in the [2025-05-14 software
meeting](https://docs.google.com/document/d/1AN1jaIdfKChKjMnzSd3ecjRTZGOnoglBfV9LCpevMgk/edit?tab=t.geukyqpm9ntj#heading=h.ziivhaa9au6q)
I plan to propose deprecating GPS functionality from the adafruithat
variants too.

Specifically, this PR:

- unifies the systemd services for the Python device controller into a
single service, and this PR provides a single top-level entrypoint
script which selects the adafruithat vs. planktoscopehat `main.py`
script based on the ~configuration in
`/usr/share/planktoscope/installer-config.yml`, in the same way that
#573 selects adafruithat vs. planktoscopehat for the Node-RED dashboard~
`~/PlanktoScope/config.json` file's `acq_instrument` field (whose values
are like `PlanktoScope v2.6`). See
#583 (comment)
and the [2025-05-07 software
meeting](https://docs.google.com/document/d/1AN1jaIdfKChKjMnzSd3ecjRTZGOnoglBfV9LCpevMgk/edit?tab=t.geukyqpm9ntj#heading=h.81oklfxjwmel)
for additional context on this step towards a piecemeal incremental
unification of the adafruithat vs. planktoscopehat variants of the
Python device controller.
- updates the Node-RED dashboard's `settings.js` file to choose between
the adafruithat vs. planktoscopehat variants of the dashboard based on
the `~/PlanktoScope/config.json` file's `acq_instrument` field.
- fixes a regression in the `fairscope-latest` image caused by #573,
where the `fairscope-latest` image was unable to select the
`planktoscopehat` Node-RED dashboard (because it was looking for a
`fairscope-latest` variant of the dashboard).

This PR also removes OS setup script support for "segmenter-only"
images, since those images were never officially supported (and never
documented in
https://docs.planktoscope.community/reference/software/subsystems/installation/)
and we stopped building them with #573.

TODOs:

- [x] Move the `if __name__ == "__main__"` code blocks in the
adafruithat/planktoscopehat `main.py` files into a main function, so
that we can invoke those scripts more cleanly, and so that we can make
loguru-based logging work properly. This task is blocked by #600 due to
the risk of messy merge conflicts with that PR.
- [x] Move the loguru-based logger from the adafruithat/planktoscopehat
`main.py` files to the hardware controller's top-level `main.py` file,
so that log messages will be saved to file.
- [x] Ensure that uncaught exceptions in the code are are logged to file
by a top-level exception catcher via loguru.

For future PRs (since this PR already touches a lot of files):

- [ ] Move the `.../control/planktoscopehat/planktoscope/identity.py` &
`.../control/planktoscopehat/planktoscope/mqtt.py` &
`.../control/planktoscopehat/planktoscope/camera` &
`.../control/planktoscopehat/planktoscope/imaging` driver modules to a
shared, unified location (perhaps `../control/drivers`) which is used by
both `.../planktoscopehat/main.py` and `.../adafruithat/main.py`,
instead of having two (supposedly) identical of each module.
- [ ] Move everything in `.../control/{variant}/planktoscope` to
`.../control/{variant}`, to reduce redundancies the path names

---------

Co-authored-by: Sonny Piers <[email protected]>
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.

1 participant