Skip to content

PlanktoScope/dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dashboard

This is the new Node-RED project for the PlanktoScope.

Setup

  1. Prepare the SD Card

    • Download the latest development PlanktoScope OS.

    • Flash the .img.xz file to an SD card using Raspberry Pi Imager.

      • Open Raspberry Pi Imager.
      • Select "Choose OS" and locate the PlanktoScope image.
      • Select "Choose Storage" and pick your SD card.
      • Click "Write" to flash the image.
    • Insert the SD card into the PlanktoScope.

  2. Connect to the Local Network

    • Use an Ethernet cable to connect the PlanktoScope to your local router.
    • Power on the PlanktoScope.
  3. Connect the PlanktoScope to Wi-Fi

    • Once the PlanktoScope’s Wi-Fi becomes visible, use your computer or mobile device to connect it to your local router’s Wi-Fi network.
  4. Switch to the Node-RED dashboard project

  • Go to Node-RED admin
  • In the main menu, select ProjectsOpen and select "dashboard"
  1. Update the dashboard project
  • In the right sidebar, open the history tab → Commit History → hit the refresh button
  • If there are remote changes hit the pull button

/ps/node-red-v2/dashboard/ to access the dashboard /admin/ps/node-red-v2/ to access the Node-RED editor

Development

Before making contributions you will need to setup authentication, there are 2 methods available

Simple (Node-RED and token)
  • Go to https://github.com/settings/personal-access-tokens
  • Generate new token
  • Token name: "PlanktoScope dashboard"
  • Resource owner: "PlanktoScope"
  • Repository accessOnly select repositories select PlanktoScope/dashboard
  • PermissionsRepository permissionsContents select Read and Write
  • Hit Generate token

Copy the token somehwere safe.

When using the Node-RED GUI to push changes, you will be prompted for git username and password.

Use your GitHub username and the generated token as password.

Advanced (CLI and SSH)

See Development Environment then:

cd PlanktoScope/node-red/projects/dashboard
git remote set-url origin [email protected]:PlanktoScope/dashboard.git
git fetch origin
git checkout main
git pull

# use Git CLI instead of Node-RED history tab

Updating PlanktoScope

If you pull changes on the dashboard project, Node-RED may complain about missing nodes.

In that case you will need to type the following commands in the PlanktoScope

cd /home/pi/PlanktoScope
git pull
sudo systemctl restart nodered

You can use SSH or the Cockpit terminal.

Read and Write Data in global.json

Data is stored in a file located at: /home/pi/PlanktoScope/node-red/context/global/global.json.

Read Data

To retrieve a value stored in this file, use the following script in a Function Node:

// Retrieve the global variable
msg.variable = global.get("variable")
return msg

Template Node to Display and Modify Data

<template>
  <v-text-field
    label="My variable"
    variant="outlined"
    v-model="msg.variable"
    @update:model-value="send({ variable: msg.variable })"
  ></v-text-field>
</template>

Write Data

To set a value in the file, use the following script in a Function Node:

// Set a value in the global context
global.set("variable", msg.variable)
return msg

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •