From da1a66cb0dd683c3de9b18541f3a9a7a73138e3c Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Thu, 24 Apr 2025 15:23:00 +0200 Subject: [PATCH 01/19] 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 02/19] 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 03/19] 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 04/19] 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 05/19] 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 06/19] 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 07/19] 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 From 8f6459ab3179615776aaa78d4bf9fde2abfb42ab Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Wed, 18 Jun 2025 13:09:27 +0000 Subject: [PATCH 08/19] f --- os/planktoscope-app-env/setup.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/os/planktoscope-app-env/setup.sh b/os/planktoscope-app-env/setup.sh index 94ddbeb96..8e42b4c85 100755 --- a/os/planktoscope-app-env/setup.sh +++ b/os/planktoscope-app-env/setup.sh @@ -9,8 +9,6 @@ build_scripts_root=$(dirname "$(realpath "$BASH_SOURCE")") -# Get command-line args - # Set up pretty error printing red_fg=31 @@ -59,14 +57,12 @@ else panic "$description" fi -if [ "$hardware_type" = "adafruithat" ]; then - description="set up GPS and clock driver" - report_starting "$description" - if "$build_scripts_root/gps/install.sh"; then - report_finished "$description" - else - panic "$description" - fi +description="set up GPS and clock driver" +report_starting "$description" +if "$build_scripts_root/gps/install.sh"; then + report_finished "$description" +else + panic "$description" fi description="enable CPU overclocking" From f943b0d6103d0373f23725d0ce9b40bedb6731ba Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Wed, 18 Jun 2025 13:16:25 +0000 Subject: [PATCH 09/19] update doc --- documentation/docs/setup/software/config.md | 4 ---- documentation/docs/setup/software/index.md | 16 ---------------- 2 files changed, 20 deletions(-) diff --git a/documentation/docs/setup/software/config.md b/documentation/docs/setup/software/config.md index f26388f9f..62ce6ac28 100644 --- a/documentation/docs/setup/software/config.md +++ b/documentation/docs/setup/software/config.md @@ -6,10 +6,6 @@ Currently, all post-installation configuration is performed in the PlanktoScope ## Hardware Version -!!! info - - This step is only required if you are using a `planktoscopehat` SD card image; it is not needed on the `adafruithat` and `fairscope-latest` SD card images. - The first time you start the PlanktoScope, you will need to select the hardware version of your PlanktoScope for the PlanktoScope software to match the actual configuration of your PlanktoScope hardware. To do this, open the Node-RED dashboard. You should see a homepage with a drop-down menu to select your PlanktoScope hardware version. You should select the correct version for your PlanktoScope. After you select a hardware version, the PlanktoScope will show the Node-RED dashboard's normal homepage navigation buttons; you should also wait several seconds for the PlanktoScope software to restart and load the updated hardware settings. ## Next steps diff --git a/documentation/docs/setup/software/index.md b/documentation/docs/setup/software/index.md index 43e294426..7cbf12369 100644 --- a/documentation/docs/setup/software/index.md +++ b/documentation/docs/setup/software/index.md @@ -8,10 +8,6 @@ If you are building your own PlanktoScope from your own hardware kit, you will n In order to install the PlanktoScope software, you will first need to choose an SD card image file to use for installation, and then you will install that SD card image and perform some configuration of the software. -## Choosing an SD card image - -PlanktoScope SD card image files are identified with a version number as well as a hardware configuration tag - for example, the SD card image file named `planktoscope-v2024.0.0+planktoscopehat.img.xz` is for v2020.0.0 of the PlanktoScope OS, configured to work with versions of the PlanktoScope hardware based on the custom PlanktoScope HAT (rather than the Adafruit Stepper Motor HAT). Thus, you will need to choose both a version number (e.g. v2023.9.0) and a hardware configuration (e.g. `planktoscopehat`). - ### PlanktoScope OS versions Because the PlanktoScope project aims to release occasional updates to the PlanktoScope OS in order to fix various software problems and make various improvements to the software, multiple versions of the PlanktoScope OS exist, and new versions will be released in the future. In general, each version of the PlanktoScope OS will be compatible with all previous officially-released versions of the PlanktoScope hardware (which are all versions listed in the [hardware changelog](../../reference/hardware/changelog.md) without the description of a "prototype"). The PlanktoScope documentation describes the latest stable release of the PlanktoScope OS, and you should always use the latest stable release on your PlanktoScopes. @@ -26,18 +22,6 @@ PlanktoScope OS versions are independent of hardware versions, and (starting in - v2024.1.0: this version will be the second release of the PlanktoScope OS in 2024. -### Hardware configurations - -Currently, each version of the PlanktoScope OS is provided as three SD card images which support the two different types of hardware configurations supported by the PlanktoScope software: - -- `adafruithat`: this configuration of the PlanktoScope OS is compatible with v2.1 of the PlanktoScope hardware, which uses the [Adafruit Stepper Motor HAT](https://learn.adafruit.com/adafruit-dc-and-stepper-motor-hat-for-raspberry-pi/overview). - -- `planktoscopehat`: this configuration of the PlanktoScope OS is compatible with all versions of the PlanktoScope hardware starting with hardware v2.3; those hardware versions use the [PlanktoScope HAT](../../reference/hardware/hat.md) instead of the Adafruit Stepper Motor HAT. This configuration requires you to select the hardware version of your PlanktoScope in the [post-installation configuration](config.md) process. - -- `fairscope-latest`: this configuration of the PlanktoScope OS is identical to the `planktoscopehat` configuration, except that this one sets the default settings to be for hardware version v2.6 so that you won't need to select the hardware version of your PlanktoScope in the post-installation configuration process. - -If you have a PlanktoScope from FairScope, you should probably use the `fairscope-latest` SD card image; otherwise, if you have a non-FairScope PlanktoScope with hardware version v2.3 or later, you should probably use the `planktoscopehat` SD card image; otherwise, if you have a v2.1 PlanktoScope, you should probably use an `adafruithat` SD card image. - ## Installation After you have chosen a PlanktoScope OS SD card image for the desired OS version and hardware configuration, you should follow our [standard installation](standard-install.md) guide in order to install that SD card image into your PlanktoScope. From a51e92efd879739250019f1ecc2b0da79b8d17c5 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Wed, 18 Jun 2025 13:37:57 +0000 Subject: [PATCH 10/19] f --- .../python-hardware-controller/install.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/os/planktoscope-app-env/python-hardware-controller/install.sh b/os/planktoscope-app-env/python-hardware-controller/install.sh index 08698e285..6bdad71a5 100755 --- a/os/planktoscope-app-env/python-hardware-controller/install.sh +++ b/os/planktoscope-app-env/python-hardware-controller/install.sh @@ -27,8 +27,3 @@ poetry --directory "$HOME/PlanktoScope/controller" install \ file="/etc/systemd/system/planktoscope-org.controller.service" sudo cp "$config_files_root$file" "$file" sudo systemctl enable "planktoscope-org.controller.service" - -# Select the enabled hardware controller -mkdir -p "$HOME/PlanktoScope" -cp "$HOME/PlanktoScope/default-configs/$default_config.hardware.json" \ - "$HOME/PlanktoScope/hardware.json" From 41c159d905204e40a4590cfeff3ada996916dbfa Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Wed, 18 Jun 2025 14:02:06 +0000 Subject: [PATCH 11/19] f --- .github/workflows/build-os.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-os.yml b/.github/workflows/build-os.yml index a5deb118a..40568d116 100644 --- a/.github/workflows/build-os.yml +++ b/.github/workflows/build-os.yml @@ -326,9 +326,10 @@ jobs: else version="$(printf "%.7s" "${{ github.sha }}")" fi + variant="" if [[ "${{ inputs.base_release_name }}" != "bookworm" ]]; then - variant="$variant.${{ inputs.base_release_name }}" + variant="${{ inputs.base_release_name }}" fi if [[ "${{ inputs.arch }}" != "arm64" ]]; then variant="$variant.${{ inputs.arch }}" @@ -338,7 +339,10 @@ jobs: fi # Assemble the image name - output_name="${{ inputs.name }}-$version+$variant" + output_name="${{ inputs.name }}-$version" + if [[ $variant != "" ]]; then + output_name="$output_name.$variant" + fi echo "OUTPUT_IMAGE_NAME=$output_name" >> $GITHUB_ENV - name: Shrink the OS image From 447ca77caf92f435c899c937d02df17b65642be1 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Wed, 18 Jun 2025 15:58:13 +0000 Subject: [PATCH 12/19] f --- node-red/projects/adafruithat/flows.json | 2577 +++++++++--------- node-red/projects/planktoscopehat/flows.json | 29 +- 2 files changed, 1333 insertions(+), 1273 deletions(-) diff --git a/node-red/projects/adafruithat/flows.json b/node-red/projects/adafruithat/flows.json index b14a8e021..196cf2b65 100644 --- a/node-red/projects/adafruithat/flows.json +++ b/node-red/projects/adafruithat/flows.json @@ -124,7 +124,7 @@ "color": "#DDAA99" }, { - "id": "e6665421f66ea4c8", + "id": "b7861ce703215a01", "type": "subflow", "name": "Load hardware config", "info": "", @@ -135,7 +135,7 @@ "y": 40, "wires": [ { - "id": "48ceeda454438cb7" + "id": "0f16258953fae292" } ] } @@ -146,7 +146,7 @@ "y": 40, "wires": [ { - "id": "2b1a67ac127f3fe7", + "id": "d0fbcd200cd09981", "port": 0 } ] @@ -156,6 +156,29 @@ "meta": {}, "color": "#DDAA99" }, + { + "id": "dda6605ca2508d77", + "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", + "c00c6732b9f36adb", + "f952c1cb7e590dc4" + ], + "x": 34, + "y": 39, + "w": 392, + "h": 142 + }, { "id": "3a6bb13f.c9703e", "type": "ui_tab", @@ -357,7 +380,8 @@ "order": 1, "disp": false, "width": "24", - "collapse": false + "collapse": false, + "className": "" }, { "id": "737ec584.2eea2c", @@ -373,10 +397,11 @@ "type": "ui_group", "name": "Group 1", "tab": "3a6bb13f.c9703e", - "order": 1, + "order": 2, "disp": false, "width": "4", - "collapse": false + "collapse": false, + "className": "" }, { "id": "3e1ba03d.f01d8", @@ -393,7 +418,7 @@ "type": "ui_group", "name": "Group 2", "tab": "3a6bb13f.c9703e", - "order": 2, + "order": 3, "disp": false, "width": "4", "collapse": false @@ -403,7 +428,7 @@ "type": "ui_group", "name": "Group 3", "tab": "3a6bb13f.c9703e", - "order": 3, + "order": 4, "disp": false, "width": "4", "collapse": false @@ -413,7 +438,7 @@ "type": "ui_group", "name": "Group 4", "tab": "3a6bb13f.c9703e", - "order": 4, + "order": 5, "disp": false, "width": "4", "collapse": false @@ -423,7 +448,7 @@ "type": "ui_group", "name": "Group 5", "tab": "3a6bb13f.c9703e", - "order": 5, + "order": 6, "disp": false, "width": "4", "collapse": false @@ -433,7 +458,7 @@ "type": "ui_group", "name": "Group 6", "tab": "3a6bb13f.c9703e", - "order": 6, + "order": 7, "disp": false, "width": "4", "collapse": false @@ -488,16 +513,6 @@ "width": 4, "collapse": false }, - { - "id": "404c301a.19c4e", - "type": "ui_group", - "name": "Fraction size", - "tab": "c9194f02.9d5e9", - "order": 2, - "disp": true, - "width": "10", - "collapse": false - }, { "id": "4322c187.e73e5", "type": "ui_group", @@ -538,23 +553,18 @@ "autoConnect": true, "usetls": false, "compatmode": false, - "protocolVersion": "4", + "protocolVersion": 4, "keepalive": "60", "cleansession": true, "birthTopic": "", "birthQos": "0", "birthPayload": "", - "birthMsg": {}, "closeTopic": "", "closeQos": "0", "closePayload": "", - "closeMsg": {}, "willTopic": "", "willQos": "0", - "willPayload": "", - "willMsg": {}, - "userProps": "", - "sessionExpiry": "" + "willPayload": "" }, { "id": "abeb6dad.635a2", @@ -649,7 +659,7 @@ "type": "ui_group", "name": "Shutdown", "tab": "3a6bb13f.c9703e", - "order": 7, + "order": 8, "disp": true, "width": 4, "collapse": false @@ -658,9 +668,9 @@ "id": "3dfd8a69.69ed56", "type": "ui_spacer", "name": "spacer", - "group": "3e1ba03d.f01d8", - "order": 5, - "width": 10, + "group": "f3ca28ef.4df0a8", + "order": 3, + "width": 4, "height": 1 }, { @@ -789,12 +799,24 @@ { "id": "6c31ad948a9d62fd", "type": "ui_spacer", + "z": "b771c342.49603", "name": "spacer", - "group": "4248342d.e55fac", - "order": 2, - "width": 1, + "group": "3e1ba03d.f01d8", + "order": 5, + "width": 10, "height": 1 }, + { + "id": "0035a03e1490cd8c", + "type": "ui_group", + "name": "Setup", + "tab": "3a6bb13f.c9703e", + "order": 1, + "disp": true, + "width": "8", + "collapse": false, + "className": "" + }, { "id": "833bc5bb.217ba8", "type": "ui_group", @@ -827,7 +849,8 @@ "chunk": false, "sendError": false, "encoding": "none", - "x": 560, + "allProps": false, + "x": 500, "y": 60, "wires": [ [ @@ -844,7 +867,7 @@ "property": "payload", "action": "", "pretty": false, - "x": 730, + "x": 750, "y": 60, "wires": [ [ @@ -858,11 +881,12 @@ "z": "1c24ad9c.bebec2", "name": "", "filename": "/home/pi/PlanktoScope/config.json", + "filenameType": "str", "appendNewline": true, "createDir": true, "overwriteFile": "true", "encoding": "none", - "x": 990, + "x": 1070, "y": 160, "wires": [ [] @@ -891,9 +915,11 @@ "name": "Global Set", "func": "global.set(\"config_keys\", Object.keys(msg.payload));\n\nfor (const key in msg.payload) {\n global.set(key, msg.payload[key]);\n}\n\nreturn msg;", "outputs": 1, + "timeout": "", "noerr": 0, "initialize": "", "finalize": "", + "libs": [], "x": 910, "y": 60, "wires": [ @@ -1010,9 +1036,9 @@ ] }, { - "id": "48ceeda454438cb7", + "id": "0f16258953fae292", "type": "file in", - "z": "e6665421f66ea4c8", + "z": "b7861ce703215a01", "name": "", "filename": "/home/pi/PlanktoScope/hardware.json", "filenameType": "str", @@ -1020,19 +1046,20 @@ "chunk": false, "sendError": false, "encoding": "none", + "allProps": false, "x": 250, "y": 40, "wires": [ [ - "853c938a270fd85e" + "81c516291ab19acd" ] ], "info": "# PlanktoScope Help\nThis Node will read the content of the file named **config.txt** containing all the input placeholders.\n" }, { - "id": "853c938a270fd85e", + "id": "81c516291ab19acd", "type": "json", - "z": "e6665421f66ea4c8", + "z": "b7861ce703215a01", "name": "Parse JSON", "property": "payload", "action": "", @@ -1041,14 +1068,14 @@ "y": 40, "wires": [ [ - "2b1a67ac127f3fe7" + "d0fbcd200cd09981" ] ] }, { - "id": "2b1a67ac127f3fe7", + "id": "d0fbcd200cd09981", "type": "change", - "z": "e6665421f66ea4c8", + "z": "b7861ce703215a01", "name": "", "rules": [ { @@ -1070,16 +1097,6 @@ [] ] }, - { - "id": "2f30a6ee99587899", - "type": "comment", - "z": "eaae323a.31b3", - "name": "LICENSE", - "info": "Copyright 2022 Thibaut Pollina and Romain Bazile\nLicensed under GPL v3.0", - "x": 140, - "y": 600, - "wires": [] - }, { "id": "4e78af2d.90be7", "type": "ui_ui_control", @@ -1106,6 +1123,7 @@ "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", + "className": "", "x": 130, "y": 100, "wires": [ @@ -1128,6 +1146,7 @@ "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", + "className": "", "x": 130, "y": 140, "wires": [ @@ -1150,6 +1169,7 @@ "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", + "className": "", "x": 140, "y": 180, "wires": [ @@ -1172,6 +1192,7 @@ "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", + "className": "", "x": 160, "y": 220, "wires": [ @@ -1194,6 +1215,7 @@ "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", + "className": "", "x": 130, "y": 260, "wires": [ @@ -1216,6 +1238,7 @@ "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", + "className": "", "x": 160, "y": 60, "wires": [ @@ -1421,7 +1444,7 @@ "raw": false, "topic": "Turning off now!", "name": "Shutdown message", - "x": 570, + "x": 580, "y": 540, "wires": [ [] @@ -1446,7 +1469,7 @@ "from": "", "to": "", "reg": false, - "x": 300, + "x": 310, "y": 500, "wires": [ [ @@ -1505,7 +1528,7 @@ "from": "", "to": "", "reg": false, - "x": 330, + "x": 340, "y": 540, "wires": [ [ @@ -1514,152 +1537,357 @@ ] }, { - "id": "4557d689.a4fa88", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "sample_ship", - "label": "Name of the ship", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": "300", - "topic": "sample_ship", - "sendOnBlur": true, - "className": "", - "topicType": "str", - "x": 670, - "y": 80, + "id": "57db4f6279b5afe0", + "type": "comment", + "z": "eaae323a.31b3", + "name": "LICENSE", + "info": "Copyright 2022 Thibaut Pollina and Romain Bazile\nLicensed under GPL v3.0", + "x": 140, + "y": 600, + "wires": [] + }, + { + "id": "6af85f0e0fc21b11", + "type": "ui_ui_control", + "z": "eaae323a.31b3", + "name": "", + "events": "all", + "x": 700, + "y": 720, "wires": [ - [ - "9f501f49.45645" - ] + [] ] }, { - "id": "fcfc31ae.af3af", + "id": "382f8fcc81f904f1", "type": "ui_dropdown", - "z": "b771c342.49603", - "name": "sample_sampling_gear", - "label": "Sampling gear*", + "z": "eaae323a.31b3", + "name": "", + "label": "Hardware version", "tooltip": "", - "place": "Choose from list", - "group": "3e1ba03d.f01d8", - "order": 6, + "place": "Select option", + "group": "0035a03e1490cd8c", + "order": 2, "width": 0, "height": 0, - "passthru": true, + "passthru": false, "multiple": false, "options": [ { - "label": "High Speed Net", - "value": "net_hsn", - "type": "str" - }, - { - "label": "Tara Decknet", - "value": "net_decknet", - "type": "str" - }, - { - "label": "Plankton net", - "value": "net", - "type": "str" - }, - { - "label": "Niskin bottle 12L", - "value": "niskin_12L", - "type": "str" - }, - { - "label": "Niskin bottle 24L", - "value": "niskin_24L", - "type": "str" - }, - { - "label": "Pass Hull", - "value": "pass_hull", + "label": "", + "value": "PlanktoScope v2.3", "type": "str" }, { - "label": "Single location (with net or bucket)", - "value": "single_location", + "label": "", + "value": "PlanktoScope v2.5", "type": "str" }, { - "label": "Lab culture", - "value": "culture", + "label": "", + "value": "PlanktoScope v2.6", "type": "str" }, { - "label": "Test", - "value": "test", + "label": "", + "value": "PlanktoScope v3.0", "type": "str" } ], "payload": "", - "topic": "sample_sampling_gear", + "topic": "acq_instrument", "topicType": "str", "className": "", - "x": 630, - "y": 200, + "x": 490, + "y": 640, "wires": [ [ - "9f501f49.45645", - "46eb1bf8.3dc5f4", - "3ac7b631f5d8ef90" + "9f34e4a2f33c4022" ] ] }, { - "id": "82c5fc77.59c97", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "sample_operator", - "label": "Name of the operator*", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 3, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": "300", - "topic": "sample_operator", - "sendOnBlur": true, - "className": "", - "topicType": "str", - "x": 650, - "y": 160, + "id": "9f34e4a2f33c4022", + "type": "link out", + "z": "eaae323a.31b3", + "name": "Set hardware version", + "mode": "link", + "links": [ + "cb9009e8a49e93cc" + ], + "x": 655, + "y": 640, + "wires": [] + }, + { + "id": "e954204b947a0c70", + "type": "switch", + "z": "eaae323a.31b3", + "name": "", + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "null" + }, + { + "t": "else" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 290, + "y": 680, "wires": [ [ - "9f501f49.45645" + "382f8fcc81f904f1", + "e3736dd7be4b7522" + ], + [ + "f80babd43aa7cce4" ] ] }, { - "id": "9c882b37.fde668", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "sample_project", - "label": "Name of the project*", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": "300", - "topic": "sample_project", - "sendOnBlur": true, - "className": "", - "topicType": "str", - "x": 660, - "y": 40, + "id": "e3736dd7be4b7522", + "type": "change", + "z": "eaae323a.31b3", + "name": "Show setup panel", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "{\"group\":{\"show\":[\"Home_Setup\"],\"hide\":[\"Home_Group_1\",\"Home_Group_2\",\"Home_Group_3\",\"Home_Group_4\",\"Home_Group_5\",\"Home_Group_6\"]}}", + "tot": "json" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 490, + "y": 680, + "wires": [ + [ + "6af85f0e0fc21b11" + ] + ] + }, + { + "id": "f80babd43aa7cce4", + "type": "change", + "z": "eaae323a.31b3", + "name": "Show home buttons", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "{\"group\":{\"hide\":[\"Home_Setup\"],\"show\":[\"Home_Group_1\",\"Home_Group_2\",\"Home_Group_3\",\"Home_Group_4\",\"Home_Group_5\",\"Home_Group_6\"]}}", + "tot": "json" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 500, + "y": 720, + "wires": [ + [ + "6af85f0e0fc21b11" + ] + ] + }, + { + "id": "438439b4ae62444c", + "type": "ui_template", + "z": "eaae323a.31b3", + "group": "0035a03e1490cd8c", + "name": "Information", + "order": 1, + "width": "0", + "height": "0", + "format": "
\n

\n To start using your PlanktoScope, please indicate the version of your PlanktoScope hardware:\n

