From da1a66cb0dd683c3de9b18541f3a9a7a73138e3c Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Thu, 24 Apr 2025 15:23:00 +0200 Subject: [PATCH 1/7] Remove hardware variant --- .github/workflows/build-os-bookworm-dx.yml | 54 ------------------- .github/workflows/build-os-bookworm.yml | 12 +---- .github/workflows/build-os.yml | 10 ++-- software/distro/setup/ci-record-version.sh | 9 ---- software/distro/setup/cleanup.sh | 18 ++----- .../node-red-frontend/install.sh | 19 +------ .../python-hardware-controller/install.sh | 16 ++---- .../setup/planktoscope-app-env/setup.sh | 11 +--- software/distro/setup/setup.sh | 20 +++---- 9 files changed, 23 insertions(+), 146 deletions(-) delete mode 100644 .github/workflows/build-os-bookworm-dx.yml diff --git a/.github/workflows/build-os-bookworm-dx.yml b/.github/workflows/build-os-bookworm-dx.yml deleted file mode 100644 index d4198cb0f..000000000 --- a/.github/workflows/build-os-bookworm-dx.yml +++ /dev/null @@ -1,54 +0,0 @@ ---- -name: build-os-bookworm-dx -on: - push: - branches: - - 'master' - - 'software/beta' - - 'software/stable' - tags: - - 'software/v*' - paths: - - 'software/**' - - '!software/CHANGELOG.md' - - '.github/workflows/build-os*.yml' - pull_request: - paths: - - 'software/**' - - '!software/CHANGELOG.md' - - '.github/workflows/build-os*.yml' - #merge_group: - workflow_dispatch: - inputs: - git-ref: - description: 'Git ref (optional)' - required: false - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - name: build - strategy: - fail-fast: false - matrix: - variant: - - adafruithat - - planktoscopehat - base_variant_name: - - desktop - permissions: - contents: read - packages: write - id-token: write - uses: ./.github/workflows/build-os.yml - secrets: inherit - with: - name: planktoscope - base_release_name: bookworm - base_image_variant: ${{ matrix.base_variant_name }} - base_release_date: 2024-11-19 - arch: arm64 - variant: ${{ matrix.variant }} diff --git a/.github/workflows/build-os-bookworm.yml b/.github/workflows/build-os-bookworm.yml index 20d3f5218..00bd8966f 100644 --- a/.github/workflows/build-os-bookworm.yml +++ b/.github/workflows/build-os-bookworm.yml @@ -31,15 +31,6 @@ concurrency: jobs: build: name: build - strategy: - fail-fast: false - matrix: - variant: - - adafruithat - - planktoscopehat - - fairscope-latest - base_variant_name: - - lite permissions: contents: read packages: write @@ -49,7 +40,6 @@ jobs: with: name: planktoscope base_release_name: bookworm - base_image_variant: ${{ matrix.base_variant_name }} + base_image_variant: lite base_release_date: 2024-11-19 arch: arm64 - variant: ${{ matrix.variant }} diff --git a/.github/workflows/build-os.yml b/.github/workflows/build-os.yml index 97730e37f..6ac544fc2 100644 --- a/.github/workflows/build-os.yml +++ b/.github/workflows/build-os.yml @@ -26,10 +26,6 @@ on: description: 'The CPU architecture of the OS (armhf, arm64)' required: true type: string - variant: - description: 'The name of the RPi OS base image variant (none, segmenter-only, adafruithat, planktoscopehat)' - required: true - type: string jobs: build-os-image: @@ -152,7 +148,7 @@ jobs: ACTUAL_SHA="$(printf "%.7s" "${{ env.ACTUAL_SHA }}")" /run/os-setup/software/distro/setup/ci-record-version.sh \ "github.com/${{ env.REPO }}" "$ACTUAL_SHA" "hash" \ - "${{ inputs.variant }}" "/run/os-setup" + "/run/os-setup" echo "installer-config.yml:" cat /usr/share/planktoscope/installer-config.yml echo "installer-versioning.yml:" @@ -275,7 +271,7 @@ jobs: run: | echo "Running setup scripts..." export DEBIAN_FRONTEND=noninteractive - /run/os-setup/software/distro/setup/setup.sh ${{ inputs.variant }} + /run/os-setup/software/distro/setup/setup.sh echo "Done!" - name: Prepare for a headless first boot on bare metal @@ -329,7 +325,7 @@ jobs: else version="$(printf "%.7s" "${{ github.sha }}")" fi - variant="${{ inputs.variant }}" + variant="" if [[ "${{ inputs.base_release_name }}" != "bookworm" ]]; then variant="$variant.${{ inputs.base_release_name }}" fi diff --git a/software/distro/setup/ci-record-version.sh b/software/distro/setup/ci-record-version.sh index fdf41dc2d..2a894a023 100755 --- a/software/distro/setup/ci-record-version.sh +++ b/software/distro/setup/ci-record-version.sh @@ -5,7 +5,6 @@ # REPO (the repo used for setup, e.g. github.com/PlanktoScope/PlanktoScope) # VERSION_QUERY (the version query, e.g. a commit hash) # QUERY_TYPE (eitiher branch, tag, or hash) -# HARDWARE (either none, segmenter-only, adafruithat, or planktoscopehat) # VERSION_QUERY_DIR (the filesystem path of the git repo used for getting version info) # Utilities for user interaction @@ -99,7 +98,6 @@ main() { info "${BOLD}Repo${NO_COLOR}: ${GREEN}${pretty_repo}${NO_COLOR}" info "${BOLD}Version query${NO_COLOR}: ${GREEN}${VERSION_QUERY}${NO_COLOR}" info "${BOLD}Query type${NO_COLOR}: ${GREEN}${QUERY_TYPE}${NO_COLOR}" - info "${BOLD}Hardware${NO_COLOR}: ${GREEN}${HARDWARE}${NO_COLOR}" if [ -n "${VERBOSE-}" ]; then VERBOSE=v info "${BOLD}Tag prefix${NO_COLOR}: $(with_empty_placeholder "${TAG_PREFIX}")" @@ -160,7 +158,6 @@ main() { "repo" "${pretty_repo}" \ "version-query" "${VERSION_QUERY}" \ "query-type" "${QUERY_TYPE}" \ - "hardware" "${HARDWARE}" \ "tag-prefix" "${TAG_PREFIX}" \ "setup-entrypoint" "${SETUP_ENTRYPOINT}" \ | sudo tee --append "${installer_config_file}" > /dev/null @@ -183,7 +180,6 @@ main() { REPO="$1" VERSION_QUERY="$2" QUERY_TYPE="$3" -HARDWARE="$4" VERSION_QUERY_DIR="$5" # Set default values for the command-line arguments @@ -200,11 +196,6 @@ if [ -z "${QUERY_TYPE-}" ]; then error "QUERY_TYPE environment variable was not set!" exit 1 fi -DEFAULT_HARDWARE="planktoscopehat" -if [ -z "${HARDWARE-}" ]; then - error "HARDWARE environment variable was not set!" - exit 1 -fi DEFAULT_TAG_PREFIX="software/" if [ -z "${TAG_PREFIX-}" ]; then TAG_PREFIX="${DEFAULT_TAG_PREFIX}" diff --git a/software/distro/setup/cleanup.sh b/software/distro/setup/cleanup.sh index ef3494a83..47bfe35e3 100755 --- a/software/distro/setup/cleanup.sh +++ b/software/distro/setup/cleanup.sh @@ -5,10 +5,6 @@ setup_scripts_root=$(dirname $(realpath $BASH_SOURCE)) -# Get command-line args - -hardware_type="$1" # should be either none, adafruithat, planktoscopehat, or segmenter-only - # Set up pretty error printing red_fg=31 @@ -35,16 +31,12 @@ function panic { # Run sub-scripts -if [ $hardware_type = "none" ]; then - echo "Warning: skipping PlanktoScope-specific setup because hardware type was specified as: $hardware_type" +description="remove unnecessary artifacts from the PlanktoScope application environment" +report_starting "$description" +if $setup_scripts_root/planktoscope-app-env/cleanup.sh ; then + report_finished "$description" else - description="remove unnecessary artifacts from the PlanktoScope application environment" - report_starting "$description" - if $setup_scripts_root/planktoscope-app-env/cleanup.sh ; then - report_finished "$description" - else - panic "$description" - fi + panic "$description" fi description="remove unnecessary artifacts from the base operating system" diff --git a/software/distro/setup/planktoscope-app-env/node-red-frontend/install.sh b/software/distro/setup/planktoscope-app-env/node-red-frontend/install.sh index 82571facd..347a0d279 100755 --- a/software/distro/setup/planktoscope-app-env/node-red-frontend/install.sh +++ b/software/distro/setup/planktoscope-app-env/node-red-frontend/install.sh @@ -4,22 +4,6 @@ # Determine the base path for copied files config_files_root=$(dirname "$(realpath "$BASH_SOURCE")") -# Get command-line args -hardware_type="$1" # should be either adafruithat, planktoscopehat, fairscope-latest, or segmenter-only -default_config="$hardware_type-latest" -case "$hardware_type" in -"fairscope-latest") - hardware_type="planktoscopehat" - default_config="fairscope-latest" - ;; -"segmenter-only") - # FIXME: instead set up the segmenter-only version of the Node-RED dashboard! - echo "Warning: setting up adafruithat version of Node-RED dashboard for hardware type: $hardware_type" - hardware_type=adafruithat - default_config="adafruithat-latest" - ;; -esac - # Install dependencies # smbus is needed by some python3 nodes in the Node-RED dashboard for the Adafruit HAT. # Since the Node-RED systemd service runs as the pi user by default (and we don't override that @@ -45,4 +29,5 @@ sudo mkdir -p /etc/systemd/system/nodered.service.d sudo cp $config_files_root/30-override.conf /etc/systemd/system/nodered.service.d/30-override.conf # Install dependencies to make them available to Node-RED -npm --prefix "$HOME"/PlanktoScope/software/node-red-dashboard/$hardware_type install +npm --prefix "$HOME"/PlanktoScope/software/node-red-dashboard/adafruithat install +npm --prefix "$HOME"/PlanktoScope/software/node-red-dashboard/planktoscopehat install diff --git a/software/distro/setup/planktoscope-app-env/python-hardware-controller/install.sh b/software/distro/setup/planktoscope-app-env/python-hardware-controller/install.sh index 0bd1dfca7..7ee854a3b 100755 --- a/software/distro/setup/planktoscope-app-env/python-hardware-controller/install.sh +++ b/software/distro/setup/planktoscope-app-env/python-hardware-controller/install.sh @@ -6,16 +6,6 @@ config_files_root="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" distro_setup_files_root="$(dirname "$(dirname "$config_files_root")")" -# Get command-line args -hardware_type="$1" # should be either adafruithat, planktoscopehat, or fairscope-latest -default_config="$hardware_type-latest" -case "$hardware_type" in -"fairscope-latest") - hardware_type="planktoscopehat" - default_config="fairscope-latest" - ;; -esac - ## Install basic Python tooling sudo -E apt-get install -y -o Dpkg::Progress-Fancy=0 \ git python3-pip python3-venv @@ -60,6 +50,6 @@ sudo cp "$config_files_root$file" "$file" # Select the enabled hardware controller mkdir -p "$HOME/PlanktoScope" -sudo systemctl enable "planktoscope-org.device-backend.controller-$hardware_type.service" -cp "$HOME/PlanktoScope/device-backend/default-configs/$default_config.hardware.json" \ - "$HOME/PlanktoScope/hardware.json" +# sudo systemctl enable "planktoscope-org.device-backend.controller-$hardware_type.service" +# cp "$HOME/PlanktoScope/device-backend/default-configs/$default_config.hardware.json" \ +# "$HOME/PlanktoScope/hardware.json" diff --git a/software/distro/setup/planktoscope-app-env/setup.sh b/software/distro/setup/planktoscope-app-env/setup.sh index 6f1224f4a..ddfc4fb6a 100755 --- a/software/distro/setup/planktoscope-app-env/setup.sh +++ b/software/distro/setup/planktoscope-app-env/setup.sh @@ -11,8 +11,6 @@ build_scripts_root=$(dirname "$(realpath "$BASH_SOURCE")") # Get command-line args -hardware_type="$1" # should be either adafruithat, planktoscopehat, fairscope-latest, or segmenter-only - # Set up pretty error printing red_fg=31 @@ -55,20 +53,15 @@ fi description="set up Node-RED frontend" report_starting "$description" -if "$build_scripts_root/node-red-frontend/install.sh" "$hardware_type"; then +if "$build_scripts_root/node-red-frontend/install.sh"; then report_finished "$description" else panic "$description" fi -if [ "$hardware_type" = "segmenter-only" ]; then - echo "Warning: skipping PlanktoScope hardware-specific setup because hardware type was specified as: $hardware_type" - exit 0 -fi - description="set up Python hardware controller" report_starting "$description" -if "$build_scripts_root/python-hardware-controller/install.sh" "$hardware_type"; then +if "$build_scripts_root/python-hardware-controller/install.sh"; then report_finished "$description" else panic "$description" diff --git a/software/distro/setup/setup.sh b/software/distro/setup/setup.sh index c4ba79d97..fc8b40eaf 100755 --- a/software/distro/setup/setup.sh +++ b/software/distro/setup/setup.sh @@ -11,8 +11,6 @@ setup_scripts_root=$(dirname "$(realpath "$BASH_SOURCE")") # Get command-line args -hardware_type="$1" # should be either none, adafruithat, planktoscopehat, fairscope-latest, or segmenter-only - # Set up pretty error printing red_fg=31 @@ -50,17 +48,13 @@ else panic "$description" fi -if [ "$hardware_type" = "none" ]; then - echo "Warning: skipping PlanktoScope-specific setup because hardware type was specified as: $hardware_type" +description="set up PlanktoScope application environment" +report_starting "$description" +if "$setup_scripts_root"/planktoscope-app-env/setup.sh; then + report_finished "$description" + source "$setup_scripts_root"/planktoscope-app-env/export-env.sh else - description="set up PlanktoScope application environment" - report_starting "$description" - if "$setup_scripts_root"/planktoscope-app-env/setup.sh "$hardware_type"; then - report_finished "$description" - source "$setup_scripts_root"/planktoscope-app-env/export-env.sh - else - panic "$description" - fi + panic "$description" fi -"$setup_scripts_root"/cleanup.sh "$hardware_type" +"$setup_scripts_root"/cleanup.sh From 7a5a2171fea5a66370e295d4b576e8126e598143 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Thu, 24 Apr 2025 15:28:25 +0200 Subject: [PATCH 2/7] f --- software/distro/setup/ci-record-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/software/distro/setup/ci-record-version.sh b/software/distro/setup/ci-record-version.sh index 2a894a023..a6c4c96e9 100755 --- a/software/distro/setup/ci-record-version.sh +++ b/software/distro/setup/ci-record-version.sh @@ -180,7 +180,7 @@ main() { REPO="$1" VERSION_QUERY="$2" QUERY_TYPE="$3" -VERSION_QUERY_DIR="$5" +VERSION_QUERY_DIR="$4" # Set default values for the command-line arguments if [ -z "${REPO-}" ]; then From 79dee7d1407a011cb5ed20b832982d1aa8570ed0 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Thu, 24 Apr 2025 15:46:12 +0200 Subject: [PATCH 3/7] f --- .../setup/planktoscope-app-env/node-red-frontend/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/software/distro/setup/planktoscope-app-env/node-red-frontend/install.sh b/software/distro/setup/planktoscope-app-env/node-red-frontend/install.sh index 347a0d279..8a370ea26 100755 --- a/software/distro/setup/planktoscope-app-env/node-red-frontend/install.sh +++ b/software/distro/setup/planktoscope-app-env/node-red-frontend/install.sh @@ -20,8 +20,8 @@ fi curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered | bash -s - --confirm-install --confirm-pi --no-init -cp "$HOME/PlanktoScope/software/node-red-dashboard/default-configs/$default_config.config.json" \ - "$HOME"/PlanktoScope/config.json +# cp "$HOME/PlanktoScope/software/node-red-dashboard/default-configs/$default_config.config.json" \ +# "$HOME"/PlanktoScope/config.json # Configure node-red npm --prefix "$HOME"/PlanktoScope/software/node-red-dashboard install From fccad9e14156d25b0b519816747955387089792d Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Thu, 24 Apr 2025 16:29:53 +0200 Subject: [PATCH 4/7] Update flow to create config.json --- .../planktoscopehat/flows.json | 78 +++++++++++++++---- 1 file changed, 64 insertions(+), 14 deletions(-) diff --git a/software/node-red-dashboard/planktoscopehat/flows.json b/software/node-red-dashboard/planktoscopehat/flows.json index 1e37240df..18265e7b7 100644 --- a/software/node-red-dashboard/planktoscopehat/flows.json +++ b/software/node-red-dashboard/planktoscopehat/flows.json @@ -8505,8 +8505,8 @@ "z": "1eaf21c8.f7a21e", "name": "", "env": [], - "x": 510, - "y": 300, + "x": 490, + "y": 360, "wires": [ [] ] @@ -8522,8 +8522,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 350, - "y": 300, + "x": 330, + "y": 360, "wires": [ [ "1cfadc66.3cde8c" @@ -8756,8 +8756,8 @@ "className": "", "topic": "Resetting hardware configuration to version-specific default", "name": "", - "x": 370, - "y": 260, + "x": 350, + "y": 320, "wires": [] }, { @@ -8779,7 +8779,7 @@ "from": "", "to": "", "reg": false, - "x": 410, + "x": 610, "y": 220, "wires": [ [ @@ -8799,7 +8799,7 @@ "winHide": false, "oldrc": false, "name": "Copy default hardware config", - "x": 700, + "x": 940, "y": 220, "wires": [ [ @@ -8826,8 +8826,8 @@ "drop": false, "allowrate": false, "outputs": 1, - "x": 930, - "y": 220, + "x": 1190, + "y": 240, "wires": [ [ "3973b999ee7b3b1d" @@ -8846,8 +8846,8 @@ "5984b086eddc9311", "a2f2a4c7cbae4446" ], - "x": 1095, - "y": 220, + "x": 1315, + "y": 240, "wires": [] }, { @@ -8945,14 +8945,15 @@ "08d177136bd18281", "9f34e4a2f33c4022" ], - "x": 205, + "x": 125, "y": 260, "wires": [ [ "68703ef63da2f081", "d276ce894f483bcf", "3e2c5c1c.4c57b4", - "a7e5c7f4.644678" + "a7e5c7f4.644678", + "0adb1755a133ca44" ] ] }, @@ -8981,5 +8982,54 @@ "x": 875, "y": 120, "wires": [] + }, + { + "id": "be756939e3b468be", + "type": "exec", + "z": "1eaf21c8.f7a21e", + "command": "cp", + "addpay": "payload", + "append": "/home/pi/PlanktoScope/config.json", + "useSpawn": "false", + "timer": "", + "winHide": false, + "oldrc": false, + "name": "Copy default software config", + "x": 940, + "y": 280, + "wires": [ + [ + "97e582080deae888" + ], + [], + [] + ] + }, + { + "id": "0adb1755a133ca44", + "type": "change", + "z": "1eaf21c8.f7a21e", + "name": "Choose default software config", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "$join([\"/home/pi/PlanktoScope/node-red-dashboard/default-configs/\", $substringAfter(msg.payload, \"PlanktoScope \"), \".config.json\"])", + "tot": "jsonata" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 610, + "y": 280, + "wires": [ + [ + "be756939e3b468be" + ] + ] } ] \ No newline at end of file From 14c55061f4c028586af65bc5dc76162d5138267f Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Thu, 24 Apr 2025 16:57:35 +0200 Subject: [PATCH 5/7] f --- .../planktoscopehat/flows.json | 95 ++++++++++++------- 1 file changed, 59 insertions(+), 36 deletions(-) diff --git a/software/node-red-dashboard/planktoscopehat/flows.json b/software/node-red-dashboard/planktoscopehat/flows.json index 18265e7b7..c14c5055c 100644 --- a/software/node-red-dashboard/planktoscopehat/flows.json +++ b/software/node-red-dashboard/planktoscopehat/flows.json @@ -8253,7 +8253,7 @@ "438febd245a9f73c" ], "x": 1495, - "y": 380, + "y": 620, "wires": [] }, { @@ -8273,7 +8273,7 @@ "drop": false, "outputs": 1, "x": 1180, - "y": 380, + "y": 620, "wires": [ [ "e41870d7.300eb8" @@ -8287,7 +8287,7 @@ "name": "", "env": [], "x": 1220, - "y": 420, + "y": 660, "wires": [] }, { @@ -8310,7 +8310,7 @@ "to": "", "reg": false, "x": 660, - "y": 440, + "y": 680, "wires": [ [ "cd1987c7.027f58" @@ -8341,7 +8341,7 @@ "officon": "", "offcolor": "", "x": 960, - "y": 440, + "y": 680, "wires": [ [ "8e3b3d3c.955148", @@ -8369,7 +8369,7 @@ "to": "", "reg": false, "x": 670, - "y": 400, + "y": 640, "wires": [ [ "ee58b91c.396108" @@ -8395,7 +8395,7 @@ "className": "", "topicType": "str", "x": 940, - "y": 400, + "y": 640, "wires": [ [ "2068e7f.f4efb18", @@ -8506,7 +8506,7 @@ "name": "", "env": [], "x": 490, - "y": 360, + "y": 600, "wires": [ [] ] @@ -8523,7 +8523,7 @@ "finalize": "", "libs": [], "x": 330, - "y": 360, + "y": 600, "wires": [ [ "1cfadc66.3cde8c" @@ -8564,7 +8564,7 @@ "to": "", "reg": false, "x": 670, - "y": 480, + "y": 720, "wires": [ [ "244ca5dd62df2bcd" @@ -8590,7 +8590,7 @@ "className": "", "topicType": "str", "x": 940, - "y": 480, + "y": 720, "wires": [ [ "8e3b3d3c.955148", @@ -8610,7 +8610,7 @@ "finalize": "", "libs": [], "x": 1220, - "y": 480, + "y": 720, "wires": [ [ "5d5ad36d2c50dcc2" @@ -8624,7 +8624,7 @@ "name": "Process_pixel calibration", "links": [], "x": 1495, - "y": 500, + "y": 740, "wires": [] }, { @@ -8672,7 +8672,7 @@ "topic": "acq_fnumber_objective", "topicType": "str", "x": 930, - "y": 520, + "y": 760, "wires": [ [ "a6983d3232b570a7", @@ -8700,7 +8700,7 @@ "to": "", "reg": false, "x": 1260, - "y": 520, + "y": 760, "wires": [ [ "5d5ad36d2c50dcc2" @@ -8734,7 +8734,7 @@ "to": "", "reg": false, "x": 680, - "y": 520, + "y": 760, "wires": [ [ "6146ba22df928516" @@ -8757,7 +8757,7 @@ "topic": "Resetting hardware configuration to version-specific default", "name": "", "x": 350, - "y": 320, + "y": 560, "wires": [] }, { @@ -8779,8 +8779,8 @@ "from": "", "to": "", "reg": false, - "x": 610, - "y": 220, + "x": 590, + "y": 300, "wires": [ [ "e3ba6ac89221b17b" @@ -8799,8 +8799,8 @@ "winHide": false, "oldrc": false, "name": "Copy default hardware config", - "x": 940, - "y": 220, + "x": 920, + "y": 300, "wires": [ [ "97e582080deae888" @@ -8826,8 +8826,8 @@ "drop": false, "allowrate": false, "outputs": 1, - "x": 1190, - "y": 240, + "x": 1170, + "y": 360, "wires": [ [ "3973b999ee7b3b1d" @@ -8846,8 +8846,8 @@ "5984b086eddc9311", "a2f2a4c7cbae4446" ], - "x": 1315, - "y": 240, + "x": 1305, + "y": 360, "wires": [] }, { @@ -8856,7 +8856,7 @@ "z": "1eaf21c8.f7a21e", "name": "", "x": 380, - "y": 440, + "y": 680, "wires": [ [ "54ba7f16.709ad8", @@ -8878,7 +8878,7 @@ "onceDelay": 0.1, "topic": "", "x": 170, - "y": 460, + "y": 700, "wires": [ [ "3bcaf757cbc77fbe" @@ -8929,7 +8929,7 @@ "3973b999ee7b3b1d" ], "x": 205, - "y": 420, + "y": 660, "wires": [ [ "3bcaf757cbc77fbe" @@ -8945,15 +8945,16 @@ "08d177136bd18281", "9f34e4a2f33c4022" ], - "x": 125, - "y": 260, + "x": 185, + "y": 360, "wires": [ [ "68703ef63da2f081", "d276ce894f483bcf", "3e2c5c1c.4c57b4", "a7e5c7f4.644678", - "0adb1755a133ca44" + "0adb1755a133ca44", + "dffeaf1bc89fcb11" ] ] }, @@ -8995,8 +8996,8 @@ "winHide": false, "oldrc": false, "name": "Copy default software config", - "x": 940, - "y": 280, + "x": 920, + "y": 360, "wires": [ [ "97e582080deae888" @@ -9015,7 +9016,7 @@ "t": "set", "p": "payload", "pt": "msg", - "to": "$join([\"/home/pi/PlanktoScope/node-red-dashboard/default-configs/\", $substringAfter(msg.payload, \"PlanktoScope \"), \".config.json\"])", + "to": "$join([\"/home/pi/PlanktoScope/software/node-red-dashboard/default-configs/\", $substringAfter(msg.payload, \"PlanktoScope \"), \".config.json\"])", "tot": "jsonata" } ], @@ -9024,12 +9025,34 @@ "from": "", "to": "", "reg": false, - "x": 610, - "y": 280, + "x": 590, + "y": 360, "wires": [ [ "be756939e3b468be" ] ] + }, + { + "id": "dffeaf1bc89fcb11", + "type": "exec", + "z": "1eaf21c8.f7a21e", + "command": "sudo systemctl enable planktoscope-org.device-backend.controller-planktoscopehat.service", + "addpay": false, + "append": "", + "useSpawn": "false", + "timer": "", + "winHide": false, + "oldrc": false, + "name": "Enable hardware controller", + "x": 920, + "y": 420, + "wires": [ + [ + "97e582080deae888" + ], + [], + [] + ] } ] \ No newline at end of file From 437f67a5271a563af081f1ed41b850ab730d3f21 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Thu, 24 Apr 2025 17:00:58 +0200 Subject: [PATCH 6/7] f --- .../setup/planktoscope-app-env/node-red-frontend/install.sh | 3 --- .../python-hardware-controller/install.sh | 6 ------ 2 files changed, 9 deletions(-) diff --git a/software/distro/setup/planktoscope-app-env/node-red-frontend/install.sh b/software/distro/setup/planktoscope-app-env/node-red-frontend/install.sh index 8a370ea26..85c91c1f8 100755 --- a/software/distro/setup/planktoscope-app-env/node-red-frontend/install.sh +++ b/software/distro/setup/planktoscope-app-env/node-red-frontend/install.sh @@ -20,9 +20,6 @@ fi curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered | bash -s - --confirm-install --confirm-pi --no-init -# cp "$HOME/PlanktoScope/software/node-red-dashboard/default-configs/$default_config.config.json" \ -# "$HOME"/PlanktoScope/config.json - # Configure node-red npm --prefix "$HOME"/PlanktoScope/software/node-red-dashboard install sudo mkdir -p /etc/systemd/system/nodered.service.d diff --git a/software/distro/setup/planktoscope-app-env/python-hardware-controller/install.sh b/software/distro/setup/planktoscope-app-env/python-hardware-controller/install.sh index 7ee854a3b..cc2a722bb 100755 --- a/software/distro/setup/planktoscope-app-env/python-hardware-controller/install.sh +++ b/software/distro/setup/planktoscope-app-env/python-hardware-controller/install.sh @@ -47,9 +47,3 @@ sudo cp "$config_files_root$file" "$file" # or for the PlanktoScope HAT file="/etc/systemd/system/planktoscope-org.device-backend.controller-planktoscopehat.service" sudo cp "$config_files_root$file" "$file" - -# Select the enabled hardware controller -mkdir -p "$HOME/PlanktoScope" -# sudo systemctl enable "planktoscope-org.device-backend.controller-$hardware_type.service" -# cp "$HOME/PlanktoScope/device-backend/default-configs/$default_config.hardware.json" \ -# "$HOME/PlanktoScope/hardware.json" From 59fa7c96b498efedb69596de5df6ea85eaedaa75 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Thu, 24 Apr 2025 17:50:55 +0200 Subject: [PATCH 7/7] f --- .../planktoscopehat/flows.json | 106 ++++++++++++++---- 1 file changed, 83 insertions(+), 23 deletions(-) diff --git a/software/node-red-dashboard/planktoscopehat/flows.json b/software/node-red-dashboard/planktoscopehat/flows.json index c14c5055c..0002ddd19 100644 --- a/software/node-red-dashboard/planktoscopehat/flows.json +++ b/software/node-red-dashboard/planktoscopehat/flows.json @@ -99,6 +99,7 @@ } ], "env": [], + "meta": {}, "color": "#DDAA99" }, { @@ -156,6 +157,41 @@ "meta": {}, "color": "#DDAA99" }, + { + "id": "312b406fb4b5b22a", + "type": "group", + "z": "1eaf21c8.f7a21e", + "style": { + "stroke": "#999999", + "stroke-opacity": "1", + "fill": "none", + "fill-opacity": "1", + "label": true, + "label-position": "nw", + "color": "#a4a4a4" + }, + "nodes": [ + "427c312.fc5e65", + "8c8ed9e0b7724439", + "c00c6732b9f36adb" + ], + "x": 14, + "y": 99, + "w": 372, + "h": 142 + }, + { + "id": "48a24615eef0ab29", + "type": "junction", + "z": "1eaf21c8.f7a21e", + "x": 760, + "y": 240, + "wires": [ + [ + "56dd3f82c45717f0" + ] + ] + }, { "id": "3a6bb13f.c9703e", "type": "ui_tab", @@ -8403,27 +8439,6 @@ ] ] }, - { - "id": "be888117.5cd67", - "type": "ui_template", - "z": "1eaf21c8.f7a21e", - "group": "6be36295.0ab324", - "name": "Stepper controller type header", - "order": 3, - "width": "5", - "height": 1, - "format": "
Stepper controller type
", - "storeOutMessages": true, - "fwdInMessages": true, - "resendOnRefresh": true, - "templateScope": "local", - "className": "", - "x": 550, - "y": 80, - "wires": [ - [] - ] - }, { "id": "7534dfd9.8cf3e8", "type": "ui_template", @@ -8534,9 +8549,10 @@ "id": "427c312.fc5e65", "type": "subflow:1c24ad9c.bebec2", "z": "1eaf21c8.f7a21e", + "g": "312b406fb4b5b22a", "name": "", "env": [], - "x": 170, + "x": 90, "y": 140, "wires": [ [ @@ -8889,6 +8905,7 @@ "id": "c00c6732b9f36adb", "type": "change", "z": "1eaf21c8.f7a21e", + "g": "312b406fb4b5b22a", "name": "Get acq_instrument", "rules": [ { @@ -8911,7 +8928,7 @@ "from": "", "to": "", "reg": false, - "x": 370, + "x": 270, "y": 140, "wires": [ [ @@ -9054,5 +9071,48 @@ [], [] ] + }, + { + "id": "8c8ed9e0b7724439", + "type": "catch", + "z": "1eaf21c8.f7a21e", + "g": "312b406fb4b5b22a", + "name": "", + "scope": "group", + "uncaught": false, + "x": 190, + "y": 200, + "wires": [ + [ + "a4d44f0d0c41771e" + ] + ] + }, + { + "id": "a4d44f0d0c41771e", + "type": "change", + "z": "1eaf21c8.f7a21e", + "name": "", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "null", + "tot": "json" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 580, + "y": 240, + "wires": [ + [ + "48a24615eef0ab29" + ] + ] } ] \ No newline at end of file