\n
\n", + "storeOutMessages": true, + "fwdInMessages": true, + "resendOnRefresh": true, + "templateScope": "local", + "className": "", + "x": 710, + "y": 680, + "wires": [ + [] + ] + }, + { + "id": "a2f2a4c7cbae4446", + "type": "link in", + "z": "eaae323a.31b3", + "name": "Load hardware version", + "links": [ + "3973b999ee7b3b1d", + "56dd3f82c45717f0" + ], + "x": 185, + "y": 680, + "wires": [ + [ + "e954204b947a0c70" + ] + ] + }, + { + "id": "4557d689.a4fa88", + "type": "ui_text_input", + "z": "b771c342.49603", + "name": "sample_ship", + "label": "Name of the ship", + "tooltip": "", + "group": "3e1ba03d.f01d8", + "order": 2, + "width": 0, + "height": 0, + "passthru": true, + "mode": "text", + "delay": "300", + "topic": "sample_ship", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 670, + "y": 80, + "wires": [ + [ + "9f501f49.45645" + ] + ] + }, + { + "id": "fcfc31ae.af3af", + "type": "ui_dropdown", + "z": "b771c342.49603", + "name": "sample_sampling_gear", + "label": "Sampling gear*", + "tooltip": "", + "place": "Choose from list", + "group": "3e1ba03d.f01d8", + "order": 6, + "width": 0, + "height": 0, + "passthru": true, + "multiple": false, + "options": [ + { + "label": "High Speed Net", + "value": "net_hsn", + "type": "str" + }, + { + "label": "Tara Decknet", + "value": "net_decknet", + "type": "str" + }, + { + "label": "Plankton net", + "value": "net", + "type": "str" + }, + { + "label": "Niskin bottle 12L", + "value": "niskin_12L", + "type": "str" + }, + { + "label": "Niskin bottle 24L", + "value": "niskin_24L", + "type": "str" + }, + { + "label": "Pass Hull", + "value": "pass_hull", + "type": "str" + }, + { + "label": "Single location (with net or bucket)", + "value": "single_location", + "type": "str" + }, + { + "label": "Lab culture", + "value": "culture", + "type": "str" + }, + { + "label": "Test", + "value": "test", + "type": "str" + } + ], + "payload": "", + "topic": "sample_sampling_gear", + "topicType": "str", + "className": "", + "x": 630, + "y": 200, + "wires": [ + [ + "9f501f49.45645", + "46eb1bf8.3dc5f4", + "3ac7b631f5d8ef90" + ] + ] + }, + { + "id": "82c5fc77.59c97", + "type": "ui_text_input", + "z": "b771c342.49603", + "name": "sample_operator", + "label": "Name of the operator*", + "tooltip": "", + "group": "3e1ba03d.f01d8", + "order": 3, + "width": 0, + "height": 0, + "passthru": true, + "mode": "text", + "delay": "300", + "topic": "sample_operator", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 650, + "y": 160, + "wires": [ + [ + "9f501f49.45645" + ] + ] + }, + { + "id": "9c882b37.fde668", + "type": "ui_text_input", + "z": "b771c342.49603", + "name": "sample_project", + "label": "Name of the project*", + "tooltip": "", + "group": "3e1ba03d.f01d8", + "order": 1, + "width": 0, + "height": 0, + "passthru": true, + "mode": "text", + "delay": "300", + "topic": "sample_project", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 660, + "y": 40, "wires": [ [ "9f501f49.45645" @@ -2153,7 +2381,7 @@ "wires": [ [ "14658615.47c862", - "3318a1aaa70fc2ee" + "a9fb1f4b83fc25a7" ] ] }, @@ -2215,7 +2443,7 @@ "wires": [ [ "14658615.47c862", - "cc67c97f55a340d3" + "ad54b89540460d27" ] ] }, @@ -2276,7 +2504,7 @@ "wires": [ [ "14658615.47c862", - "9c8f370d124a55e4" + "c21bf0244e67e40a" ] ] }, @@ -2651,6 +2879,8 @@ "mode": "number", "delay": "300", "topic": "acq_minimum_mesh", + "sendOnBlur": true, + "className": "", "topicType": "str", "x": 640, "y": 360, @@ -2675,6 +2905,8 @@ "mode": "number", "delay": "300", "topic": "acq_maximum_mesh", + "sendOnBlur": true, + "className": "", "topicType": "str", "x": 640, "y": 400, @@ -2752,12 +2984,12 @@ "wires": [ [ "14658615.47c862", - "38616e738f4f615b" + "f8044c35996322e6" ] ] }, { - "id": "3318a1aaa70fc2ee", + "id": "a9fb1f4b83fc25a7", "type": "change", "z": "b771c342.49603", "name": "Repopulate input fields", @@ -2784,7 +3016,7 @@ ] }, { - "id": "cc67c97f55a340d3", + "id": "ad54b89540460d27", "type": "change", "z": "b771c342.49603", "name": "Repopulate input fields", @@ -2811,7 +3043,7 @@ ] }, { - "id": "9c8f370d124a55e4", + "id": "c21bf0244e67e40a", "type": "change", "z": "b771c342.49603", "name": "Repopulate input fields", @@ -2838,7 +3070,7 @@ ] }, { - "id": "38616e738f4f615b", + "id": "f8044c35996322e6", "type": "change", "z": "b771c342.49603", "name": "Repopulate input fields", @@ -2865,7 +3097,7 @@ ] }, { - "id": "577be9c22c739ca0", + "id": "8b48a02877b7b6d6", "type": "inject", "z": "b771c342.49603", "name": "", @@ -2932,7 +3164,7 @@ "z": "bccd1f23.87219", "name": "down", "group": "fbd92986.1028c8", - "order": 6, + "order": 8, "width": 4, "height": 1, "passthru": true, @@ -2958,7 +3190,7 @@ "z": "bccd1f23.87219", "name": "up", "group": "fbd92986.1028c8", - "order": 3, + "order": 1, "width": 4, "height": 1, "passthru": false, @@ -3198,21 +3430,6 @@ ] ] }, - { - "id": "cbb8afed.0a026", - "type": "rpi-gpio out", - "z": "bccd1f23.87219", - "name": "LED Output", - "pin": "21", - "set": true, - "level": "0", - "freq": "", - "out": "out", - "bcm": true, - "x": 550, - "y": 120, - "wires": [] - }, { "id": "3cb96380.e575ec", "type": "function", @@ -3299,7 +3516,7 @@ "type": "function", "z": "bccd1f23.87219", "name": "focus", - "func": "var distance = global.get(\"focus_distance\");\n\nif (distance === undefined || distance === \"\" || distance === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Distance\";\n return [null, msg]\n}else {\n distance = global.get(\"focus_distance\");\n // msg.payload is UP or DOWN here\n msg.payload={\"action\":\"move\", \n \"direction\":msg.payload,\n \"distance\":(distance/1000)};\n}\nreturn [msg, null];", + "func": "var distance = global.get(\"focus_distance\");\nvar speed = global.get(\"focus_speed\");\n\nif (distance === undefined || distance === \"\" || distance === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Distance\";\n return [null, msg]\n}\nif (speed === undefined || speed === \"\" || speed === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Speed\";\n return [null, msg]\n}\n// msg.payload is UP or DOWN here\nmsg.payload={\"action\":\"move\", \n \"direction\":msg.payload,\n \"distance\":(distance/1000),\n \"speed\": (speed/1000)\n};\nreturn [msg, null];", "outputs": 2, "noerr": 0, "initialize": "", @@ -3367,7 +3584,7 @@ "z": "bccd1f23.87219", "name": "", "group": "fbd92986.1028c8", - "order": 1, + "order": 2, "width": 4, "height": 1, "passthru": false, @@ -3394,7 +3611,7 @@ "z": "bccd1f23.87219", "name": "", "group": "fbd92986.1028c8", - "order": 8, + "order": 7, "width": 4, "height": 1, "passthru": false, @@ -3441,10 +3658,10 @@ ] }, { - "id": "9a1d0e7c.2d5a1", + "id": "f782a471.447748", "type": "inject", "z": "bccd1f23.87219", - "name": "Default: OFF", + "name": "Default: 2mL/min", "props": [ { "p": "payload" @@ -3453,48 +3670,23 @@ "repeat": "", "crontab": "", "once": true, - "onceDelay": 0.1, + "onceDelay": "0.5", "topic": "", - "payload": "off", - "payloadType": "str", + "payload": "2", + "payloadType": "num", "x": 130, - "y": 120, + "y": 380, "wires": [ [ - "f0775525.cf806" + "cb2d5174.cfe9f" ] ] }, { - "id": "f782a471.447748", + "id": "73b8252a.5ca754", "type": "inject", "z": "bccd1f23.87219", - "name": "Default: 2mL/min", - "props": [ - { - "p": "payload" - } - ], - "repeat": "", - "crontab": "", - "once": true, - "onceDelay": "0.5", - "topic": "", - "payload": "2", - "payloadType": "num", - "x": 130, - "y": 380, - "wires": [ - [ - "cb2d5174.cfe9f" - ] - ] - }, - { - "id": "73b8252a.5ca754", - "type": "inject", - "z": "bccd1f23.87219", - "name": "Default: 2mL", + "name": "Default: 2mL", "props": [ { "p": "payload" @@ -3600,7 +3792,7 @@ "z": "bccd1f23.87219", "name": "", "group": "fbd92986.1028c8", - "order": 2, + "order": 3, "width": 4, "height": 1, "passthru": false, @@ -3627,7 +3819,7 @@ "z": "bccd1f23.87219", "name": "", "group": "fbd92986.1028c8", - "order": 7, + "order": 6, "width": 4, "height": 1, "passthru": false, @@ -3648,43 +3840,6 @@ ] ] }, - { - "id": "f0775525.cf806", - "type": "ui_multistate_switch", - "z": "bccd1f23.87219", - "name": "light_control", - "group": "4248342d.e55fac", - "order": 1, - "width": 5, - "height": 1, - "label": "Light ", - "stateField": "payload", - "enableField": "enable", - "rounded": true, - "useThemeColors": true, - "hideSelectedLabel": false, - "options": [ - { - "label": "Off", - "value": "0", - "valueType": "num", - "color": "#009933" - }, - { - "label": "On", - "value": "1", - "valueType": "num", - "color": "#999999" - } - ], - "x": 350, - "y": 120, - "wires": [ - [ - "cbb8afed.0a026" - ] - ] - }, { "id": "8ea9dc9a.c7d87", "type": "function", @@ -4096,7 +4251,7 @@ "y": 840, "wires": [ [ - "37f412d1454deb64" + "f62c3241bd753f24" ] ] }, @@ -4203,32 +4358,6 @@ ] ] }, - { - "id": "d5415af6.e06cc", - "type": "ui_text_input", - "z": "bccd1f23.87219", - "name": "WB Red input", - "label": "WB: Red", - "tooltip": "From 0.0 to 32.0", - "group": "8c38a81e.9897a8", - "order": 6, - "width": 4, - "height": 1, - "passthru": true, - "mode": "number", - "delay": "0", - "topic": "red", - "sendOnBlur": true, - "className": "", - "topicType": "str", - "x": 580, - "y": 1040, - "wires": [ - [ - "f7a7398fd6ce4a4f" - ] - ] - }, { "id": "dba68c1f.e3144", "type": "ui_text_input", @@ -4251,13 +4380,13 @@ "y": 1080, "wires": [ [ - "df8a7667c9d133b1" + "3ece53716a02e09e" ] ] }, { - "id": "d91550e8b15ed3b8", - "type": "subflow:e6665421f66ea4c8", + "id": "33ef60a6a80aa3a7", + "type": "subflow:b7861ce703215a01", "z": "bccd1f23.87219", "name": "", "x": 160, @@ -4272,43 +4401,69 @@ ] }, { - "id": "04920f50bbbf6a2a", + "id": "a3d034643b56796f", + "type": "inject", + "z": "bccd1f23.87219", + "name": "Once", + "props": [], + "repeat": "", + "crontab": "", + "once": true, + "onceDelay": 0.1, + "topic": "", + "x": 70, + "y": 1080, + "wires": [ + [ + "33ef60a6a80aa3a7" + ] + ] + }, + { + "id": "5984b086eddc9311", "type": "link in", "z": "bccd1f23.87219", "name": "Load hardware config", "links": [ - "e4ead350b3d07578", - "4a1f303f0b6f7f42" + "3973b999ee7b3b1d", + "5d3df1564b9af89c" ], "x": 25, "y": 1000, "wires": [ [ - "d91550e8b15ed3b8" + "33ef60a6a80aa3a7" ] ] }, { - "id": "7386eaf7ca9d8bfa", - "type": "inject", + "id": "d5415af6.e06cc", + "type": "ui_text_input", "z": "bccd1f23.87219", - "name": "Once", - "props": [], - "repeat": "", - "crontab": "", - "once": true, - "onceDelay": 0.1, - "topic": "", - "x": 50, - "y": 1080, + "name": "WB Red input", + "label": "WB: Red", + "tooltip": "From 0.0 to 32.0", + "group": "8c38a81e.9897a8", + "order": 6, + "width": 4, + "height": 1, + "passthru": true, + "mode": "number", + "delay": "0", + "topic": "red", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 580, + "y": 1040, "wires": [ [ - "d91550e8b15ed3b8" + "01c2b633558b0b02" ] ] }, { - "id": "f7a7398fd6ce4a4f", + "id": "01c2b633558b0b02", "type": "switch", "z": "bccd1f23.87219", "name": "Validate", @@ -4337,13 +4492,13 @@ "5e147425.7666ec" ], [ - "64b05eea4c5469be", - "4a1f303f0b6f7f42" + "cbfaf049d92be90e", + "5d3df1564b9af89c" ] ] }, { - "id": "df8a7667c9d133b1", + "id": "3ece53716a02e09e", "type": "switch", "z": "bccd1f23.87219", "name": "Validate", @@ -4372,13 +4527,13 @@ "5e147425.7666ec" ], [ - "64b05eea4c5469be", - "4a1f303f0b6f7f42" + "cbfaf049d92be90e", + "5d3df1564b9af89c" ] ] }, { - "id": "64b05eea4c5469be", + "id": "cbfaf049d92be90e", "type": "ui_toast", "z": "bccd1f23.87219", "position": "top right", @@ -4397,20 +4552,20 @@ "wires": [] }, { - "id": "4a1f303f0b6f7f42", + "id": "5d3df1564b9af89c", "type": "link out", "z": "bccd1f23.87219", "name": "Reload hardware config", "mode": "link", "links": [ - "04920f50bbbf6a2a" + "5984b086eddc9311" ], "x": 915, "y": 1140, "wires": [] }, { - "id": "37f412d1454deb64", + "id": "f62c3241bd753f24", "type": "ui_slider", "z": "bccd1f23.87219", "name": "ISO selector", @@ -4425,7 +4580,7 @@ "topic": "topic", "topicType": "msg", "min": "50", - "max": "800", + "max": "650", "step": "50", "className": "", "x": 570, @@ -4437,101 +4592,244 @@ ] }, { - "id": "f59a2f0d.5e9af", - "type": "ui_numeric", - "z": "baa1e3d9.cb29d", - "name": "acq_minimum_mesh", - "label": "Min fraction size (μm)", - "tooltip": "", - "group": "404c301a.19c4e", - "order": 1, - "width": 5, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "acq_minimum_mesh", - "format": "{{value}}", - "min": 0, - "max": "300", - "step": "10", - "x": 640, - "y": 160, + "id": "bf696a1bfcf40cc9", + "type": "function", + "z": "bccd1f23.87219", + "name": "Get led status", + "func": "msg.topic = \"light\"\nmsg.payload = {\"action\":\"status\"}\n\nreturn msg;", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1680, + "y": 100, "wires": [ [ - "fb887036.12429" + "853fdbc93d99656b" ] ] }, { - "id": "6008a8bb.259f08", - "type": "ui_numeric", - "z": "baa1e3d9.cb29d", - "name": "acq_maximum_mesh", - "label": "Max fraction size (μm)", - "tooltip": "", - "group": "404c301a.19c4e", - "order": 2, - "width": 5, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "acq_maximum_mesh", - "format": "{{value}}", - "min": "200", - "max": "2000", - "step": "100", - "x": 640, - "y": 200, + "id": "853fdbc93d99656b", + "type": "mqtt out", + "z": "bccd1f23.87219", + "name": "", + "topic": "", + "qos": "", + "retain": "", + "respTopic": "", + "contentType": "", + "userProps": "", + "correl": "", + "expiry": "", + "broker": "8dc3722c.06efa8", + "x": 1850, + "y": 100, + "wires": [] + }, + { + "id": "73d75d56a5860c40", + "type": "inject", + "z": "bccd1f23.87219", + "name": "Trigger", + "props": [], + "repeat": "", + "crontab": "", + "once": true, + "onceDelay": "0", + "topic": "", + "x": 1500, + "y": 100, "wires": [ [ - "fb887036.12429" + "bf696a1bfcf40cc9" ] ] }, { - "id": "6b34c456.83178c", - "type": "ui_text_input", - "z": "baa1e3d9.cb29d", - "name": "acq_id", - "label": "Acquisition unique ID*", - "tooltip": "", - "group": "4322c187.e73e5", - "order": 1, - "width": 5, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "acq_id", - "sendOnBlur": true, - "className": "", - "topicType": "str", - "x": 690, - "y": 240, + "id": "310ee70930b17fae", + "type": "mqtt in", + "z": "bccd1f23.87219", + "name": "", + "topic": "status/light", + "qos": "0", + "datatype": "json", + "broker": "8dc3722c.06efa8", + "nl": false, + "rap": false, + "inputs": 0, + "x": 1480, + "y": 180, "wires": [ [ - "fb887036.12429" + "fcaf6b9230805de2" ] ] }, { - "id": "cc0ca68b.4263a8", - "type": "ui_dropdown", - "z": "baa1e3d9.cb29d", - "name": "acq_celltype", - "label": "Flowcell thickness*", - "tooltip": "", - "place": "Select option", - "group": "4322c187.e73e5", - "order": 6, - "width": 5, + "id": "fcaf6b9230805de2", + "type": "json", + "z": "bccd1f23.87219", + "name": "", + "property": "payload", + "action": "obj", + "pretty": true, + "x": 1630, + "y": 180, + "wires": [ + [ + "1e021d2306c69193" + ] + ] + }, + { + "id": "1e9ddd41b0fa067d", + "type": "ui_multistate_switch", + "z": "bccd1f23.87219", + "name": "light_control", + "group": "4248342d.e55fac", + "order": 1, + "width": 6, "height": 1, - "passthru": true, - "multiple": false, - "options": [ - { - "label": "200 μm µ-Slide I Luer", - "value": 200, + "label": "Light ", + "stateField": "payload", + "enableField": "enable", + "passthroughField": "passthrough", + "inputMsgField": "inputmsg", + "rounded": true, + "useThemeColors": true, + "hideSelectedLabel": false, + "multilineLabel": false, + "passThrough": "never", + "inputMsg": "all", + "userInput": "enabled_show", + "options": [ + { + "label": "Off", + "value": "off", + "valueType": "str", + "color": "#009933" + }, + { + "label": "On", + "value": "on", + "valueType": "str", + "color": "#999999" + } + ], + "topic": "", + "x": 1510, + "y": 260, + "wires": [ + [ + "fa4e2b4c606ec8a8" + ] + ] + }, + { + "id": "fa4e2b4c606ec8a8", + "type": "function", + "z": "bccd1f23.87219", + "name": "Prepare message", + "func": "msg.topic = \"light\"\nmsg.payload = {\"action\": msg.payload}\n\nreturn msg;", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1710, + "y": 260, + "wires": [ + [ + "82b88ded06e67fba" + ] + ] + }, + { + "id": "82b88ded06e67fba", + "type": "mqtt out", + "z": "bccd1f23.87219", + "name": "", + "topic": "", + "qos": "", + "retain": "", + "respTopic": "", + "contentType": "", + "userProps": "", + "correl": "", + "expiry": "", + "broker": "8dc3722c.06efa8", + "x": 1890, + "y": 260, + "wires": [] + }, + { + "id": "1e021d2306c69193", + "type": "function", + "z": "bccd1f23.87219", + "name": "Set Led Status", + "func": "msg.payload = msg.payload.status.toLowerCase();\n\nreturn msg;", + "outputs": 1, + "timeout": 0, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1780, + "y": 180, + "wires": [ + [ + "1e9ddd41b0fa067d" + ] + ] + }, + { + "id": "6b34c456.83178c", + "type": "ui_text_input", + "z": "baa1e3d9.cb29d", + "name": "acq_id", + "label": "Acquisition unique ID*", + "tooltip": "", + "group": "4322c187.e73e5", + "order": 1, + "width": 5, + "height": 1, + "passthru": true, + "mode": "text", + "delay": 300, + "topic": "acq_id", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 690, + "y": 180, + "wires": [ + [ + "fb887036.12429" + ] + ] + }, + { + "id": "cc0ca68b.4263a8", + "type": "ui_dropdown", + "z": "baa1e3d9.cb29d", + "name": "acq_celltype", + "label": "Flowcell thickness*", + "tooltip": "", + "place": "Select option", + "group": "4322c187.e73e5", + "order": 6, + "width": 5, + "height": 1, + "passthru": true, + "multiple": false, + "options": [ + { + "label": "200 μm µ-Slide I Luer", + "value": 200, "type": "num" }, { @@ -4560,7 +4858,7 @@ "topicType": "str", "className": "", "x": 670, - "y": 80, + "y": 100, "wires": [ [ "fb887036.12429", @@ -4580,7 +4878,7 @@ "finalize": "", "libs": [], "x": 920, - "y": 220, + "y": 180, "wires": [ [ "52ea7d01.711034" @@ -4602,8 +4900,8 @@ "resendOnRefresh": false, "templateScope": "local", "className": "", - "x": 650, - "y": 20, + "x": 550, + "y": 40, "wires": [ [] ] @@ -4661,7 +4959,7 @@ "resendOnRefresh": false, "templateScope": "local", "className": "", - "x": 1180, + "x": 1160, "y": 380, "wires": [ [] @@ -4674,13 +4972,12 @@ "name": "Image control", "func": "// Reset the number of images taken\nflow.set('img_counter', 0);\n\nvar acq_celltype = global.get(\"acq_celltype\");\nvar acq_minimum_mesh = global.get(\"acq_minimum_mesh\");\nvar acq_maximum_mesh = global.get(\"acq_maximum_mesh\");\nvar imaging_pump_volume = global.get(\"imaging_pump_volume\");\nvar acq_id = global.get(\"acq_id\");\nvar nb_frame = global.get(\"nb_frame\");\nvar pump_direction = global.get(\"pump_direction\");\nvar sleep_before = global.get(\"sleep_before\");\nvar object_date = global.get(\"object_date\");\n\nif (acq_celltype === undefined || acq_celltype === \"\") {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Type of the flowcell\";\n return [null, msg];\n} else if (acq_minimum_mesh === undefined || acq_minimum_mesh === \"\") {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Lower fraction size\";\n return [null, msg];\n} else if (acq_maximum_mesh === undefined || acq_maximum_mesh === \"\") {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Upper fraction size\";\n return [null, msg];\n} else if (imaging_pump_volume === undefined || imaging_pump_volume === \"\" || imaging_pump_volume === null) {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Volume inbetween images\";\n return [null, msg];\n} else if (acq_id === undefined || acq_id === \"\") {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Acquisition ID\";\n return [null, msg];\n} else if (nb_frame === undefined || nb_frame === \"\" || nb_frame === null) {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Number of image to save\";\n return [null, msg];\n} else if (pump_direction === undefined || pump_direction === \"\" || pump_direction === null) {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Pump direction\";\n return [null, msg];\n} else if (sleep_before === undefined || sleep_before === \"\" || sleep_before === null) {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Delay before image\";\n return [null, msg];\n}else if (object_date === undefined || object_date === \"\" || object_date === null) {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Object date\";\n return [null, msg];\n}\n\nmsg.payload = {\n \"action\": \"image\",\n \"sleep\": sleep_before,\n \"pump_direction\": pump_direction,\n \"volume\": imaging_pump_volume,\n \"nb_frame\": nb_frame,\n}\nmsg.send = true\n\nreturn [msg, null];", "outputs": 2, - "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 680, - "y": 480, + "x": 640, + "y": 440, "wires": [ [ "52ea7d01.711034", @@ -4704,11 +5001,10 @@ "ok": "OK", "cancel": "", "raw": false, - "className": "", "topic": "", "name": "", - "x": 950, - "y": 560, + "x": 890, + "y": 520, "wires": [ [] ] @@ -4721,14 +5017,9 @@ "topic": "", "qos": "", "retain": "", - "respTopic": "", - "contentType": "", - "userProps": "", - "correl": "", - "expiry": "", "broker": "8dc3722c.06efa8", - "x": 1150, - "y": 440, + "x": 1130, + "y": 420, "wires": [] }, { @@ -4745,14 +5036,12 @@ "tooltip": "", "color": "", "bgcolor": "#AD1625", - "className": "", "icon": "cancel", "payload": "{\"action\":\"stop\"}", "payloadType": "json", "topic": "imager/image", - "topicType": "str", - "x": 460, - "y": 520, + "x": 420, + "y": 480, "wires": [ [ "d74210ef.edc15" @@ -4768,8 +5057,8 @@ "qos": "", "retain": "", "broker": "8dc3722c.06efa8", - "x": 650, - "y": 520, + "x": 610, + "y": 480, "wires": [] }, { @@ -4795,8 +5084,8 @@ "offvalueType": "str", "officon": "", "offcolor": "", - "x": 460, - "y": 560, + "x": 420, + "y": 520, "wires": [ [ "6b2239f3.41fa3" @@ -4815,8 +5104,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 910, - "y": 440, + "x": 870, + "y": 400, "wires": [ [ "29be525e.0c87fe" @@ -4842,8 +5131,8 @@ "randomUnits": "seconds", "drop": false, "outputs": 1, - "x": 940, - "y": 480, + "x": 900, + "y": 440, "wires": [ [ "c3e50240.82aa58" @@ -4870,8 +5159,8 @@ "payloadType": "str", "topic": "imager/image", "topicType": "str", - "x": 680, - "y": 440, + "x": 420, + "y": 400, "wires": [ [ "52ea7d01.711034" @@ -4885,16 +5174,14 @@ "name": "", "env": [], "x": 110, - "y": 220, + "y": 180, "wires": [ [ "f3658d30.b8448", "de2c90cf.b73b08", "4be09c97f86897d9", "f573206abefa9518", - "f948151ab4031df4", - "5e3dec55.881074", - "d3ca8847.4d1ae" + "f948151ab4031df4" ] ] }, @@ -4905,11 +5192,13 @@ "name": "get acq_id", "func": "msg.payload = msg.payload.acq_id;\nreturn msg;", "outputs": 1, + "timeout": "", "noerr": 0, "initialize": "", "finalize": "", + "libs": [], "x": 330, - "y": 240, + "y": 180, "wires": [ [ "6b34c456.83178c" @@ -4923,50 +5212,19 @@ "name": "get acq_celltype", "func": "msg.topic = 'acq_celltype';\nmsg.payload = msg.payload.acq_celltype;\nreturn msg;", "outputs": 1, + "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 340, - "y": 80, + "y": 100, "wires": [ [ "cc0ca68b.4263a8" ] ] }, - { - "id": "5e3dec55.881074", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "get acq_minimum_mesh", - "func": "msg.payload = msg.payload.acq_minimum_mesh;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 370, - "y": 160, - "wires": [ - [ - "f59a2f0d.5e9af" - ] - ] - }, - { - "id": "d3ca8847.4d1ae", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "get acq_maximum_mesh", - "func": "msg.payload = msg.payload.acq_maximum_mesh;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 370, - "y": 200, - "wires": [ - [ - "6008a8bb.259f08" - ] - ] - }, { "id": "b402f719.55bc98", "type": "inject", @@ -4988,8 +5246,8 @@ "topic": "pump_direction", "payload": "FORWARD", "payloadType": "str", - "x": 220, - "y": 560, + "x": 180, + "y": 520, "wires": [ [ "bb62da8a.ebc328" @@ -5006,8 +5264,8 @@ "noerr": 0, "initialize": "", "finalize": "", - "x": 660, - "y": 560, + "x": 620, + "y": 520, "wires": [ [] ] @@ -5031,7 +5289,7 @@ "className": "", "topicType": "str", "x": 680, - "y": 280, + "y": 220, "wires": [ [ "fb887036.12429", @@ -5058,6 +5316,11 @@ "v": "status/focus", "vt": "str" }, + { + "t": "eq", + "v": "status/light", + "vt": "str" + }, { "t": "eq", "v": "status/imager", @@ -5066,7 +5329,7 @@ ], "checkall": "true", "repair": false, - "outputs": 3, + "outputs": 4, "x": 320, "y": 800, "wires": [ @@ -5078,6 +5341,9 @@ "c516d9ea.f7f6e", "6742014e.1bb238" ], + [ + "6742014e.1bb238" + ], [ "307c851e.fb0f7a", "2b9d6988.d84836" @@ -5212,7 +5478,7 @@ "raw": false, "topic": "", "name": "", - "x": 1260, + "x": 1270, "y": 900, "wires": [] }, @@ -5303,7 +5569,7 @@ "format": "{{msg.payload}}", "layout": "col-center", "x": 1200, - "y": 140, + "y": 100, "wires": [] }, { @@ -5318,7 +5584,7 @@ "finalize": "", "libs": [], "x": 960, - "y": 140, + "y": 100, "wires": [ [ "9bd72495.a8a098" @@ -5339,7 +5605,7 @@ "format": "{{msg.payload}} mL", "layout": "col-center", "x": 1200, - "y": 300, + "y": 260, "wires": [] }, { @@ -5353,7 +5619,7 @@ "initialize": "", "finalize": "", "x": 950, - "y": 300, + "y": 260, "wires": [ [ "8e16aa2f.e40398" @@ -5446,7 +5712,7 @@ "step": "0.1", "className": "", "x": 670, - "y": 120, + "y": 140, "wires": [ [ "fb887036.12429" @@ -5461,8 +5727,8 @@ "links": [ "559a8085.1d6b9" ], - "x": 795, - "y": 140, + "x": 735, + "y": 60, "wires": [ [ "99b11fe4.2795d" @@ -5483,7 +5749,7 @@ "fwdInMessages": false, "resendOnRefresh": false, "templateScope": "local", - "x": 1260, + "x": 1270, "y": 820, "wires": [ [] @@ -5495,8 +5761,8 @@ "z": "baa1e3d9.cb29d", "name": "", "env": [], - "x": 930, - "y": 520, + "x": 890, + "y": 480, "wires": [ [] ] @@ -5513,7 +5779,7 @@ "finalize": "", "libs": [], "x": 330, - "y": 280, + "y": 220, "wires": [ [ "51b4d0df.d70a88" @@ -5532,10 +5798,10 @@ "finalize": "", "libs": [], "x": 380, - "y": 320, + "y": 260, "wires": [ [ - "e1acc6c599033114" + "0df8d1d86af6455a" ] ] }, @@ -5546,12 +5812,13 @@ "name": "get sleep_before", "func": "msg.payload = msg.payload.sleep_before;\nreturn msg;", "outputs": 1, + "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 340, - "y": 120, + "y": 140, "wires": [ [ "49ea1123.ee1768" @@ -5564,8 +5831,8 @@ "z": "baa1e3d9.cb29d", "name": "onTab", "events": "all", - "x": 330, - "y": 380, + "x": 310, + "y": 340, "wires": [ [ "9b69ea945b587192" @@ -5583,8 +5850,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 480, - "y": 380, + "x": 460, + "y": 340, "wires": [ [ "52ea7d01.711034" @@ -5595,7 +5862,7 @@ ] }, { - "id": "e1acc6c599033114", + "id": "0df8d1d86af6455a", "type": "ui_text_input", "z": "baa1e3d9.cb29d", "name": "imaging_pump_volume", @@ -5606,14 +5873,14 @@ "width": 0, "height": 0, "passthru": true, - "mode": "text", + "mode": "number", "delay": 300, "topic": "imaging_pump_volume", "sendOnBlur": true, "className": "", "topicType": "str", "x": 630, - "y": 320, + "y": 260, "wires": [ [ "fb887036.12429", @@ -5622,12 +5889,12 @@ ] }, { - "id": "f4caa15e2bbfd6e7", + "id": "37116281279b9b82", "type": "ui_template", "z": "baa1e3d9.cb29d", "group": "4322c187.e73e5", "name": "Start Acquisition", - "order": 13, + "order": 12, "width": "5", "height": "1", "format": "\n\n", @@ -5636,8 +5903,8 @@ "resendOnRefresh": false, "templateScope": "local", "className": "", - "x": 460, - "y": 480, + "x": 420, + "y": 440, "wires": [ [ "c9f510c0.7d1328" @@ -5872,7 +6139,7 @@ "raw": false, "topic": "", "name": "", - "x": 1340, + "x": 1350, "y": 680, "wires": [] }, @@ -5889,7 +6156,7 @@ "targetType": "full", "statusVal": "", "statusType": "auto", - "x": 830, + "x": 840, "y": 760, "wires": [] }, @@ -6049,7 +6316,6 @@ "fwdInMessages": true, "resendOnRefresh": true, "templateScope": "local", - "className": "", "x": 1340, "y": 760, "wires": [ @@ -6121,7 +6387,7 @@ "allowHTML": false, "outputs": 1, "topic": "", - "x": 790, + "x": 770, "y": 140, "wires": [ [ @@ -6210,7 +6476,7 @@ "noerr": 0, "initialize": "", "finalize": "", - "x": 990, + "x": 950, "y": 140, "wires": [ [] @@ -6271,7 +6537,7 @@ "noerr": 0, "initialize": "", "finalize": "", - "x": 630, + "x": 620, "y": 140, "wires": [ [ @@ -6444,7 +6710,7 @@ "resendOnRefresh": false, "templateScope": "local", "className": "", - "x": 1370, + "x": 1380, "y": 600, "wires": [ [] @@ -6495,7 +6761,7 @@ "from": "", "to": "", "reg": false, - "x": 1010, + "x": 1020, "y": 840, "wires": [ [ @@ -6796,7 +7062,7 @@ "name": "", "group": "a7d64879.38298", "order": 4, - "width": 6, + "width": "6", "height": 1, "passthru": false, "label": "Reboot", @@ -6813,7 +7079,7 @@ "y": 240, "wires": [ [ - "4af9112d.87767" + "611a8b1c.a829b4" ] ] }, @@ -6844,7 +7110,7 @@ "name": "", "group": "a7d64879.38298", "order": 5, - "width": 6, + "width": "6", "height": 1, "passthru": false, "label": "Shutdown", @@ -6861,18 +7127,19 @@ "y": 320, "wires": [ [ - "4af9112d.87767" + "611a8b1c.a829b4" ] ] }, { - "id": "4af9112d.87767", - "type": "python3-function", + "id": "b81b990a.d4dca", + "type": "link in", "z": "9daf9e2b.019fc", - "name": "action", - "func": "#!/usr/bin/python3\nimport smbus2 as smbus\n\nbus = smbus.SMBus(1)\n#turn off LED\nbus.write_byte_data(0x0d, 0x07, 0x00)\n#turn off Fan\nbus.write_byte_data(0x0d, 0x08, 0x00)\n\n#msg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg", - "outputs": 1, - "x": 330, + "name": "Shutdown", + "links": [ + "e08cfcb8.2a67e8" + ], + "x": 195, "y": 280, "wires": [ [ @@ -6881,13 +7148,13 @@ ] }, { - "id": "466eb611.4da048", + "id": "ea4fae012404854c", "type": "ui_button", "z": "9daf9e2b.019fc", "name": "", "group": "a7d64879.38298", "order": 2, - "width": 6, + "width": "6", "height": 1, "passthru": true, "label": "Restart Hardware Controller", @@ -6900,184 +7167,62 @@ "payloadType": "str", "topic": "", "topicType": "str", - "x": 460, - "y": 420, - "wires": [ - [ - "bd5cceef.b17ad", - "414353cde6a62346" - ] - ] - }, - { - "id": "bd5cceef.b17ad", - "type": "exec", - "z": "9daf9e2b.019fc", - "command": "sudo systemctl restart planktoscope-org.controller.service", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "winHide": false, - "oldrc": false, - "name": "Restart hardware controller", - "x": 800, - "y": 420, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "43cf8ff7.75231", - "type": "rpi-gpio out", - "z": "9daf9e2b.019fc", - "name": "Pump Enable", - "pin": "4", - "set": true, - "level": "1", - "freq": "", - "out": "out", - "bcm": true, - "x": 420, - "y": 80, - "wires": [] - }, - { - "id": "4bca8a25.15be3c", - "type": "rpi-gpio out", - "z": "9daf9e2b.019fc", - "name": "Focus Enable", - "pin": "12", - "set": true, - "level": "1", - "freq": "", - "out": "out", - "bcm": true, - "x": 420, - "y": 120, - "wires": [] - }, - { - "id": "50f9b5b.a84bccc", - "type": "inject", - "z": "9daf9e2b.019fc", - "name": "Default: ON", - "props": [ - { - "p": "payload" - } - ], - "repeat": "", - "crontab": "", - "once": true, - "onceDelay": "0.01", - "topic": "", - "payload": "true", - "payloadType": "bool", - "x": 150, - "y": 100, + "x": 440, + "y": 400, "wires": [ [ - "43cf8ff7.75231", - "4bca8a25.15be3c", - "6db0fcf5.f0effc", - "5fc4ede4.72516c" + "c54d948575dbcff8", + "d10f3ffd98055447" ] ] }, { - "id": "45a7b5aa.2ed20c", + "id": "438febd245a9f73c", "type": "link in", "z": "9daf9e2b.019fc", "name": "Restart Hardware Controller", "links": [ "e41870d7.300eb8", - "e4ead350b3d07578" + "3973b999ee7b3b1d" ], "x": 195, "y": 420, "wires": [ [ - "466eb611.4da048" - ] - ] - }, - { - "id": "b81b990a.d4dca", - "type": "link in", - "z": "9daf9e2b.019fc", - "name": "Shutdown", - "links": [ - "e08cfcb8.2a67e8" - ], - "x": 195, - "y": 280, - "wires": [ - [ - "4af9112d.87767" + "ea4fae012404854c" ] ] }, { - "id": "5fc4ede4.72516c", - "type": "rpi-gpio out", - "z": "9daf9e2b.019fc", - "name": "HAT Pump Enable", - "pin": "23", - "set": true, - "level": "1", - "freq": "", - "out": "out", - "bcm": true, - "x": 430, - "y": 40, - "wires": [] - }, - { - "id": "6db0fcf5.f0effc", - "type": "rpi-gpio out", - "z": "9daf9e2b.019fc", - "name": "HAT Focus Enable", - "pin": "5", - "set": true, - "level": "1", - "freq": "", - "out": "out", - "bcm": true, - "x": 430, - "y": 160, - "wires": [] - }, - { - "id": "38c05fcb891c82bf", + "id": "c54d948575dbcff8", "type": "exec", "z": "9daf9e2b.019fc", - "command": "docker restart apps_ps_backend_proc-segmenter-server-1", + "command": "sudo systemctl restart planktoscope-org.controller.service", "addpay": false, "append": "", "useSpawn": "false", "timer": "", "winHide": false, "oldrc": false, - "name": "Restart segmenter", - "x": 770, - "y": 500, + "name": "Restart hardware controller", + "x": 780, + "y": 400, "wires": [ - [], + [ + "8cad7139d2a089d9" + ], [], [] ] }, { - "id": "631b8626185addfc", + "id": "e2e5ce0351a6cc11", "type": "ui_button", "z": "9daf9e2b.019fc", "name": "", "group": "a7d64879.38298", "order": 3, - "width": 6, + "width": "6", "height": 1, "passthru": true, "label": "Restart Segmenter", @@ -7090,38 +7235,58 @@ "payloadType": "str", "topic": "", "topicType": "str", - "x": 430, - "y": 500, + "x": 410, + "y": 600, "wires": [ [ - "38c05fcb891c82bf", - "e036d07cf78fde85" + "2cdbadb65d0e1b20", + "9c1629488b02fdba" ] ] }, { - "id": "cec5bd6f962f6903", + "id": "2cdbadb65d0e1b20", + "type": "exec", + "z": "9daf9e2b.019fc", + "command": "docker restart apps_ps_backend_proc-segmenter-server-1", + "addpay": false, + "append": "", + "useSpawn": "false", + "timer": "", + "winHide": false, + "oldrc": false, + "name": "Restart segmenter", + "x": 750, + "y": 600, + "wires": [ + [], + [], + [] + ] + }, + { + "id": "7b64209d734e4e2c", "type": "ui_template", "z": "9daf9e2b.019fc", "group": "a7d64879.38298", "name": "Logs", "order": 1, - "width": 0, - "height": 0, + "width": "0", + "height": "0", "format": "

\n The PlanktoScope software application consists of three components: a Node-RED dashboard which provides the user interface you're using; a Hardware Controller\n which executes commands sent from the Node-RED dashboard for hardware control and image acquisition; and a Segmenter which processes an acquired dataset of\n images and isolates objects from those images. Each component has its own independent log of messages, managed separately from the logs for the other components.\n

\n

\n All three components have live-updating logs which you can monitor. Additionally, the Hardware Controller and the Segmenter also save all of their log messages\n to files which you can browse and download. Those software components create a new log file each time they start, and the name of the log file includes the time\n in the PlanktoScope's clock when the software component started. However, if your PlanktoScope's clock is usually wrong, it makes the log files difficult to navigate.\n This will be fixed in a future version of the software.\n

\n

\n If you need to share your logs with other people (e.g. on Slack or GitHub), you should open the \"Downloadable Logs\" links, and then you can select one file or multiple\n log files for downloading as a zip archive.\n

\n", "storeOutMessages": true, "fwdInMessages": true, "resendOnRefresh": true, "templateScope": "local", "className": "", - "x": 650, + "x": 630, "y": 180, "wires": [ [] ] }, { - "id": "414353cde6a62346", + "id": "d10f3ffd98055447", "type": "ui_toast", "z": "9daf9e2b.019fc", "position": "top right", @@ -7135,12 +7300,12 @@ "className": "", "topic": "", "name": "", - "x": 770, - "y": 380, + "x": 750, + "y": 360, "wires": [] }, { - "id": "e036d07cf78fde85", + "id": "9c1629488b02fdba", "type": "ui_toast", "z": "9daf9e2b.019fc", "position": "top right", @@ -7154,26 +7319,26 @@ "className": "", "topic": "", "name": "", - "x": 770, - "y": 460, + "x": 750, + "y": 560, "wires": [] }, { - "id": "ddcbbfa5.cd158", + "id": "8cad7139d2a089d9", "type": "exec", - "z": "1371dec5.76e671", - "command": "vcgencmd measure_temp | tr -d \"temp=\" | tr -d \"'C\" | tr -d \"\\n\"", + "z": "9daf9e2b.019fc", + "command": "sudo systemctl restart nodered.service", "addpay": false, "append": "", - "useSpawn": "", + "useSpawn": "false", "timer": "", - "name": "RPi Temp.", - "x": 330, - "y": 40, + "winHide": false, + "oldrc": false, + "name": "Restart Node Red", + "x": 1150, + "y": 400, "wires": [ - [ - "bc503fa5.f46dd" - ], + [], [], [] ] @@ -7224,194 +7389,71 @@ "wires": [ [ "3910d662.fa1f7a", - "ddcbbfa5.cd158", - "23a84a3856fb68bd", - "4ed64bd91fa9fbdf", - "ed5f2d963d85478b" + "aa2e4cd182dbc776", + "797675a937dc1629", + "f6f570b10c675854" ] ] }, { - "id": "2549f778.4eb828", - "type": "python3-function", + "id": "569154a.b53182c", + "type": "inject", "z": "1371dec5.76e671", - "name": "fan control", - "func": "import smbus2 as smbus\n\nstate = msg[\"payload\"]\nbus = smbus.SMBus(1)\n\nDEVICE_ADDRESS = 0x0d\n# command happens twice, for reasons\nif state == \"off\":\n with smbus.SMBus(1) as bus:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\n return msg\nif state == \"on\":\n with smbus.SMBus(1) as bus:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)\n return msg\n", - "outputs": 1, - "x": 1150, - "y": 40, + "name": "once", + "props": [ + { + "p": "payload" + } + ], + "repeat": "", + "crontab": "", + "once": true, + "onceDelay": "", + "topic": "", + "payload": "start", + "payloadType": "str", + "x": 130, + "y": 700, "wires": [ [ - "e640ebb5c397f424" + "5883e629f5d546ed" ] ] }, { - "id": "b7ab1ada.1f4158", - "type": "exec", + "id": "4828d2f4.7c712c", + "type": "function", "z": "1371dec5.76e671", - "command": "i2cdetect -y 1", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "1", - "winHide": false, - "oldrc": false, - "name": "i2c update", - "x": 1440, - "y": 40, + "name": "set global", + "func": "global.set(\"acq_instrument_id\",msg.payload);\n", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 580, + "y": 720, "wires": [ - [], - [], [] ] }, { - "id": "bc503fa5.f46dd", - "type": "switch", + "id": "e2f39a35.f57298", + "type": "subflow:1c24ad9c.bebec2", "z": "1371dec5.76e671", "name": "", - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "gt", - "v": "40", - "vt": "num" - }, - { - "t": "lte", - "v": "35", - "vt": "num" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 570, - "y": 40, + "env": [], + "x": 130, + "y": 640, "wires": [ [ - "a25d6486.e1ce28" - ], - [ - "5d4f3e71.1bad4" + "9b64f397101c2762" ] ] }, { - "id": "5d4f3e71.1bad4", - "type": "change", - "z": "1371dec5.76e671", - "name": "Set OFF", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "off", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 720, - "y": 60, - "wires": [ - [ - "7fb13a4a53b612a0" - ] - ] - }, - { - "id": "a25d6486.e1ce28", - "type": "change", - "z": "1371dec5.76e671", - "name": "Set ON", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "on", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 720, - "y": 20, - "wires": [ - [ - "7fb13a4a53b612a0" - ] - ] - }, - { - "id": "569154a.b53182c", - "type": "inject", - "z": "1371dec5.76e671", - "name": "once", - "props": [ - { - "p": "payload" - } - ], - "repeat": "", - "crontab": "", - "once": true, - "onceDelay": "", - "topic": "", - "payload": "start", - "payloadType": "str", - "x": 170, - "y": 680, - "wires": [ - [ - "ccb5172d10c1ccaf" - ] - ] - }, - { - "id": "4828d2f4.7c712c", - "type": "function", - "z": "1371dec5.76e671", - "name": "set global", - "func": "global.set(\"acq_instrument_id\",msg.payload);\n", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 580, - "y": 700, - "wires": [ - [] - ] - }, - { - "id": "e2f39a35.f57298", - "type": "subflow:1c24ad9c.bebec2", - "z": "1371dec5.76e671", - "name": "", - "env": [], - "x": 170, - "y": 620, - "wires": [ - [ - "950b773ad4c0fdfe" - ] - ] - }, - { - "id": "3e64877a.9684b", - "type": "function", + "id": "3e64877a.9684b", + "type": "function", "z": "1371dec5.76e671", "name": "set global", "func": "global.set(\"acq_software\", \"PlanktoScope \" + msg.payload);\n", @@ -7422,7 +7464,7 @@ "finalize": "", "libs": [], "x": 820, - "y": 500, + "y": 520, "wires": [ [] ] @@ -7445,7 +7487,7 @@ "fontSize": "", "color": "#000000", "x": 600, - "y": 620, + "y": 640, "wires": [] }, { @@ -7460,13 +7502,8 @@ "label": "Instrument Name", "format": "{{msg.payload}}", "layout": "row-spread", - "className": "", - "style": false, - "font": "", - "fontSize": "", - "color": "#000000", "x": 610, - "y": 660, + "y": 680, "wires": [] }, { @@ -7487,7 +7524,7 @@ "fontSize": "", "color": "#000000", "x": 850, - "y": 540, + "y": 560, "wires": [] }, { @@ -7503,7 +7540,7 @@ "format": "{{msg.payload}}", "layout": "row-spread", "x": 600, - "y": 740, + "y": 760, "wires": [] }, { @@ -7514,28 +7551,14 @@ "links": [ "559a8085.1d6b9" ], - "x": 205, - "y": 740, + "x": 155, + "y": 760, "wires": [ [ "f783aefd.c3bfd8" ] ] }, - { - "id": "11b51f8f.acd308", - "type": "python3-function", - "z": "1371dec5.76e671", - "d": true, - "name": "fan temperature", - "func": "import smbus\nbus = smbus.SMBus(1)\n\naddr = 0x0d\nfan_reg = 0x08\n\ntemp = float( msg[\"payload\"])\n\n# 0x01 full speed, 0x02: 20% speed, ..., 0x09: 90% speed\n\nif temp < 38:\n bus.write_byte_data(addr, fan_reg, 0x00)\nelif temp < 43:\n bus.write_byte_data(addr, fan_reg, 0x02)\nelif temp < 46:\n bus.write_byte_data(addr, fan_reg, 0x04)\nelif temp < 48:\n bus.write_byte_data(addr, fan_reg, 0x06)\nelif temp < 52:\n bus.write_byte_data(addr, fan_reg, 0x08)\nelse:\n bus.write_byte_data(addr, fan_reg, 0x01)\n\nreturn msg", - "outputs": 1, - "x": 1440, - "y": 120, - "wires": [ - [] - ] - }, { "id": "eaf74a43.fa27d", "type": "switch", @@ -7573,7 +7596,6 @@ "ok": "OK", "cancel": "", "raw": false, - "className": "", "topic": "", "name": "", "x": 1090, @@ -7635,52 +7657,7 @@ ] }, { - "id": "e640ebb5c397f424", - "type": "delay", - "z": "1371dec5.76e671", - "name": "", - "pauseType": "delay", - "timeout": "1", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "allowrate": false, - "outputs": 1, - "x": 1300, - "y": 40, - "wires": [ - [ - "b7ab1ada.1f4158" - ] - ] - }, - { - "id": "7fb13a4a53b612a0", - "type": "rbe", - "z": "1371dec5.76e671", - "name": "", - "func": "rbe", - "gap": "", - "start": "", - "inout": "out", - "septopics": true, - "property": "payload", - "topi": "topic", - "x": 1010, - "y": 40, - "wires": [ - [ - "2549f778.4eb828" - ] - ] - }, - { - "id": "ccb5172d10c1ccaf", + "id": "5883e629f5d546ed", "type": "file in", "z": "1371dec5.76e671", "name": "Get machine name", @@ -7692,7 +7669,7 @@ "encoding": "none", "allProps": false, "x": 350, - "y": 680, + "y": 700, "wires": [ [ "a400a97e.e333a8", @@ -7701,7 +7678,7 @@ ] }, { - "id": "950b773ad4c0fdfe", + "id": "9b64f397101c2762", "type": "change", "z": "1371dec5.76e671", "name": "Get acq_instrument", @@ -7727,7 +7704,7 @@ "to": "", "reg": false, "x": 350, - "y": 620, + "y": 640, "wires": [ [ "bdc6718a.dd5d48" @@ -7735,7 +7712,28 @@ ] }, { - "id": "24de7407445d2087", + "id": "99725e1437cc390b", + "type": "file in", + "z": "1371dec5.76e671", + "name": "Versioning File", + "filename": "/usr/share/planktoscope/installer-versioning.yml", + "filenameType": "str", + "format": "utf8", + "chunk": false, + "sendError": false, + "encoding": "none", + "allProps": false, + "x": 240, + "y": 540, + "wires": [ + [ + "f4e21e28bd903f6d" + ] + ], + "info": "# PlanktoScope Help\nThis Node will read the content of the file named **config.txt** containing all the input placeholders.\n" + }, + { + "id": "6a0fa173874c3ddd", "type": "inject", "z": "1371dec5.76e671", "name": "once", @@ -7752,60 +7750,40 @@ "payload": "start", "payloadType": "str", "x": 90, - "y": 520, - "wires": [ - [ - "e4f9ed2b337c2fa6" - ] - ] - }, - { - "id": "e4f9ed2b337c2fa6", - "type": "file in", - "z": "1371dec5.76e671", - "name": "Versioning File", - "filename": "/usr/share/planktoscope/installer-versioning.yml", - "filenameType": "str", - "format": "utf8", - "chunk": false, - "sendError": false, - "encoding": "none", - "allProps": false, - "x": 240, - "y": 520, + "y": 540, "wires": [ [ - "db79aae8a7fe3512" + "99725e1437cc390b" ] ] }, { - "id": "db79aae8a7fe3512", + "id": "f4e21e28bd903f6d", "type": "yaml", "z": "1371dec5.76e671", "property": "payload", "name": "", "x": 390, - "y": 520, + "y": 540, "wires": [ [ - "04c313e8d9aac122", - "ef1970121e57c5e8", - "574361abfe75b3b3" + "d6264e3e29b68c6e", + "aa84b912c996c69e", + "fba22dc2c16b3ec8" ] ] }, { - "id": "04c313e8d9aac122", + "id": "d6264e3e29b68c6e", "type": "change", "z": "1371dec5.76e671", - "name": "Get repo", + "name": "Get version", "rules": [ { "t": "set", "p": "payload", "pt": "msg", - "to": "payload.repo", + "to": "payload.version", "tot": "msg" } ], @@ -7814,25 +7792,26 @@ "from": "", "to": "", "reg": false, - "x": 580, - "y": 480, + "x": 590, + "y": 540, "wires": [ [ - "57b3b083a2455e09" + "3e64877a.9684b", + "8343fa69.49339" ] ] }, { - "id": "ef1970121e57c5e8", + "id": "aa84b912c996c69e", "type": "change", "z": "1371dec5.76e671", - "name": "Get version", + "name": "Get repo", "rules": [ { "t": "set", "p": "payload", "pt": "msg", - "to": "payload.version", + "to": "payload.repo", "tot": "msg" } ], @@ -7841,17 +7820,16 @@ "from": "", "to": "", "reg": false, - "x": 590, - "y": 520, + "x": 580, + "y": 500, "wires": [ [ - "3e64877a.9684b", - "8343fa69.49339" + "fd55e7a43d9bdbbb" ] ] }, { - "id": "57b3b083a2455e09", + "id": "fd55e7a43d9bdbbb", "type": "function", "z": "1371dec5.76e671", "name": "set global", @@ -7863,13 +7841,13 @@ "finalize": "", "libs": [], "x": 820, - "y": 460, + "y": 480, "wires": [ [] ] }, { - "id": "574361abfe75b3b3", + "id": "fba22dc2c16b3ec8", "type": "change", "z": "1371dec5.76e671", "name": "Get commit", @@ -7888,15 +7866,15 @@ "to": "", "reg": false, "x": 590, - "y": 560, + "y": 580, "wires": [ [ - "016d1d2a2f19f1a6" + "2ddc75a4ac38a17f" ] ] }, { - "id": "016d1d2a2f19f1a6", + "id": "2ddc75a4ac38a17f", "type": "function", "z": "1371dec5.76e671", "name": "set global", @@ -7908,18 +7886,18 @@ "finalize": "", "libs": [], "x": 820, - "y": 580, + "y": 600, "wires": [ [] ] }, { - "id": "4ed64bd91fa9fbdf", + "id": "797675a937dc1629", "type": "ui_template", "z": "1371dec5.76e671", "group": "3da7da8f.179606", "name": "Metrics panel", - "order": 1, + "order": 2, "width": "0", "height": "0", "format": "
\n

\n The instrument's system time is different from your web browser's time by {{drift}}.\n As a result, timestamps in your datasets will be incorrect.\n Additionally, system metrics will not be recorded or shown correctly.\n Additionally, you will see incorrectly-aligned graphs in the metrics below.\n

\n

Please change the instrument's system time or your web browser's time to accurate values.

\n

\n \n

\n
\n\n
\n

Loading system metrics, please wait...

\n
\n\n
\n \n
\n\n\n", @@ -7935,7 +7913,27 @@ ] }, { - "id": "38bad1e220cd5d87", + "id": "aa2e4cd182dbc776", + "type": "function", + "z": "1371dec5.76e671", + "name": "Get system time", + "func": "var date = new Date();\ndate.setSeconds(0, 0);\nmsg.payload = (\n date.toISOString().replace('T', ' ').replace(/:\\d+\\.\\d+Z/,' UTC')\n);\nreturn msg", + "outputs": 1, + "timeout": "", + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 340, + "y": 240, + "wires": [ + [ + "7c9ee522f6dbd3b0" + ] + ] + }, + { + "id": "7c9ee522f6dbd3b0", "type": "ui_text", "z": "1371dec5.76e671", "group": "ce9e278.781eed8", @@ -7949,61 +7947,57 @@ "className": "", "style": false, "font": "", - "fontSize": 16, + "fontSize": "", "color": "#000000", "x": 590, "y": 240, "wires": [] }, { - "id": "ed5f2d963d85478b", - "type": "function", + "id": "6dc9862f2eebe935", + "type": "http in", "z": "1371dec5.76e671", - "name": "Get system time", - "func": "var date = new Date();\ndate.setSeconds(0, 0);\nmsg.payload = (\n date.toISOString().replace('T', ' ').replace(/:\\d+\\.\\d+Z/,' UTC')\n);\nreturn msg", - "outputs": 1, - "timeout": 0, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 340, - "y": 240, + "name": "POST /api/system-time", + "url": "/api/system-time", + "method": "post", + "upload": false, + "swaggerDoc": "", + "x": 120, + "y": 360, "wires": [ [ - "38bad1e220cd5d87" + "a7994a561866dc94", + "dea222e9a6553cac" ] ] }, { - "id": "23a84a3856fb68bd", - "type": "ui_template", + "id": "1c4113d4c933fd4b", + "type": "ui_toast", "z": "1371dec5.76e671", - "group": "ce9e278.781eed8", - "name": "Browser time", - "order": 6, - "width": "6", - "height": "1", - "format": "
\n

Browser Time

\n

{{time}}

\n
\n\n", - "storeOutMessages": true, - "fwdInMessages": true, - "resendOnRefresh": false, - "templateScope": "local", + "position": "top right", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 0, + "ok": "OK", + "cancel": "", + "raw": false, "className": "", - "x": 330, - "y": 200, - "wires": [ - [] - ] + "topic": "Setting system time", + "name": "", + "x": 610, + "y": 340, + "wires": [] }, { - "id": "19a45f972be2b0f1", + "id": "a7994a561866dc94", "type": "function", "z": "1371dec5.76e671", "name": "Get system time", "func": "var date = new Date(msg.payload.timestamp);\nmsg.payload = (\n date.toISOString().replace('T', ' ').replace(/:\\d+\\.\\d+Z/,' UTC')\n);\nreturn msg", "outputs": 1, - "timeout": 0, + "timeout": "", "noerr": 0, "initialize": "", "finalize": "", @@ -8012,56 +8006,38 @@ "y": 340, "wires": [ [ - "ee2c5e7c29eb4760" + "1c4113d4c933fd4b", + "423659c62bae0524" ] ] }, { - "id": "8ba3e2774987fd58", - "type": "http in", + "id": "814ce40bfc413777", + "type": "exec", "z": "1371dec5.76e671", - "name": "POST /api/system-time", - "url": "/api/system-time", - "method": "post", - "upload": false, - "swaggerDoc": "", - "x": 120, - "y": 360, + "command": "sudo date -s", + "addpay": "payload", + "append": "", + "useSpawn": "", + "timer": "", + "winHide": false, + "name": "Set system time", + "x": 600, + "y": 380, "wires": [ - [ - "19a45f972be2b0f1", - "07bbdca8d6153210", - "595df18543c8328e" - ] + [], + [], + [] ] }, { - "id": "ee2c5e7c29eb4760", - "type": "ui_toast", - "z": "1371dec5.76e671", - "position": "top right", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 0, - "ok": "OK", - "cancel": "", - "raw": false, - "className": "", - "topic": "Setting system time", - "name": "", - "x": 610, - "y": 340, - "wires": [] - }, - { - "id": "07bbdca8d6153210", + "id": "dea222e9a6553cac", "type": "function", "z": "1371dec5.76e671", "name": "Prepare timestamp", "func": "msg.payload = ('@' + msg.payload.timestamp).slice(0, -3);\nreturn msg;", "outputs": 1, - "timeout": 0, + "timeout": "", "noerr": 0, "initialize": "", "finalize": "", @@ -8070,31 +8046,33 @@ "y": 380, "wires": [ [ - "7558e8f302d5b944" + "814ce40bfc413777" ] ] }, { - "id": "7558e8f302d5b944", - "type": "exec", + "id": "f6f570b10c675854", + "type": "ui_template", "z": "1371dec5.76e671", - "command": "sudo date -s", - "addpay": "payload", - "append": "", - "useSpawn": "", - "timer": "", - "winHide": false, - "name": "Set system time", - "x": 600, - "y": 380, + "group": "ce9e278.781eed8", + "name": "Browser time", + "order": 6, + "width": "6", + "height": "1", + "format": "
\n

Browser Time

\n

{{time}}

\n
\n\n", + "storeOutMessages": true, + "fwdInMessages": true, + "resendOnRefresh": false, + "templateScope": "local", + "className": "", + "x": 330, + "y": 200, "wires": [ - [], - [], [] ] }, { - "id": "c8be8dad272e1fa5", + "id": "3822b843fda94733", "type": "http in", "z": "1371dec5.76e671", "name": "GET /api/system-time", @@ -8106,18 +8084,18 @@ "y": 420, "wires": [ [ - "0f4ce59587fa14e1" + "5b0a65d3fe187424" ] ] }, { - "id": "0f4ce59587fa14e1", + "id": "5b0a65d3fe187424", "type": "function", "z": "1371dec5.76e671", "name": "Get system time", "func": "var date = new Date();\nmsg.payload = {'timestamp': date.getTime()};\nreturn msg", "outputs": 1, - "timeout": 0, + "timeout": "", "noerr": 0, "initialize": "", "finalize": "", @@ -8126,32 +8104,32 @@ "y": 420, "wires": [ [ - "433d48a4b1bc0b27" + "312a15407574b38e" ] ] }, { - "id": "433d48a4b1bc0b27", + "id": "423659c62bae0524", "type": "http response", "z": "1371dec5.76e671", - "name": "Send GET response", + "name": "Send POST response", "statusCode": "", - "headers": { - "Content-Type": "application/json; charset=UTF-8" - }, + "headers": {}, "x": 620, - "y": 420, + "y": 300, "wires": [] }, { - "id": "595df18543c8328e", + "id": "312a15407574b38e", "type": "http response", "z": "1371dec5.76e671", - "name": "Send POST response", + "name": "Send GET response", "statusCode": "", - "headers": {}, + "headers": { + "Content-Type": "application/json; charset=UTF-8" + }, "x": 620, - "y": 300, + "y": 420, "wires": [] }, { @@ -8163,6 +8141,8 @@ "qos": "0", "datatype": "json", "broker": "8dc3722c.06efa8", + "nl": false, + "rap": false, "inputs": 0, "x": 290, "y": 340, @@ -8224,6 +8204,7 @@ "type": "link out", "z": "9a22e67a.378818", "name": "Fluidic module status", + "mode": "link", "links": [ "bb628f8d.98f108" ], @@ -8248,11 +8229,12 @@ "type": "link out", "z": "1eaf21c8.f7a21e", "name": "Stepper config change", + "mode": "link", "links": [ - "45a7b5aa.2ed20c" + "438febd245a9f73c" ], - "x": 1475, - "y": 380, + "x": 1505, + "y": 540, "wires": [] }, { @@ -8271,8 +8253,8 @@ "randomUnits": "seconds", "drop": false, "outputs": 1, - "x": 1160, - "y": 380, + "x": 1120, + "y": 540, "wires": [ [ "e41870d7.300eb8" @@ -8285,69 +8267,10 @@ "z": "1eaf21c8.f7a21e", "name": "", "env": [], - "x": 1200, - "y": 420, + "x": 1160, + "y": 580, "wires": [] }, - { - "id": "c534fd26.13741", - "type": "change", - "z": "1eaf21c8.f7a21e", - "name": "Get stepper_reverse", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "payload.stepper_reverse", - "tot": "msg" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 640, - "y": 440, - "wires": [ - [ - "cd1987c7.027f58" - ] - ] - }, - { - "id": "cd1987c7.027f58", - "type": "ui_switch", - "z": "1eaf21c8.f7a21e", - "name": "stepper_reverse", - "label": "Invert stepper output", - "tooltip": "Stepper 1 is controlled by output 1 or the other way around", - "group": "6be36295.0ab324", - "order": 5, - "width": 0, - "height": 0, - "passthru": false, - "decouple": "false", - "topic": "stepper_reverse", - "style": "", - "onvalue": "true", - "onvalueType": "bool", - "onicon": "", - "oncolor": "", - "offvalue": "false", - "offvalueType": "bool", - "officon": "", - "offcolor": "", - "x": 940, - "y": 440, - "wires": [ - [ - "8e3b3d3c.955148", - "2068e7f.f4efb18" - ] - ] - }, { "id": "54ba7f16.709ad8", "type": "change", @@ -8367,8 +8290,8 @@ "from": "", "to": "", "reg": false, - "x": 650, - "y": 400, + "x": 610, + "y": 560, "wires": [ [ "ee58b91c.396108" @@ -8390,9 +8313,11 @@ "mode": "number", "delay": "2000", "topic": "pump_steps_per_ml", + "sendOnBlur": true, + "className": "", "topicType": "str", - "x": 920, - "y": 400, + "x": 880, + "y": 560, "wires": [ [ "2068e7f.f4efb18", @@ -8408,15 +8333,15 @@ "name": "Information", "order": 1, "width": "8", - "height": 3, - "format": "
\n

\n Changing one of these values will cause the Python hardware controller to restart, to reload the new hardware configuration.\n

\n

\n Warning: selecting a hardware version from the dropdown menu below will also overwrite all of your hardware settings, including your camera white balance settings.\n

\n

\n If you are not sure, you probably should not be touching anything here!\n

\n
", + "height": "3", + "format": "
\n

\n Changing one of these values will cause the Python hardware controller to restart, to reload the new hardware configuration.\n

\n

\n Warning: selecting a hardware version from the dropdown menu below will also overwrite all of your hardware settings, including your camera white balance settings.\n

\n

\n If you are not sure, you probably should not be touching anything here!\n

\n
\n", "storeOutMessages": true, "fwdInMessages": true, "resendOnRefresh": true, "templateScope": "local", "className": "", - "x": 590, - "y": 60, + "x": 610, + "y": 40, "wires": [ [] ] @@ -8455,19 +8380,23 @@ "label": "", "value": "PlanktoScope v2.6", "type": "str" + }, + { + "label": "", + "value": "PlanktoScope v3.0", + "type": "str" } ], "payload": "", "topic": "acq_instrument", "topicType": "str", "className": "", - "x": 580, + "x": 670, "y": 160, "wires": [ [ - "3e2c5c1c.4c57b4", - "932a1ef8c2e81979", - "025ad3cdaa557843" + "08d177136bd18281", + "56dd3f82c45717f0" ] ] }, @@ -8477,8 +8406,8 @@ "z": "1eaf21c8.f7a21e", "name": "", "env": [], - "x": 970, - "y": 160, + "x": 510, + "y": 360, "wires": [ [] ] @@ -8490,13 +8419,12 @@ "name": "Save global", "func": "global.set(msg.topic,msg.payload);\nreturn msg;", "outputs": 1, - "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 810, - "y": 160, + "x": 350, + "y": 360, "wires": [ [ "1cfadc66.3cde8c" @@ -8507,13 +8435,14 @@ "id": "427c312.fc5e65", "type": "subflow:1c24ad9c.bebec2", "z": "1eaf21c8.f7a21e", + "g": "dda6605ca2508d77", "name": "", "env": [], - "x": 130, - "y": 160, + "x": 110, + "y": 80, "wires": [ [ - "2716aa5b3d027f95" + "c00c6732b9f36adb" ] ] }, @@ -8536,8 +8465,8 @@ "from": "", "to": "", "reg": false, - "x": 650, - "y": 480, + "x": 610, + "y": 640, "wires": [ [ "244ca5dd62df2bcd" @@ -8562,8 +8491,8 @@ "sendOnBlur": true, "className": "", "topicType": "str", - "x": 930, - "y": 480, + "x": 880, + "y": 640, "wires": [ [ "8e3b3d3c.955148", @@ -8582,8 +8511,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 1200, - "y": 480, + "x": 1160, + "y": 640, "wires": [ [ "5d5ad36d2c50dcc2" @@ -8596,8 +8525,8 @@ "z": "1eaf21c8.f7a21e", "name": "Process_pixel calibration", "links": [], - "x": 1475, - "y": 500, + "x": 1505, + "y": 660, "wires": [] }, { @@ -8644,8 +8573,8 @@ "payload": "", "topic": "acq_fnumber_objective", "topicType": "str", - "x": 910, - "y": 520, + "x": 870, + "y": 680, "wires": [ [ "a6983d3232b570a7", @@ -8672,8 +8601,8 @@ "from": "", "to": "", "reg": false, - "x": 1240, - "y": 520, + "x": 1200, + "y": 680, "wires": [ [ "5d5ad36d2c50dcc2" @@ -8706,8 +8635,8 @@ "from": "", "to": "", "reg": false, - "x": 660, - "y": 520, + "x": 620, + "y": 680, "wires": [ [ "6146ba22df928516" @@ -8715,56 +8644,7 @@ ] }, { - "id": "da3d4a90384d62a8", - "type": "subflow:e6665421f66ea4c8", - "z": "1eaf21c8.f7a21e", - "name": "", - "x": 360, - "y": 440, - "wires": [ - [ - "c534fd26.13741", - "54ba7f16.709ad8", - "c67c305004f87e39", - "11955bbeefc29ab4" - ] - ] - }, - { - "id": "f83560053c609914", - "type": "inject", - "z": "1eaf21c8.f7a21e", - "name": "Once", - "props": [], - "repeat": "", - "crontab": "", - "once": true, - "onceDelay": 0.1, - "topic": "", - "x": 130, - "y": 440, - "wires": [ - [ - "da3d4a90384d62a8" - ] - ] - }, - { - "id": "e4ead350b3d07578", - "type": "link out", - "z": "1eaf21c8.f7a21e", - "name": "Reload hardware config", - "mode": "link", - "links": [ - "04920f50bbbf6a2a", - "45a7b5aa.2ed20c" - ], - "x": 875, - "y": 240, - "wires": [] - }, - { - "id": "025ad3cdaa557843", + "id": "d276ce894f483bcf", "type": "ui_toast", "z": "1eaf21c8.f7a21e", "position": "top right", @@ -8778,22 +8658,36 @@ "className": "", "topic": "Resetting hardware configuration to version-specific default", "name": "", - "x": 830, - "y": 120, + "x": 370, + "y": 320, "wires": [] }, { - "id": "932a1ef8c2e81979", + "id": "68703ef63da2f081", "type": "change", "z": "1eaf21c8.f7a21e", - "name": "Choose default hardware config", + "name": "Sanitize hardware version", "rules": [ { "t": "set", - "p": "payload", + "p": "hardware_version", "pt": "msg", - "to": "$join([\"/home/pi/PlanktoScope/default-configs/\", $substringAfter(msg.payload, \"PlanktoScope \"), \".hardware.json\"])", + "to": "$substringAfter(msg.payload, \"PlanktoScope \")", "tot": "jsonata" + }, + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "{}", + "tot": "json" + }, + { + "t": "set", + "p": "payload.hardware_version", + "pt": "msg", + "to": "hardware_version", + "tot": "msg" } ], "action": "", @@ -8801,66 +8695,69 @@ "from": "", "to": "", "reg": false, - "x": 210, - "y": 240, + "x": 390, + "y": 280, "wires": [ [ - "833dac7cbd693c53" + "7c947780b3e03ec4" ] ] }, { - "id": "833dac7cbd693c53", - "type": "exec", + "id": "3973b999ee7b3b1d", + "type": "link out", "z": "1eaf21c8.f7a21e", - "command": "cp", - "addpay": "payload", - "append": "/home/pi/PlanktoScope/hardware.json", - "useSpawn": "false", - "timer": "", - "winHide": false, - "oldrc": false, - "name": "Copy default hardware config", - "x": 500, - "y": 240, + "name": "Reload hardware config", + "mode": "link", + "links": [ + "438febd245a9f73c", + "4ebc0345e63a78e9", + "5984b086eddc9311", + "a2f2a4c7cbae4446" + ], + "x": 975, + "y": 280, + "wires": [] + }, + { + "id": "3bcaf757cbc77fbe", + "type": "subflow:b7861ce703215a01", + "z": "1eaf21c8.f7a21e", + "name": "", + "x": 320, + "y": 600, "wires": [ [ - "0b67ccf37c034e90" - ], - [], - [] + "54ba7f16.709ad8", + "c67c305004f87e39", + "11955bbeefc29ab4" + ] ] }, { - "id": "0b67ccf37c034e90", - "type": "delay", + "id": "862235d10aae5b83", + "type": "inject", "z": "1eaf21c8.f7a21e", - "name": "", - "pauseType": "delay", - "timeout": "500", - "timeoutUnits": "milliseconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "allowrate": false, - "outputs": 1, - "x": 730, - "y": 240, + "name": "Once", + "props": [], + "repeat": "", + "crontab": "", + "once": true, + "onceDelay": 0.1, + "topic": "", + "x": 110, + "y": 620, "wires": [ [ - "da3d4a90384d62a8", - "e4ead350b3d07578" + "3bcaf757cbc77fbe" ] ] }, { - "id": "2716aa5b3d027f95", + "id": "c00c6732b9f36adb", "type": "change", "z": "1eaf21c8.f7a21e", + "g": "dda6605ca2508d77", "name": "Get acq_instrument", "rules": [ { @@ -8883,12 +8780,148 @@ "from": "", "to": "", "reg": false, - "x": 330, - "y": 160, + "x": 310, + "y": 80, + "wires": [ + [ + "a7e5c7f4.644678", + "56dd3f82c45717f0" + ] + ] + }, + { + "id": "4ebc0345e63a78e9", + "type": "link in", + "z": "1eaf21c8.f7a21e", + "name": "Load hardware config", + "links": [ + "3973b999ee7b3b1d" + ], + "x": 145, + "y": 580, "wires": [ [ + "3bcaf757cbc77fbe" + ] + ] + }, + { + "id": "cb9009e8a49e93cc", + "type": "link in", + "z": "1eaf21c8.f7a21e", + "name": "Set hardware version", + "links": [ + "08d177136bd18281", + "9f34e4a2f33c4022" + ], + "x": 205, + "y": 320, + "wires": [ + [ + "68703ef63da2f081", + "d276ce894f483bcf", + "3e2c5c1c.4c57b4", "a7e5c7f4.644678" ] ] + }, + { + "id": "08d177136bd18281", + "type": "link out", + "z": "1eaf21c8.f7a21e", + "name": "Set hardware version", + "mode": "link", + "links": [ + "cb9009e8a49e93cc" + ], + "x": 875, + "y": 160, + "wires": [] + }, + { + "id": "56dd3f82c45717f0", + "type": "link out", + "z": "1eaf21c8.f7a21e", + "name": "Hardware version loaded", + "mode": "link", + "links": [ + "a2f2a4c7cbae4446" + ], + "x": 875, + "y": 120, + "wires": [] + }, + { + "id": "7c947780b3e03ec4", + "type": "set hardware version", + "z": "1eaf21c8.f7a21e", + "name": "", + "x": 680, + "y": 280, + "wires": [ + [ + "3973b999ee7b3b1d" + ] + ] + }, + { + "id": "f952c1cb7e590dc4", + "type": "catch", + "z": "1eaf21c8.f7a21e", + "g": "dda6605ca2508d77", + "name": "", + "scope": "group", + "uncaught": false, + "x": 190, + "y": 140, + "wires": [ + [ + "cf9703e0125167a9", + "907bb11512516d26" + ] + ] + }, + { + "id": "cf9703e0125167a9", + "type": "change", + "z": "1eaf21c8.f7a21e", + "name": "", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "null", + "tot": "json" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 680, + "y": 220, + "wires": [ + [ + "56dd3f82c45717f0" + ] + ] + }, + { + "id": "907bb11512516d26", + "type": "debug", + "z": "1eaf21c8.f7a21e", + "name": "debug 1", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "statusVal": "", + "statusType": "auto", + "x": 120, + "y": 380, + "wires": [] } ] \ No newline at end of file diff --git a/node-red/projects/planktoscopehat/flows.json b/node-red/projects/planktoscopehat/flows.json index ef49e2429..cd403bbc7 100644 --- a/node-red/projects/planktoscopehat/flows.json +++ b/node-red/projects/planktoscopehat/flows.json @@ -1548,6 +1548,11 @@ "passthru": false, "multiple": false, "options": [ + { + "label": "", + "value": "PlanktoScope v2.1", + "type": "str" + }, { "label": "", "value": "PlanktoScope v2.3", @@ -7183,7 +7188,9 @@ "x": 780, "y": 420, "wires": [ - [], + [ + "8cad7139d2a089d9" + ], [], [] ] @@ -7296,6 +7303,26 @@ "y": 460, "wires": [] }, + { + "id": "8cad7139d2a089d9", + "type": "exec", + "z": "9daf9e2b.019fc", + "command": "sudo systemctl restart nodered.service", + "addpay": false, + "append": "", + "useSpawn": "false", + "timer": "", + "winHide": false, + "oldrc": false, + "name": "Restart Node Red", + "x": 1090, + "y": 400, + "wires": [ + [], + [], + [] + ] + }, { "id": "3910d662.fa1f7a", "type": "exec", From b2f40fe461012c9440c3fb39a60ac11b296f8dd9 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Wed, 18 Jun 2025 16:05:17 +0000 Subject: [PATCH 13/19] f --- node-red/projects/adafruithat/flows.json | 2485 +++++++++++----------- 1 file changed, 1226 insertions(+), 1259 deletions(-) diff --git a/node-red/projects/adafruithat/flows.json b/node-red/projects/adafruithat/flows.json index 196cf2b65..b14a8e021 100644 --- a/node-red/projects/adafruithat/flows.json +++ b/node-red/projects/adafruithat/flows.json @@ -124,7 +124,7 @@ "color": "#DDAA99" }, { - "id": "b7861ce703215a01", + "id": "e6665421f66ea4c8", "type": "subflow", "name": "Load hardware config", "info": "", @@ -135,7 +135,7 @@ "y": 40, "wires": [ { - "id": "0f16258953fae292" + "id": "48ceeda454438cb7" } ] } @@ -146,7 +146,7 @@ "y": 40, "wires": [ { - "id": "d0fbcd200cd09981", + "id": "2b1a67ac127f3fe7", "port": 0 } ] @@ -156,29 +156,6 @@ "meta": {}, "color": "#DDAA99" }, - { - "id": "dda6605ca2508d77", - "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", - "c00c6732b9f36adb", - "f952c1cb7e590dc4" - ], - "x": 34, - "y": 39, - "w": 392, - "h": 142 - }, { "id": "3a6bb13f.c9703e", "type": "ui_tab", @@ -380,8 +357,7 @@ "order": 1, "disp": false, "width": "24", - "collapse": false, - "className": "" + "collapse": false }, { "id": "737ec584.2eea2c", @@ -397,11 +373,10 @@ "type": "ui_group", "name": "Group 1", "tab": "3a6bb13f.c9703e", - "order": 2, + "order": 1, "disp": false, "width": "4", - "collapse": false, - "className": "" + "collapse": false }, { "id": "3e1ba03d.f01d8", @@ -418,7 +393,7 @@ "type": "ui_group", "name": "Group 2", "tab": "3a6bb13f.c9703e", - "order": 3, + "order": 2, "disp": false, "width": "4", "collapse": false @@ -428,7 +403,7 @@ "type": "ui_group", "name": "Group 3", "tab": "3a6bb13f.c9703e", - "order": 4, + "order": 3, "disp": false, "width": "4", "collapse": false @@ -438,7 +413,7 @@ "type": "ui_group", "name": "Group 4", "tab": "3a6bb13f.c9703e", - "order": 5, + "order": 4, "disp": false, "width": "4", "collapse": false @@ -448,7 +423,7 @@ "type": "ui_group", "name": "Group 5", "tab": "3a6bb13f.c9703e", - "order": 6, + "order": 5, "disp": false, "width": "4", "collapse": false @@ -458,7 +433,7 @@ "type": "ui_group", "name": "Group 6", "tab": "3a6bb13f.c9703e", - "order": 7, + "order": 6, "disp": false, "width": "4", "collapse": false @@ -513,6 +488,16 @@ "width": 4, "collapse": false }, + { + "id": "404c301a.19c4e", + "type": "ui_group", + "name": "Fraction size", + "tab": "c9194f02.9d5e9", + "order": 2, + "disp": true, + "width": "10", + "collapse": false + }, { "id": "4322c187.e73e5", "type": "ui_group", @@ -553,18 +538,23 @@ "autoConnect": true, "usetls": false, "compatmode": false, - "protocolVersion": 4, + "protocolVersion": "4", "keepalive": "60", "cleansession": true, "birthTopic": "", "birthQos": "0", "birthPayload": "", + "birthMsg": {}, "closeTopic": "", "closeQos": "0", "closePayload": "", + "closeMsg": {}, "willTopic": "", "willQos": "0", - "willPayload": "" + "willPayload": "", + "willMsg": {}, + "userProps": "", + "sessionExpiry": "" }, { "id": "abeb6dad.635a2", @@ -659,7 +649,7 @@ "type": "ui_group", "name": "Shutdown", "tab": "3a6bb13f.c9703e", - "order": 8, + "order": 7, "disp": true, "width": 4, "collapse": false @@ -668,9 +658,9 @@ "id": "3dfd8a69.69ed56", "type": "ui_spacer", "name": "spacer", - "group": "f3ca28ef.4df0a8", - "order": 3, - "width": 4, + "group": "3e1ba03d.f01d8", + "order": 5, + "width": 10, "height": 1 }, { @@ -799,24 +789,12 @@ { "id": "6c31ad948a9d62fd", "type": "ui_spacer", - "z": "b771c342.49603", "name": "spacer", - "group": "3e1ba03d.f01d8", - "order": 5, - "width": 10, + "group": "4248342d.e55fac", + "order": 2, + "width": 1, "height": 1 }, - { - "id": "0035a03e1490cd8c", - "type": "ui_group", - "name": "Setup", - "tab": "3a6bb13f.c9703e", - "order": 1, - "disp": true, - "width": "8", - "collapse": false, - "className": "" - }, { "id": "833bc5bb.217ba8", "type": "ui_group", @@ -849,8 +827,7 @@ "chunk": false, "sendError": false, "encoding": "none", - "allProps": false, - "x": 500, + "x": 560, "y": 60, "wires": [ [ @@ -867,7 +844,7 @@ "property": "payload", "action": "", "pretty": false, - "x": 750, + "x": 730, "y": 60, "wires": [ [ @@ -881,12 +858,11 @@ "z": "1c24ad9c.bebec2", "name": "", "filename": "/home/pi/PlanktoScope/config.json", - "filenameType": "str", "appendNewline": true, "createDir": true, "overwriteFile": "true", "encoding": "none", - "x": 1070, + "x": 990, "y": 160, "wires": [ [] @@ -915,11 +891,9 @@ "name": "Global Set", "func": "global.set(\"config_keys\", Object.keys(msg.payload));\n\nfor (const key in msg.payload) {\n global.set(key, msg.payload[key]);\n}\n\nreturn msg;", "outputs": 1, - "timeout": "", "noerr": 0, "initialize": "", "finalize": "", - "libs": [], "x": 910, "y": 60, "wires": [ @@ -1036,9 +1010,9 @@ ] }, { - "id": "0f16258953fae292", + "id": "48ceeda454438cb7", "type": "file in", - "z": "b7861ce703215a01", + "z": "e6665421f66ea4c8", "name": "", "filename": "/home/pi/PlanktoScope/hardware.json", "filenameType": "str", @@ -1046,20 +1020,19 @@ "chunk": false, "sendError": false, "encoding": "none", - "allProps": false, "x": 250, "y": 40, "wires": [ [ - "81c516291ab19acd" + "853c938a270fd85e" ] ], "info": "# PlanktoScope Help\nThis Node will read the content of the file named **config.txt** containing all the input placeholders.\n" }, { - "id": "81c516291ab19acd", + "id": "853c938a270fd85e", "type": "json", - "z": "b7861ce703215a01", + "z": "e6665421f66ea4c8", "name": "Parse JSON", "property": "payload", "action": "", @@ -1068,14 +1041,14 @@ "y": 40, "wires": [ [ - "d0fbcd200cd09981" + "2b1a67ac127f3fe7" ] ] }, { - "id": "d0fbcd200cd09981", + "id": "2b1a67ac127f3fe7", "type": "change", - "z": "b7861ce703215a01", + "z": "e6665421f66ea4c8", "name": "", "rules": [ { @@ -1097,6 +1070,16 @@ [] ] }, + { + "id": "2f30a6ee99587899", + "type": "comment", + "z": "eaae323a.31b3", + "name": "LICENSE", + "info": "Copyright 2022 Thibaut Pollina and Romain Bazile\nLicensed under GPL v3.0", + "x": 140, + "y": 600, + "wires": [] + }, { "id": "4e78af2d.90be7", "type": "ui_ui_control", @@ -1123,7 +1106,6 @@ "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", - "className": "", "x": 130, "y": 100, "wires": [ @@ -1146,7 +1128,6 @@ "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", - "className": "", "x": 130, "y": 140, "wires": [ @@ -1169,7 +1150,6 @@ "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", - "className": "", "x": 140, "y": 180, "wires": [ @@ -1192,7 +1172,6 @@ "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", - "className": "", "x": 160, "y": 220, "wires": [ @@ -1215,7 +1194,6 @@ "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", - "className": "", "x": 130, "y": 260, "wires": [ @@ -1238,7 +1216,6 @@ "fwdInMessages": true, "resendOnRefresh": false, "templateScope": "local", - "className": "", "x": 160, "y": 60, "wires": [ @@ -1444,7 +1421,7 @@ "raw": false, "topic": "Turning off now!", "name": "Shutdown message", - "x": 580, + "x": 570, "y": 540, "wires": [ [] @@ -1469,7 +1446,7 @@ "from": "", "to": "", "reg": false, - "x": 310, + "x": 300, "y": 500, "wires": [ [ @@ -1528,7 +1505,7 @@ "from": "", "to": "", "reg": false, - "x": 340, + "x": 330, "y": 540, "wires": [ [ @@ -1537,334 +1514,129 @@ ] }, { - "id": "57db4f6279b5afe0", - "type": "comment", - "z": "eaae323a.31b3", - "name": "LICENSE", - "info": "Copyright 2022 Thibaut Pollina and Romain Bazile\nLicensed under GPL v3.0", - "x": 140, - "y": 600, - "wires": [] - }, - { - "id": "6af85f0e0fc21b11", - "type": "ui_ui_control", - "z": "eaae323a.31b3", - "name": "", - "events": "all", - "x": 700, - "y": 720, + "id": "4557d689.a4fa88", + "type": "ui_text_input", + "z": "b771c342.49603", + "name": "sample_ship", + "label": "Name of the ship", + "tooltip": "", + "group": "3e1ba03d.f01d8", + "order": 2, + "width": 0, + "height": 0, + "passthru": true, + "mode": "text", + "delay": "300", + "topic": "sample_ship", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 670, + "y": 80, "wires": [ - [] + [ + "9f501f49.45645" + ] ] }, { - "id": "382f8fcc81f904f1", + "id": "fcfc31ae.af3af", "type": "ui_dropdown", - "z": "eaae323a.31b3", - "name": "", - "label": "Hardware version", + "z": "b771c342.49603", + "name": "sample_sampling_gear", + "label": "Sampling gear*", "tooltip": "", - "place": "Select option", - "group": "0035a03e1490cd8c", - "order": 2, + "place": "Choose from list", + "group": "3e1ba03d.f01d8", + "order": 6, "width": 0, "height": 0, - "passthru": false, + "passthru": true, "multiple": false, "options": [ { - "label": "", - "value": "PlanktoScope v2.3", + "label": "High Speed Net", + "value": "net_hsn", "type": "str" }, { - "label": "", - "value": "PlanktoScope v2.5", + "label": "Tara Decknet", + "value": "net_decknet", "type": "str" }, { - "label": "", - "value": "PlanktoScope v2.6", + "label": "Plankton net", + "value": "net", "type": "str" }, { - "label": "", - "value": "PlanktoScope v3.0", + "label": "Niskin bottle 12L", + "value": "niskin_12L", + "type": "str" + }, + { + "label": "Niskin bottle 24L", + "value": "niskin_24L", + "type": "str" + }, + { + "label": "Pass Hull", + "value": "pass_hull", + "type": "str" + }, + { + "label": "Single location (with net or bucket)", + "value": "single_location", + "type": "str" + }, + { + "label": "Lab culture", + "value": "culture", + "type": "str" + }, + { + "label": "Test", + "value": "test", "type": "str" } ], "payload": "", - "topic": "acq_instrument", + "topic": "sample_sampling_gear", "topicType": "str", "className": "", - "x": 490, - "y": 640, + "x": 630, + "y": 200, "wires": [ [ - "9f34e4a2f33c4022" + "9f501f49.45645", + "46eb1bf8.3dc5f4", + "3ac7b631f5d8ef90" ] ] }, { - "id": "9f34e4a2f33c4022", - "type": "link out", - "z": "eaae323a.31b3", - "name": "Set hardware version", - "mode": "link", - "links": [ - "cb9009e8a49e93cc" - ], - "x": 655, - "y": 640, - "wires": [] - }, - { - "id": "e954204b947a0c70", - "type": "switch", - "z": "eaae323a.31b3", - "name": "", - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "null" - }, - { - "t": "else" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 290, - "y": 680, + "id": "82c5fc77.59c97", + "type": "ui_text_input", + "z": "b771c342.49603", + "name": "sample_operator", + "label": "Name of the operator*", + "tooltip": "", + "group": "3e1ba03d.f01d8", + "order": 3, + "width": 0, + "height": 0, + "passthru": true, + "mode": "text", + "delay": "300", + "topic": "sample_operator", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 650, + "y": 160, "wires": [ [ - "382f8fcc81f904f1", - "e3736dd7be4b7522" - ], - [ - "f80babd43aa7cce4" - ] - ] - }, - { - "id": "e3736dd7be4b7522", - "type": "change", - "z": "eaae323a.31b3", - "name": "Show setup panel", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "{\"group\":{\"show\":[\"Home_Setup\"],\"hide\":[\"Home_Group_1\",\"Home_Group_2\",\"Home_Group_3\",\"Home_Group_4\",\"Home_Group_5\",\"Home_Group_6\"]}}", - "tot": "json" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 490, - "y": 680, - "wires": [ - [ - "6af85f0e0fc21b11" - ] - ] - }, - { - "id": "f80babd43aa7cce4", - "type": "change", - "z": "eaae323a.31b3", - "name": "Show home buttons", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "{\"group\":{\"hide\":[\"Home_Setup\"],\"show\":[\"Home_Group_1\",\"Home_Group_2\",\"Home_Group_3\",\"Home_Group_4\",\"Home_Group_5\",\"Home_Group_6\"]}}", - "tot": "json" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 500, - "y": 720, - "wires": [ - [ - "6af85f0e0fc21b11" - ] - ] - }, - { - "id": "438439b4ae62444c", - "type": "ui_template", - "z": "eaae323a.31b3", - "group": "0035a03e1490cd8c", - "name": "Information", - "order": 1, - "width": "0", - "height": "0", - "format": "
\n

\n To start using your PlanktoScope, please indicate the version of your PlanktoScope hardware:\n

\n
\n", - "storeOutMessages": true, - "fwdInMessages": true, - "resendOnRefresh": true, - "templateScope": "local", - "className": "", - "x": 710, - "y": 680, - "wires": [ - [] - ] - }, - { - "id": "a2f2a4c7cbae4446", - "type": "link in", - "z": "eaae323a.31b3", - "name": "Load hardware version", - "links": [ - "3973b999ee7b3b1d", - "56dd3f82c45717f0" - ], - "x": 185, - "y": 680, - "wires": [ - [ - "e954204b947a0c70" - ] - ] - }, - { - "id": "4557d689.a4fa88", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "sample_ship", - "label": "Name of the ship", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": "300", - "topic": "sample_ship", - "sendOnBlur": true, - "className": "", - "topicType": "str", - "x": 670, - "y": 80, - "wires": [ - [ - "9f501f49.45645" - ] - ] - }, - { - "id": "fcfc31ae.af3af", - "type": "ui_dropdown", - "z": "b771c342.49603", - "name": "sample_sampling_gear", - "label": "Sampling gear*", - "tooltip": "", - "place": "Choose from list", - "group": "3e1ba03d.f01d8", - "order": 6, - "width": 0, - "height": 0, - "passthru": true, - "multiple": false, - "options": [ - { - "label": "High Speed Net", - "value": "net_hsn", - "type": "str" - }, - { - "label": "Tara Decknet", - "value": "net_decknet", - "type": "str" - }, - { - "label": "Plankton net", - "value": "net", - "type": "str" - }, - { - "label": "Niskin bottle 12L", - "value": "niskin_12L", - "type": "str" - }, - { - "label": "Niskin bottle 24L", - "value": "niskin_24L", - "type": "str" - }, - { - "label": "Pass Hull", - "value": "pass_hull", - "type": "str" - }, - { - "label": "Single location (with net or bucket)", - "value": "single_location", - "type": "str" - }, - { - "label": "Lab culture", - "value": "culture", - "type": "str" - }, - { - "label": "Test", - "value": "test", - "type": "str" - } - ], - "payload": "", - "topic": "sample_sampling_gear", - "topicType": "str", - "className": "", - "x": 630, - "y": 200, - "wires": [ - [ - "9f501f49.45645", - "46eb1bf8.3dc5f4", - "3ac7b631f5d8ef90" - ] - ] - }, - { - "id": "82c5fc77.59c97", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "sample_operator", - "label": "Name of the operator*", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 3, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": "300", - "topic": "sample_operator", - "sendOnBlur": true, - "className": "", - "topicType": "str", - "x": 650, - "y": 160, - "wires": [ - [ - "9f501f49.45645" + "9f501f49.45645" ] ] }, @@ -2381,7 +2153,7 @@ "wires": [ [ "14658615.47c862", - "a9fb1f4b83fc25a7" + "3318a1aaa70fc2ee" ] ] }, @@ -2443,7 +2215,7 @@ "wires": [ [ "14658615.47c862", - "ad54b89540460d27" + "cc67c97f55a340d3" ] ] }, @@ -2504,7 +2276,7 @@ "wires": [ [ "14658615.47c862", - "c21bf0244e67e40a" + "9c8f370d124a55e4" ] ] }, @@ -2879,8 +2651,6 @@ "mode": "number", "delay": "300", "topic": "acq_minimum_mesh", - "sendOnBlur": true, - "className": "", "topicType": "str", "x": 640, "y": 360, @@ -2905,8 +2675,6 @@ "mode": "number", "delay": "300", "topic": "acq_maximum_mesh", - "sendOnBlur": true, - "className": "", "topicType": "str", "x": 640, "y": 400, @@ -2984,12 +2752,12 @@ "wires": [ [ "14658615.47c862", - "f8044c35996322e6" + "38616e738f4f615b" ] ] }, { - "id": "a9fb1f4b83fc25a7", + "id": "3318a1aaa70fc2ee", "type": "change", "z": "b771c342.49603", "name": "Repopulate input fields", @@ -3016,7 +2784,7 @@ ] }, { - "id": "ad54b89540460d27", + "id": "cc67c97f55a340d3", "type": "change", "z": "b771c342.49603", "name": "Repopulate input fields", @@ -3043,7 +2811,7 @@ ] }, { - "id": "c21bf0244e67e40a", + "id": "9c8f370d124a55e4", "type": "change", "z": "b771c342.49603", "name": "Repopulate input fields", @@ -3070,7 +2838,7 @@ ] }, { - "id": "f8044c35996322e6", + "id": "38616e738f4f615b", "type": "change", "z": "b771c342.49603", "name": "Repopulate input fields", @@ -3097,7 +2865,7 @@ ] }, { - "id": "8b48a02877b7b6d6", + "id": "577be9c22c739ca0", "type": "inject", "z": "b771c342.49603", "name": "", @@ -3164,7 +2932,7 @@ "z": "bccd1f23.87219", "name": "down", "group": "fbd92986.1028c8", - "order": 8, + "order": 6, "width": 4, "height": 1, "passthru": true, @@ -3190,7 +2958,7 @@ "z": "bccd1f23.87219", "name": "up", "group": "fbd92986.1028c8", - "order": 1, + "order": 3, "width": 4, "height": 1, "passthru": false, @@ -3430,6 +3198,21 @@ ] ] }, + { + "id": "cbb8afed.0a026", + "type": "rpi-gpio out", + "z": "bccd1f23.87219", + "name": "LED Output", + "pin": "21", + "set": true, + "level": "0", + "freq": "", + "out": "out", + "bcm": true, + "x": 550, + "y": 120, + "wires": [] + }, { "id": "3cb96380.e575ec", "type": "function", @@ -3516,7 +3299,7 @@ "type": "function", "z": "bccd1f23.87219", "name": "focus", - "func": "var distance = global.get(\"focus_distance\");\nvar speed = global.get(\"focus_speed\");\n\nif (distance === undefined || distance === \"\" || distance === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Distance\";\n return [null, msg]\n}\nif (speed === undefined || speed === \"\" || speed === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Speed\";\n return [null, msg]\n}\n// msg.payload is UP or DOWN here\nmsg.payload={\"action\":\"move\", \n \"direction\":msg.payload,\n \"distance\":(distance/1000),\n \"speed\": (speed/1000)\n};\nreturn [msg, null];", + "func": "var distance = global.get(\"focus_distance\");\n\nif (distance === undefined || distance === \"\" || distance === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Distance\";\n return [null, msg]\n}else {\n distance = global.get(\"focus_distance\");\n // msg.payload is UP or DOWN here\n msg.payload={\"action\":\"move\", \n \"direction\":msg.payload,\n \"distance\":(distance/1000)};\n}\nreturn [msg, null];", "outputs": 2, "noerr": 0, "initialize": "", @@ -3584,7 +3367,7 @@ "z": "bccd1f23.87219", "name": "", "group": "fbd92986.1028c8", - "order": 2, + "order": 1, "width": 4, "height": 1, "passthru": false, @@ -3611,7 +3394,7 @@ "z": "bccd1f23.87219", "name": "", "group": "fbd92986.1028c8", - "order": 7, + "order": 8, "width": 4, "height": 1, "passthru": false, @@ -3657,6 +3440,31 @@ ] ] }, + { + "id": "9a1d0e7c.2d5a1", + "type": "inject", + "z": "bccd1f23.87219", + "name": "Default: OFF", + "props": [ + { + "p": "payload" + } + ], + "repeat": "", + "crontab": "", + "once": true, + "onceDelay": 0.1, + "topic": "", + "payload": "off", + "payloadType": "str", + "x": 130, + "y": 120, + "wires": [ + [ + "f0775525.cf806" + ] + ] + }, { "id": "f782a471.447748", "type": "inject", @@ -3792,7 +3600,7 @@ "z": "bccd1f23.87219", "name": "", "group": "fbd92986.1028c8", - "order": 3, + "order": 2, "width": 4, "height": 1, "passthru": false, @@ -3819,7 +3627,7 @@ "z": "bccd1f23.87219", "name": "", "group": "fbd92986.1028c8", - "order": 6, + "order": 7, "width": 4, "height": 1, "passthru": false, @@ -3841,35 +3649,72 @@ ] }, { - "id": "8ea9dc9a.c7d87", - "type": "function", - "z": "bccd1f23.87219", - "name": "Encapsulate settings", - "func": "msg.payload = {\n \"action\":\"settings\", \n \"settings\":{[msg.topic]:msg.payload}\n}\n\nmsg.topic = \"imager/image\"\nreturn msg;", - "outputs": 1, - "noerr": 0, - "initialize": "", - "finalize": "", - "x": 1120, - "y": 940, - "wires": [ - [ - "845e06e1.0d812" - ] - ] - }, - { - "id": "5765a825.a595c8", - "type": "ui_slider", + "id": "f0775525.cf806", + "type": "ui_multistate_switch", "z": "bccd1f23.87219", - "name": "Shutter speed slider", - "label": "Shutter Speed", - "tooltip": "In microseconds, up to 1000µs, 125µs by default", - "group": "8c38a81e.9897a8", - "order": 4, - "width": 0, - "height": 0, - "passthru": true, + "name": "light_control", + "group": "4248342d.e55fac", + "order": 1, + "width": 5, + "height": 1, + "label": "Light ", + "stateField": "payload", + "enableField": "enable", + "rounded": true, + "useThemeColors": true, + "hideSelectedLabel": false, + "options": [ + { + "label": "Off", + "value": "0", + "valueType": "num", + "color": "#009933" + }, + { + "label": "On", + "value": "1", + "valueType": "num", + "color": "#999999" + } + ], + "x": 350, + "y": 120, + "wires": [ + [ + "cbb8afed.0a026" + ] + ] + }, + { + "id": "8ea9dc9a.c7d87", + "type": "function", + "z": "bccd1f23.87219", + "name": "Encapsulate settings", + "func": "msg.payload = {\n \"action\":\"settings\", \n \"settings\":{[msg.topic]:msg.payload}\n}\n\nmsg.topic = \"imager/image\"\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "x": 1120, + "y": 940, + "wires": [ + [ + "845e06e1.0d812" + ] + ] + }, + { + "id": "5765a825.a595c8", + "type": "ui_slider", + "z": "bccd1f23.87219", + "name": "Shutter speed slider", + "label": "Shutter Speed", + "tooltip": "In microseconds, up to 1000µs, 125µs by default", + "group": "8c38a81e.9897a8", + "order": 4, + "width": 0, + "height": 0, + "passthru": true, "outs": "end", "topic": "shutter_speed", "topicType": "str", @@ -4251,7 +4096,7 @@ "y": 840, "wires": [ [ - "f62c3241bd753f24" + "37f412d1454deb64" ] ] }, @@ -4358,6 +4203,32 @@ ] ] }, + { + "id": "d5415af6.e06cc", + "type": "ui_text_input", + "z": "bccd1f23.87219", + "name": "WB Red input", + "label": "WB: Red", + "tooltip": "From 0.0 to 32.0", + "group": "8c38a81e.9897a8", + "order": 6, + "width": 4, + "height": 1, + "passthru": true, + "mode": "number", + "delay": "0", + "topic": "red", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 580, + "y": 1040, + "wires": [ + [ + "f7a7398fd6ce4a4f" + ] + ] + }, { "id": "dba68c1f.e3144", "type": "ui_text_input", @@ -4380,13 +4251,13 @@ "y": 1080, "wires": [ [ - "3ece53716a02e09e" + "df8a7667c9d133b1" ] ] }, { - "id": "33ef60a6a80aa3a7", - "type": "subflow:b7861ce703215a01", + "id": "d91550e8b15ed3b8", + "type": "subflow:e6665421f66ea4c8", "z": "bccd1f23.87219", "name": "", "x": 160, @@ -4401,69 +4272,43 @@ ] }, { - "id": "a3d034643b56796f", - "type": "inject", - "z": "bccd1f23.87219", - "name": "Once", - "props": [], - "repeat": "", - "crontab": "", - "once": true, - "onceDelay": 0.1, - "topic": "", - "x": 70, - "y": 1080, - "wires": [ - [ - "33ef60a6a80aa3a7" - ] - ] - }, - { - "id": "5984b086eddc9311", + "id": "04920f50bbbf6a2a", "type": "link in", "z": "bccd1f23.87219", "name": "Load hardware config", "links": [ - "3973b999ee7b3b1d", - "5d3df1564b9af89c" + "e4ead350b3d07578", + "4a1f303f0b6f7f42" ], "x": 25, "y": 1000, "wires": [ [ - "33ef60a6a80aa3a7" + "d91550e8b15ed3b8" ] ] }, { - "id": "d5415af6.e06cc", - "type": "ui_text_input", + "id": "7386eaf7ca9d8bfa", + "type": "inject", "z": "bccd1f23.87219", - "name": "WB Red input", - "label": "WB: Red", - "tooltip": "From 0.0 to 32.0", - "group": "8c38a81e.9897a8", - "order": 6, - "width": 4, - "height": 1, - "passthru": true, - "mode": "number", - "delay": "0", - "topic": "red", - "sendOnBlur": true, - "className": "", - "topicType": "str", - "x": 580, - "y": 1040, + "name": "Once", + "props": [], + "repeat": "", + "crontab": "", + "once": true, + "onceDelay": 0.1, + "topic": "", + "x": 50, + "y": 1080, "wires": [ [ - "01c2b633558b0b02" + "d91550e8b15ed3b8" ] ] }, { - "id": "01c2b633558b0b02", + "id": "f7a7398fd6ce4a4f", "type": "switch", "z": "bccd1f23.87219", "name": "Validate", @@ -4492,13 +4337,13 @@ "5e147425.7666ec" ], [ - "cbfaf049d92be90e", - "5d3df1564b9af89c" + "64b05eea4c5469be", + "4a1f303f0b6f7f42" ] ] }, { - "id": "3ece53716a02e09e", + "id": "df8a7667c9d133b1", "type": "switch", "z": "bccd1f23.87219", "name": "Validate", @@ -4527,13 +4372,13 @@ "5e147425.7666ec" ], [ - "cbfaf049d92be90e", - "5d3df1564b9af89c" + "64b05eea4c5469be", + "4a1f303f0b6f7f42" ] ] }, { - "id": "cbfaf049d92be90e", + "id": "64b05eea4c5469be", "type": "ui_toast", "z": "bccd1f23.87219", "position": "top right", @@ -4552,20 +4397,20 @@ "wires": [] }, { - "id": "5d3df1564b9af89c", + "id": "4a1f303f0b6f7f42", "type": "link out", "z": "bccd1f23.87219", "name": "Reload hardware config", "mode": "link", "links": [ - "5984b086eddc9311" + "04920f50bbbf6a2a" ], "x": 915, "y": 1140, "wires": [] }, { - "id": "f62c3241bd753f24", + "id": "37f412d1454deb64", "type": "ui_slider", "z": "bccd1f23.87219", "name": "ISO selector", @@ -4580,7 +4425,7 @@ "topic": "topic", "topicType": "msg", "min": "50", - "max": "650", + "max": "800", "step": "50", "className": "", "x": 570, @@ -4592,237 +4437,94 @@ ] }, { - "id": "bf696a1bfcf40cc9", - "type": "function", - "z": "bccd1f23.87219", - "name": "Get led status", - "func": "msg.topic = \"light\"\nmsg.payload = {\"action\":\"status\"}\n\nreturn msg;", - "outputs": 1, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 1680, - "y": 100, - "wires": [ - [ - "853fdbc93d99656b" - ] - ] - }, - { - "id": "853fdbc93d99656b", - "type": "mqtt out", - "z": "bccd1f23.87219", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "respTopic": "", - "contentType": "", - "userProps": "", - "correl": "", - "expiry": "", - "broker": "8dc3722c.06efa8", - "x": 1850, - "y": 100, - "wires": [] - }, - { - "id": "73d75d56a5860c40", - "type": "inject", - "z": "bccd1f23.87219", - "name": "Trigger", - "props": [], - "repeat": "", - "crontab": "", - "once": true, - "onceDelay": "0", - "topic": "", - "x": 1500, - "y": 100, + "id": "f59a2f0d.5e9af", + "type": "ui_numeric", + "z": "baa1e3d9.cb29d", + "name": "acq_minimum_mesh", + "label": "Min fraction size (μm)", + "tooltip": "", + "group": "404c301a.19c4e", + "order": 1, + "width": 5, + "height": 1, + "wrap": false, + "passthru": true, + "topic": "acq_minimum_mesh", + "format": "{{value}}", + "min": 0, + "max": "300", + "step": "10", + "x": 640, + "y": 160, "wires": [ [ - "bf696a1bfcf40cc9" + "fb887036.12429" ] ] }, { - "id": "310ee70930b17fae", - "type": "mqtt in", - "z": "bccd1f23.87219", - "name": "", - "topic": "status/light", - "qos": "0", - "datatype": "json", - "broker": "8dc3722c.06efa8", - "nl": false, - "rap": false, - "inputs": 0, - "x": 1480, - "y": 180, + "id": "6008a8bb.259f08", + "type": "ui_numeric", + "z": "baa1e3d9.cb29d", + "name": "acq_maximum_mesh", + "label": "Max fraction size (μm)", + "tooltip": "", + "group": "404c301a.19c4e", + "order": 2, + "width": 5, + "height": 1, + "wrap": false, + "passthru": true, + "topic": "acq_maximum_mesh", + "format": "{{value}}", + "min": "200", + "max": "2000", + "step": "100", + "x": 640, + "y": 200, "wires": [ [ - "fcaf6b9230805de2" + "fb887036.12429" ] ] }, { - "id": "fcaf6b9230805de2", - "type": "json", - "z": "bccd1f23.87219", - "name": "", - "property": "payload", - "action": "obj", - "pretty": true, - "x": 1630, - "y": 180, + "id": "6b34c456.83178c", + "type": "ui_text_input", + "z": "baa1e3d9.cb29d", + "name": "acq_id", + "label": "Acquisition unique ID*", + "tooltip": "", + "group": "4322c187.e73e5", + "order": 1, + "width": 5, + "height": 1, + "passthru": true, + "mode": "text", + "delay": 300, + "topic": "acq_id", + "sendOnBlur": true, + "className": "", + "topicType": "str", + "x": 690, + "y": 240, "wires": [ [ - "1e021d2306c69193" + "fb887036.12429" ] ] }, { - "id": "1e9ddd41b0fa067d", - "type": "ui_multistate_switch", - "z": "bccd1f23.87219", - "name": "light_control", - "group": "4248342d.e55fac", - "order": 1, - "width": 6, - "height": 1, - "label": "Light ", - "stateField": "payload", - "enableField": "enable", - "passthroughField": "passthrough", - "inputMsgField": "inputmsg", - "rounded": true, - "useThemeColors": true, - "hideSelectedLabel": false, - "multilineLabel": false, - "passThrough": "never", - "inputMsg": "all", - "userInput": "enabled_show", - "options": [ - { - "label": "Off", - "value": "off", - "valueType": "str", - "color": "#009933" - }, - { - "label": "On", - "value": "on", - "valueType": "str", - "color": "#999999" - } - ], - "topic": "", - "x": 1510, - "y": 260, - "wires": [ - [ - "fa4e2b4c606ec8a8" - ] - ] - }, - { - "id": "fa4e2b4c606ec8a8", - "type": "function", - "z": "bccd1f23.87219", - "name": "Prepare message", - "func": "msg.topic = \"light\"\nmsg.payload = {\"action\": msg.payload}\n\nreturn msg;", - "outputs": 1, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 1710, - "y": 260, - "wires": [ - [ - "82b88ded06e67fba" - ] - ] - }, - { - "id": "82b88ded06e67fba", - "type": "mqtt out", - "z": "bccd1f23.87219", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "respTopic": "", - "contentType": "", - "userProps": "", - "correl": "", - "expiry": "", - "broker": "8dc3722c.06efa8", - "x": 1890, - "y": 260, - "wires": [] - }, - { - "id": "1e021d2306c69193", - "type": "function", - "z": "bccd1f23.87219", - "name": "Set Led Status", - "func": "msg.payload = msg.payload.status.toLowerCase();\n\nreturn msg;", - "outputs": 1, - "timeout": 0, - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 1780, - "y": 180, - "wires": [ - [ - "1e9ddd41b0fa067d" - ] - ] - }, - { - "id": "6b34c456.83178c", - "type": "ui_text_input", - "z": "baa1e3d9.cb29d", - "name": "acq_id", - "label": "Acquisition unique ID*", - "tooltip": "", - "group": "4322c187.e73e5", - "order": 1, - "width": 5, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "acq_id", - "sendOnBlur": true, - "className": "", - "topicType": "str", - "x": 690, - "y": 180, - "wires": [ - [ - "fb887036.12429" - ] - ] - }, - { - "id": "cc0ca68b.4263a8", - "type": "ui_dropdown", - "z": "baa1e3d9.cb29d", - "name": "acq_celltype", - "label": "Flowcell thickness*", - "tooltip": "", - "place": "Select option", - "group": "4322c187.e73e5", - "order": 6, - "width": 5, + "id": "cc0ca68b.4263a8", + "type": "ui_dropdown", + "z": "baa1e3d9.cb29d", + "name": "acq_celltype", + "label": "Flowcell thickness*", + "tooltip": "", + "place": "Select option", + "group": "4322c187.e73e5", + "order": 6, + "width": 5, "height": 1, "passthru": true, "multiple": false, @@ -4858,7 +4560,7 @@ "topicType": "str", "className": "", "x": 670, - "y": 100, + "y": 80, "wires": [ [ "fb887036.12429", @@ -4878,7 +4580,7 @@ "finalize": "", "libs": [], "x": 920, - "y": 180, + "y": 220, "wires": [ [ "52ea7d01.711034" @@ -4900,8 +4602,8 @@ "resendOnRefresh": false, "templateScope": "local", "className": "", - "x": 550, - "y": 40, + "x": 650, + "y": 20, "wires": [ [] ] @@ -4959,7 +4661,7 @@ "resendOnRefresh": false, "templateScope": "local", "className": "", - "x": 1160, + "x": 1180, "y": 380, "wires": [ [] @@ -4972,12 +4674,13 @@ "name": "Image control", "func": "// Reset the number of images taken\nflow.set('img_counter', 0);\n\nvar acq_celltype = global.get(\"acq_celltype\");\nvar acq_minimum_mesh = global.get(\"acq_minimum_mesh\");\nvar acq_maximum_mesh = global.get(\"acq_maximum_mesh\");\nvar imaging_pump_volume = global.get(\"imaging_pump_volume\");\nvar acq_id = global.get(\"acq_id\");\nvar nb_frame = global.get(\"nb_frame\");\nvar pump_direction = global.get(\"pump_direction\");\nvar sleep_before = global.get(\"sleep_before\");\nvar object_date = global.get(\"object_date\");\n\nif (acq_celltype === undefined || acq_celltype === \"\") {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Type of the flowcell\";\n return [null, msg];\n} else if (acq_minimum_mesh === undefined || acq_minimum_mesh === \"\") {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Lower fraction size\";\n return [null, msg];\n} else if (acq_maximum_mesh === undefined || acq_maximum_mesh === \"\") {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Upper fraction size\";\n return [null, msg];\n} else if (imaging_pump_volume === undefined || imaging_pump_volume === \"\" || imaging_pump_volume === null) {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Volume inbetween images\";\n return [null, msg];\n} else if (acq_id === undefined || acq_id === \"\") {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Acquisition ID\";\n return [null, msg];\n} else if (nb_frame === undefined || nb_frame === \"\" || nb_frame === null) {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Number of image to save\";\n return [null, msg];\n} else if (pump_direction === undefined || pump_direction === \"\" || pump_direction === null) {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Pump direction\";\n return [null, msg];\n} else if (sleep_before === undefined || sleep_before === \"\" || sleep_before === null) {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Delay before image\";\n return [null, msg];\n}else if (object_date === undefined || object_date === \"\" || object_date === null) {\n msg.topic = \"Missing entry :\";\n msg.payload = \"Object date\";\n return [null, msg];\n}\n\nmsg.payload = {\n \"action\": \"image\",\n \"sleep\": sleep_before,\n \"pump_direction\": pump_direction,\n \"volume\": imaging_pump_volume,\n \"nb_frame\": nb_frame,\n}\nmsg.send = true\n\nreturn [msg, null];", "outputs": 2, + "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 640, - "y": 440, + "x": 680, + "y": 480, "wires": [ [ "52ea7d01.711034", @@ -5001,10 +4704,11 @@ "ok": "OK", "cancel": "", "raw": false, + "className": "", "topic": "", "name": "", - "x": 890, - "y": 520, + "x": 950, + "y": 560, "wires": [ [] ] @@ -5017,9 +4721,14 @@ "topic": "", "qos": "", "retain": "", + "respTopic": "", + "contentType": "", + "userProps": "", + "correl": "", + "expiry": "", "broker": "8dc3722c.06efa8", - "x": 1130, - "y": 420, + "x": 1150, + "y": 440, "wires": [] }, { @@ -5036,12 +4745,14 @@ "tooltip": "", "color": "", "bgcolor": "#AD1625", + "className": "", "icon": "cancel", "payload": "{\"action\":\"stop\"}", "payloadType": "json", "topic": "imager/image", - "x": 420, - "y": 480, + "topicType": "str", + "x": 460, + "y": 520, "wires": [ [ "d74210ef.edc15" @@ -5057,8 +4768,8 @@ "qos": "", "retain": "", "broker": "8dc3722c.06efa8", - "x": 610, - "y": 480, + "x": 650, + "y": 520, "wires": [] }, { @@ -5084,8 +4795,8 @@ "offvalueType": "str", "officon": "", "offcolor": "", - "x": 420, - "y": 520, + "x": 460, + "y": 560, "wires": [ [ "6b2239f3.41fa3" @@ -5104,8 +4815,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 870, - "y": 400, + "x": 910, + "y": 440, "wires": [ [ "29be525e.0c87fe" @@ -5131,8 +4842,8 @@ "randomUnits": "seconds", "drop": false, "outputs": 1, - "x": 900, - "y": 440, + "x": 940, + "y": 480, "wires": [ [ "c3e50240.82aa58" @@ -5159,8 +4870,8 @@ "payloadType": "str", "topic": "imager/image", "topicType": "str", - "x": 420, - "y": 400, + "x": 680, + "y": 440, "wires": [ [ "52ea7d01.711034" @@ -5174,14 +4885,16 @@ "name": "", "env": [], "x": 110, - "y": 180, + "y": 220, "wires": [ [ "f3658d30.b8448", "de2c90cf.b73b08", "4be09c97f86897d9", "f573206abefa9518", - "f948151ab4031df4" + "f948151ab4031df4", + "5e3dec55.881074", + "d3ca8847.4d1ae" ] ] }, @@ -5192,13 +4905,11 @@ "name": "get acq_id", "func": "msg.payload = msg.payload.acq_id;\nreturn msg;", "outputs": 1, - "timeout": "", "noerr": 0, "initialize": "", "finalize": "", - "libs": [], "x": 330, - "y": 180, + "y": 240, "wires": [ [ "6b34c456.83178c" @@ -5212,19 +4923,50 @@ "name": "get acq_celltype", "func": "msg.topic = 'acq_celltype';\nmsg.payload = msg.payload.acq_celltype;\nreturn msg;", "outputs": 1, - "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 340, - "y": 100, + "y": 80, "wires": [ [ "cc0ca68b.4263a8" ] ] }, + { + "id": "5e3dec55.881074", + "type": "function", + "z": "baa1e3d9.cb29d", + "name": "get acq_minimum_mesh", + "func": "msg.payload = msg.payload.acq_minimum_mesh;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 370, + "y": 160, + "wires": [ + [ + "f59a2f0d.5e9af" + ] + ] + }, + { + "id": "d3ca8847.4d1ae", + "type": "function", + "z": "baa1e3d9.cb29d", + "name": "get acq_maximum_mesh", + "func": "msg.payload = msg.payload.acq_maximum_mesh;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 370, + "y": 200, + "wires": [ + [ + "6008a8bb.259f08" + ] + ] + }, { "id": "b402f719.55bc98", "type": "inject", @@ -5246,8 +4988,8 @@ "topic": "pump_direction", "payload": "FORWARD", "payloadType": "str", - "x": 180, - "y": 520, + "x": 220, + "y": 560, "wires": [ [ "bb62da8a.ebc328" @@ -5264,8 +5006,8 @@ "noerr": 0, "initialize": "", "finalize": "", - "x": 620, - "y": 520, + "x": 660, + "y": 560, "wires": [ [] ] @@ -5289,7 +5031,7 @@ "className": "", "topicType": "str", "x": 680, - "y": 220, + "y": 280, "wires": [ [ "fb887036.12429", @@ -5316,11 +5058,6 @@ "v": "status/focus", "vt": "str" }, - { - "t": "eq", - "v": "status/light", - "vt": "str" - }, { "t": "eq", "v": "status/imager", @@ -5329,7 +5066,7 @@ ], "checkall": "true", "repair": false, - "outputs": 4, + "outputs": 3, "x": 320, "y": 800, "wires": [ @@ -5341,9 +5078,6 @@ "c516d9ea.f7f6e", "6742014e.1bb238" ], - [ - "6742014e.1bb238" - ], [ "307c851e.fb0f7a", "2b9d6988.d84836" @@ -5478,7 +5212,7 @@ "raw": false, "topic": "", "name": "", - "x": 1270, + "x": 1260, "y": 900, "wires": [] }, @@ -5569,7 +5303,7 @@ "format": "{{msg.payload}}", "layout": "col-center", "x": 1200, - "y": 100, + "y": 140, "wires": [] }, { @@ -5584,7 +5318,7 @@ "finalize": "", "libs": [], "x": 960, - "y": 100, + "y": 140, "wires": [ [ "9bd72495.a8a098" @@ -5605,7 +5339,7 @@ "format": "{{msg.payload}} mL", "layout": "col-center", "x": 1200, - "y": 260, + "y": 300, "wires": [] }, { @@ -5619,7 +5353,7 @@ "initialize": "", "finalize": "", "x": 950, - "y": 260, + "y": 300, "wires": [ [ "8e16aa2f.e40398" @@ -5712,7 +5446,7 @@ "step": "0.1", "className": "", "x": 670, - "y": 140, + "y": 120, "wires": [ [ "fb887036.12429" @@ -5727,8 +5461,8 @@ "links": [ "559a8085.1d6b9" ], - "x": 735, - "y": 60, + "x": 795, + "y": 140, "wires": [ [ "99b11fe4.2795d" @@ -5749,7 +5483,7 @@ "fwdInMessages": false, "resendOnRefresh": false, "templateScope": "local", - "x": 1270, + "x": 1260, "y": 820, "wires": [ [] @@ -5761,8 +5495,8 @@ "z": "baa1e3d9.cb29d", "name": "", "env": [], - "x": 890, - "y": 480, + "x": 930, + "y": 520, "wires": [ [] ] @@ -5779,7 +5513,7 @@ "finalize": "", "libs": [], "x": 330, - "y": 220, + "y": 280, "wires": [ [ "51b4d0df.d70a88" @@ -5798,10 +5532,10 @@ "finalize": "", "libs": [], "x": 380, - "y": 260, + "y": 320, "wires": [ [ - "0df8d1d86af6455a" + "e1acc6c599033114" ] ] }, @@ -5812,13 +5546,12 @@ "name": "get sleep_before", "func": "msg.payload = msg.payload.sleep_before;\nreturn msg;", "outputs": 1, - "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 340, - "y": 140, + "y": 120, "wires": [ [ "49ea1123.ee1768" @@ -5831,8 +5564,8 @@ "z": "baa1e3d9.cb29d", "name": "onTab", "events": "all", - "x": 310, - "y": 340, + "x": 330, + "y": 380, "wires": [ [ "9b69ea945b587192" @@ -5850,8 +5583,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 460, - "y": 340, + "x": 480, + "y": 380, "wires": [ [ "52ea7d01.711034" @@ -5862,7 +5595,7 @@ ] }, { - "id": "0df8d1d86af6455a", + "id": "e1acc6c599033114", "type": "ui_text_input", "z": "baa1e3d9.cb29d", "name": "imaging_pump_volume", @@ -5873,14 +5606,14 @@ "width": 0, "height": 0, "passthru": true, - "mode": "number", + "mode": "text", "delay": 300, "topic": "imaging_pump_volume", "sendOnBlur": true, "className": "", "topicType": "str", "x": 630, - "y": 260, + "y": 320, "wires": [ [ "fb887036.12429", @@ -5889,12 +5622,12 @@ ] }, { - "id": "37116281279b9b82", + "id": "f4caa15e2bbfd6e7", "type": "ui_template", "z": "baa1e3d9.cb29d", "group": "4322c187.e73e5", "name": "Start Acquisition", - "order": 12, + "order": 13, "width": "5", "height": "1", "format": "\n\n", @@ -5903,8 +5636,8 @@ "resendOnRefresh": false, "templateScope": "local", "className": "", - "x": 420, - "y": 440, + "x": 460, + "y": 480, "wires": [ [ "c9f510c0.7d1328" @@ -6139,7 +5872,7 @@ "raw": false, "topic": "", "name": "", - "x": 1350, + "x": 1340, "y": 680, "wires": [] }, @@ -6156,7 +5889,7 @@ "targetType": "full", "statusVal": "", "statusType": "auto", - "x": 840, + "x": 830, "y": 760, "wires": [] }, @@ -6316,6 +6049,7 @@ "fwdInMessages": true, "resendOnRefresh": true, "templateScope": "local", + "className": "", "x": 1340, "y": 760, "wires": [ @@ -6387,7 +6121,7 @@ "allowHTML": false, "outputs": 1, "topic": "", - "x": 770, + "x": 790, "y": 140, "wires": [ [ @@ -6476,7 +6210,7 @@ "noerr": 0, "initialize": "", "finalize": "", - "x": 950, + "x": 990, "y": 140, "wires": [ [] @@ -6537,7 +6271,7 @@ "noerr": 0, "initialize": "", "finalize": "", - "x": 620, + "x": 630, "y": 140, "wires": [ [ @@ -6710,7 +6444,7 @@ "resendOnRefresh": false, "templateScope": "local", "className": "", - "x": 1380, + "x": 1370, "y": 600, "wires": [ [] @@ -6761,7 +6495,7 @@ "from": "", "to": "", "reg": false, - "x": 1020, + "x": 1010, "y": 840, "wires": [ [ @@ -7062,7 +6796,7 @@ "name": "", "group": "a7d64879.38298", "order": 4, - "width": "6", + "width": 6, "height": 1, "passthru": false, "label": "Reboot", @@ -7079,7 +6813,7 @@ "y": 240, "wires": [ [ - "611a8b1c.a829b4" + "4af9112d.87767" ] ] }, @@ -7110,7 +6844,7 @@ "name": "", "group": "a7d64879.38298", "order": 5, - "width": "6", + "width": 6, "height": 1, "passthru": false, "label": "Shutdown", @@ -7127,19 +6861,18 @@ "y": 320, "wires": [ [ - "611a8b1c.a829b4" + "4af9112d.87767" ] ] }, { - "id": "b81b990a.d4dca", - "type": "link in", + "id": "4af9112d.87767", + "type": "python3-function", "z": "9daf9e2b.019fc", - "name": "Shutdown", - "links": [ - "e08cfcb8.2a67e8" - ], - "x": 195, + "name": "action", + "func": "#!/usr/bin/python3\nimport smbus2 as smbus\n\nbus = smbus.SMBus(1)\n#turn off LED\nbus.write_byte_data(0x0d, 0x07, 0x00)\n#turn off Fan\nbus.write_byte_data(0x0d, 0x08, 0x00)\n\n#msg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg", + "outputs": 1, + "x": 330, "y": 280, "wires": [ [ @@ -7148,13 +6881,13 @@ ] }, { - "id": "ea4fae012404854c", + "id": "466eb611.4da048", "type": "ui_button", "z": "9daf9e2b.019fc", "name": "", "group": "a7d64879.38298", "order": 2, - "width": "6", + "width": 6, "height": 1, "passthru": true, "label": "Restart Hardware Controller", @@ -7167,62 +6900,184 @@ "payloadType": "str", "topic": "", "topicType": "str", - "x": 440, - "y": 400, + "x": 460, + "y": 420, + "wires": [ + [ + "bd5cceef.b17ad", + "414353cde6a62346" + ] + ] + }, + { + "id": "bd5cceef.b17ad", + "type": "exec", + "z": "9daf9e2b.019fc", + "command": "sudo systemctl restart planktoscope-org.controller.service", + "addpay": false, + "append": "", + "useSpawn": "false", + "timer": "", + "winHide": false, + "oldrc": false, + "name": "Restart hardware controller", + "x": 800, + "y": 420, + "wires": [ + [], + [], + [] + ] + }, + { + "id": "43cf8ff7.75231", + "type": "rpi-gpio out", + "z": "9daf9e2b.019fc", + "name": "Pump Enable", + "pin": "4", + "set": true, + "level": "1", + "freq": "", + "out": "out", + "bcm": true, + "x": 420, + "y": 80, + "wires": [] + }, + { + "id": "4bca8a25.15be3c", + "type": "rpi-gpio out", + "z": "9daf9e2b.019fc", + "name": "Focus Enable", + "pin": "12", + "set": true, + "level": "1", + "freq": "", + "out": "out", + "bcm": true, + "x": 420, + "y": 120, + "wires": [] + }, + { + "id": "50f9b5b.a84bccc", + "type": "inject", + "z": "9daf9e2b.019fc", + "name": "Default: ON", + "props": [ + { + "p": "payload" + } + ], + "repeat": "", + "crontab": "", + "once": true, + "onceDelay": "0.01", + "topic": "", + "payload": "true", + "payloadType": "bool", + "x": 150, + "y": 100, "wires": [ [ - "c54d948575dbcff8", - "d10f3ffd98055447" + "43cf8ff7.75231", + "4bca8a25.15be3c", + "6db0fcf5.f0effc", + "5fc4ede4.72516c" ] ] }, { - "id": "438febd245a9f73c", + "id": "45a7b5aa.2ed20c", "type": "link in", "z": "9daf9e2b.019fc", "name": "Restart Hardware Controller", "links": [ "e41870d7.300eb8", - "3973b999ee7b3b1d" + "e4ead350b3d07578" ], "x": 195, "y": 420, "wires": [ [ - "ea4fae012404854c" + "466eb611.4da048" + ] + ] + }, + { + "id": "b81b990a.d4dca", + "type": "link in", + "z": "9daf9e2b.019fc", + "name": "Shutdown", + "links": [ + "e08cfcb8.2a67e8" + ], + "x": 195, + "y": 280, + "wires": [ + [ + "4af9112d.87767" ] ] }, { - "id": "c54d948575dbcff8", + "id": "5fc4ede4.72516c", + "type": "rpi-gpio out", + "z": "9daf9e2b.019fc", + "name": "HAT Pump Enable", + "pin": "23", + "set": true, + "level": "1", + "freq": "", + "out": "out", + "bcm": true, + "x": 430, + "y": 40, + "wires": [] + }, + { + "id": "6db0fcf5.f0effc", + "type": "rpi-gpio out", + "z": "9daf9e2b.019fc", + "name": "HAT Focus Enable", + "pin": "5", + "set": true, + "level": "1", + "freq": "", + "out": "out", + "bcm": true, + "x": 430, + "y": 160, + "wires": [] + }, + { + "id": "38c05fcb891c82bf", "type": "exec", "z": "9daf9e2b.019fc", - "command": "sudo systemctl restart planktoscope-org.controller.service", + "command": "docker restart apps_ps_backend_proc-segmenter-server-1", "addpay": false, "append": "", "useSpawn": "false", "timer": "", "winHide": false, "oldrc": false, - "name": "Restart hardware controller", - "x": 780, - "y": 400, + "name": "Restart segmenter", + "x": 770, + "y": 500, "wires": [ - [ - "8cad7139d2a089d9" - ], + [], [], [] ] }, { - "id": "e2e5ce0351a6cc11", + "id": "631b8626185addfc", "type": "ui_button", "z": "9daf9e2b.019fc", "name": "", "group": "a7d64879.38298", "order": 3, - "width": "6", + "width": 6, "height": 1, "passthru": true, "label": "Restart Segmenter", @@ -7235,58 +7090,38 @@ "payloadType": "str", "topic": "", "topicType": "str", - "x": 410, - "y": 600, + "x": 430, + "y": 500, "wires": [ [ - "2cdbadb65d0e1b20", - "9c1629488b02fdba" + "38c05fcb891c82bf", + "e036d07cf78fde85" ] ] }, { - "id": "2cdbadb65d0e1b20", - "type": "exec", - "z": "9daf9e2b.019fc", - "command": "docker restart apps_ps_backend_proc-segmenter-server-1", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "winHide": false, - "oldrc": false, - "name": "Restart segmenter", - "x": 750, - "y": 600, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "7b64209d734e4e2c", + "id": "cec5bd6f962f6903", "type": "ui_template", "z": "9daf9e2b.019fc", "group": "a7d64879.38298", "name": "Logs", "order": 1, - "width": "0", - "height": "0", + "width": 0, + "height": 0, "format": "

\n The PlanktoScope software application consists of three components: a Node-RED dashboard which provides the user interface you're using; a Hardware Controller\n which executes commands sent from the Node-RED dashboard for hardware control and image acquisition; and a Segmenter which processes an acquired dataset of\n images and isolates objects from those images. Each component has its own independent log of messages, managed separately from the logs for the other components.\n

\n

\n All three components have live-updating logs which you can monitor. Additionally, the Hardware Controller and the Segmenter also save all of their log messages\n to files which you can browse and download. Those software components create a new log file each time they start, and the name of the log file includes the time\n in the PlanktoScope's clock when the software component started. However, if your PlanktoScope's clock is usually wrong, it makes the log files difficult to navigate.\n This will be fixed in a future version of the software.\n

\n

\n If you need to share your logs with other people (e.g. on Slack or GitHub), you should open the \"Downloadable Logs\" links, and then you can select one file or multiple\n log files for downloading as a zip archive.\n

\n", "storeOutMessages": true, "fwdInMessages": true, "resendOnRefresh": true, "templateScope": "local", "className": "", - "x": 630, + "x": 650, "y": 180, "wires": [ [] ] }, { - "id": "d10f3ffd98055447", + "id": "414353cde6a62346", "type": "ui_toast", "z": "9daf9e2b.019fc", "position": "top right", @@ -7300,12 +7135,12 @@ "className": "", "topic": "", "name": "", - "x": 750, - "y": 360, + "x": 770, + "y": 380, "wires": [] }, { - "id": "9c1629488b02fdba", + "id": "e036d07cf78fde85", "type": "ui_toast", "z": "9daf9e2b.019fc", "position": "top right", @@ -7319,26 +7154,26 @@ "className": "", "topic": "", "name": "", - "x": 750, - "y": 560, + "x": 770, + "y": 460, "wires": [] }, { - "id": "8cad7139d2a089d9", + "id": "ddcbbfa5.cd158", "type": "exec", - "z": "9daf9e2b.019fc", - "command": "sudo systemctl restart nodered.service", + "z": "1371dec5.76e671", + "command": "vcgencmd measure_temp | tr -d \"temp=\" | tr -d \"'C\" | tr -d \"\\n\"", "addpay": false, "append": "", - "useSpawn": "false", + "useSpawn": "", "timer": "", - "winHide": false, - "oldrc": false, - "name": "Restart Node Red", - "x": 1150, - "y": 400, + "name": "RPi Temp.", + "x": 330, + "y": 40, "wires": [ - [], + [ + "bc503fa5.f46dd" + ], [], [] ] @@ -7389,9 +7224,132 @@ "wires": [ [ "3910d662.fa1f7a", - "aa2e4cd182dbc776", - "797675a937dc1629", - "f6f570b10c675854" + "ddcbbfa5.cd158", + "23a84a3856fb68bd", + "4ed64bd91fa9fbdf", + "ed5f2d963d85478b" + ] + ] + }, + { + "id": "2549f778.4eb828", + "type": "python3-function", + "z": "1371dec5.76e671", + "name": "fan control", + "func": "import smbus2 as smbus\n\nstate = msg[\"payload\"]\nbus = smbus.SMBus(1)\n\nDEVICE_ADDRESS = 0x0d\n# command happens twice, for reasons\nif state == \"off\":\n with smbus.SMBus(1) as bus:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\n return msg\nif state == \"on\":\n with smbus.SMBus(1) as bus:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)\n return msg\n", + "outputs": 1, + "x": 1150, + "y": 40, + "wires": [ + [ + "e640ebb5c397f424" + ] + ] + }, + { + "id": "b7ab1ada.1f4158", + "type": "exec", + "z": "1371dec5.76e671", + "command": "i2cdetect -y 1", + "addpay": false, + "append": "", + "useSpawn": "false", + "timer": "1", + "winHide": false, + "oldrc": false, + "name": "i2c update", + "x": 1440, + "y": 40, + "wires": [ + [], + [], + [] + ] + }, + { + "id": "bc503fa5.f46dd", + "type": "switch", + "z": "1371dec5.76e671", + "name": "", + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "gt", + "v": "40", + "vt": "num" + }, + { + "t": "lte", + "v": "35", + "vt": "num" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 570, + "y": 40, + "wires": [ + [ + "a25d6486.e1ce28" + ], + [ + "5d4f3e71.1bad4" + ] + ] + }, + { + "id": "5d4f3e71.1bad4", + "type": "change", + "z": "1371dec5.76e671", + "name": "Set OFF", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "off", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 720, + "y": 60, + "wires": [ + [ + "7fb13a4a53b612a0" + ] + ] + }, + { + "id": "a25d6486.e1ce28", + "type": "change", + "z": "1371dec5.76e671", + "name": "Set ON", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "on", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 720, + "y": 20, + "wires": [ + [ + "7fb13a4a53b612a0" ] ] }, @@ -7412,11 +7370,11 @@ "topic": "", "payload": "start", "payloadType": "str", - "x": 130, - "y": 700, + "x": 170, + "y": 680, "wires": [ [ - "5883e629f5d546ed" + "ccb5172d10c1ccaf" ] ] }, @@ -7432,7 +7390,7 @@ "finalize": "", "libs": [], "x": 580, - "y": 720, + "y": 700, "wires": [ [] ] @@ -7443,11 +7401,11 @@ "z": "1371dec5.76e671", "name": "", "env": [], - "x": 130, - "y": 640, + "x": 170, + "y": 620, "wires": [ [ - "9b64f397101c2762" + "950b773ad4c0fdfe" ] ] }, @@ -7464,7 +7422,7 @@ "finalize": "", "libs": [], "x": 820, - "y": 520, + "y": 500, "wires": [ [] ] @@ -7487,7 +7445,7 @@ "fontSize": "", "color": "#000000", "x": 600, - "y": 640, + "y": 620, "wires": [] }, { @@ -7502,8 +7460,13 @@ "label": "Instrument Name", "format": "{{msg.payload}}", "layout": "row-spread", + "className": "", + "style": false, + "font": "", + "fontSize": "", + "color": "#000000", "x": 610, - "y": 680, + "y": 660, "wires": [] }, { @@ -7524,7 +7487,7 @@ "fontSize": "", "color": "#000000", "x": 850, - "y": 560, + "y": 540, "wires": [] }, { @@ -7540,7 +7503,7 @@ "format": "{{msg.payload}}", "layout": "row-spread", "x": 600, - "y": 760, + "y": 740, "wires": [] }, { @@ -7551,14 +7514,28 @@ "links": [ "559a8085.1d6b9" ], - "x": 155, - "y": 760, + "x": 205, + "y": 740, "wires": [ [ "f783aefd.c3bfd8" ] ] }, + { + "id": "11b51f8f.acd308", + "type": "python3-function", + "z": "1371dec5.76e671", + "d": true, + "name": "fan temperature", + "func": "import smbus\nbus = smbus.SMBus(1)\n\naddr = 0x0d\nfan_reg = 0x08\n\ntemp = float( msg[\"payload\"])\n\n# 0x01 full speed, 0x02: 20% speed, ..., 0x09: 90% speed\n\nif temp < 38:\n bus.write_byte_data(addr, fan_reg, 0x00)\nelif temp < 43:\n bus.write_byte_data(addr, fan_reg, 0x02)\nelif temp < 46:\n bus.write_byte_data(addr, fan_reg, 0x04)\nelif temp < 48:\n bus.write_byte_data(addr, fan_reg, 0x06)\nelif temp < 52:\n bus.write_byte_data(addr, fan_reg, 0x08)\nelse:\n bus.write_byte_data(addr, fan_reg, 0x01)\n\nreturn msg", + "outputs": 1, + "x": 1440, + "y": 120, + "wires": [ + [] + ] + }, { "id": "eaf74a43.fa27d", "type": "switch", @@ -7596,6 +7573,7 @@ "ok": "OK", "cancel": "", "raw": false, + "className": "", "topic": "", "name": "", "x": 1090, @@ -7657,7 +7635,52 @@ ] }, { - "id": "5883e629f5d546ed", + "id": "e640ebb5c397f424", + "type": "delay", + "z": "1371dec5.76e671", + "name": "", + "pauseType": "delay", + "timeout": "1", + "timeoutUnits": "seconds", + "rate": "1", + "nbRateUnits": "1", + "rateUnits": "second", + "randomFirst": "1", + "randomLast": "5", + "randomUnits": "seconds", + "drop": false, + "allowrate": false, + "outputs": 1, + "x": 1300, + "y": 40, + "wires": [ + [ + "b7ab1ada.1f4158" + ] + ] + }, + { + "id": "7fb13a4a53b612a0", + "type": "rbe", + "z": "1371dec5.76e671", + "name": "", + "func": "rbe", + "gap": "", + "start": "", + "inout": "out", + "septopics": true, + "property": "payload", + "topi": "topic", + "x": 1010, + "y": 40, + "wires": [ + [ + "2549f778.4eb828" + ] + ] + }, + { + "id": "ccb5172d10c1ccaf", "type": "file in", "z": "1371dec5.76e671", "name": "Get machine name", @@ -7669,7 +7692,7 @@ "encoding": "none", "allProps": false, "x": 350, - "y": 700, + "y": 680, "wires": [ [ "a400a97e.e333a8", @@ -7678,7 +7701,7 @@ ] }, { - "id": "9b64f397101c2762", + "id": "950b773ad4c0fdfe", "type": "change", "z": "1371dec5.76e671", "name": "Get acq_instrument", @@ -7704,7 +7727,7 @@ "to": "", "reg": false, "x": 350, - "y": 640, + "y": 620, "wires": [ [ "bdc6718a.dd5d48" @@ -7712,28 +7735,7 @@ ] }, { - "id": "99725e1437cc390b", - "type": "file in", - "z": "1371dec5.76e671", - "name": "Versioning File", - "filename": "/usr/share/planktoscope/installer-versioning.yml", - "filenameType": "str", - "format": "utf8", - "chunk": false, - "sendError": false, - "encoding": "none", - "allProps": false, - "x": 240, - "y": 540, - "wires": [ - [ - "f4e21e28bd903f6d" - ] - ], - "info": "# PlanktoScope Help\nThis Node will read the content of the file named **config.txt** containing all the input placeholders.\n" - }, - { - "id": "6a0fa173874c3ddd", + "id": "24de7407445d2087", "type": "inject", "z": "1371dec5.76e671", "name": "once", @@ -7750,40 +7752,60 @@ "payload": "start", "payloadType": "str", "x": 90, - "y": 540, + "y": 520, + "wires": [ + [ + "e4f9ed2b337c2fa6" + ] + ] + }, + { + "id": "e4f9ed2b337c2fa6", + "type": "file in", + "z": "1371dec5.76e671", + "name": "Versioning File", + "filename": "/usr/share/planktoscope/installer-versioning.yml", + "filenameType": "str", + "format": "utf8", + "chunk": false, + "sendError": false, + "encoding": "none", + "allProps": false, + "x": 240, + "y": 520, "wires": [ [ - "99725e1437cc390b" + "db79aae8a7fe3512" ] ] }, { - "id": "f4e21e28bd903f6d", + "id": "db79aae8a7fe3512", "type": "yaml", "z": "1371dec5.76e671", "property": "payload", "name": "", "x": 390, - "y": 540, + "y": 520, "wires": [ [ - "d6264e3e29b68c6e", - "aa84b912c996c69e", - "fba22dc2c16b3ec8" + "04c313e8d9aac122", + "ef1970121e57c5e8", + "574361abfe75b3b3" ] ] }, { - "id": "d6264e3e29b68c6e", + "id": "04c313e8d9aac122", "type": "change", "z": "1371dec5.76e671", - "name": "Get version", + "name": "Get repo", "rules": [ { "t": "set", "p": "payload", "pt": "msg", - "to": "payload.version", + "to": "payload.repo", "tot": "msg" } ], @@ -7792,26 +7814,25 @@ "from": "", "to": "", "reg": false, - "x": 590, - "y": 540, + "x": 580, + "y": 480, "wires": [ [ - "3e64877a.9684b", - "8343fa69.49339" + "57b3b083a2455e09" ] ] }, { - "id": "aa84b912c996c69e", + "id": "ef1970121e57c5e8", "type": "change", "z": "1371dec5.76e671", - "name": "Get repo", + "name": "Get version", "rules": [ { "t": "set", "p": "payload", "pt": "msg", - "to": "payload.repo", + "to": "payload.version", "tot": "msg" } ], @@ -7820,16 +7841,17 @@ "from": "", "to": "", "reg": false, - "x": 580, - "y": 500, + "x": 590, + "y": 520, "wires": [ [ - "fd55e7a43d9bdbbb" + "3e64877a.9684b", + "8343fa69.49339" ] ] }, { - "id": "fd55e7a43d9bdbbb", + "id": "57b3b083a2455e09", "type": "function", "z": "1371dec5.76e671", "name": "set global", @@ -7841,13 +7863,13 @@ "finalize": "", "libs": [], "x": 820, - "y": 480, + "y": 460, "wires": [ [] ] }, { - "id": "fba22dc2c16b3ec8", + "id": "574361abfe75b3b3", "type": "change", "z": "1371dec5.76e671", "name": "Get commit", @@ -7866,15 +7888,15 @@ "to": "", "reg": false, "x": 590, - "y": 580, + "y": 560, "wires": [ [ - "2ddc75a4ac38a17f" + "016d1d2a2f19f1a6" ] ] }, { - "id": "2ddc75a4ac38a17f", + "id": "016d1d2a2f19f1a6", "type": "function", "z": "1371dec5.76e671", "name": "set global", @@ -7886,18 +7908,18 @@ "finalize": "", "libs": [], "x": 820, - "y": 600, + "y": 580, "wires": [ [] ] }, { - "id": "797675a937dc1629", + "id": "4ed64bd91fa9fbdf", "type": "ui_template", "z": "1371dec5.76e671", "group": "3da7da8f.179606", "name": "Metrics panel", - "order": 2, + "order": 1, "width": "0", "height": "0", "format": "
\n

\n The instrument's system time is different from your web browser's time by {{drift}}.\n As a result, timestamps in your datasets will be incorrect.\n Additionally, system metrics will not be recorded or shown correctly.\n Additionally, you will see incorrectly-aligned graphs in the metrics below.\n

\n

Please change the instrument's system time or your web browser's time to accurate values.

\n

\n \n

\n
\n\n
\n

Loading system metrics, please wait...

\n
\n\n
\n \n
\n\n\n", @@ -7913,13 +7935,34 @@ ] }, { - "id": "aa2e4cd182dbc776", + "id": "38bad1e220cd5d87", + "type": "ui_text", + "z": "1371dec5.76e671", + "group": "ce9e278.781eed8", + "order": 5, + "width": 0, + "height": 0, + "name": "", + "label": "System Time", + "format": "{{msg.payload}}", + "layout": "row-spread", + "className": "", + "style": false, + "font": "", + "fontSize": 16, + "color": "#000000", + "x": 590, + "y": 240, + "wires": [] + }, + { + "id": "ed5f2d963d85478b", "type": "function", "z": "1371dec5.76e671", "name": "Get system time", "func": "var date = new Date();\ndate.setSeconds(0, 0);\nmsg.payload = (\n date.toISOString().replace('T', ' ').replace(/:\\d+\\.\\d+Z/,' UTC')\n);\nreturn msg", "outputs": 1, - "timeout": "", + "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", @@ -7928,33 +7971,53 @@ "y": 240, "wires": [ [ - "7c9ee522f6dbd3b0" + "38bad1e220cd5d87" ] ] }, { - "id": "7c9ee522f6dbd3b0", - "type": "ui_text", + "id": "23a84a3856fb68bd", + "type": "ui_template", "z": "1371dec5.76e671", "group": "ce9e278.781eed8", - "order": 5, - "width": 0, - "height": 0, - "name": "", - "label": "System Time", - "format": "{{msg.payload}}", - "layout": "row-spread", + "name": "Browser time", + "order": 6, + "width": "6", + "height": "1", + "format": "
\n

Browser Time

\n

{{time}}

\n
\n\n", + "storeOutMessages": true, + "fwdInMessages": true, + "resendOnRefresh": false, + "templateScope": "local", "className": "", - "style": false, - "font": "", - "fontSize": "", - "color": "#000000", - "x": 590, - "y": 240, - "wires": [] + "x": 330, + "y": 200, + "wires": [ + [] + ] }, { - "id": "6dc9862f2eebe935", + "id": "19a45f972be2b0f1", + "type": "function", + "z": "1371dec5.76e671", + "name": "Get system time", + "func": "var date = new Date(msg.payload.timestamp);\nmsg.payload = (\n date.toISOString().replace('T', ' ').replace(/:\\d+\\.\\d+Z/,' UTC')\n);\nreturn msg", + "outputs": 1, + "timeout": 0, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 340, + "y": 340, + "wires": [ + [ + "ee2c5e7c29eb4760" + ] + ] + }, + { + "id": "8ba3e2774987fd58", "type": "http in", "z": "1371dec5.76e671", "name": "POST /api/system-time", @@ -7966,13 +8029,14 @@ "y": 360, "wires": [ [ - "a7994a561866dc94", - "dea222e9a6553cac" + "19a45f972be2b0f1", + "07bbdca8d6153210", + "595df18543c8328e" ] ] }, { - "id": "1c4113d4c933fd4b", + "id": "ee2c5e7c29eb4760", "type": "ui_toast", "z": "1371dec5.76e671", "position": "top right", @@ -7991,28 +8055,27 @@ "wires": [] }, { - "id": "a7994a561866dc94", + "id": "07bbdca8d6153210", "type": "function", "z": "1371dec5.76e671", - "name": "Get system time", - "func": "var date = new Date(msg.payload.timestamp);\nmsg.payload = (\n date.toISOString().replace('T', ' ').replace(/:\\d+\\.\\d+Z/,' UTC')\n);\nreturn msg", + "name": "Prepare timestamp", + "func": "msg.payload = ('@' + msg.payload.timestamp).slice(0, -3);\nreturn msg;", "outputs": 1, - "timeout": "", + "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 340, - "y": 340, + "x": 350, + "y": 380, "wires": [ [ - "1c4113d4c933fd4b", - "423659c62bae0524" + "7558e8f302d5b944" ] ] }, { - "id": "814ce40bfc413777", + "id": "7558e8f302d5b944", "type": "exec", "z": "1371dec5.76e671", "command": "sudo date -s", @@ -8031,48 +8094,7 @@ ] }, { - "id": "dea222e9a6553cac", - "type": "function", - "z": "1371dec5.76e671", - "name": "Prepare timestamp", - "func": "msg.payload = ('@' + msg.payload.timestamp).slice(0, -3);\nreturn msg;", - "outputs": 1, - "timeout": "", - "noerr": 0, - "initialize": "", - "finalize": "", - "libs": [], - "x": 350, - "y": 380, - "wires": [ - [ - "814ce40bfc413777" - ] - ] - }, - { - "id": "f6f570b10c675854", - "type": "ui_template", - "z": "1371dec5.76e671", - "group": "ce9e278.781eed8", - "name": "Browser time", - "order": 6, - "width": "6", - "height": "1", - "format": "
\n

Browser Time

\n

{{time}}

\n
\n\n", - "storeOutMessages": true, - "fwdInMessages": true, - "resendOnRefresh": false, - "templateScope": "local", - "className": "", - "x": 330, - "y": 200, - "wires": [ - [] - ] - }, - { - "id": "3822b843fda94733", + "id": "c8be8dad272e1fa5", "type": "http in", "z": "1371dec5.76e671", "name": "GET /api/system-time", @@ -8084,18 +8106,18 @@ "y": 420, "wires": [ [ - "5b0a65d3fe187424" + "0f4ce59587fa14e1" ] ] }, { - "id": "5b0a65d3fe187424", + "id": "0f4ce59587fa14e1", "type": "function", "z": "1371dec5.76e671", "name": "Get system time", "func": "var date = new Date();\nmsg.payload = {'timestamp': date.getTime()};\nreturn msg", "outputs": 1, - "timeout": "", + "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", @@ -8104,32 +8126,32 @@ "y": 420, "wires": [ [ - "312a15407574b38e" + "433d48a4b1bc0b27" ] ] }, { - "id": "423659c62bae0524", + "id": "433d48a4b1bc0b27", "type": "http response", "z": "1371dec5.76e671", - "name": "Send POST response", + "name": "Send GET response", "statusCode": "", - "headers": {}, + "headers": { + "Content-Type": "application/json; charset=UTF-8" + }, "x": 620, - "y": 300, + "y": 420, "wires": [] }, { - "id": "312a15407574b38e", + "id": "595df18543c8328e", "type": "http response", "z": "1371dec5.76e671", - "name": "Send GET response", + "name": "Send POST response", "statusCode": "", - "headers": { - "Content-Type": "application/json; charset=UTF-8" - }, + "headers": {}, "x": 620, - "y": 420, + "y": 300, "wires": [] }, { @@ -8141,8 +8163,6 @@ "qos": "0", "datatype": "json", "broker": "8dc3722c.06efa8", - "nl": false, - "rap": false, "inputs": 0, "x": 290, "y": 340, @@ -8204,7 +8224,6 @@ "type": "link out", "z": "9a22e67a.378818", "name": "Fluidic module status", - "mode": "link", "links": [ "bb628f8d.98f108" ], @@ -8229,12 +8248,11 @@ "type": "link out", "z": "1eaf21c8.f7a21e", "name": "Stepper config change", - "mode": "link", "links": [ - "438febd245a9f73c" + "45a7b5aa.2ed20c" ], - "x": 1505, - "y": 540, + "x": 1475, + "y": 380, "wires": [] }, { @@ -8253,8 +8271,8 @@ "randomUnits": "seconds", "drop": false, "outputs": 1, - "x": 1120, - "y": 540, + "x": 1160, + "y": 380, "wires": [ [ "e41870d7.300eb8" @@ -8267,10 +8285,69 @@ "z": "1eaf21c8.f7a21e", "name": "", "env": [], - "x": 1160, - "y": 580, + "x": 1200, + "y": 420, "wires": [] }, + { + "id": "c534fd26.13741", + "type": "change", + "z": "1eaf21c8.f7a21e", + "name": "Get stepper_reverse", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "payload.stepper_reverse", + "tot": "msg" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 640, + "y": 440, + "wires": [ + [ + "cd1987c7.027f58" + ] + ] + }, + { + "id": "cd1987c7.027f58", + "type": "ui_switch", + "z": "1eaf21c8.f7a21e", + "name": "stepper_reverse", + "label": "Invert stepper output", + "tooltip": "Stepper 1 is controlled by output 1 or the other way around", + "group": "6be36295.0ab324", + "order": 5, + "width": 0, + "height": 0, + "passthru": false, + "decouple": "false", + "topic": "stepper_reverse", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "x": 940, + "y": 440, + "wires": [ + [ + "8e3b3d3c.955148", + "2068e7f.f4efb18" + ] + ] + }, { "id": "54ba7f16.709ad8", "type": "change", @@ -8290,8 +8367,8 @@ "from": "", "to": "", "reg": false, - "x": 610, - "y": 560, + "x": 650, + "y": 400, "wires": [ [ "ee58b91c.396108" @@ -8313,11 +8390,9 @@ "mode": "number", "delay": "2000", "topic": "pump_steps_per_ml", - "sendOnBlur": true, - "className": "", "topicType": "str", - "x": 880, - "y": 560, + "x": 920, + "y": 400, "wires": [ [ "2068e7f.f4efb18", @@ -8333,15 +8408,15 @@ "name": "Information", "order": 1, "width": "8", - "height": "3", - "format": "
\n

\n Changing one of these values will cause the Python hardware controller to restart, to reload the new hardware configuration.\n

\n

\n Warning: selecting a hardware version from the dropdown menu below will also overwrite all of your hardware settings, including your camera white balance settings.\n

\n

\n If you are not sure, you probably should not be touching anything here!\n

\n
\n", + "height": 3, + "format": "
\n

\n Changing one of these values will cause the Python hardware controller to restart, to reload the new hardware configuration.\n

\n

\n Warning: selecting a hardware version from the dropdown menu below will also overwrite all of your hardware settings, including your camera white balance settings.\n

\n

\n If you are not sure, you probably should not be touching anything here!\n

\n
", "storeOutMessages": true, "fwdInMessages": true, "resendOnRefresh": true, "templateScope": "local", "className": "", - "x": 610, - "y": 40, + "x": 590, + "y": 60, "wires": [ [] ] @@ -8378,12 +8453,7 @@ }, { "label": "", - "value": "PlanktoScope v2.6", - "type": "str" - }, - { - "label": "", - "value": "PlanktoScope v3.0", + "value": "PlanktoScope v2.6", "type": "str" } ], @@ -8391,12 +8461,13 @@ "topic": "acq_instrument", "topicType": "str", "className": "", - "x": 670, + "x": 580, "y": 160, "wires": [ [ - "08d177136bd18281", - "56dd3f82c45717f0" + "3e2c5c1c.4c57b4", + "932a1ef8c2e81979", + "025ad3cdaa557843" ] ] }, @@ -8406,8 +8477,8 @@ "z": "1eaf21c8.f7a21e", "name": "", "env": [], - "x": 510, - "y": 360, + "x": 970, + "y": 160, "wires": [ [] ] @@ -8419,12 +8490,13 @@ "name": "Save global", "func": "global.set(msg.topic,msg.payload);\nreturn msg;", "outputs": 1, + "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], - "x": 350, - "y": 360, + "x": 810, + "y": 160, "wires": [ [ "1cfadc66.3cde8c" @@ -8435,14 +8507,13 @@ "id": "427c312.fc5e65", "type": "subflow:1c24ad9c.bebec2", "z": "1eaf21c8.f7a21e", - "g": "dda6605ca2508d77", "name": "", "env": [], - "x": 110, - "y": 80, + "x": 130, + "y": 160, "wires": [ [ - "c00c6732b9f36adb" + "2716aa5b3d027f95" ] ] }, @@ -8465,8 +8536,8 @@ "from": "", "to": "", "reg": false, - "x": 610, - "y": 640, + "x": 650, + "y": 480, "wires": [ [ "244ca5dd62df2bcd" @@ -8491,8 +8562,8 @@ "sendOnBlur": true, "className": "", "topicType": "str", - "x": 880, - "y": 640, + "x": 930, + "y": 480, "wires": [ [ "8e3b3d3c.955148", @@ -8511,8 +8582,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 1160, - "y": 640, + "x": 1200, + "y": 480, "wires": [ [ "5d5ad36d2c50dcc2" @@ -8525,8 +8596,8 @@ "z": "1eaf21c8.f7a21e", "name": "Process_pixel calibration", "links": [], - "x": 1505, - "y": 660, + "x": 1475, + "y": 500, "wires": [] }, { @@ -8573,8 +8644,8 @@ "payload": "", "topic": "acq_fnumber_objective", "topicType": "str", - "x": 870, - "y": 680, + "x": 910, + "y": 520, "wires": [ [ "a6983d3232b570a7", @@ -8601,8 +8672,8 @@ "from": "", "to": "", "reg": false, - "x": 1200, - "y": 680, + "x": 1240, + "y": 520, "wires": [ [ "5d5ad36d2c50dcc2" @@ -8635,8 +8706,8 @@ "from": "", "to": "", "reg": false, - "x": 620, - "y": 680, + "x": 660, + "y": 520, "wires": [ [ "6146ba22df928516" @@ -8644,90 +8715,15 @@ ] }, { - "id": "d276ce894f483bcf", - "type": "ui_toast", - "z": "1eaf21c8.f7a21e", - "position": "top right", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 0, - "ok": "OK", - "cancel": "", - "raw": false, - "className": "", - "topic": "Resetting hardware configuration to version-specific default", - "name": "", - "x": 370, - "y": 320, - "wires": [] - }, - { - "id": "68703ef63da2f081", - "type": "change", - "z": "1eaf21c8.f7a21e", - "name": "Sanitize hardware version", - "rules": [ - { - "t": "set", - "p": "hardware_version", - "pt": "msg", - "to": "$substringAfter(msg.payload, \"PlanktoScope \")", - "tot": "jsonata" - }, - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "{}", - "tot": "json" - }, - { - "t": "set", - "p": "payload.hardware_version", - "pt": "msg", - "to": "hardware_version", - "tot": "msg" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 390, - "y": 280, - "wires": [ - [ - "7c947780b3e03ec4" - ] - ] - }, - { - "id": "3973b999ee7b3b1d", - "type": "link out", - "z": "1eaf21c8.f7a21e", - "name": "Reload hardware config", - "mode": "link", - "links": [ - "438febd245a9f73c", - "4ebc0345e63a78e9", - "5984b086eddc9311", - "a2f2a4c7cbae4446" - ], - "x": 975, - "y": 280, - "wires": [] - }, - { - "id": "3bcaf757cbc77fbe", - "type": "subflow:b7861ce703215a01", + "id": "da3d4a90384d62a8", + "type": "subflow:e6665421f66ea4c8", "z": "1eaf21c8.f7a21e", "name": "", - "x": 320, - "y": 600, + "x": 360, + "y": 440, "wires": [ [ + "c534fd26.13741", "54ba7f16.709ad8", "c67c305004f87e39", "11955bbeefc29ab4" @@ -8735,7 +8731,7 @@ ] }, { - "id": "862235d10aae5b83", + "id": "f83560053c609914", "type": "inject", "z": "1eaf21c8.f7a21e", "name": "Once", @@ -8745,34 +8741,59 @@ "once": true, "onceDelay": 0.1, "topic": "", - "x": 110, - "y": 620, + "x": 130, + "y": 440, "wires": [ [ - "3bcaf757cbc77fbe" + "da3d4a90384d62a8" ] ] }, { - "id": "c00c6732b9f36adb", + "id": "e4ead350b3d07578", + "type": "link out", + "z": "1eaf21c8.f7a21e", + "name": "Reload hardware config", + "mode": "link", + "links": [ + "04920f50bbbf6a2a", + "45a7b5aa.2ed20c" + ], + "x": 875, + "y": 240, + "wires": [] + }, + { + "id": "025ad3cdaa557843", + "type": "ui_toast", + "z": "1eaf21c8.f7a21e", + "position": "top right", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 0, + "ok": "OK", + "cancel": "", + "raw": false, + "className": "", + "topic": "Resetting hardware configuration to version-specific default", + "name": "", + "x": 830, + "y": 120, + "wires": [] + }, + { + "id": "932a1ef8c2e81979", "type": "change", "z": "1eaf21c8.f7a21e", - "g": "dda6605ca2508d77", - "name": "Get acq_instrument", + "name": "Choose default hardware config", "rules": [ { "t": "set", "p": "payload", "pt": "msg", - "to": "payload.acq_instrument", - "tot": "msg" - }, - { - "t": "set", - "p": "topic", - "pt": "msg", - "to": "acq_instrument", - "tot": "str" + "to": "$join([\"/home/pi/PlanktoScope/default-configs/\", $substringAfter(msg.payload, \"PlanktoScope \"), \".hardware.json\"])", + "tot": "jsonata" } ], "action": "", @@ -8780,119 +8801,81 @@ "from": "", "to": "", "reg": false, - "x": 310, - "y": 80, - "wires": [ - [ - "a7e5c7f4.644678", - "56dd3f82c45717f0" - ] - ] - }, - { - "id": "4ebc0345e63a78e9", - "type": "link in", - "z": "1eaf21c8.f7a21e", - "name": "Load hardware config", - "links": [ - "3973b999ee7b3b1d" - ], - "x": 145, - "y": 580, - "wires": [ - [ - "3bcaf757cbc77fbe" - ] - ] - }, - { - "id": "cb9009e8a49e93cc", - "type": "link in", - "z": "1eaf21c8.f7a21e", - "name": "Set hardware version", - "links": [ - "08d177136bd18281", - "9f34e4a2f33c4022" - ], - "x": 205, - "y": 320, + "x": 210, + "y": 240, "wires": [ [ - "68703ef63da2f081", - "d276ce894f483bcf", - "3e2c5c1c.4c57b4", - "a7e5c7f4.644678" + "833dac7cbd693c53" ] ] }, { - "id": "08d177136bd18281", - "type": "link out", - "z": "1eaf21c8.f7a21e", - "name": "Set hardware version", - "mode": "link", - "links": [ - "cb9009e8a49e93cc" - ], - "x": 875, - "y": 160, - "wires": [] - }, - { - "id": "56dd3f82c45717f0", - "type": "link out", - "z": "1eaf21c8.f7a21e", - "name": "Hardware version loaded", - "mode": "link", - "links": [ - "a2f2a4c7cbae4446" - ], - "x": 875, - "y": 120, - "wires": [] - }, - { - "id": "7c947780b3e03ec4", - "type": "set hardware version", + "id": "833dac7cbd693c53", + "type": "exec", "z": "1eaf21c8.f7a21e", - "name": "", - "x": 680, - "y": 280, + "command": "cp", + "addpay": "payload", + "append": "/home/pi/PlanktoScope/hardware.json", + "useSpawn": "false", + "timer": "", + "winHide": false, + "oldrc": false, + "name": "Copy default hardware config", + "x": 500, + "y": 240, "wires": [ [ - "3973b999ee7b3b1d" - ] + "0b67ccf37c034e90" + ], + [], + [] ] }, { - "id": "f952c1cb7e590dc4", - "type": "catch", + "id": "0b67ccf37c034e90", + "type": "delay", "z": "1eaf21c8.f7a21e", - "g": "dda6605ca2508d77", "name": "", - "scope": "group", - "uncaught": false, - "x": 190, - "y": 140, + "pauseType": "delay", + "timeout": "500", + "timeoutUnits": "milliseconds", + "rate": "1", + "nbRateUnits": "1", + "rateUnits": "second", + "randomFirst": "1", + "randomLast": "5", + "randomUnits": "seconds", + "drop": false, + "allowrate": false, + "outputs": 1, + "x": 730, + "y": 240, "wires": [ [ - "cf9703e0125167a9", - "907bb11512516d26" + "da3d4a90384d62a8", + "e4ead350b3d07578" ] ] }, { - "id": "cf9703e0125167a9", + "id": "2716aa5b3d027f95", "type": "change", "z": "1eaf21c8.f7a21e", - "name": "", + "name": "Get acq_instrument", "rules": [ { "t": "set", "p": "payload", "pt": "msg", - "to": "null", - "tot": "json" + "to": "payload.acq_instrument", + "tot": "msg" + }, + { + "t": "set", + "p": "topic", + "pt": "msg", + "to": "acq_instrument", + "tot": "str" } ], "action": "", @@ -8900,28 +8883,12 @@ "from": "", "to": "", "reg": false, - "x": 680, - "y": 220, + "x": 330, + "y": 160, "wires": [ [ - "56dd3f82c45717f0" + "a7e5c7f4.644678" ] ] - }, - { - "id": "907bb11512516d26", - "type": "debug", - "z": "1eaf21c8.f7a21e", - "name": "debug 1", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "statusVal": "", - "statusType": "auto", - "x": 120, - "y": 380, - "wires": [] } ] \ No newline at end of file From 81a4e22eeb7a6cfc7556da53631b0a8a3947b3f3 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Wed, 18 Jun 2025 16:06:54 +0000 Subject: [PATCH 14/19] cool --- node-red/.config.projects.json | 2 +- node-red/projects/adafruithat/flows.json | 26 ++++++++++++++++++-- node-red/projects/planktoscopehat/flows.json | 8 +++--- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/node-red/.config.projects.json b/node-red/.config.projects.json index fe3343b25..a25d4e8d6 100644 --- a/node-red/.config.projects.json +++ b/node-red/.config.projects.json @@ -10,5 +10,5 @@ "credentialSecret": false } }, - "activeProject": "planktoscopehat" + "activeProject": "adafruithat" } \ No newline at end of file diff --git a/node-red/projects/adafruithat/flows.json b/node-red/projects/adafruithat/flows.json index b14a8e021..460f4655b 100644 --- a/node-red/projects/adafruithat/flows.json +++ b/node-red/projects/adafruithat/flows.json @@ -6916,7 +6916,7 @@ "command": "sudo systemctl restart planktoscope-org.controller.service", "addpay": false, "append": "", - "useSpawn": "false", + "useSpawn": "true", "timer": "", "winHide": false, "oldrc": false, @@ -6924,7 +6924,9 @@ "x": 800, "y": 420, "wires": [ - [], + [ + "154753a6a39b04b8" + ], [], [] ] @@ -7158,6 +7160,26 @@ "y": 460, "wires": [] }, + { + "id": "154753a6a39b04b8", + "type": "exec", + "z": "9daf9e2b.019fc", + "command": "sudo systemctl restart nodered.service", + "addpay": false, + "append": "", + "useSpawn": "false", + "timer": "", + "winHide": false, + "oldrc": false, + "name": "Restart Node Red", + "x": 1070, + "y": 420, + "wires": [ + [], + [], + [] + ] + }, { "id": "ddcbbfa5.cd158", "type": "exec", diff --git a/node-red/projects/planktoscopehat/flows.json b/node-red/projects/planktoscopehat/flows.json index cd403bbc7..4caf1c412 100644 --- a/node-red/projects/planktoscopehat/flows.json +++ b/node-red/projects/planktoscopehat/flows.json @@ -7180,7 +7180,7 @@ "command": "sudo systemctl restart planktoscope-org.controller.service", "addpay": false, "append": "", - "useSpawn": "false", + "useSpawn": "true", "timer": "", "winHide": false, "oldrc": false, @@ -7315,8 +7315,8 @@ "winHide": false, "oldrc": false, "name": "Restart Node Red", - "x": 1090, - "y": 400, + "x": 1030, + "y": 420, "wires": [ [], [], @@ -8862,4 +8862,4 @@ "y": 120, "wires": [] } -] +] \ No newline at end of file From 0d793aec80fdff93431c60aabbf6d5c5742e4d0f Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Wed, 18 Jun 2025 16:07:32 +0000 Subject: [PATCH 15/19] f --- node-red/.config.projects.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node-red/.config.projects.json b/node-red/.config.projects.json index a25d4e8d6..fe3343b25 100644 --- a/node-red/.config.projects.json +++ b/node-red/.config.projects.json @@ -10,5 +10,5 @@ "credentialSecret": false } }, - "activeProject": "adafruithat" + "activeProject": "planktoscopehat" } \ No newline at end of file From 5dd2a617dce7c15eabe3589100ca69d183db75b1 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Wed, 18 Jun 2025 16:09:07 +0000 Subject: [PATCH 16/19] f --- node-red/.config.projects.json | 2 +- node-red/projects/adafruithat/flows.json | 2 +- node-red/projects/planktoscopehat/flows.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/node-red/.config.projects.json b/node-red/.config.projects.json index fe3343b25..a25d4e8d6 100644 --- a/node-red/.config.projects.json +++ b/node-red/.config.projects.json @@ -10,5 +10,5 @@ "credentialSecret": false } }, - "activeProject": "planktoscopehat" + "activeProject": "adafruithat" } \ No newline at end of file diff --git a/node-red/projects/adafruithat/flows.json b/node-red/projects/adafruithat/flows.json index 460f4655b..0818e1c5a 100644 --- a/node-red/projects/adafruithat/flows.json +++ b/node-red/projects/adafruithat/flows.json @@ -6916,7 +6916,7 @@ "command": "sudo systemctl restart planktoscope-org.controller.service", "addpay": false, "append": "", - "useSpawn": "true", + "useSpawn": "false", "timer": "", "winHide": false, "oldrc": false, diff --git a/node-red/projects/planktoscopehat/flows.json b/node-red/projects/planktoscopehat/flows.json index 4caf1c412..f77552d1c 100644 --- a/node-red/projects/planktoscopehat/flows.json +++ b/node-red/projects/planktoscopehat/flows.json @@ -7180,7 +7180,7 @@ "command": "sudo systemctl restart planktoscope-org.controller.service", "addpay": false, "append": "", - "useSpawn": "true", + "useSpawn": "false", "timer": "", "winHide": false, "oldrc": false, From 72aa1b19a85b1934d241586e6d187cf01ea082c7 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Wed, 18 Jun 2025 16:20:03 +0000 Subject: [PATCH 17/19] cool --- node-red/.config.projects.json | 2 +- node-red/projects/planktoscopehat/flows.json | 164 +++++++++++++------ 2 files changed, 117 insertions(+), 49 deletions(-) diff --git a/node-red/.config.projects.json b/node-red/.config.projects.json index a25d4e8d6..fe3343b25 100644 --- a/node-red/.config.projects.json +++ b/node-red/.config.projects.json @@ -10,5 +10,5 @@ "credentialSecret": false } }, - "activeProject": "adafruithat" + "activeProject": "planktoscopehat" } \ No newline at end of file diff --git a/node-red/projects/planktoscopehat/flows.json b/node-red/projects/planktoscopehat/flows.json index f77552d1c..6e8dbffc3 100644 --- a/node-red/projects/planktoscopehat/flows.json +++ b/node-red/projects/planktoscopehat/flows.json @@ -156,6 +156,29 @@ "meta": {}, "color": "#DDAA99" }, + { + "id": "37fd90bb2f83eddc", + "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", + "c00c6732b9f36adb", + "e1d81baf6ae9ac67" + ], + "x": 34, + "y": 19, + "w": 392, + "h": 142 + }, { "id": "3a6bb13f.c9703e", "type": "ui_tab", @@ -8233,8 +8256,8 @@ "randomUnits": "seconds", "drop": false, "outputs": 1, - "x": 1180, - "y": 380, + "x": 1160, + "y": 520, "wires": [ [ "e41870d7.300eb8" @@ -8247,8 +8270,8 @@ "z": "1eaf21c8.f7a21e", "name": "", "env": [], - "x": 1220, - "y": 420, + "x": 1200, + "y": 560, "wires": [] }, { @@ -8270,8 +8293,8 @@ "from": "", "to": "", "reg": false, - "x": 670, - "y": 400, + "x": 650, + "y": 540, "wires": [ [ "ee58b91c.396108" @@ -8296,8 +8319,8 @@ "sendOnBlur": true, "className": "", "topicType": "str", - "x": 940, - "y": 400, + "x": 920, + "y": 540, "wires": [ [ "2068e7f.f4efb18", @@ -8371,8 +8394,8 @@ "topic": "acq_instrument", "topicType": "str", "className": "", - "x": 670, - "y": 160, + "x": 650, + "y": 300, "wires": [ [ "08d177136bd18281", @@ -8386,8 +8409,8 @@ "z": "1eaf21c8.f7a21e", "name": "", "env": [], - "x": 510, - "y": 300, + "x": 490, + "y": 440, "wires": [ [] ] @@ -8403,8 +8426,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 350, - "y": 300, + "x": 330, + "y": 440, "wires": [ [ "1cfadc66.3cde8c" @@ -8415,10 +8438,11 @@ "id": "427c312.fc5e65", "type": "subflow:1c24ad9c.bebec2", "z": "1eaf21c8.f7a21e", + "g": "37fd90bb2f83eddc", "name": "", "env": [], - "x": 170, - "y": 140, + "x": 110, + "y": 60, "wires": [ [ "c00c6732b9f36adb" @@ -8444,8 +8468,8 @@ "from": "", "to": "", "reg": false, - "x": 670, - "y": 480, + "x": 650, + "y": 620, "wires": [ [ "244ca5dd62df2bcd" @@ -8470,8 +8494,8 @@ "sendOnBlur": true, "className": "", "topicType": "str", - "x": 940, - "y": 480, + "x": 920, + "y": 620, "wires": [ [ "8e3b3d3c.955148", @@ -8490,8 +8514,8 @@ "initialize": "", "finalize": "", "libs": [], - "x": 1220, - "y": 480, + "x": 1200, + "y": 620, "wires": [ [ "5d5ad36d2c50dcc2" @@ -8552,8 +8576,8 @@ "payload": "", "topic": "acq_fnumber_objective", "topicType": "str", - "x": 930, - "y": 520, + "x": 910, + "y": 660, "wires": [ [ "a6983d3232b570a7", @@ -8580,8 +8604,8 @@ "from": "", "to": "", "reg": false, - "x": 1260, - "y": 520, + "x": 1240, + "y": 660, "wires": [ [ "5d5ad36d2c50dcc2" @@ -8614,8 +8638,8 @@ "from": "", "to": "", "reg": false, - "x": 680, - "y": 520, + "x": 660, + "y": 660, "wires": [ [ "6146ba22df928516" @@ -8637,8 +8661,8 @@ "className": "", "topic": "Resetting hardware configuration to version-specific default", "name": "", - "x": 370, - "y": 260, + "x": 350, + "y": 400, "wires": [] }, { @@ -8660,8 +8684,8 @@ "from": "", "to": "", "reg": false, - "x": 410, - "y": 220, + "x": 390, + "y": 360, "wires": [ [ "e3ba6ac89221b17b" @@ -8680,8 +8704,8 @@ "winHide": false, "oldrc": false, "name": "Copy default hardware config", - "x": 700, - "y": 220, + "x": 680, + "y": 360, "wires": [ [ "97e582080deae888" @@ -8707,8 +8731,8 @@ "drop": false, "allowrate": false, "outputs": 1, - "x": 930, - "y": 220, + "x": 910, + "y": 360, "wires": [ [ "3973b999ee7b3b1d" @@ -8727,8 +8751,8 @@ "5984b086eddc9311", "a2f2a4c7cbae4446" ], - "x": 1095, - "y": 220, + "x": 1075, + "y": 360, "wires": [] }, { @@ -8736,8 +8760,8 @@ "type": "subflow:b7861ce703215a01", "z": "1eaf21c8.f7a21e", "name": "", - "x": 380, - "y": 440, + "x": 360, + "y": 580, "wires": [ [ "54ba7f16.709ad8", @@ -8769,6 +8793,7 @@ "id": "c00c6732b9f36adb", "type": "change", "z": "1eaf21c8.f7a21e", + "g": "37fd90bb2f83eddc", "name": "Get acq_instrument", "rules": [ { @@ -8791,8 +8816,8 @@ "from": "", "to": "", "reg": false, - "x": 370, - "y": 140, + "x": 310, + "y": 60, "wires": [ [ "a7e5c7f4.644678", @@ -8808,8 +8833,8 @@ "links": [ "3973b999ee7b3b1d" ], - "x": 205, - "y": 420, + "x": 185, + "y": 560, "wires": [ [ "3bcaf757cbc77fbe" @@ -8825,8 +8850,8 @@ "08d177136bd18281", "9f34e4a2f33c4022" ], - "x": 205, - "y": 260, + "x": 185, + "y": 400, "wires": [ [ "68703ef63da2f081", @@ -8845,8 +8870,8 @@ "links": [ "cb9009e8a49e93cc" ], - "x": 875, - "y": 160, + "x": 855, + "y": 300, "wires": [] }, { @@ -8861,5 +8886,48 @@ "x": 875, "y": 120, "wires": [] + }, + { + "id": "e1d81baf6ae9ac67", + "type": "catch", + "z": "1eaf21c8.f7a21e", + "g": "37fd90bb2f83eddc", + "name": "", + "scope": null, + "uncaught": false, + "x": 170, + "y": 120, + "wires": [ + [ + "d88e0266c746ea70" + ] + ] + }, + { + "id": "d88e0266c746ea70", + "type": "change", + "z": "1eaf21c8.f7a21e", + "name": "Set acq_instrument to null", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "null", + "tot": "json" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 410, + "y": 220, + "wires": [ + [ + "56dd3f82c45717f0" + ] + ] } ] \ No newline at end of file From 1abdadf42c7d6653961ea5ce549b63e957bce820 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Wed, 18 Jun 2025 16:23:03 +0000 Subject: [PATCH 18/19] cool --- node-red/projects/adafruithat/flows.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/node-red/projects/adafruithat/flows.json b/node-red/projects/adafruithat/flows.json index 0818e1c5a..c0e478cbc 100644 --- a/node-red/projects/adafruithat/flows.json +++ b/node-red/projects/adafruithat/flows.json @@ -8478,6 +8478,11 @@ "value": "PlanktoScope v2.6", "type": "str" } + { + "label": "", + "value": "PlanktoScope v3.0", + "type": "str" + } ], "payload": "", "topic": "acq_instrument", From b37d4b2fea6f4ff04d520c7e11cc58b954610034 Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Thu, 19 Jun 2025 07:13:33 +0000 Subject: [PATCH 19/19] f --- node-red/nodes/package-lock.json | 1 - node-red/projects/adafruithat/flows.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/node-red/nodes/package-lock.json b/node-red/nodes/package-lock.json index a102459a2..2e357b51c 100644 --- a/node-red/nodes/package-lock.json +++ b/node-red/nodes/package-lock.json @@ -4,7 +4,6 @@ "requires": true, "packages": { "": { - "name": "nodes", "dependencies": { "csv-parse": "^5.6.0", "mime": "^4.0.7" diff --git a/node-red/projects/adafruithat/flows.json b/node-red/projects/adafruithat/flows.json index c0e478cbc..16dd3e19a 100644 --- a/node-red/projects/adafruithat/flows.json +++ b/node-red/projects/adafruithat/flows.json @@ -8477,7 +8477,7 @@ "label": "", "value": "PlanktoScope v2.6", "type": "str" - } + }, { "label": "", "value": "PlanktoScope v3.0",