From 00c9c8434da9abee367e94cdc3e0534beb6d37a0 Mon Sep 17 00:00:00 2001 From: tpollina Date: Mon, 13 Apr 2020 22:43:29 -0700 Subject: [PATCH 01/48] Set theme jekyll-theme-minimal --- _config.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 _config.yml diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..2f7efbe --- /dev/null +++ b/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-minimal \ No newline at end of file From 84f9339d4027aa466f025d496f901b705d84d9a1 Mon Sep 17 00:00:00 2001 From: tpollina Date: Mon, 13 Apr 2020 22:45:49 -0700 Subject: [PATCH 02/48] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 35cebb5..eb9eb44 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,5 @@ Please find the documentation here : https://planktonscope.readthedocs.io/en/latest/index.html + +## This is a test From 7ac8bebde9c629ec284fcce52fb8575f6950e7b6 Mon Sep 17 00:00:00 2001 From: tpollina Date: Tue, 14 Apr 2020 23:34:05 -0700 Subject: [PATCH 03/48] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index eb9eb44..35cebb5 100644 --- a/README.md +++ b/README.md @@ -2,5 +2,3 @@ Please find the documentation here : https://planktonscope.readthedocs.io/en/latest/index.html - -## This is a test From cf1be6ec1e67938c0f6dab0371e197bbb9089ea1 Mon Sep 17 00:00:00 2001 From: tpollina Date: Wed, 15 Apr 2020 13:17:18 -0700 Subject: [PATCH 04/48] Update README.md --- README.md | 237 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 234 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 35cebb5..5093083 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,235 @@ -# PlanktonScope +========================== +PlanktonScope Installation +========================== -Please find the documentation here : -https://planktonscope.readthedocs.io/en/latest/index.html +************************************* +Install Raspbian on your Raspberry Pi +************************************* + +Download the image +================== + +Download the .zip file of Raspbian Buster with desktop from the Raspberry Pi website Downloads page. + +Writing an image to the SD card + +Download the latest version of balenaEtcher and install it. + +Connect an SD card reader with the micro SD card inside. + +Open balenaEtcher and select from your hard drive the Raspberry Pi .zip file you wish to write to the SD card. + +Select the SD card you wish to write your image to. + +Review your selections and click 'Flash!' to begin writing data to the SD card. + +Prepare your Raspberry Pi +------------------------- +`Getting Started with your Raspberry Pi `_ + +Plug the SD Card in your Raspberry Pi + +Connect your Pi to a screen, mouse, keyboard and power + +Finish the setup + +Make sure you have access to internet and update/upgrade your fresh raspbian + +Update your Pi first +:: + sudo apt-get update -y + sudo apt-get upgrade -y + +Reboot your Pi safely +:: + sudo reboot now + +*************************** +Raspberry Pi configurations +*************************** + +Enable Camera/SSH/I2C in raspi-config + +Open up the configuration page and select Interfacing Options by typing this command: +:: + sudo raspi-config + +Select **Serial** + +Select **NO** + +Keep the **Serial Port Hardware enabled** + +Reboot your Pi safely +:: + sudo reboot now + + +************************************************** +Install the needed libraries for the PlanktonScope +************************************************** + +Install CircuitPython +===================== +`Installing CircuitPython on Raspberry Pi `_ + +Run the following command to install adafruit_blinka +:: + pip3 install adafruit-blinka + sudo pip3 install adafruit-circuitpython-motorkit + +Install RPi Cam Web Interface +============================= + +`RPi Cam Web Interface `_ + +Clone the code from github and enable and run the install script with the following commands +:: + git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git + cd RPi_Cam_Web_Interface + ./install.sh + +Press Enter to allow default setting of the installation +Press Enter to start RPi Cam Web Interface now +Found what is the IP of your Raspberry Pi +:: + sudo ip addr show | grep 'inet 1' + +Reach the url on a local browser : http://127.0.0.1/html/ + +Install Ultimate GPS HAT +======================== +`Installing Adafruit GPS HAT `_ + +`Use Python Thread with GPS HAT `_ + +:: + sudo apt-get install python gpsd gpsd-clients + +Install RGB Cooling HAT +======================= +`Installing RGB Cooling HAT `_ +Type these command to install: +:: + git clone https://github.com/WiringPi/WiringPi.git + cd WiringPi + sudo ./build + sudo apt-get install gcc + +Install Node-RED +================== +`Installing Node-RED on Raspberry Pi `_ + +Prerequisites +------------- +Ensure npm is able to build any binary modules it needs to install. +:: + sudo apt-get install build-essential + +Download and installation +------------------------- +To install Node.js, npm and Node-RED onto a Raspberry Pi, run the following command will that download and install them: +:: + bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) + +Due to the limited memory of the Raspberry Pi, you will need to start Node-RED with an additional argument to tell the underlying Node.js process to free up unused memory sooner than it would otherwise. +:: + node-red-pi --max-old-space-size=256 + +Autostart on boot +----------------- +Run Node-RED when the Pi is turned on, or re-booted, enable the service to autostart by running the command: +:: + sudo systemctl enable nodered.service + +Check the installation +---------------------- +Make sure NodeRed is correctly installed by reaching the following page from the broswer of your pi : +:: + http://localhost:1880. + +Install few nodes +----------------- +These nodes will be used in Node-RED: +:: + cd .node-red/ + npm install node-red-dashboard + npm install node-red-contrib-python3-function + npm install node-red-contrib-camerapi + npm install node-red-contrib-gpsd + npm install node-red-contrib-web-worldmap + +Import the last GUI +------------------- + +Import the `lastest version of the GUI `_ + +Install Mosquitto MQTT +====================== + +In order to send and receive from Node-RED: +:: + sudo apt-get install mosquitto mosquitto-clients + + +Install mqtt-paho +================= + +In order to send and receive from python: +:: + pip3 install paho-mqtt + +Install OpenCV +================= + +Use the quick version without virtual env +https://www.pyimagesearch.com/2019/09/16/install-opencv-4-on-raspberry-pi-4-and-raspbian-buster/ + + +Install MorphoCut +================= + +`Installing MorphoCut `_ + +MorphoCut is packaged on PyPI and can be installed with pip: +:: + sudo apt-get install python3-scipy + pip3 install -U git+https://github.com/morphocut/morphocut.git@pyrocystis + +Finishing the install +===================== + +Make sure to update your Pi +:: + sudo apt-get update -y + sudo apt-get full-upgrade -y + +Reboot your Pi safely +:: + sudo reboot now + + +******************* +Usefull later maybe +******************* + +Download the GitHub repo +======================== +At this link : https://github.com/tpollina/PlanktonScope/archive/master.zip +Unzip to a specific location: +:: + unzip /home/pi/Downloads/PlanktonScope-master.zip -d /home/pi/ + mv /home/pi/PlanktonScope-master /home/pi/PlanktonScope + +Update node-RED interface +========================= +To update the interface, you can just download the lastest .json file: +:: + wget -P $HOME/.node-red https://raw.githubusercontent.com/tpollina/PlanktonScope/master/scripts/flows_planktonscope.json + + +Share WiFi via Ethernet +======================= + +At this link : https://www.instructables.com/id/Share-WiFi-With-Ethernet-Port-on-a-Raspberry-Pi/ + From bd03fcfdbe827648a04f76059f92aba3c7878e3b Mon Sep 17 00:00:00 2001 From: tpollina Date: Wed, 15 Apr 2020 13:17:32 -0700 Subject: [PATCH 05/48] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 5093083..c0dcd74 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -========================== PlanktonScope Installation ========================== From 1a8ef383029d3ac169573e2227c171f9749045e7 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Fri, 29 May 2020 20:00:59 +0200 Subject: [PATCH 06/48] README.md formatting changes. Markdown is not easy when you start! --- README.md | 267 ++++++++++++++++++++++++++---------------------------- 1 file changed, 126 insertions(+), 141 deletions(-) diff --git a/README.md b/README.md index c0dcd74..5d90a67 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,8 @@ -PlanktonScope Installation -========================== +# PlanktonScope Installation -************************************* -Install Raspbian on your Raspberry Pi -************************************* +## Install and setup Raspbian on your Raspberry Pi -Download the image -================== +### Download the image Download the .zip file of Raspbian Buster with desktop from the Raspberry Pi website Downloads page. @@ -22,213 +18,202 @@ Select the SD card you wish to write your image to. Review your selections and click 'Flash!' to begin writing data to the SD card. -Prepare your Raspberry Pi -------------------------- -`Getting Started with your Raspberry Pi `_ +### Prepare your Raspberry Pi +[Getting Started with your Raspberry Pi](https://projects.raspberrypi.org/en/projects/raspberry-pi-getting-started/) Plug the SD Card in your Raspberry Pi -Connect your Pi to a screen, mouse, keyboard and power +Connect your Pi to a screen, mouse, keyboard and power Finish the setup Make sure you have access to internet and update/upgrade your fresh raspbian -Update your Pi first -:: - sudo apt-get update -y - sudo apt-get upgrade -y - +Update your Pi first +``` +sudo apt-get update -y +sudo apt-get upgrade -y +``` Reboot your Pi safely -:: - sudo reboot now +``` +sudo reboot now +``` -*************************** -Raspberry Pi configurations -*************************** +### Raspberry Pi configurations Enable Camera/SSH/I2C in raspi-config Open up the configuration page and select Interfacing Options by typing this command: -:: - sudo raspi-config +``` +sudo raspi-config +``` -Select **Serial** +Select `Serial` -Select **NO** +Select `NO` -Keep the **Serial Port Hardware enabled** +Keep the `Serial Port Hardware enabled` Reboot your Pi safely -:: - sudo reboot now +``` +sudo reboot now +``` +## Install the needed libraries for the PlanktonScope -************************************************** -Install the needed libraries for the PlanktonScope -************************************************** - -Install CircuitPython -===================== -`Installing CircuitPython on Raspberry Pi `_ +### Install CircuitPython +[Installing CircuitPython on Raspberry Pi](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi) Run the following command to install adafruit_blinka -:: - pip3 install adafruit-blinka - sudo pip3 install adafruit-circuitpython-motorkit +``` +pip3 install adafruit-blinka +sudo pip3 install adafruit-circuitpython-motorkit +``` -Install RPi Cam Web Interface -============================= +### Install RPi Cam Web Interface -`RPi Cam Web Interface `_ +[RPi Cam Web Interface](https://elinux.org/RPi-Cam-Web-Interface) Clone the code from github and enable and run the install script with the following commands -:: - git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git - cd RPi_Cam_Web_Interface - ./install.sh +``` +git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git +cd RPi_Cam_Web_Interface +./install.sh +``` Press Enter to allow default setting of the installation Press Enter to start RPi Cam Web Interface now Found what is the IP of your Raspberry Pi -:: - sudo ip addr show | grep 'inet 1' +``` +sudo ip addr show | grep 'inet 1' +``` Reach the url on a local browser : http://127.0.0.1/html/ -Install Ultimate GPS HAT -======================== -`Installing Adafruit GPS HAT `_ +### Install Ultimate GPS HAT +[Installing Adafruit GPS HAT](https://learn.adafruit.com/adafruit-ultimate-gps-hat-for-raspberry-pi/pi-setup) -`Use Python Thread with GPS HAT `_ +[Use Python Thread with GPS HAT](http://www.danmandle.com/blog/getting-gpsd-to-work-with-python/) + +``` +sudo apt-get install python gpsd gpsd-clients +``` + +### Install RGB Cooling HAT +[Installing RGB Cooling HAT](https://www.yahboom.net/study/RGB_Cooling_HAT) -:: - sudo apt-get install python gpsd gpsd-clients - -Install RGB Cooling HAT -======================= -`Installing RGB Cooling HAT `_ Type these command to install: -:: - git clone https://github.com/WiringPi/WiringPi.git - cd WiringPi - sudo ./build - sudo apt-get install gcc +``` +git clone https://github.com/WiringPi/WiringPi.git +cd WiringPi +sudo ./build +sudo apt-get install gcc +``` -Install Node-RED -================== -`Installing Node-RED on Raspberry Pi `_ +### Install Node-RED +[Installing Node-RED on Raspberry Pi](https://nodered.org/docs/getting-started/raspberrypi) -Prerequisites -------------- -Ensure npm is able to build any binary modules it needs to install. -:: - sudo apt-get install build-essential +#### Prerequisites +Ensure npm is able to build any binary modules it needs to install. +``` +sudo apt-get install build-essential +``` -Download and installation -------------------------- -To install Node.js, npm and Node-RED onto a Raspberry Pi, run the following command will that download and install them: -:: - bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) - +#### Download and installation +To install Node.js, npm and Node-RED onto a Raspberry Pi, run the following command will that download and install them: +``` +bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) +``` Due to the limited memory of the Raspberry Pi, you will need to start Node-RED with an additional argument to tell the underlying Node.js process to free up unused memory sooner than it would otherwise. -:: - node-red-pi --max-old-space-size=256 +``` +node-red-pi --max-old-space-size=256 +``` -Autostart on boot ------------------ +#### Autostart on boot Run Node-RED when the Pi is turned on, or re-booted, enable the service to autostart by running the command: -:: - sudo systemctl enable nodered.service +``` +sudo systemctl enable nodered.service +``` -Check the installation ----------------------- -Make sure NodeRed is correctly installed by reaching the following page from the broswer of your pi : -:: - http://localhost:1880. +#### Check the installation +Make sure NodeRed is correctly installed by reaching the following page from the broswer of your pi : http://localhost:1880. -Install few nodes ------------------ +#### Install few nodes These nodes will be used in Node-RED: -:: - cd .node-red/ - npm install node-red-dashboard - npm install node-red-contrib-python3-function - npm install node-red-contrib-camerapi - npm install node-red-contrib-gpsd - npm install node-red-contrib-web-worldmap +``` +cd .node-red/ +npm install node-red-dashboard +npm install node-red-contrib-python3-function +npm install node-red-contrib-camerapi +npm install node-red-contrib-gpsd +npm install node-red-contrib-web-worldmap +``` -Import the last GUI -------------------- +#### Import the last GUI -Import the `lastest version of the GUI `_ +Import the lastest version of the GUI from https://raw.githubusercontent.com/tpollina/PlanktonScope/master/scripts/flows_planktonscope.json> -Install Mosquitto MQTT -====================== +### Install Mosquitto MQTT In order to send and receive from Node-RED: -:: - sudo apt-get install mosquitto mosquitto-clients - +``` +sudo apt-get install mosquitto mosquitto-clients -Install mqtt-paho -================= +``` + +### Install mqtt-paho In order to send and receive from python: -:: - pip3 install paho-mqtt - -Install OpenCV -================= +``` +pip3 install paho-mqtt +``` + +### Install OpenCV Use the quick version without virtual env https://www.pyimagesearch.com/2019/09/16/install-opencv-4-on-raspberry-pi-4-and-raspbian-buster/ -Install MorphoCut -================= +### Install MorphoCut -`Installing MorphoCut `_ +_Installing MorphoCut `_ MorphoCut is packaged on PyPI and can be installed with pip: -:: - sudo apt-get install python3-scipy - pip3 install -U git+https://github.com/morphocut/morphocut.git@pyrocystis +``` +sudo apt-get install python3-scipy +pip3 install -U git+https://github.com/morphocut/morphocut.git@pyrocystis +``` -Finishing the install -===================== +## Finishing the install -Make sure to update your Pi -:: - sudo apt-get update -y - sudo apt-get full-upgrade -y +Make sure to update your Pi +``` +sudo apt-get update -y +sudo apt-get full-upgrade -y +``` Reboot your Pi safely -:: - sudo reboot now +``` +sudo reboot now +``` -******************* -Usefull later maybe -******************* +## Useful later maybe -Download the GitHub repo -======================== +### Download the GitHub repo At this link : https://github.com/tpollina/PlanktonScope/archive/master.zip Unzip to a specific location: -:: - unzip /home/pi/Downloads/PlanktonScope-master.zip -d /home/pi/ - mv /home/pi/PlanktonScope-master /home/pi/PlanktonScope +``` +unzip /home/pi/Downloads/PlanktonScope-master.zip -d /home/pi/ +mv /home/pi/PlanktonScope-master /home/pi/PlanktonScope +``` -Update node-RED interface -========================= +### Update node-RED interface To update the interface, you can just download the lastest .json file: -:: - wget -P $HOME/.node-red https://raw.githubusercontent.com/tpollina/PlanktonScope/master/scripts/flows_planktonscope.json - +``` +wget -P $HOME/.node-red https://raw.githubusercontent.com/tpollina/PlanktonScope/master/scripts/flows_planktonscope.json +``` -Share WiFi via Ethernet -======================= +### Share WiFi via Ethernet At this link : https://www.instructables.com/id/Share-WiFi-With-Ethernet-Port-on-a-Raspberry-Pi/ - From 250b00ec6df03b26b00a62f7954194479e8a858f Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Fri, 29 May 2020 20:02:55 +0200 Subject: [PATCH 07/48] README.md: PlanktonScope replacement by PlanktoScop --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5d90a67..23e175f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# PlanktonScope Installation +# PlanktoScop Installation ## Install and setup Raspbian on your Raspberry Pi @@ -59,7 +59,7 @@ Reboot your Pi safely sudo reboot now ``` -## Install the needed libraries for the PlanktonScope +## Install the needed libraries for the PlanktoScop ### Install CircuitPython [Installing CircuitPython on Raspberry Pi](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi) From a5d92d4d6e29e2813759316682eee41b8c0e7667 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Fri, 29 May 2020 23:05:41 +0200 Subject: [PATCH 08/48] README.md: improve documentation on setup, part 1 --- README.md | 77 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 23e175f..c7ceaaa 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,77 @@ -# PlanktoScop Installation +# PlanktoScop Main Repository +The PlanktoScop is an open and affordable modular imaging platform for citizen oceanography. + +It's a high-throughtput microscope platform, designed with an open-hardware and open-software mentality. + +You can learn more about the PlantoScop [on its website](https://www.planktonscope.org/discover). + + +# PlanktoScop Raspberry Pi Setup +After getting your kit and finding the necessary components, but before assembling your kit, you should take the time to do a mockup build and setup your Raspberry! ## Install and setup Raspbian on your Raspberry Pi ### Download the image -Download the .zip file of Raspbian Buster with desktop from the Raspberry Pi website Downloads page. +The latest Raspbian version can always be downloaded from [the Raspberry Pi Downloads page](https://www.raspberrypi.org/downloads/raspbian/). +For a first build, it's recommende to download an image of Raspbian Buster with desktop. -Writing an image to the SD card +#### Writing an image to the SD card -Download the latest version of balenaEtcher and install it. +Download the latest version of [balenaEtcher](https://www.balena.io/etcher/) and install it. Connect an SD card reader with the micro SD card inside. -Open balenaEtcher and select from your hard drive the Raspberry Pi .zip file you wish to write to the SD card. +Open balenaEtcher and select from your hard drive the image zip file you just downloaded. -Select the SD card you wish to write your image to. +Select the SD card you want to write your image to. -Review your selections and click 'Flash!' to begin writing data to the SD card. +Review your selections and click `Flash!` to begin writing data to the SD card. -### Prepare your Raspberry Pi +#### Prepare your Raspberry Pi [Getting Started with your Raspberry Pi](https://projects.raspberrypi.org/en/projects/raspberry-pi-getting-started/) -Plug the SD Card in your Raspberry Pi +Plug the SD Card in your Raspberry Pi and connect your Pi to a screen, mouse and a keyboard. Check the connection twice before plugging the power. -Connect your Pi to a screen, mouse, keyboard and power +The first boot to the desktop may take up to 120 seconds. This is normal and is caused by the image expanding the filesystem to the whole SD card. DO NOT REBOOT before you reach the desktop. -Finish the setup +#### Finish the setup -Make sure you have access to internet and update/upgrade your fresh raspbian +Make sure you have access to internet and update/upgrade your fresh Raspbian install. -Update your Pi first +Update your Pi first. Open up a terminal, and do the following: ``` sudo apt-get update -y sudo apt-get upgrade -y ``` -Reboot your Pi safely + +You can now reboot your Pi safely. ``` sudo reboot now ``` -### Raspberry Pi configurations +## Raspberry Pi configurations -Enable Camera/SSH/I2C in raspi-config +### Enable Camera/SSH/I2C in raspi-config -Open up the configuration page and select Interfacing Options by typing this command: +Open up a terminal once again, and access the configuration tool: ``` sudo raspi-config ``` -Select `Serial` +While you're here, a wise thing to do would be to change the default password for the `pi` user. This is very warmly recommended if your PlanktoScop is connected to a shared network you do not control. Just select the first option `1 Change User Password`. -Select `NO` +Now, you can go to `5 Interfacing Options`, then `P2 SSH`. Choose `Yes` to activate the SSH access. -Keep the `Serial Port Hardware enabled` +Again, select `5 Interfacing Options`, then `P4 SPI`. Choose `Yes` to enable the SPI interface. -Reboot your Pi safely +One more, select `5 Interfacing Options`, then `P5 I2C`. Choose `Yes` to enable the ARM I2C interface of the Raspberry. + +Finally, select `5 Interfacing Options`, then `P6 Serial`. + +This time, choose `No` to deactivate the login shell on the serial connection, but then choose `Yes` to keep the Serial port hardware enabled. + +Reboot your Pi safely. ``` sudo reboot now ``` @@ -62,33 +79,35 @@ sudo reboot now ## Install the needed libraries for the PlanktoScop ### Install CircuitPython -[Installing CircuitPython on Raspberry Pi](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi) +Start by following [Adafruit's guide](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi). You can start at the chapter `Install Python Libraries`. -Run the following command to install adafruit_blinka +For the record, the command are as following, however, Adafruit's page might have been updated, so please make sure this is still needed: ``` +pip3 install RPI.GPIO pip3 install adafruit-blinka sudo pip3 install adafruit-circuitpython-motorkit ``` ### Install RPi Cam Web Interface -[RPi Cam Web Interface](https://elinux.org/RPi-Cam-Web-Interface) +You can find more information about the RPi Cam Web Interface on [eLinux' website]](https://elinux.org/RPi-Cam-Web-Interface). -Clone the code from github and enable and run the install script with the following commands +To set it up, clone the code from Github and enable and run the install script with the following commands ``` git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git cd RPi_Cam_Web_Interface ./install.sh ``` -Press Enter to allow default setting of the installation -Press Enter to start RPi Cam Web Interface now -Found what is the IP of your Raspberry Pi +Press Enter to allow default setting of the installation. +Press Enter to start RPi Cam Web Interface now. +Found what is the IP of your Raspberry Pi. ``` sudo ip addr show | grep 'inet 1' ``` +You can test the interface locally by accessing this url in from the browser in the Raspberry: `http://localhost/html` -Reach the url on a local browser : http://127.0.0.1/html/ +You can also try to access this page from another computer connected to the same network with the IP address previously found : `http://[IP_ADDRESS]/html/`. ### Install Ultimate GPS HAT [Installing Adafruit GPS HAT](https://learn.adafruit.com/adafruit-ultimate-gps-hat-for-raspberry-pi/pi-setup) From 69a393db50474d33139c98b19b0ce062b33a0255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon-Martin=20Schr=C3=B6der?= Date: Tue, 16 Jun 2020 21:30:47 +0200 Subject: [PATCH 09/48] Update MorphoCut installation instructions PlanktonScope-related things are now merged into master of the MorphoCut repository. --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c0dcd74..8c68f80 100644 --- a/README.md +++ b/README.md @@ -188,12 +188,14 @@ https://www.pyimagesearch.com/2019/09/16/install-opencv-4-on-raspberry-pi-4-and- Install MorphoCut ================= -`Installing MorphoCut `_ +[Installing MorphoCut](https://morphocut.readthedocs.io/en/stable/installation.html) MorphoCut is packaged on PyPI and can be installed with pip: -:: - sudo apt-get install python3-scipy - pip3 install -U git+https://github.com/morphocut/morphocut.git@pyrocystis + +```sh +sudo apt-get install python3-scipy +pip3 install -U git+https://github.com/morphocut/morphocut.git +``` Finishing the install ===================== From 4a158c8c7c90ce17fc3d70f43899db2cfb62b86a Mon Sep 17 00:00:00 2001 From: tpollina Date: Mon, 6 Jul 2020 17:10:32 +0200 Subject: [PATCH 10/48] Update README.md Divide Installation in Basic/Expert Installations to make it easier --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8c68f80..62681a5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,16 @@ -PlanktonScope Installation -========================== +PlanktonScope +============= + +This GitHub is part of a community that you can find on this website : https://www.planktonscope.org/ + +PlanktonScope Basic Installation +================================ + +Before going further, notice that you can download the image disk already setup without having to deal with all these command lines. +Jump here : http://planktonscope.su.domains/Images_raspberry/Raspbian_Buster_Morphocut_WiFi.img + +PlanktonScope Expert Installation +================================= ************************************* Install Raspbian on your Raspberry Pi From c8dffd590b818e4e5712e26adc28082f0011609d Mon Sep 17 00:00:00 2001 From: tpollina Date: Mon, 6 Jul 2020 17:11:00 +0200 Subject: [PATCH 11/48] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 62681a5..85b7983 100644 --- a/README.md +++ b/README.md @@ -3,14 +3,14 @@ PlanktonScope This GitHub is part of a community that you can find on this website : https://www.planktonscope.org/ -PlanktonScope Basic Installation -================================ +Basic Installation +================== Before going further, notice that you can download the image disk already setup without having to deal with all these command lines. Jump here : http://planktonscope.su.domains/Images_raspberry/Raspbian_Buster_Morphocut_WiFi.img -PlanktonScope Expert Installation -================================= +Expert Installation +=================== ************************************* Install Raspbian on your Raspberry Pi From ac6e3204e550ba7c957a653054dd6db2083e3df6 Mon Sep 17 00:00:00 2001 From: tpollina Date: Tue, 14 Jul 2020 16:55:16 +0200 Subject: [PATCH 12/48] Rename config.txt to config.json --- config.txt => config.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename config.txt => config.json (100%) diff --git a/config.txt b/config.json similarity index 100% rename from config.txt rename to config.json From 2412e73b1bb87e9ea560b1729198a8b55687d1e6 Mon Sep 17 00:00:00 2001 From: tpollina Date: Tue, 14 Jul 2020 16:55:43 +0200 Subject: [PATCH 13/48] Delete _config.yml --- _config.yml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 _config.yml diff --git a/_config.yml b/_config.yml deleted file mode 100644 index 2f7efbe..0000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-minimal \ No newline at end of file From 889d2eedae1cbae0ebc41ff41f412b238afa5e47 Mon Sep 17 00:00:00 2001 From: tpollina Date: Tue, 14 Jul 2020 16:56:04 +0200 Subject: [PATCH 14/48] Delete StackFlow_v3.py --- scripts/StackFlow_v3.py | 116 ---------------------------------------- 1 file changed, 116 deletions(-) delete mode 100644 scripts/StackFlow_v3.py diff --git a/scripts/StackFlow_v3.py b/scripts/StackFlow_v3.py deleted file mode 100644 index 82f7110..0000000 --- a/scripts/StackFlow_v3.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python -# coding: utf-8 - -################################################################################ -# A) Import the librairies needed to execute the script -################################################################################ -#Activate pinout to control the LEDs and the RELAY -from gpiozero import LED -#Allow to access the I2C BUS from the Raspberry Pi -import smbus -#Time librairy in order to sleep when need -from time import sleep -#Picamera library to take images -from picamera import PiCamera -#Enable calculation of remaining duration and datetime -from datetime import datetime, timedelta -#Enable creation of new folders -import os -from adafruit_motor import stepper -from adafruit_motorkit import MotorKit -from time import sleep - -kit = MotorKit() -pump_stepper = kit.stepper1 -pump_stepper.release() - - -################################################################################ -# C) Configuration file -################################################################################ - - -camera = PiCamera() -camera.resolution = (3280, 2464) -camera.iso = 60 -sleep(3) -camera.shutter_speed = 300 -camera.exposure_mode = 'off' -g = camera.awb_gains -camera.awb_mode = 'off' -camera.awb_gains = g -nb_frame=2000 - -pump_stepper.release() -################################################################################ -# E) Define simple functions making the whole sequence -### - -################################################################################ - - -print("###############") -print("IMAGING") -print("###############") - -#Inform on the statut of the operation -print("Imaging : engaged") -#start the preview only during the acquisition -camera.start_preview(fullscreen=False, window = (160, 0, 640, 480)) - - -#get the actual date -date_now = datetime.now().strftime("%m_%d_%Y") -day_now="/home/pi/Desktop/PlanktonScope_acquisition/"+str(date_now) - -#create a directory if the directory doesn't exist yet -if not os.path.exists(day_now): - os.makedirs(day_now) - -#get the actual date -hour_now = datetime.now().strftime("%H") -hour="/home/pi/Desktop/PlanktonScope_acquisition/"+str(date_now)+"/"+str(hour_now) - -#create a directory if the directory doesn't exist yet -if not os.path.exists(hour): - os.makedirs(hour) - - -#allow the camera to warm up - -for i in range(200): - pump_stepper.onestep(direction=stepper.BACKWARD, style=stepper.SINGLE) - sleep(0.01) - -for frame in range(nb_frame): - - #get the time now - time = datetime.now().strftime("%M_%S_%f") - #create a filename from the date and the time - filename="/home/pi/Desktop/PlanktonScope_acquisition/"+str(date_now)+"/"+str(hour_now)+"/"+str(time)+".jpg" - - #capture an image with the specified filename - camera.capture(filename) - - #wait to complete the imaging process and print info on the terminal - print("Imaging : "+str(frame)+"/"+str(nb_frame)) - - for i in range(10): - pump_stepper.onestep(direction=stepper.BACKWARD, style=stepper.SINGLE) - sleep(0.01) - sleep(0.5) - - -#stop the preview during the rest of the sequence -camera.stop_preview() -pump_stepper.release() - -#Inform on the statut of the operation -print("Imaging : done") - - -################################################################################ - -################################################# -# F) Execute the sequence -################################################################################ From c474b3a7e69812ae9fdba0ad7145eb7f9e0f5cbf Mon Sep 17 00:00:00 2001 From: tpollina Date: Tue, 14 Jul 2020 16:56:17 +0200 Subject: [PATCH 15/48] Delete Morphocut_segmentation.py --- scripts/Morphocut_segmentation.py | 140 ------------------------------ 1 file changed, 140 deletions(-) delete mode 100644 scripts/Morphocut_segmentation.py diff --git a/scripts/Morphocut_segmentation.py b/scripts/Morphocut_segmentation.py deleted file mode 100644 index 94531a5..0000000 --- a/scripts/Morphocut_segmentation.py +++ /dev/null @@ -1,140 +0,0 @@ - -import datetime -import os - -from skimage.util import img_as_ubyte -from skimage.filters import threshold_otsu - - -from morphocut import Call -from morphocut.contrib.ecotaxa import EcotaxaWriter -from morphocut.contrib.zooprocess import CalculateZooProcessFeatures -from morphocut.core import Pipeline -from morphocut.file import Find -from morphocut.image import ( - ExtractROI, - FindRegions, - ImageReader, - ImageWriter, - RescaleIntensity, - RGB2Gray, -) -from morphocut.stat import RunningMedian -from morphocut.str import Format -from morphocut.stream import TQDM, Enumerate - -import_path = "/home/pi/Desktop/PlanktonScope_acquisition/01_17_2020/16_2" -export_path = "/home/pi/Desktop/PlanktonScope_acquisition/01_17_2020/16" -archive_fn = os.path.join(export_path, "17_morphocut_processed.zip") - -# Meta data that is added to every object -global_metadata = { - "process_datetime": datetime.datetime.now(), - "sample_project": "PlanktonScope Villefranche", - "sample_ship": "Kayak de Fabien", - "sample_operator": "Thibaut Pollina", - "sample_id": "Flowcam_PlanktonScope_comparison", - "sample_sampling_gear": "net", - "object_date": 20200117, - "object_time": 150000, - "object_lat": 43.696146, - "object_lon": 7.308359, - "object_depth_min": 0, - "object_depth_max": 1, - "acq_fnumber_objective": 16, - "acq_celltype": 400, - "acq_camera": "Pi Camera V2.1", - "acq_instrument": "PlanktonScope V2.1", - "acq_software": "Node-RED Dashboard and raw python", - "acq_instrument_ID": "copepode", - "acq_camera_resolution" : "(3280, 2464)", - "acq_camera_iso" : 60, - "acq_camera_shutter_speed" : 100, - "acq_camera_exposure_mode" : "off", - "acq_camera_awb_mode" : "off", - "process_pixel": 1.19 - -} - -if __name__ == "__main__": - print("Processing images under {}...".format(import_path)) - - # Create export_path in case it doesn't exist - - os.makedirs(export_path, exist_ok=True) - # Define processing pipeline - with Pipeline() as p: - # Recursively find .jpg files in import_path. - # Sort to get consective frames. - abs_path = Find(import_path, [".jpg"], sort=True, verbose=True) - - # Extract name from abs_path - name = Call(lambda p: os.path.splitext(os.path.basename(p))[0], abs_path) - - # Show progress bar for frames - TQDM(Format("Frame {name}", name=name)) - - # Read image - img = ImageReader(abs_path) - - - # Convert image to uint8 gray - img_gray = RGB2Gray(img) - - #img_gray = Call(img_as_ubyte, img_gray) - - # Apply threshold find objects - - #threshold = 200 # - #threshold = Call(threshold_otsu, img_gray) - threshold = 180 # - - mask = img_gray < threshold - - - # Write corrected frames - - ImageWriter(frame_fn, mask) - - # Find objects - regionprops = FindRegions( - mask, img_gray, min_area=300, padding=10, warn_empty=name - ) - - # For an object, extract a vignette/ROI from the image - roi_orig = ExtractROI(img, regionprops, bg_color=255) - #roi_gray = ExtractROI(img_gray, regionprops, bg_color=255) - - # Generate an object identifier - i = Enumerate() - - object_id = Format("{name}_{i:d}", name=name, i=i) - - # Calculate features. The calculated features are added to the global_metadata. - # Returns a Variable representing a dict for every object in the stream. - #meta = CalculateZooProcessFeatures( - # regionprops, prefix="object_", meta=global_metadata - #) - # If CalculateZooProcessFeatures is not used, we need to copy global_metadata into the stream: - # meta = Call(lambda: global_metadata.copy()) - # https://github.com/morphocut/morphocut/issues/51 - - # Add object_id to the metadata dictionary - #meta["object_id"] = object_id - - # Generate object filenames - - orig_fn = Format(os.path.join(export_path, "{object_id}.jpg"), object_id=object_id) - #gray_fn = Format("{object_id}-gray.jpg", object_id=object_id) - - ImageWriter(orig_fn, roi_orig) - - # Write objects to an EcoTaxa archive: - # roi image in original color, roi image in grayscale, metadata associated with each object - #EcotaxaWriter(archive_fn, [(orig_fn, roi_orig)], meta) - - # Progress bar for objects - TQDM(Format("Object {object_id}", object_id=object_id)) - - # Execute pipeline - p.run() From 10bc0c2535c1406b17c05554a0983f91bf0f3194 Mon Sep 17 00:00:00 2001 From: tpollina Date: Tue, 14 Jul 2020 18:21:16 +0200 Subject: [PATCH 16/48] Delete store_retrieve.json --- flows/store_retrieve.json | 1170 ------------------------------------- 1 file changed, 1170 deletions(-) delete mode 100644 flows/store_retrieve.json diff --git a/flows/store_retrieve.json b/flows/store_retrieve.json deleted file mode 100644 index 02147cb..0000000 --- a/flows/store_retrieve.json +++ /dev/null @@ -1,1170 +0,0 @@ -[ - { - "id": "103f6179.d5012f", - "type": "tab", - "label": "Sample", - "disabled": false, - "info": "" - }, - { - "id": "f6f450aa.8ed73", - "type": "ui_text_input", - "z": "103f6179.d5012f", - "name": "sample_ship", - "label": "Name of the ship", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 5, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_ship", - "x": 1170, - "y": 100, - "wires": [ - [ - "e17096e4.74caf8" - ] - ] - }, - { - "id": "8f3a0dab.4d614", - "type": "ui_dropdown", - "z": "103f6179.d5012f", - "name": "sample_sampling_gear", - "label": "Sampling gear", - "tooltip": "", - "place": "Select", - "group": "aac2eaf7.0cdab8", - "order": 7, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "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" - } - ], - "payload": "", - "topic": "sample_sampling_gear", - "x": 1130, - "y": 220, - "wires": [ - [ - "e17096e4.74caf8" - ] - ] - }, - { - "id": "e046b933.316b28", - "type": "ui_text_input", - "z": "103f6179.d5012f", - "name": "sample_operator", - "label": "Name of the operator", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 6, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_operator", - "x": 1150, - "y": 180, - "wires": [ - [ - "e17096e4.74caf8" - ] - ] - }, - { - "id": "2ff04681.e99aea", - "type": "ui_text_input", - "z": "103f6179.d5012f", - "name": "sample_project", - "label": "Name of the project*", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_project", - "x": 1160, - "y": 60, - "wires": [ - [ - "e17096e4.74caf8" - ] - ] - }, - { - "id": "75615576.3a38cc", - "type": "ui_text_input", - "z": "103f6179.d5012f", - "name": "sample_id", - "label": "ID of the station*", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "sample_id", - "x": 1170, - "y": 140, - "wires": [ - [ - "e17096e4.74caf8" - ] - ] - }, - { - "id": "b77eb8b0.a222a8", - "type": "ui_date_picker", - "z": "103f6179.d5012f", - "name": "acq_date", - "label": "Date :", - "group": "aac2eaf7.0cdab8", - "order": 10, - "width": 0, - "height": 0, - "passthru": true, - "topic": "", - "x": 1176, - "y": 640, - "wires": [ - [ - "4fa687df.1aa1d8" - ] - ] - }, - { - "id": "86d5ed81.6dc99", - "type": "ui_text_input", - "z": "103f6179.d5012f", - "name": "acq_time", - "label": "Time :", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 11, - "width": 0, - "height": 0, - "passthru": true, - "mode": "time", - "delay": 300, - "topic": "", - "x": 1176, - "y": 680, - "wires": [ - [ - "26461e30.b461b2" - ] - ] - }, - { - "id": "26461e30.b461b2", - "type": "function", - "z": "103f6179.d5012f", - "name": "set time global", - "func": "var time = new Date(msg.payload);\nglobal.set('generic_acq_time',time);\n\nvar hour = time.getUTCHours();\nif (hour<10){hour = \"0\"+hour;}\nvar minute = time.getUTCMinutes();\nif (minute<10){minute = \"0\"+minute;}\n\nvar time_UTC = \"\"+hour+minute+\"00\";\nglobal.set('object_time',time_UTC);\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1396, - "y": 680, - "wires": [ - [ - "da16d746.4b12e8" - ] - ] - }, - { - "id": "4fa687df.1aa1d8", - "type": "function", - "z": "103f6179.d5012f", - "name": "set date global", - "func": "var date = new Date(msg.payload);\nglobal.set('generic_acq_date',date);\n\nvar year = date.getUTCFullYear();\nvar month = date.getUTCMonth()+1;\nif (month<10){month = \"0\"+month;}\nvar day = date.getUTCDate();\nif (day<10){day = \"0\"+day;}\n\nvar date_UTC = \"\"+year+month+day;\nglobal.set('object_date',date_UTC);\n\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1396, - "y": 640, - "wires": [ - [ - "da16d746.4b12e8" - ] - ] - }, - { - "id": "da16d746.4b12e8", - "type": "function", - "z": "103f6179.d5012f", - "name": "get global", - "func": "msg.payload={\n generic:{\n \"generic_sample_date\":global.get(\"generic_sample_date\"),\n \"generic_sample_time\":global.get(\"generic_sample_time\"),\n \"generic_acq_date\":global.get(\"generic_acq_date\"),\n \"generic_acq_time\":global.get(\"generic_acq_time\")\n },\n sample:{\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_date\":global.get(\"sample_date\"),\n \"sample_time\":global.get(\"sample_time\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_project\":global.get(\"sample_project\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\")\n },\n acquisition:{\n \"acq_id\":global.get(\"acq_id\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_magnification\":global.get(\"magnification\")\n },\n object:{\n \"object_date\":global.get(\"object_date\"),\n \"object_time\":global.get(\"object_time\"),\n \"object_depth_min\":global.get(\"object_depth_min\"),\n \"object_depth_max\":global.get(\"object_depth_max\")\n \n },\n process:{\n //PROCESS\n \"process_pixel\":global.get(\"process_pixel\"),\n \"process_id\":global.get(\"process_id\")\n }\n};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1693, - "y": 60, - "wires": [ - [ - "28df8fd6.06fb7" - ] - ] - }, - { - "id": "6dd1657e.c52e4c", - "type": "file", - "z": "103f6179.d5012f", - "name": "", - "filename": "/home/pi/PlanktonScope/log/config.txt", - "appendNewline": true, - "createDir": true, - "overwriteFile": "true", - "encoding": "none", - "x": 2043, - "y": 60, - "wires": [ - [] - ] - }, - { - "id": "3a43748d.52464c", - "type": "function", - "z": "103f6179.d5012f", - "name": "set optical config", - "func": "global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1386, - "y": 720, - "wires": [ - [ - "da16d746.4b12e8" - ] - ] - }, - { - "id": "ff1b2069.b8273", - "type": "ui_dropdown", - "z": "103f6179.d5012f", - "name": "acq_fnumber_objective", - "label": "M12 Lens*", - "tooltip": "", - "place": "Select option", - "group": "aac2eaf7.0cdab8", - "order": 15, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "f 25mm 1/2\" 5MP IR", - "value": 25, - "type": "num" - }, - { - "label": "f 16mm 1/2.5\" 5MP IR", - "value": 16, - "type": "num" - }, - { - "label": "f 12mm 1/2.5\" 5MP IR", - "value": 12, - "type": "num" - }, - { - "label": "f 8mm 1/2.5\" 5MP IR", - "value": 8, - "type": "num" - }, - { - "label": "f 6mm 1/2.5\" 5MP IR", - "value": 6, - "type": "num" - } - ], - "payload": "", - "topic": "acq_fnumber_objective", - "x": 1126, - "y": 720, - "wires": [ - [ - "3a43748d.52464c" - ] - ] - }, - { - "id": "4d38113f.08c6d", - "type": "ui_numeric", - "z": "103f6179.d5012f", - "name": "acq_minimum_mesh", - "label": "Min fraction size (μm)", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 16, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "acq_minimum_mesh", - "format": "{{value}}", - "min": 0, - "max": "300", - "step": "10", - "x": 1136, - "y": 520, - "wires": [ - [ - "d911efe0.ea7f1" - ] - ] - }, - { - "id": "220c7464.306a8c", - "type": "ui_numeric", - "z": "103f6179.d5012f", - "name": "acq_maximum_mesh", - "label": "Max fraction size (μm)", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 17, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "acq_maximum_mesh", - "format": "{{value}}", - "min": "200", - "max": "2000", - "step": "100", - "x": 1136, - "y": 560, - "wires": [ - [ - "d911efe0.ea7f1" - ] - ] - }, - { - "id": "c3b1ab59.484178", - "type": "ui_text_input", - "z": "103f6179.d5012f", - "name": "acq_id", - "label": "Acquisition unique ID*", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 9, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "acq_id", - "x": 1186, - "y": 400, - "wires": [ - [ - "d911efe0.ea7f1" - ] - ] - }, - { - "id": "3bb0adb4.de5412", - "type": "ui_dropdown", - "z": "103f6179.d5012f", - "name": "acq_celltype", - "label": "Thickness flowcell*", - "tooltip": "", - "place": "Select option", - "group": "aac2eaf7.0cdab8", - "order": 13, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "200 μm µ-Slide I Luer", - "value": 200, - "type": "num" - }, - { - "label": "400 μm µ-Slide I Luer", - "value": 400, - "type": "num" - }, - { - "label": "600 μm µ-Slide I Luer", - "value": 600, - "type": "num" - }, - { - "label": "800 μm µ-Slide I Luer", - "value": 800, - "type": "num" - } - ], - "payload": "", - "topic": "acq_celltype", - "x": 1166, - "y": 480, - "wires": [ - [ - "d911efe0.ea7f1" - ] - ] - }, - { - "id": "c19a2c73.7512f", - "type": "ui_text_input", - "z": "103f6179.d5012f", - "name": "acq_volume", - "label": "Volume to pass (ml)", - "tooltip": "", - "group": "aac2eaf7.0cdab8", - "order": 14, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "acq_volume", - "x": 1166, - "y": 600, - "wires": [ - [ - "d911efe0.ea7f1" - ] - ] - }, - { - "id": "c9b2c48c.40d068", - "type": "comment", - "z": "103f6179.d5012f", - "name": "sample", - "info": "SAMPLE: a collection event\n\n sample_id [t] : unique identifier\n sample_*** [f] or [t] : other fields relative to the sample\n", - "x": 990, - "y": 20, - "wires": [] - }, - { - "id": "8abc2578.2ebcf8", - "type": "comment", - "z": "103f6179.d5012f", - "name": "acquisition", - "info": "ACQUISITION: metadata relative to the image acquisition\n\n acq_id [t] : unique identifier. If your acquisition differ for each sample you must have different identifier.\n acq_instrument [t] : name of the instrument (UVP, ZOOSCAN, FLOWCAM, etc.)\n acq_*** [f] or [t] : other fields relative to the acquisition\n", - "x": 996, - "y": 360, - "wires": [] - }, - { - "id": "91ab2c80.0f453", - "type": "comment", - "z": "103f6179.d5012f", - "name": "object", - "info": "OBJECT: one object to be classified, usually one organism. One object can be represented by several images. In this tsv file, there is one line per image which means the object data gets repeated on several lines.\n\n object_id [t] : unique object name (will be displayed in Ecotaxa object page)\n object_link [f] : URL of an associated website\n object_lat [f] : latitude, decimal degrees\n object_lon [f] : longitude, decimal degrees\n object_date [f] : ISO8601 YYYYMMJJ UTC\n object_time [f] : ISO8601 HHMMSS UTC\n object_depth_min [f] : minimum depth of object, meters\n object_depth_max [f] : maximum depth of object, meters\n\nAnd, for already classified objects\n\n object_annotation_date [t] : ISO8601 YYYYMMJJ UTC\n object_annotation_time [t] : ISO8601 YYYYMMJJ UTC\n object_annotation_category [t] : class of the object with optionnaly its direct parent following separated by left angle bracket without whitespace \"Cnidaria Date: Tue, 14 Jul 2020 18:21:23 +0200 Subject: [PATCH 17/48] Delete mqtt_nodered.json --- flows/mqtt_nodered.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 flows/mqtt_nodered.json diff --git a/flows/mqtt_nodered.json b/flows/mqtt_nodered.json deleted file mode 100644 index abeb85e..0000000 --- a/flows/mqtt_nodered.json +++ /dev/null @@ -1 +0,0 @@ -[{"id":"259c8713.b50e28","type":"tab","label":"Main","disabled":false,"info":""},{"id":"6d0d6fc7.d30bb","type":"ui_text_input","z":"259c8713.b50e28","name":"sample_ship","label":"Name of the ship","tooltip":"","group":"3e1ba03d.f01d8","order":3,"width":12,"height":1,"passthru":true,"mode":"text","delay":300,"topic":"sample_ship","x":1370,"y":140,"wires":[["de9708c2.d00068"]]},{"id":"43b12fe4.c5aa3","type":"ui_dropdown","z":"259c8713.b50e28","name":"sample_sampling_gear","label":"Sampling gear","tooltip":"","place":"Select","group":"3e1ba03d.f01d8","order":5,"width":0,"height":0,"passthru":true,"options":[{"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"}],"payload":"","topic":"sample_sampling_gear","x":1330,"y":220,"wires":[["3c6a723.145778e"]]},{"id":"458408d7.2b3b68","type":"ui_text_input","z":"259c8713.b50e28","name":"sample_operator","label":"Name of the operator","tooltip":"","group":"3e1ba03d.f01d8","order":4,"width":12,"height":1,"passthru":true,"mode":"text","delay":300,"topic":"sample_operator","x":1350,"y":180,"wires":[["a2ae6c99.188f2"]]},{"id":"a163194f.0b17c8","type":"ui_text_input","z":"259c8713.b50e28","name":"sample_project","label":"Name of the project*","tooltip":"","group":"3e1ba03d.f01d8","order":1,"width":12,"height":1,"passthru":true,"mode":"text","delay":300,"topic":"sample_project","x":1360,"y":60,"wires":[["1c2c7439.47115c"]]},{"id":"914752eb.af1b","type":"ui_text_input","z":"259c8713.b50e28","name":"sample_id","label":"ID of the station*","tooltip":"","group":"3e1ba03d.f01d8","order":2,"width":12,"height":1,"passthru":true,"mode":"number","delay":300,"topic":"sample_id","x":1370,"y":100,"wires":[["30648de6.8ebc52"]]},{"id":"8a735175.23927","type":"ui_date_picker","z":"259c8713.b50e28","name":"acq_date","label":"Date :","group":"52159161.72187","order":2,"width":12,"height":1,"passthru":true,"topic":"","x":1380,"y":1141,"wires":[["86aa9817.45a2e8"]]},{"id":"16d7de1c.b0c892","type":"ui_text_input","z":"259c8713.b50e28","name":"acq_time","label":"Time :","tooltip":"","group":"52159161.72187","order":3,"width":12,"height":1,"passthru":true,"mode":"time","delay":300,"topic":"","x":1380,"y":1181,"wires":[["9b1b260f.e4b338"]]},{"id":"9b1b260f.e4b338","type":"function","z":"259c8713.b50e28","name":"set object_time","func":"var time = new Date(msg.payload);\n\nvar hour = time.getUTCHours();\nif (hour<10){hour = \"0\"+hour;}\nvar minute = time.getUTCMinutes();\nif (minute<10){minute = \"0\"+minute;}\n\nvar time_UTC = \"\"+hour+minute+\"00\";\nglobal.set('object_time',time_UTC);\nreturn msg;","outputs":1,"noerr":0,"x":1544,"y":1181,"wires":[["829cc940.327648"]]},{"id":"86aa9817.45a2e8","type":"function","z":"259c8713.b50e28","name":"set object_date","func":"var date = new Date(msg.payload);\n\nvar year = date.getUTCFullYear();\nvar month = date.getUTCMonth()+1;\nif (month<10){month = \"0\"+month;}\nvar day = date.getUTCDate();\nif (day<10){day = \"0\"+day;}\n\nvar date_UTC = \"\"+year+month+day;\nglobal.set('object_date',date_UTC);\n\nreturn msg;","outputs":1,"noerr":0,"x":1544,"y":1141,"wires":[["c93577b9.a1e438"]]},{"id":"e001a28.555566","type":"function","z":"259c8713.b50e28","name":"get global","func":"msg.payload={\n \n \"generic_nb_step\":global.get(\"generic_nb_step\"),\n \"generic_flowrate\":global.get(\"generic_flowrate\"),\n \"generic_manual_volume\":global.get(\"generic_manual_volume\"),\n \"generic_sleep_before\":global.get(\"generic_sleep_before\"),\n \"generic_volume_before\":global.get(\"generic_volume_before\"),\n \"generic_path\":global.get(\"generic_path\"),\n \"generic_nb_frame\":global.get(\"generic_nb_frame\"),\n \"generic_sleep_during\":global.get(\"generic_sleep_during\"),\n \n \"sample_project\":global.get(\"sample_project\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n //\"acq_instrument_id\":global.get(\"acq_instrument_id\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_min_esd\":global.get(\"acq_min_esd\"),\n \"acq_max_esd\":global.get(\"acq_max_esd\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_magnification\":global.get(\"magnification\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \n \"acq_camera_name\":\"Pi Camera V2.1 - 8MP\",\n \n \"object_date\":global.get(\"object_date\"),\n \"object_time\":global.get(\"object_time\"),\n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \"object_depth_min\":global.get(\"object_depth_min\"),\n \"object_depth_max\":global.get(\"object_depth_max\"),\n \n \"process_pixel\":global.get(\"process_pixel\"),\n \"process_id\":global.get(\"process_id\")\n \n};\nreturn msg;","outputs":1,"noerr":0,"x":1880,"y":60,"wires":[["76a6e6bb.a08b98"]]},{"id":"f25890f5.f2549","type":"file","z":"259c8713.b50e28","name":"","filename":"/home/pi/PlanktonScope/config.txt","appendNewline":true,"createDir":true,"overwriteFile":"true","encoding":"none","x":2233,"y":60,"wires":[[]]},{"id":"f5c1aa13.3cfbf8","type":"function","z":"259c8713.b50e28","name":"set optical config","func":"global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;","outputs":1,"noerr":0,"x":1550,"y":1041,"wires":[["72e1e23b.a8a67c"]]},{"id":"eb9181d8.25e01","type":"ui_dropdown","z":"259c8713.b50e28","name":"acq_fnumber_objective","label":"M12 Lens*","tooltip":"","place":"Select option","group":"52159161.72187","order":7,"width":12,"height":1,"passthru":true,"options":[{"label":"f 25mm 1/2\" 5MP IR","value":25,"type":"num"},{"label":"f 16mm 1/2.5\" 5MP IR","value":16,"type":"num"},{"label":"f 12mm 1/2.5\" 5MP IR","value":12,"type":"num"},{"label":"f 8mm 1/2.5\" 5MP IR","value":8,"type":"num"},{"label":"f 6mm 1/2.5\" 5MP IR","value":6,"type":"num"}],"payload":"","topic":"acq_fnumber_objective","x":1326,"y":1041,"wires":[["f5c1aa13.3cfbf8"]]},{"id":"5aba848a.7a861c","type":"ui_numeric","z":"259c8713.b50e28","name":"acq_minimum_mesh","label":"Min fraction size (μm)","tooltip":"","group":"52159161.72187","order":8,"width":12,"height":1,"wrap":false,"passthru":true,"topic":"acq_minimum_mesh","format":"{{value}}","min":0,"max":"300","step":"10","x":1336,"y":841,"wires":[["510bd72a.b42ea8"]]},{"id":"7cea16e.c42ace8","type":"ui_numeric","z":"259c8713.b50e28","name":"acq_maximum_mesh","label":"Max fraction size (μm)","tooltip":"","group":"52159161.72187","order":9,"width":12,"height":1,"wrap":false,"passthru":true,"topic":"acq_maximum_mesh","format":"{{value}}","min":"200","max":"2000","step":"100","x":1336,"y":881,"wires":[["a3f18257.8a55e"]]},{"id":"6ecc9468.0271dc","type":"ui_text_input","z":"259c8713.b50e28","name":"acq_id","label":"Acquisition unique ID*","tooltip":"","group":"52159161.72187","order":1,"width":0,"height":0,"passthru":true,"mode":"number","delay":300,"topic":"acq_id","x":1386,"y":721,"wires":[["b26183bf.aa217"]]},{"id":"259fd49a.160a3c","type":"ui_dropdown","z":"259c8713.b50e28","name":"acq_celltype","label":"Thickness flowcell*","tooltip":"","place":"Select option","group":"52159161.72187","order":6,"width":12,"height":1,"passthru":true,"options":[{"label":"200 μm µ-Slide I Luer","value":200,"type":"num"},{"label":"400 μm µ-Slide I Luer","value":400,"type":"num"},{"label":"600 μm µ-Slide I Luer","value":600,"type":"num"},{"label":"800 μm µ-Slide I Luer","value":800,"type":"num"}],"payload":"","topic":"acq_celltype","x":1366,"y":801,"wires":[["d96d32ec.f88b9"]]},{"id":"66a3425c.79aabc","type":"ui_text_input","z":"259c8713.b50e28","name":"acq_volume","label":"Volume to pass (ml)","tooltip":"","group":"52159161.72187","order":5,"width":12,"height":1,"passthru":true,"mode":"number","delay":300,"topic":"acq_volume","x":1366,"y":921,"wires":[["a3ec68a2.889ca8"]]},{"id":"6722bc48.d4f354","type":"comment","z":"259c8713.b50e28","name":"sample","info":"SAMPLE: a collection event\n\n sample_id [t] : unique identifier\n sample_*** [f] or [t] : other fields relative to the sample\n","x":810,"y":60,"wires":[]},{"id":"f93037f1.6a6238","type":"comment","z":"259c8713.b50e28","name":"acquisition","info":"ACQUISITION: metadata relative to the image acquisition\n\n acq_id [t] : unique identifier. If your acquisition differ for each sample you must have different identifier.\n acq_instrument [t] : name of the instrument (UVP, ZOOSCAN, FLOWCAM, etc.)\n acq_*** [f] or [t] : other fields relative to the acquisition\n","x":800,"y":720,"wires":[]},{"id":"734ba3db.3f82fc","type":"comment","z":"259c8713.b50e28","name":"object","info":"OBJECT: one object to be classified, usually one organism. One object can be represented by several images. In this tsv file, there is one line per image which means the object data gets repeated on several lines.\n\n object_id [t] : unique object name (will be displayed in Ecotaxa object page)\n object_link [f] : URL of an associated website\n object_lat [f] : latitude, decimal degrees\n object_lon [f] : longitude, decimal degrees\n object_date [f] : ISO8601 YYYYMMJJ UTC\n object_time [f] : ISO8601 HHMMSS UTC\n object_depth_min [f] : minimum depth of object, meters\n object_depth_max [f] : maximum depth of object, meters\n\nAnd, for already classified objects\n\n object_annotation_date [t] : ISO8601 YYYYMMJJ UTC\n object_annotation_time [t] : ISO8601 YYYYMMJJ UTC\n object_annotation_category [t] : class of the object with optionnaly its direct parent following separated by left angle bracket without whitespace \"Cnidaria","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1210,"y":300,"wires":[[]]},{"id":"b7d9455c.026588","type":"switch","z":"259c8713.b50e28","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"actuator/focus","vt":"str"},{"t":"eq","v":"Missing entry :","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1670,"y":400,"wires":[["fdb3b132.8b341"],["b9d996d6.37c2f8"]]},{"id":"b9d996d6.37c2f8","type":"ui_toast","z":"259c8713.b50e28","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":1830,"y":420,"wires":[[]]},{"id":"ca38a11d.0ee54","type":"function","z":"259c8713.b50e28","name":"init LED","func":"msg.payload=1;\nreturn msg;","outputs":1,"noerr":0,"x":240,"y":161,"wires":[["1d58e86f.a3a9e8"]]},{"id":"75701b99.c6e974","type":"exec","z":"259c8713.b50e28","command":"vcgencmd measure_temp | tr -d \"temp=\" | tr -d \"'C\" | tr -d \"\\n\"","addpay":false,"append":"","useSpawn":"","timer":"","name":"RPi Temp.","x":2750,"y":180,"wires":[["aac61390.c13c6"],[],[]]},{"id":"1780384d.718198","type":"inject","z":"259c8713.b50e28","name":"","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"onceDelay":"","x":2590,"y":180,"wires":[["75701b99.c6e974"]]},{"id":"aac61390.c13c6","type":"python3-function","z":"259c8713.b50e28","name":"fan.py","func":"#!/usr/bin/python\nimport smbus\nimport sys\n\ntemp = msg[\"payload\"]\n\ntemp = int(temp.split('.',1)[0])\n\nbus = smbus.SMBus(1)\n\nDEVICE_ADDRESS = 0x0d\n\nif temp < 38:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\nif temp > 42:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)","outputs":1,"x":2930,"y":180,"wires":[[]]},{"id":"603d5fab.08f56","type":"comment","z":"259c8713.b50e28","name":"save config.txt","info":"","x":1690,"y":20,"wires":[]},{"id":"72e1e23b.a8a67c","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04","d473399b.081ae8"],"x":1675,"y":1040,"wires":[]},{"id":"d473399b.081ae8","type":"link in","z":"259c8713.b50e28","name":"","links":["72e1e23b.a8a67c","c93577b9.a1e438","829cc940.327648"],"x":1635,"y":100,"wires":[["e001a28.555566"]]},{"id":"c93577b9.a1e438","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04","d473399b.081ae8"],"x":1675,"y":1140,"wires":[]},{"id":"829cc940.327648","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04","d473399b.081ae8"],"x":1675,"y":1180,"wires":[]},{"id":"98e2e9e0.fb7418","type":"switch","z":"259c8713.b50e28","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"actuator/pump","vt":"str"},{"t":"eq","v":"Missing entry :","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1670,"y":600,"wires":[["61fb057d.3c251c"],["46a536f0.c83138"]]},{"id":"46a536f0.c83138","type":"ui_toast","z":"259c8713.b50e28","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":1830,"y":620,"wires":[[]]},{"id":"24ffcf03.2a51b","type":"ui_button","z":"259c8713.b50e28","name":"stop pump","group":"707d9797.c8e798","order":5,"width":4,"height":1,"passthru":true,"label":"STOP PUMP","tooltip":"","color":"","bgcolor":"#AD1625","icon":"","payload":"off","payloadType":"str","topic":"actuator/wait","x":1370,"y":660,"wires":[["e2a7220a.09d43"]]},{"id":"7eb16c3b.294e54","type":"comment","z":"259c8713.b50e28","name":"turn ON the LED","info":"","x":260,"y":121,"wires":[]},{"id":"4f74f017.00a58","type":"function","z":"259c8713.b50e28","name":"focus.js","func":"state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar nb_step= global.get(\"nb_step\");\n\nif (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of steps\";\n \n}else {\n nb_step= global.get(\"nb_step\");\n if(msg.payload === \"UP\" & state===\"free\"){\n msg.payload=\"FORWARD \"+nb_step;\n }\n if(msg.payload === \"DOWN\" & state===\"free\"){\n msg.payload=\"BACKWARD \"+nb_step;\n }\n}\nreturn msg;","outputs":1,"noerr":0,"x":1520,"y":400,"wires":[["b7d9455c.026588"]],"info":"### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n"},{"id":"52cc1de5.b78e84","type":"ui_button","z":"259c8713.b50e28","name":"stop focus","group":"fbd92986.1028c8","order":5,"width":4,"height":1,"passthru":true,"label":"STOP FOCUS","tooltip":"","color":"","bgcolor":"#AD1625","icon":"","payload":"off","payloadType":"str","topic":"actuator/wait","x":1370,"y":460,"wires":[["e46763fe.7fc83"]]},{"id":"39cad6fb.1503ca","type":"ui_button","z":"259c8713.b50e28","name":"","group":"c6a276ac.3eb74","order":1,"width":12,"height":1,"passthru":false,"label":"Reboot","tooltip":"","color":"","bgcolor":"#AD1625","icon":"","payload":"off","payloadType":"str","topic":"reboot","x":2620,"y":60,"wires":[["95b876d4.07c708","99d61fbe.b244b"]]},{"id":"1f53f29b.feee4d","type":"exec","z":"259c8713.b50e28","command":"sudo","addpay":true,"append":"","useSpawn":"false","timer":"2","oldrc":false,"name":"cmd","x":2930,"y":60,"wires":[[],[],[]]},{"id":"e325458b.95bff8","type":"ui_button","z":"259c8713.b50e28","name":"","group":"c6a276ac.3eb74","order":2,"width":12,"height":1,"passthru":false,"label":"Shutdown","tooltip":"","color":"","bgcolor":"#AD1625","icon":"","payload":"off","payloadType":"str","topic":"shutdown","x":2620,"y":120,"wires":[["95b876d4.07c708","99d61fbe.b244b"]]},{"id":"95b876d4.07c708","type":"python3-function","z":"259c8713.b50e28","name":"action","func":"#!/usr/bin/python\nimport smbus\nimport time\nbus = smbus.SMBus(1)\ntime.sleep(1)\n#turn off fan RGB\nbus.write_byte_data(0x0d, 0x07, 0x00)\nbus.write_byte_data(0x0d, 0x07, 0x00)\n\nmsg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg","outputs":1,"x":2790,"y":80,"wires":[["d348474b.d756a8","1f53f29b.feee4d"]]},{"id":"d348474b.d756a8","type":"exec","z":"259c8713.b50e28","command":"i2cdetect -y 1","addpay":false,"append":"","useSpawn":"false","timer":"1","oldrc":false,"name":"i2c update","x":2950,"y":120,"wires":[[],[],[]]},{"id":"99d61fbe.b244b","type":"link out","z":"259c8713.b50e28","name":"","links":["3517d063.27073"],"x":2735,"y":20,"wires":[]},{"id":"cdd1b550.da18e8","type":"mqtt in","z":"259c8713.b50e28","name":"","topic":"receiver/#","qos":"0","datatype":"auto","broker":"b77ffa1b.942258","x":720,"y":2000,"wires":[["6920281d.dc9b48"]]},{"id":"6920281d.dc9b48","type":"switch","z":"259c8713.b50e28","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"receiver/pump","vt":"str"},{"t":"eq","v":"receiver/focus","vt":"str"},{"t":"eq","v":"receiver/image","vt":"str"},{"t":"cont","v":"receiver/segmentation","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":870,"y":2000,"wires":[["2f66e917.fee586"],["363ee47e.ed522c"],["45a52868.fe37c8"],["469cc189.903d"]]},{"id":"2f66e917.fee586","type":"switch","z":"259c8713.b50e28","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Start","vt":"str"},{"t":"eq","v":"Done","vt":"str"},{"t":"eq","v":"Interrompted","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1050,"y":1800,"wires":[["5c0d0c35.3bcf14"],["cd01157d.0892d8"],["68e02bf4.7013e4"]]},{"id":"5c0d0c35.3bcf14","type":"change","z":"259c8713.b50e28","name":"The pump has started","rules":[{"t":"set","p":"payload","pt":"msg","to":"The pump has started","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1440,"y":1760,"wires":[[]]},{"id":"cd01157d.0892d8","type":"change","z":"259c8713.b50e28","name":"The pump has finished.","rules":[{"t":"set","p":"payload","pt":"msg","to":"The pump has finished.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1430,"y":1800,"wires":[[]]},{"id":"68e02bf4.7013e4","type":"change","z":"259c8713.b50e28","name":"The pump has been stopped.","rules":[{"t":"set","p":"payload","pt":"msg","to":"The pump has been stopped.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":1840,"wires":[[]]},{"id":"363ee47e.ed522c","type":"switch","z":"259c8713.b50e28","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Start","vt":"str"},{"t":"eq","v":"Done","vt":"str"},{"t":"eq","v":"Interrompted","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1050,"y":1920,"wires":[["c088b72f.326d98"],["36934381.14442c"],["89329cfe.c8f4"]]},{"id":"c088b72f.326d98","type":"change","z":"259c8713.b50e28","name":"The focus has started","rules":[{"t":"set","p":"payload","pt":"msg","to":"The focus has started","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1440,"y":1880,"wires":[[]]},{"id":"36934381.14442c","type":"change","z":"259c8713.b50e28","name":"The focus has finished.","rules":[{"t":"set","p":"payload","pt":"msg","to":"The focus has finished.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1430,"y":1920,"wires":[[]]},{"id":"89329cfe.c8f4","type":"change","z":"259c8713.b50e28","name":"The focus has been stopped.","rules":[{"t":"set","p":"payload","pt":"msg","to":"The focus has been stopped.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":1960,"wires":[[]]},{"id":"fdb3b132.8b341","type":"mqtt out","z":"259c8713.b50e28","name":"","topic":"","qos":"","retain":"","broker":"cb2f36fe.1c7038","x":1810,"y":380,"wires":[]},{"id":"e46763fe.7fc83","type":"mqtt out","z":"259c8713.b50e28","name":"","topic":"","qos":"","retain":"","broker":"cb2f36fe.1c7038","x":1510,"y":460,"wires":[]},{"id":"61fb057d.3c251c","type":"mqtt out","z":"259c8713.b50e28","name":"","topic":"","qos":"","retain":"","broker":"cb2f36fe.1c7038","x":1810,"y":580,"wires":[]},{"id":"e2a7220a.09d43","type":"mqtt out","z":"259c8713.b50e28","name":"","topic":"","qos":"","retain":"","broker":"cb2f36fe.1c7038","x":1510,"y":660,"wires":[]},{"id":"577f7f72.6b68b","type":"ui_button","z":"259c8713.b50e28","name":"","group":"8cfadfab.327d7","order":7,"width":19,"height":1,"passthru":false,"label":"Start Acquisition","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"actuator/image","x":1360,"y":1660,"wires":[["5218ba30.bbe844"]]},{"id":"d5111b87.2a64a8","type":"ui_text_input","z":"259c8713.b50e28","name":"generic_sleep_before","label":"Sleep duration before acquisition (s)","tooltip":"","group":"8cfadfab.327d7","order":1,"width":12,"height":1,"passthru":true,"mode":"number","delay":300,"topic":"generic_sleep_before","x":1340,"y":1360,"wires":[["3d141631.d548ba"]]},{"id":"3d141631.d548ba","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04"],"x":1475,"y":1360,"wires":[]},{"id":"74c89905.79d968","type":"ui_text_input","z":"259c8713.b50e28","name":"generic_sleep_during","label":"Sleep duration between acquisition (s)","tooltip":"","group":"8cfadfab.327d7","order":2,"width":12,"height":1,"passthru":true,"mode":"number","delay":300,"topic":"generic_sleep_during","x":1340,"y":1520,"wires":[["644e95b9.04b7ac"]]},{"id":"644e95b9.04b7ac","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04"],"x":1475,"y":1520,"wires":[]},{"id":"b50cf2f4.bfb84","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04"],"x":1475,"y":501,"wires":[]},{"id":"1e75fd6c.234753","type":"ui_slider","z":"259c8713.b50e28","name":"flowrate","label":"Flowrate (ml/min)*","tooltip":"","group":"707d9797.c8e798","order":1,"width":0,"height":0,"passthru":true,"outs":"end","topic":"flowrate","min":0,"max":"20","step":"0.1","x":1380,"y":501,"wires":[["b50cf2f4.bfb84"]]},{"id":"3345fc41.8341b4","type":"function","z":"259c8713.b50e28","name":"get generic.flowrate","func":"msg.payload = msg.payload.generic_flowrate;\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":501,"wires":[["1e75fd6c.234753"]]},{"id":"32510458.f42f9c","type":"link in","z":"259c8713.b50e28","name":"","links":["b368cae7.dd66b8"],"x":895,"y":501,"wires":[["3345fc41.8341b4"]]},{"id":"3cd0a17b.0cc42e","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04"],"x":1475,"y":1440,"wires":[]},{"id":"62fea790.2840a8","type":"ui_text_input","z":"259c8713.b50e28","name":"generic_path","label":"DIrectory to store the images","tooltip":"","group":"8cfadfab.327d7","order":3,"width":12,"height":1,"passthru":true,"mode":"text","delay":300,"topic":"generic_path","x":1370,"y":1440,"wires":[["3cd0a17b.0cc42e"]]},{"id":"73e051a8.5875e","type":"ui_text_input","z":"259c8713.b50e28","name":"generic_volume_before","label":"Volume to pass before to begin","tooltip":"","group":"8cfadfab.327d7","order":5,"width":12,"height":1,"passthru":true,"mode":"number","delay":300,"topic":"generic_volume_before","x":1330,"y":1400,"wires":[["5ea01613.8cc9d8"]]},{"id":"5ea01613.8cc9d8","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04"],"x":1475,"y":1400,"wires":[]},{"id":"26549e4b.5dbf72","type":"ui_text_input","z":"259c8713.b50e28","name":"generic_nb_frame","label":"Number of frame per acquisition","tooltip":"","group":"8cfadfab.327d7","order":4,"width":12,"height":1,"passthru":true,"mode":"number","delay":300,"topic":"generic_nb_frame","x":1350,"y":1480,"wires":[["61382d0b.60c534"]]},{"id":"61382d0b.60c534","type":"link out","z":"259c8713.b50e28","name":"","links":["7532db82.1dcf04"],"x":1475,"y":1480,"wires":[]},{"id":"d5df5489.6523e8","type":"function","z":"259c8713.b50e28","name":"get generic_sleep_before","func":"msg.payload = msg.payload.generic_sleep_before;\nreturn msg;","outputs":1,"noerr":0,"x":1050,"y":1360,"wires":[["d5111b87.2a64a8"]]},{"id":"835c262e.00b468","type":"link in","z":"259c8713.b50e28","name":"","links":["b368cae7.dd66b8"],"x":895,"y":1360,"wires":[["d5df5489.6523e8"]]},{"id":"9b2fe59b.be48c8","type":"function","z":"259c8713.b50e28","name":"get generic_volume_before","func":"msg.payload = msg.payload.generic_volume_before;\nreturn msg;","outputs":1,"noerr":0,"x":1060,"y":1400,"wires":[["73e051a8.5875e"]]},{"id":"a07dad70.7c48","type":"link in","z":"259c8713.b50e28","name":"","links":["b368cae7.dd66b8"],"x":895,"y":1400,"wires":[["9b2fe59b.be48c8"]]},{"id":"54dfe4df.c6837c","type":"function","z":"259c8713.b50e28","name":"get generic_path","func":"msg.payload = msg.payload.generic_path;\nreturn msg;","outputs":1,"noerr":0,"x":1030,"y":1440,"wires":[["62fea790.2840a8"]]},{"id":"9fb166d6.86f908","type":"link in","z":"259c8713.b50e28","name":"","links":["b368cae7.dd66b8"],"x":895,"y":1440,"wires":[["54dfe4df.c6837c"]]},{"id":"1aa409a4.7b3866","type":"function","z":"259c8713.b50e28","name":"get generic_nb_frame","func":"msg.payload = msg.payload.generic_nb_frame;\nreturn msg;","outputs":1,"noerr":0,"x":1040,"y":1480,"wires":[["26549e4b.5dbf72"]]},{"id":"51e769aa.92a138","type":"link in","z":"259c8713.b50e28","name":"","links":["b368cae7.dd66b8"],"x":895,"y":1480,"wires":[["1aa409a4.7b3866"]]},{"id":"ce6ded0a.8ee37","type":"function","z":"259c8713.b50e28","name":"get generic_sleep_during","func":"msg.payload = msg.payload.generic_sleep_during;\nreturn msg;","outputs":1,"noerr":0,"x":1050,"y":1520,"wires":[["74c89905.79d968"]]},{"id":"3fa20f41.11e61","type":"link in","z":"259c8713.b50e28","name":"","links":["b368cae7.dd66b8"],"x":895,"y":1520,"wires":[["ce6ded0a.8ee37"]]},{"id":"5218ba30.bbe844","type":"function","z":"259c8713.b50e28","name":"image.js","func":"state = global.get(\"state\");\nglobal.set('img_counter',0)\nglobal.set('obj_counter',0)\nif (state == null){state=\"free\"}\n\nvar generic_sleep_before= global.get(\"generic_sleep_before\");\nvar generic_volume_before= global.get(\"generic_volume_before\");\nvar generic_path= global.get(\"generic_path\");\nvar generic_nb_frame= global.get(\"generic_nb_frame\");\nvar generic_sleep_during= global.get(\"generic_sleep_during\");\n\nif (generic_sleep_before === undefined || generic_sleep_before === \"\" || generic_sleep_before === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration before start the acquisition\";\n \n}else if (generic_volume_before === undefined || generic_volume_before === \"\" || generic_volume_before === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume before acquisition\";\n \n}else if (generic_path === undefined || generic_path === \"\" || generic_path === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Directory to store the images\";\n \n}else if (generic_nb_frame === undefined || generic_nb_frame === \"\" || generic_nb_frame === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of frames per acquisition\";\n \n}else if (generic_sleep_during === undefined || generic_sleep_during === \"\" || generic_sleep_during === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration in between each acquisition\";\n \n}else {\n generic_nb_step = 507*generic_volume_before\n generic_nb_frame=generic_nb_frame-1\n msg.payload=generic_sleep_before+' '+generic_nb_step+' '+generic_path+' '+generic_nb_frame+' '+generic_sleep_during;\n}\nreturn msg;","outputs":1,"noerr":0,"x":1520,"y":1660,"wires":[["8142bee4.882c2"]],"info":"### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n"},{"id":"8142bee4.882c2","type":"switch","z":"259c8713.b50e28","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"actuator/image","vt":"str"},{"t":"eq","v":"Missing entry :","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1670,"y":1660,"wires":[["a4b8aae3.cc3ad8"],["54420752.4a4ab8"]]},{"id":"54420752.4a4ab8","type":"ui_toast","z":"259c8713.b50e28","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":1830,"y":1680,"wires":[[]]},{"id":"a4b8aae3.cc3ad8","type":"mqtt out","z":"259c8713.b50e28","name":"","topic":"","qos":"","retain":"","broker":"cb2f36fe.1c7038","x":1810,"y":1640,"wires":[]},{"id":"ca843dd8.d1c62","type":"exec","z":"259c8713.b50e28","command":"python3.7 /home/pi/PlanktonScope/script/mqtt_pump_focus_image.py","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":430,"y":420,"wires":[[],[],[]]},{"id":"45a52868.fe37c8","type":"switch","z":"259c8713.b50e28","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Start","vt":"str"},{"t":"eq","v":"Done","vt":"str"},{"t":"eq","v":"Interrompted","vt":"str"},{"t":"cont","v":"jpg","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1050,"y":2080,"wires":[["113c9b93.455814"],["29a7c6de.6ac2ea"],["f1b07b24.b85718"],["446a811b.25e4b"]]},{"id":"177a91d4.f1016e","type":"switch","z":"259c8713.b50e28","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Start","vt":"str"},{"t":"eq","v":"Done","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1190,"y":2200,"wires":[["5d717a25.3437e4"],["7d713b16.235164"]]},{"id":"29a7c6de.6ac2ea","type":"change","z":"259c8713.b50e28","name":"The acquisition has finished.","rules":[{"t":"set","p":"payload","pt":"msg","to":"The acquisition has finished.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":2080,"wires":[[]]},{"id":"f1b07b24.b85718","type":"change","z":"259c8713.b50e28","name":"The acquisition has been stopped.","rules":[{"t":"set","p":"payload","pt":"msg","to":"The acquisition has been stopped.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1400,"y":2120,"wires":[[]]},{"id":"113c9b93.455814","type":"change","z":"259c8713.b50e28","name":"The acquisition has started","rules":[{"t":"set","p":"payload","pt":"msg","to":"The acquisition has started","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1420,"y":2040,"wires":[[]]},{"id":"446a811b.25e4b","type":"function","z":"259c8713.b50e28","name":"img_counter.js","func":"img_counter=global.get('img_counter')\nimg_counter=img_counter+1\nglobal.set('img_counter',img_counter)\nmsg.payload = img_counter\nreturn msg;","outputs":1,"noerr":0,"x":1300,"y":2160,"wires":[["57014db.1bbe0b4","95f4a476.261718"]]},{"id":"803b507f.9e38c","type":"function","z":"259c8713.b50e28","name":"obj_counter.js","func":"obj_counter=global.get('obj_counter')\nobj_counter=obj_counter+1\nglobal.set('obj_counter',obj_counter)\nmsg.payload = obj_counter\nreturn msg;","outputs":1,"noerr":0,"x":1300,"y":2280,"wires":[["6ad4ae5e.62f4a","95f4a476.261718"]]},{"id":"57014db.1bbe0b4","type":"ui_chart","z":"259c8713.b50e28","name":"img_counter","group":"8cfadfab.327d7","order":12,"width":24,"height":2,"label":"img_counter","chartType":"horizontalBar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1470,"y":2160,"wires":[[]]},{"id":"469cc189.903d","type":"switch","z":"259c8713.b50e28","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"receiver/segmentation","vt":"str"},{"t":"eq","v":"receiver/segmentation/object_id","vt":"str"},{"t":"eq","v":"receiver/segmentation/metric","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1050,"y":2240,"wires":[["177a91d4.f1016e"],["803b507f.9e38c"],["73f0f4b.8dd430c"]]},{"id":"7d713b16.235164","type":"change","z":"259c8713.b50e28","name":"The segmentation has finished.","rules":[{"t":"set","p":"payload","pt":"msg","to":"The segmentation has finished.","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1410,"y":2240,"wires":[[]]},{"id":"5d717a25.3437e4","type":"change","z":"259c8713.b50e28","name":"The segmentation has started","rules":[{"t":"set","p":"payload","pt":"msg","to":"The segmentation has started","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1410,"y":2200,"wires":[[]]},{"id":"6ad4ae5e.62f4a","type":"ui_chart","z":"259c8713.b50e28","name":"obj_counter","group":"8cfadfab.327d7","order":13,"width":24,"height":2,"label":"obj_counter","chartType":"horizontalBar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":true,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1470,"y":2280,"wires":[[]]},{"id":"95f4a476.261718","type":"ui_chart","z":"259c8713.b50e28","name":"","group":"8cfadfab.327d7","order":10,"width":24,"height":5,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"500","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1670,"y":2220,"wires":[[]]},{"id":"32b535dc.2d85ea","type":"function","z":"259c8713.b50e28","name":"","func":"msg.payload=msg.payload.object_area\nmsg.topic=\"area\"\n\nreturn msg;","outputs":1,"noerr":0,"x":1290,"y":2380,"wires":[["1624f1bf.604bfe"]]},{"id":"73f0f4b.8dd430c","type":"json","z":"259c8713.b50e28","name":"","property":"payload","action":"","pretty":false,"x":1120,"y":2380,"wires":[["32b535dc.2d85ea"]]},{"id":"6fc7332f.89431c","type":"exec","z":"259c8713.b50e28","command":"free -m | grep \"Mem\" | awk -F ' ' '{print $3}'","addpay":false,"append":"","useSpawn":"","timer":"","name":"Get memory used","x":1350,"y":2560,"wires":[["42781732.a6ab58"],[],[]]},{"id":"7cdef10d.cb2f2","type":"inject","z":"259c8713.b50e28","name":"","topic":"","payload":"","payloadType":"num","repeat":"1","crontab":"","once":false,"onceDelay":"","x":1150,"y":2560,"wires":[["6fc7332f.89431c"]]},{"id":"42781732.a6ab58","type":"ui_chart","z":"259c8713.b50e28","name":"","group":"8cfadfab.327d7","order":11,"width":24,"height":5,"label":"Memory load","chartType":"line","legend":"false","xformat":"auto","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1690,"y":2260,"wires":[[]]},{"id":"957a161c.f76038","type":"mqtt in","z":"259c8713.b50e28","name":"","topic":"receiver/#","qos":"0","datatype":"auto","broker":"b77ffa1b.942258","x":500,"y":1700,"wires":[["676a23fa.d442ac"]]},{"id":"676a23fa.d442ac","type":"debug","z":"259c8713.b50e28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":680,"y":1700,"wires":[]},{"id":"1624f1bf.604bfe","type":"ui_chart","z":"259c8713.b50e28","name":"","group":"8cfadfab.327d7","order":14,"width":24,"height":10,"label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"1000","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1470,"y":2380,"wires":[[]]},{"id":"4e90749b.fd1804","type":"ui_button","z":"259c8713.b50e28","name":"Stop Acquisition","group":"8cfadfab.327d7","order":8,"width":5,"height":1,"passthru":true,"label":"STOP ACQUISITION","tooltip":"","color":"","bgcolor":"#AD1625","icon":"","payload":"off","payloadType":"str","topic":"actuator/wait","x":1360,"y":1700,"wires":[["6b21f65f.d65e18"]]},{"id":"6b21f65f.d65e18","type":"mqtt out","z":"259c8713.b50e28","name":"","topic":"","qos":"","retain":"","broker":"cb2f36fe.1c7038","x":1510,"y":1700,"wires":[]},{"id":"e5de63c5.dfaab8","type":"ui_switch","z":"259c8713.b50e28","name":"","label":"switch","tooltip":"","group":"fbd92986.1028c8","order":5,"width":"7","height":"2","passthru":true,"decouple":"false","topic":"","style":"","onvalue":true,"onvalueType":"str","onicon":"","oncolor":"","offvalue":false,"offvalueType":"str","officon":"","offcolor":"","x":240,"y":280,"wires":[["1d58e86f.a3a9e8"]]},{"id":"376a1510.c92cc2","type":"mqtt out","z":"259c8713.b50e28","name":"","topic":"","qos":"","retain":"","broker":"cb2f36fe.1c7038","x":1950,"y":260,"wires":[]},{"id":"f91fffca.82e778","type":"ui_switch","z":"259c8713.b50e28","name":"","label":"switch","tooltip":"","group":"fbd92986.1028c8","order":5,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"actuator/stream","style":"","onvalue":"on","onvalueType":"str","onicon":"","oncolor":"","offvalue":"off","offvalueType":"str","officon":"","offcolor":"","x":1250,"y":260,"wires":[["3e58f066.366b5","f4d8a599.1c9888"]]},{"id":"f4d8a599.1c9888","type":"switch","z":"259c8713.b50e28","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1510,"y":260,"wires":[["e34fe7f8.18f85"],["631dc7be.14d66"]]},{"id":"e34fe7f8.18f85","type":"change","z":"259c8713.b50e28","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"actuator/on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1710,"y":220,"wires":[["376a1510.c92cc2"]]},{"id":"631dc7be.14d66","type":"change","z":"259c8713.b50e28","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"actuator/off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1710,"y":300,"wires":[["376a1510.c92cc2"]]},{"id":"3e1ba03d.f01d8","type":"ui_group","z":"","name":"Sample Identification","tab":"737ec584.2eea2c","order":1,"disp":true,"width":24,"collapse":false},{"id":"52159161.72187","type":"ui_group","name":"Group 1","tab":"737ec584.2eea2c","order":5,"disp":true,"width":24},{"id":"8cfadfab.327d7","type":"ui_group","z":"","name":"Charts","tab":"737ec584.2eea2c","order":6,"disp":true,"width":"24","collapse":false},{"id":"cef1e703.bcf3c8","type":"ui_group","z":"","name":"Spatio Temporal","tab":"737ec584.2eea2c","order":4,"disp":true,"width":24,"collapse":false},{"id":"fbd92986.1028c8","type":"ui_group","z":"","name":"Focus Adjustment","tab":"737ec584.2eea2c","order":2,"disp":true,"width":24,"collapse":false},{"id":"707d9797.c8e798","type":"ui_group","z":"","name":"Fluidic Manual Manipulation","tab":"737ec584.2eea2c","order":3,"disp":true,"width":24,"collapse":false},{"id":"c6a276ac.3eb74","type":"ui_group","z":"","name":"Commands","tab":"737ec584.2eea2c","order":7,"disp":true,"width":24,"collapse":false},{"id":"b77ffa1b.942258","type":"mqtt-broker","z":"","name":"","broker":"127.0.0.1","port":"1883","clientid":"test","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"cb2f36fe.1c7038","type":"mqtt-broker","z":"","name":"","broker":"0.0.0.0","port":"1883","clientid":"Client_node","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"737ec584.2eea2c","type":"ui_tab","z":"","name":"Sample","icon":"fa-eyedropper","order":2,"disabled":false,"hidden":false}] From 7251862dfa4ac0b0efc90e190d119b9f977280ee Mon Sep 17 00:00:00 2001 From: tpollina Date: Tue, 14 Jul 2020 18:21:32 +0200 Subject: [PATCH 18/48] Delete flows_planktonscope.json --- flows/flows_planktonscope.json | 1747 -------------------------------- 1 file changed, 1747 deletions(-) delete mode 100644 flows/flows_planktonscope.json diff --git a/flows/flows_planktonscope.json b/flows/flows_planktonscope.json deleted file mode 100644 index f7cec23..0000000 --- a/flows/flows_planktonscope.json +++ /dev/null @@ -1,1747 +0,0 @@ -[ - { - "id": "7f885510.6173fc", - "type": "tab", - "label": "Flow 1", - "disabled": false, - "info": "" - }, - { - "id": "955fdac.f54f328", - "type": "ui_text_input", - "z": "7f885510.6173fc", - "name": "sample_ship", - "label": "Name of the ship", - "tooltip": "", - "group": "c627ea8d.f886e8", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_ship", - "x": 170, - "y": 100, - "wires": [ - [ - "3dd9a121.e386de" - ] - ] - }, - { - "id": "dfb29406.d68148", - "type": "ui_dropdown", - "z": "7f885510.6173fc", - "name": "sample_sampling_gear", - "label": "Sampling gear", - "tooltip": "", - "place": "Select", - "group": "c627ea8d.f886e8", - "order": 5, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "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" - } - ], - "payload": "", - "topic": "sample_sampling_gear", - "x": 130, - "y": 220, - "wires": [ - [ - "8861710f.55b92" - ] - ] - }, - { - "id": "bfce92c6.5f66a", - "type": "ui_text_input", - "z": "7f885510.6173fc", - "name": "sample_operator", - "label": "Name of the operator", - "tooltip": "", - "group": "c627ea8d.f886e8", - "order": 4, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_operator", - "x": 150, - "y": 180, - "wires": [ - [ - "3dd9a121.e386de" - ] - ] - }, - { - "id": "bae9c122.3612f", - "type": "ui_text_input", - "z": "7f885510.6173fc", - "name": "sample_project", - "label": "Name of the project*", - "tooltip": "", - "group": "c627ea8d.f886e8", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_project", - "x": 160, - "y": 40, - "wires": [ - [ - "3dd9a121.e386de", - "a8cb0c6e.7220d" - ] - ] - }, - { - "id": "eb39c21c.a3fec", - "type": "ui_text_input", - "z": "7f885510.6173fc", - "name": "object_lat", - "label": "Lattitude (decimal degrees)", - "tooltip": "", - "group": "106f0e1b.6478a2", - "order": 7, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "object_lat", - "x": 1020, - "y": 320, - "wires": [ - [ - "c650b922.6adef8" - ] - ] - }, - { - "id": "404b41a5.ae3d5", - "type": "ui_text_input", - "z": "7f885510.6173fc", - "name": "object_lon", - "label": "Longitude (decimal degrees)", - "tooltip": "", - "group": "106f0e1b.6478a2", - "order": 8, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "object_lon", - "x": 1010, - "y": 360, - "wires": [ - [ - "c650b922.6adef8" - ] - ] - }, - { - "id": "d90c72f2.cf1ca", - "type": "ui_text_input", - "z": "7f885510.6173fc", - "name": "sample_id", - "label": "Name of the station*", - "tooltip": "", - "group": "c627ea8d.f886e8", - "order": 3, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_id", - "x": 170, - "y": 140, - "wires": [ - [ - "3dd9a121.e386de" - ] - ] - }, - { - "id": "3300f426.cc515c", - "type": "ui_dropdown", - "z": "7f885510.6173fc", - "name": "acq_fnumber_objective", - "label": "M12 Lens*", - "tooltip": "", - "place": "Select option", - "group": "832434ce.ebe498", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "f 25mm 1/2\" 5MP IR", - "value": 25, - "type": "num" - }, - { - "label": "f 16mm 1/2.5\" 5MP IR", - "value": 16, - "type": "num" - }, - { - "label": "f 12mm 1/2.5\" 5MP IR", - "value": 12, - "type": "num" - }, - { - "label": "f 8mm 1/2.5\" 5MP IR", - "value": 8, - "type": "num" - }, - { - "label": "f 6mm 1/2.5\" 5MP IR", - "value": 6, - "type": "num" - } - ], - "payload": "", - "topic": "acq_fnumber_objective", - "x": 1030, - "y": 40, - "wires": [ - [ - "de455648.b432f8" - ] - ] - }, - { - "id": "72d57e31.59234", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "832434ce.ebe498", - "name": "Magnification", - "order": 2, - "width": 0, - "height": 0, - "format": "
\n Magnification : X\n \n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1590, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "98a4bc0a.f3304", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "77a6994b.e3efb8", - "name": "Instrument", - "order": 1, - "width": 0, - "height": 0, - "format": "
\n Instrument :\n \n PlanktonScope V2.1\n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 170, - "y": 480, - "wires": [ - [] - ] - }, - { - "id": "53b3cb43.2acf04", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "77a6994b.e3efb8", - "name": "Software", - "order": 2, - "width": 0, - "height": 0, - "format": "
\n Software :\n \n Node-RED Dashboard\n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 180, - "y": 520, - "wires": [ - [] - ] - }, - { - "id": "1a0a45f1.2cd7da", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "77a6994b.e3efb8", - "name": "Camera", - "order": 3, - "width": 0, - "height": 0, - "format": "
\n Camera :\n \n Pi Camera v2.1\n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 180, - "y": 560, - "wires": [ - [] - ] - }, - { - "id": "de455648.b432f8", - "type": "function", - "z": "7f885510.6173fc", - "name": "calculate", - "func": "global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1220, - "y": 40, - "wires": [ - [ - "c83fc403.8ba2d8", - "48d9cc9c.852214", - "44969aec.4e87e4", - "a1201a.dc3f8fe8", - "89b9399b.9389a8" - ] - ] - }, - { - "id": "f3aa18d.65f0de8", - "type": "ui_dropdown", - "z": "7f885510.6173fc", - "name": "acq_celltype", - "label": "Thickness flowcell*", - "tooltip": "", - "place": "Select option", - "group": "a72a9ec6.bb144", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "200 μm µ-Slide I Luer", - "value": 200, - "type": "num" - }, - { - "label": "400 μm µ-Slide I Luer", - "value": 400, - "type": "num" - }, - { - "label": "600 μm µ-Slide I Luer", - "value": 600, - "type": "num" - }, - { - "label": "800 μm µ-Slide I Luer", - "value": 800, - "type": "num" - } - ], - "payload": "", - "topic": "acq_celltype", - "x": 170, - "y": 280, - "wires": [ - [ - "8861710f.55b92" - ] - ] - }, - { - "id": "45568fe8.67759", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "acq_minimum_mesh", - "label": "Min fraction size (μm)", - "tooltip": "", - "group": "a72a9ec6.bb144", - "order": 2, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "acq_minimum_mesh", - "format": "{{value}}", - "min": 0, - "max": "300", - "step": "10", - "x": 140, - "y": 320, - "wires": [ - [ - "8861710f.55b92" - ] - ] - }, - { - "id": "918b69e2.7e6e88", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "acq_maximum_mesh", - "label": "Max fraction size (μm)", - "tooltip": "", - "group": "a72a9ec6.bb144", - "order": 3, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "acq_maximum_mesh", - "format": "{{value}}", - "min": "200", - "max": "2000", - "step": "100", - "x": 140, - "y": 360, - "wires": [ - [ - "8861710f.55b92" - ] - ] - }, - { - "id": "86d762dc.47911", - "type": "ui_switch", - "z": "7f885510.6173fc", - "name": "light_state", - "label": "Light", - "tooltip": "", - "group": "c62ffbd3.787ef8", - "order": 1, - "width": 2, - "height": 1, - "passthru": true, - "decouple": "false", - "topic": "", - "style": "", - "onvalue": "true", - "onvalueType": "bool", - "onicon": "", - "oncolor": "", - "offvalue": "false", - "offvalueType": "bool", - "officon": "", - "offcolor": "", - "x": 510, - "y": 160, - "wires": [ - [ - "b5a366b4.cb6918" - ] - ] - }, - { - "id": "b5a366b4.cb6918", - "type": "exec", - "z": "7f885510.6173fc", - "command": "python3.7 $HOME/PlanktonScope/scripts/light.py", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "light.py", - "x": 820, - "y": 160, - "wires": [ - [], - [], - [] - ], - "icon": "node-red/light.svg" - }, - { - "id": "5ea28a70.42ae14", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "up", - "group": "c62ffbd3.787ef8", - "order": 3, - "width": 1, - "height": 1, - "passthru": false, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_upwards", - "payload": "up", - "payloadType": "str", - "topic": "up", - "x": 530, - "y": 280, - "wires": [ - [ - "523fdeaa.50c6c" - ] - ] - }, - { - "id": "27f16831.dde938", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "down", - "group": "c62ffbd3.787ef8", - "order": 5, - "width": 1, - "height": 1, - "passthru": true, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_downward", - "payload": "down", - "payloadType": "str", - "topic": "down", - "x": 530, - "y": 360, - "wires": [ - [ - "523fdeaa.50c6c" - ] - ] - }, - { - "id": "b110542b.5de4f8", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "kill_focus", - "group": "c62ffbd3.787ef8", - "order": 6, - "width": 2, - "height": 1, - "passthru": false, - "label": "Cancel focus", - "tooltip": "", - "color": "#AD1625", - "bgcolor": "#333333", - "icon": "pause", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 520, - "y": 400, - "wires": [ - [ - "d9dea2bc.47097" - ] - ] - }, - { - "id": "523fdeaa.50c6c", - "type": "function", - "z": "7f885510.6173fc", - "name": "focus", - "func": "if(msg.topic === \"nb_step\"){\n nb_step = msg.payload;\n global.set(\"nb_step\",nb_step);\n}\nif(msg.topic === \"up\"){\n\n nb_step = global.get(\"nb_step\");\n\n orientation = \"up\";\n\n msg.payload = String(nb_step).concat(' ', orientation);\n return msg;\n}\nif(msg.topic === \"down\"){\n \n nb_step = global.get(\"nb_step\");\n\n orientation = \"down\";\n msg.payload = String(nb_step).concat(' ', orientation);\n\n return msg;\n}\n\n", - "outputs": 1, - "noerr": 0, - "x": 670, - "y": 320, - "wires": [ - [ - "ada728bd.8e7818" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "ada728bd.8e7818", - "type": "exec", - "z": "7f885510.6173fc", - "command": "python3.7 $HOME/PlanktonScope/scripts/focus.py", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "focus.py", - "x": 820, - "y": 320, - "wires": [ - [], - [], - [] - ], - "icon": "node-red/sort.svg" - }, - { - "id": "d9dea2bc.47097", - "type": "exec", - "z": "7f885510.6173fc", - "command": "bash $HOME/PlanktonScope/scripts/killer.sh focus.py && bash $HOME/PlanktonScope/scripts/killer.sh focus.py", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "Kill Focus", - "x": 820, - "y": 400, - "wires": [ - [], - [], - [] - ], - "icon": "font-awesome/fa-stop" - }, - { - "id": "2d0f6720.0f92f8", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "832434ce.ebe498", - "name": "Pi Camera settings", - "order": 7, - "width": 0, - "height": 0, - "format": "\n", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1010, - "y": 100, - "wires": [ - [] - ] - }, - { - "id": "9599b953.529c28", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "832434ce.ebe498", - "name": "process_pixel", - "order": 3, - "width": 0, - "height": 0, - "format": "
\n Pixel resolution :\n \n μm\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1600, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "612e2b9b.ed1684", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "832434ce.ebe498", - "name": "min_size", - "order": 4, - "width": 0, - "height": 0, - "format": "
\n Smallest cells to explore :\n \n μm\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1580, - "y": 120, - "wires": [ - [] - ] - }, - { - "id": "f84ab57a.556df8", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "832434ce.ebe498", - "name": "max_size", - "order": 5, - "width": 0, - "height": 0, - "format": "
\n Biggest cells to explore :\n \n μm\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1580, - "y": 160, - "wires": [ - [] - ] - }, - { - "id": "45f53656.d631e8", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "832434ce.ebe498", - "name": "flowrate", - "order": 6, - "width": 0, - "height": 0, - "format": "
\n Suggested flowrate :\n \n ml/min\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1580, - "y": 200, - "wires": [ - [] - ] - }, - { - "id": "53ec5f97.7567c", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "3d740a07.4674e6", - "name": "Stream Pi Camera", - "order": 1, - "width": 0, - "height": 0, - "format": "
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 570, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "c84f1718.4af6b8", - "type": "ui_switch", - "z": "7f885510.6173fc", - "name": "fan_state", - "label": "Fan", - "tooltip": "", - "group": "c62ffbd3.787ef8", - "order": 2, - "width": 2, - "height": 1, - "passthru": true, - "decouple": "false", - "topic": "", - "style": "", - "onvalue": "true", - "onvalueType": "bool", - "onicon": "", - "oncolor": "", - "offvalue": "false", - "offvalueType": "bool", - "officon": "", - "offcolor": "", - "x": 520, - "y": 220, - "wires": [ - [ - "dec2b84a.6faa18" - ] - ] - }, - { - "id": "dec2b84a.6faa18", - "type": "exec", - "z": "7f885510.6173fc", - "command": "python3.7 $HOME/PlanktonScope/scripts/fan.py", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "fan.py", - "x": 810, - "y": 220, - "wires": [ - [], - [], - [] - ], - "icon": "font-awesome/fa-spinner" - }, - { - "id": "477dc1bd.c3de8", - "type": "ui_text_input", - "z": "7f885510.6173fc", - "name": "acq_id", - "label": "Acquisition unique ID*", - "tooltip": "", - "group": "a61f7be8.af6418", - "order": 1, - "width": 4, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "acq_id", - "x": 530, - "y": 680, - "wires": [ - [ - "263878b3.e0a478" - ] - ] - }, - { - "id": "3dd9a121.e386de", - "type": "function", - "z": "7f885510.6173fc", - "name": "set global", - "func": "var value = msg.payload.split(' ').join('_');\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 340, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "c83fc403.8ba2d8", - "type": "function", - "z": "7f885510.6173fc", - "name": "get magnification", - "func": "var magnification = global.get(\"magnification\");\nmsg.payload = magnification;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1410, - "y": 40, - "wires": [ - [ - "72d57e31.59234" - ] - ] - }, - { - "id": "48d9cc9c.852214", - "type": "function", - "z": "7f885510.6173fc", - "name": "get process_pixel", - "func": "var process_pixel = global.get(\"process_pixel\");\nmsg.payload = process_pixel;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1410, - "y": 80, - "wires": [ - [ - "9599b953.529c28" - ] - ] - }, - { - "id": "44969aec.4e87e4", - "type": "function", - "z": "7f885510.6173fc", - "name": "get sug_min", - "func": "var sug_min = global.get(\"sug_min\");\nmsg.payload = sug_min;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1390, - "y": 120, - "wires": [ - [ - "612e2b9b.ed1684" - ] - ] - }, - { - "id": "a1201a.dc3f8fe8", - "type": "function", - "z": "7f885510.6173fc", - "name": "get sug_max", - "func": "var sug_max = global.get(\"sug_max\");\nmsg.payload = sug_max;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1390, - "y": 160, - "wires": [ - [ - "f84ab57a.556df8" - ] - ] - }, - { - "id": "89b9399b.9389a8", - "type": "function", - "z": "7f885510.6173fc", - "name": "get flowrate", - "func": "var sug_flowrate = global.get(\"sug_flowrate\");\nmsg.payload = sug_flowrate\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1390, - "y": 200, - "wires": [ - [ - "45f53656.d631e8" - ] - ] - }, - { - "id": "c650b922.6adef8", - "type": "function", - "z": "7f885510.6173fc", - "name": "set global", - "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 1180, - "y": 320, - "wires": [ - [] - ] - }, - { - "id": "e4c54d5a.19ff3", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "sample_year", - "label": "/", - "tooltip": "", - "group": "106f0e1b.6478a2", - "order": 3, - "width": 2, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "sample_year", - "format": "{{value}}", - "min": "19", - "max": "50", - "step": 1, - "x": 1010, - "y": 480, - "wires": [ - [ - "c650b922.6adef8" - ] - ] - }, - { - "id": "b45db708.cedec8", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "sample_month", - "label": "/", - "tooltip": "", - "group": "106f0e1b.6478a2", - "order": 2, - "width": 2, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "sample_month", - "format": "{{value}}", - "min": "1", - "max": "12", - "step": 1, - "x": 1000, - "y": 440, - "wires": [ - [ - "c650b922.6adef8" - ] - ] - }, - { - "id": "6351d257.6d7f1c", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "sample_day", - "label": "Date*", - "tooltip": "", - "group": "106f0e1b.6478a2", - "order": 1, - "width": 3, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "sample_day", - "format": "{{value}}", - "min": "1", - "max": "31", - "step": 1, - "x": 1010, - "y": 400, - "wires": [ - [ - "c650b922.6adef8" - ] - ] - }, - { - "id": "9ee03294.39987", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "sample_hour", - "label": "Time*", - "tooltip": "", - "group": "106f0e1b.6478a2", - "order": 4, - "width": 5, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "sample_hour", - "format": "{{value}}", - "min": "0", - "max": "24", - "step": 1, - "x": 1010, - "y": 520, - "wires": [ - [ - "c650b922.6adef8" - ] - ] - }, - { - "id": "5bd11314.ae6e4c", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "sample_minute", - "label": ":", - "tooltip": "", - "group": "106f0e1b.6478a2", - "order": 5, - "width": 2, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "sample_minute", - "format": "{{value}}", - "min": "0", - "max": "59", - "step": 1, - "x": 1000, - "y": 560, - "wires": [ - [ - "c650b922.6adef8" - ] - ] - }, - { - "id": "8861710f.55b92", - "type": "function", - "z": "7f885510.6173fc", - "name": "set global", - "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 340, - "y": 280, - "wires": [ - [] - ] - }, - { - "id": "a8cb0c6e.7220d", - "type": "function", - "z": "7f885510.6173fc", - "name": "store generic", - "func": "global.set(\"acq_instrument\",\"PlanktonScope V2.1\");\nglobal.set(\"acq_software\",\"Node-RED Dashboard\");\nglobal.set(\"acq_camera\",\"Pi Camera V2.1\");\nglobal.set(\"acq_instrument_ID\",\"Odezenne\");", - "outputs": 1, - "noerr": 0, - "x": 350, - "y": 420, - "wires": [ - [] - ] - }, - { - "id": "263878b3.e0a478", - "type": "function", - "z": "7f885510.6173fc", - "name": "set global", - "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 680, - "y": 660, - "wires": [ - [] - ] - }, - { - "id": "4b3ea5bd.03248c", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "backward", - "group": "c62ffbd3.787ef8", - "order": 7, - "width": 3, - "height": 1, - "passthru": false, - "label": "Backward", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_back", - "payload": "backward", - "payloadType": "str", - "topic": "backward", - "x": 520, - "y": 460, - "wires": [ - [ - "84fd85fd.426878" - ] - ] - }, - { - "id": "cfe9783a.286438", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "foward", - "group": "c62ffbd3.787ef8", - "order": 9, - "width": 3, - "height": 1, - "passthru": true, - "label": "Forward", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_forward", - "payload": "foward", - "payloadType": "str", - "topic": "foward", - "x": 530, - "y": 540, - "wires": [ - [ - "84fd85fd.426878" - ] - ] - }, - { - "id": "83d75b6b.6afa28", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "kill_pump", - "group": "c62ffbd3.787ef8", - "order": 10, - "width": 2, - "height": 1, - "passthru": false, - "label": "Cancel pump", - "tooltip": "", - "color": "#AD1625", - "bgcolor": "#333333", - "icon": "pause", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 520, - "y": 580, - "wires": [ - [ - "8fc930df.c7ae6" - ] - ] - }, - { - "id": "84fd85fd.426878", - "type": "function", - "z": "7f885510.6173fc", - "name": "pump", - "func": "if(msg.topic === \"volume\"){\n volume = msg.payload;\n global.set(\"volume\",volume);\n}\nif(msg.topic === \"foward\"){\n\n volume = global.get(\"volume\");\n flowrate = global.get(\"flowrate\");\n\n action = \" foward\";\n\n msg.payload = String(volume).concat(' ',flowrate, action);\n return msg;\n}\nif(msg.topic === \"backward\"){\n \n volume = global.get(\"volume\");\n flowrate = global.get(\"flowrate\");\n\n action = \" backward\";\n msg.payload = String(volume).concat(' ',flowrate, action);\n\n return msg;\n}\n\n", - "outputs": 1, - "noerr": 0, - "x": 670, - "y": 500, - "wires": [ - [ - "649f7ec8.06a84" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "649f7ec8.06a84", - "type": "exec", - "z": "7f885510.6173fc", - "command": "python3.7 $HOME/PlanktonScope/scripts/pump.py", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "pump.py", - "x": 820, - "y": 500, - "wires": [ - [], - [], - [] - ], - "icon": "font-awesome/fa-rotate-left" - }, - { - "id": "8fc930df.c7ae6", - "type": "exec", - "z": "7f885510.6173fc", - "command": "bash $HOME/PlanktonScope/scripts/killer.sh pump.py && bash $HOME/PlanktonScope/scripts/killer.sh pump.py", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "Kill Pump", - "x": 820, - "y": 580, - "wires": [ - [], - [], - [] - ], - "icon": "font-awesome/fa-stop" - }, - { - "id": "6bf10b4c.c83c84", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "start", - "group": "a61f7be8.af6418", - "order": 2, - "width": 4, - "height": 1, - "passthru": false, - "label": "Start Acquisition", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "play_circle_fill", - "payload": "", - "payloadType": "str", - "topic": "start", - "x": 530, - "y": 760, - "wires": [ - [ - "3fe055c2.6ab7da", - "82c90711.145108", - "e1dbc623.8df898", - "5a95f150.76ab3" - ] - ] - }, - { - "id": "2c9498e7.bf0c38", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "cancel", - "group": "a61f7be8.af6418", - "order": 3, - "width": 4, - "height": 1, - "passthru": false, - "label": "Cancel Acquisition", - "tooltip": "", - "color": "#AD1625", - "bgcolor": "#333333", - "icon": "pause_circle_filled", - "payload": "", - "payloadType": "str", - "topic": "cancel", - "x": 530, - "y": 980, - "wires": [ - [ - "f2acb5e0.c2c898", - "2bfa509a.9fc06", - "a2a07a68.274a78", - "4cd6d848.672778" - ] - ] - }, - { - "id": "b0fda998.f0ad48", - "type": "file", - "z": "7f885510.6173fc", - "name": "logs.json", - "filename": "/var/www/logs.json", - "appendNewline": true, - "createDir": false, - "overwriteFile": "false", - "encoding": "none", - "x": 820, - "y": 760, - "wires": [ - [] - ] - }, - { - "id": "3fe055c2.6ab7da", - "type": "function", - "z": "7f885510.6173fc", - "name": "get global", - "func": "msg.payload = {\n \"sample\":{\n \"sample_project\":global.get(\"sample_project\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \"sample_hour\":global.get(\"sample_hour\"),\n \"sample_minute\":global.get(\"sample_minute\"),\n \"sample_day\":global.get(\"sample_day\"),\n \"sample_month\":global.get(\"sample_month\"),\n \"sample_year\":global.get(\"sample_year\")\n },\n \"object\":{\n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\")\n },\n \"acquisition\":{\n \"acq_id\":global.get(\"acq_id\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"process_pixel\":global.get(\"process_pixel\"),\n \"acq_camera\":global.get(\"acq_camera\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n \"acq_software\":global.get(\"acq_software\"),\n \"acq_instrument_ID\":global.get(\"acq_instrument_ID\")\n },\n \"process\":{\n \"process_pixel\":global.get(\"process_pixel\")\n }\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 680, - "y": 760, - "wires": [ - [ - "b0fda998.f0ad48" - ] - ] - }, - { - "id": "f2acb5e0.c2c898", - "type": "exec", - "z": "7f885510.6173fc", - "command": "sed -ie '$d' /home/pi/PlanktonScope/logs.json", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "Remove last log", - "x": 700, - "y": 1000, - "wires": [ - [], - [], - [] - ], - "icon": "font-awesome/fa-close" - }, - { - "id": "2bfa509a.9fc06", - "type": "link out", - "z": "7f885510.6173fc", - "name": "cancel_pump", - "links": [ - "eadbf812.3ea798" - ], - "x": 635, - "y": 940, - "wires": [] - }, - { - "id": "eadbf812.3ea798", - "type": "link in", - "z": "7f885510.6173fc", - "name": "", - "links": [ - "2bfa509a.9fc06" - ], - "x": 715, - "y": 600, - "wires": [ - [ - "8fc930df.c7ae6" - ] - ] - }, - { - "id": "217d8bc.8fb7374", - "type": "ui_template", - "z": "7f885510.6173fc", - "group": "79767bcc.30bb94", - "name": "Instructions", - "order": 1, - "width": 0, - "height": 0, - "format": "

In case you forget dude but it's important to read this whenever you are not sure before clicking on any buttons.

\n
\n

Focusing :

\n

To focus, you need to specify a value for the number of steps. Then, you can click once but wait while the stage is moving.

\n

To cancel a focusing, click once on CANCEL FOCUS.

\n
\n

Pumping manually :

\n

To focus, you need to specify a value for the volume. Then, you can click once in order to pump manually a defined volume in a certain direction.

\n

To cancel a pumping event, click once on CANCEL PUMP.

\n

Do not run an acquisition if you are using the pump manually.

\n
\n

Start Acquisition :

\n

Taking images will requires few inputs :

\n
    \n
  1. Name of the project
  2. \n
  3. Name of the station
  4. \n
  5. Acquisition ID
  6. \n
  7. Volume
  8. \n
  9. M12 Lens
  10. \n
\n

If any of the previous settings are missing, it's going to be a real mess and delete previous acquisition. So check twice here !!

\n

The other inputs are always welcome ;)

\n
\n

Cancel Acquisition :

\n

I made this button CANCEL ACQUISITION to cancel an acquisition which maybe be fucked.

\n

Image you click it, it's going to delete the folder in which you save this acquisition, meaning execute :

\n

 

\nrm -r  /var/www/Name_of_the_project/Name_of_the_station/Acquisition_ID\n

 

\n

So if you made a great acquisition, then run a new one with the same input for Acquisition ID and finally click on this button, you are going to delete them both.

\n

Don't use it if you don't need it and please never click twice because the pi might burn.

\n
\n

ssh :

\n

To access the inside of the pi, you can use ssh from from terminal once your are connected to the WiFi by typing this command : ssh -Y planktonscope@192.168.4.1

\n

 

\n

The Password is : raspberry

\n
\n

Data :

\n

In order to access your acquisitions, you can either click on this link or get to the directory via ssh : /var/www/

\n
\n

In order to access the script via ssh, you can get to the directory : /home/pi/PlanktonScope/

\n", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 570, - "y": 1180, - "wires": [ - [] - ] - }, - { - "id": "82c90711.145108", - "type": "function", - "z": "7f885510.6173fc", - "name": "image", - "func": "var sample_project= global.get(\"sample_project\");\nvar sample_id= global.get(\"sample_id\");\nvar acq_id= global.get(\"acq_id\");\nvar volume= global.get(\"volume\");\nvar flowrate= global.get(\"flowrate\");\nmsg.payload = \"/var/www/\"+sample_project+\"/\"+sample_id+\"/\"+acq_id+\" \"+volume+\" \"+flowrate\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 670, - "y": 800, - "wires": [ - [ - "38c8440d.d0139c" - ] - ] - }, - { - "id": "1e9ae141.a0729f", - "type": "exec", - "z": "7f885510.6173fc", - "command": "python3.7 $HOME/PlanktonScope/scripts/image.py", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "image.py", - "x": 960, - "y": 800, - "wires": [ - [], - [], - [] - ], - "icon": "font-awesome/fa-file-image-o" - }, - { - "id": "7d2d5235.35f5ec", - "type": "exec", - "z": "7f885510.6173fc", - "command": "bash /home/pi/PlanktonScope/scripts/kill_image.sh", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "Kill Image", - "x": 840, - "y": 1060, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "a2a07a68.274a78", - "type": "function", - "z": "7f885510.6173fc", - "name": "get global", - "func": "var in_path= global.get(\"in_path\");\nvar sample_project= global.get(\"sample_project\");\nvar sample_id= global.get(\"sample_id\");\nvar acq_id= global.get(\"acq_id\");\nmsg.payload = \"/var/www/\"+sample_project+\"/\"+sample_id+\"/\"+acq_id\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 680, - "y": 1060, - "wires": [ - [ - "7d2d5235.35f5ec" - ] - ] - }, - { - "id": "e1dbc623.8df898", - "type": "exec", - "z": "7f885510.6173fc", - "command": "bash /home/pi/RPi_Cam_Web_Interface/stop.sh", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "Stop RPi Web Interface", - "x": 730, - "y": 860, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "597635eb.72154c", - "type": "exec", - "z": "7f885510.6173fc", - "command": "bash /home/pi/RPi_Cam_Web_Interface/start.sh", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "Start RPi Web Interface", - "x": 890, - "y": 1120, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "4cd6d848.672778", - "type": "delay", - "z": "7f885510.6173fc", - "name": "", - "pauseType": "delay", - "timeout": "2", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "x": 680, - "y": 1120, - "wires": [ - [ - "597635eb.72154c" - ] - ] - }, - { - "id": "38c8440d.d0139c", - "type": "delay", - "z": "7f885510.6173fc", - "name": "", - "pauseType": "delay", - "timeout": "2", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "x": 820, - "y": 800, - "wires": [ - [ - "1e9ae141.a0729f" - ] - ] - }, - { - "id": "5a95f150.76ab3", - "type": "link out", - "z": "7f885510.6173fc", - "name": "start_pump", - "links": [ - "5da0773a.700338" - ], - "x": 635, - "y": 720, - "wires": [] - }, - { - "id": "5da0773a.700338", - "type": "link in", - "z": "7f885510.6173fc", - "name": "", - "links": [ - "5a95f150.76ab3" - ], - "x": 715, - "y": 540, - "wires": [ - [ - "649f7ec8.06a84" - ] - ] - }, - { - "id": "4b817fa7.d0d14", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "flowrate", - "label": "Flowrate (ml/min)*", - "tooltip": "", - "group": "a72a9ec6.bb144", - "order": 4, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "flowrate", - "format": "{{value}}", - "min": "0.3", - "max": "20", - "step": "0.1", - "x": 180, - "y": 400, - "wires": [ - [ - "8861710f.55b92" - ] - ] - }, - { - "id": "42d9d2cb.9d3f84", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "nb_step", - "label": "nb step (30μm/step)", - "tooltip": "", - "group": "c62ffbd3.787ef8", - "order": 4, - "width": 4, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "nb_step", - "format": "{{value}}", - "min": "1", - "max": "5000", - "step": 1, - "x": 520, - "y": 320, - "wires": [ - [ - "523fdeaa.50c6c" - ] - ] - }, - { - "id": "4287fe47.26a63", - "type": "ui_numeric", - "z": "7f885510.6173fc", - "name": "volume", - "label": "Volume (ml)*", - "tooltip": "", - "group": "c62ffbd3.787ef8", - "order": 8, - "width": 4, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "volume", - "format": "{{value}}", - "min": "1", - "max": "5000", - "step": 1, - "x": 520, - "y": 500, - "wires": [ - [ - "84fd85fd.426878" - ] - ] - }, - { - "id": "c627ea8d.f886e8", - "type": "ui_group", - "z": "", - "name": "Sample", - "tab": "6b01f851.598028", - "order": 1, - "disp": true, - "width": 6, - "collapse": false - }, - { - "id": "106f0e1b.6478a2", - "type": "ui_group", - "z": "", - "name": "Spatio Temporal", - "tab": "6b01f851.598028", - "order": 6, - "disp": true, - "width": 7, - "collapse": false - }, - { - "id": "832434ce.ebe498", - "type": "ui_group", - "z": "", - "name": "Optic Settings", - "tab": "6b01f851.598028", - "order": 3, - "disp": true, - "width": "7", - "collapse": false - }, - { - "id": "77a6994b.e3efb8", - "type": "ui_group", - "z": "", - "name": "Generic info", - "tab": "6b01f851.598028", - "order": 7, - "disp": true, - "width": 6, - "collapse": false - }, - { - "id": "a72a9ec6.bb144", - "type": "ui_group", - "z": "", - "name": "Fluidic settings", - "tab": "6b01f851.598028", - "order": 4, - "disp": true, - "width": 6, - "collapse": false - }, - { - "id": "c62ffbd3.787ef8", - "type": "ui_group", - "z": "", - "name": "Controller", - "tab": "6b01f851.598028", - "order": 5, - "disp": true, - "width": "12", - "collapse": false - }, - { - "id": "3d740a07.4674e6", - "type": "ui_group", - "z": "", - "name": "Preview", - "tab": "6b01f851.598028", - "order": 2, - "disp": true, - "width": 12, - "collapse": false - }, - { - "id": "a61f7be8.af6418", - "type": "ui_group", - "z": "", - "name": "Acquisition", - "tab": "6b01f851.598028", - "order": 8, - "disp": true, - "width": 12, - "collapse": false - }, - { - "id": "79767bcc.30bb94", - "type": "ui_group", - "z": "", - "name": "Reminder", - "tab": "6b01f851.598028", - "order": 9, - "disp": true, - "width": 27, - "collapse": false - }, - { - "id": "6b01f851.598028", - "type": "ui_tab", - "z": "", - "name": "PlanktonScope GUI v2.1", - "icon": "date_range", - "order": 1, - "disabled": false, - "hidden": false - } -] From c32dd07d38be21f2a41c951410118e66fe72fcfe Mon Sep 17 00:00:00 2001 From: tpollina Date: Tue, 14 Jul 2020 18:21:40 +0200 Subject: [PATCH 19/48] Delete flow_chaetoceros.json --- flows/flow_chaetoceros.json | 4436 ----------------------------------- 1 file changed, 4436 deletions(-) delete mode 100644 flows/flow_chaetoceros.json diff --git a/flows/flow_chaetoceros.json b/flows/flow_chaetoceros.json deleted file mode 100644 index 17282c3..0000000 --- a/flows/flow_chaetoceros.json +++ /dev/null @@ -1,4436 +0,0 @@ -[ - { - "id": "259c8713.b50e28", - "type": "tab", - "label": "Main", - "disabled": false, - "info": "" - }, - { - "id": "173a6e6b.e5ca6a", - "type": "subflow", - "name": "sample metadata", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 40, - "wires": [ - { - "id": "2582798f.eddcc6" - }, - { - "id": "1d28205b.58a37" - }, - { - "id": "1590a418.9166dc" - }, - { - "id": "d96f9fa3.d4cfc" - }, - { - "id": "784e2f78.9b96f" - } - ] - } - ], - "out": [ - { - "x": 840, - "y": 40, - "wires": [ - { - "id": "a163194f.0b17c8", - "port": 0 - }, - { - "id": "914752eb.af1b", - "port": 0 - }, - { - "id": "6d0d6fc7.d30bb", - "port": 0 - }, - { - "id": "458408d7.2b3b68", - "port": 0 - }, - { - "id": "43b12fe4.c5aa3", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#DDAA99" - }, - { - "id": "ae90e3e.7d9fba", - "type": "subflow", - "name": "Focus actuation", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 40, - "wires": [ - { - "id": "81a7627c.bac92" - } - ] - } - ], - "out": [ - { - "x": 800, - "y": 200, - "wires": [ - { - "id": "5f4a72d1.9f6adc", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#A6BBCF", - "icon": "node-red/sort.svg" - }, - { - "id": "407d8cdb.3cb7cc", - "type": "subflow", - "name": "Pump actuation", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 40, - "wires": [ - { - "id": "d9a85435.ced5e" - }, - { - "id": "f859eeef.c59ed" - } - ] - } - ], - "out": [ - { - "x": 700, - "y": 40, - "wires": [ - { - "id": "59b05f7f.9e83f8", - "port": 0 - }, - { - "id": "309468bc.ac83f8", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#A6BBCF", - "icon": "font-awesome/fa-recycle" - }, - { - "id": "bdd6e33e.5db3b8", - "type": "subflow", - "name": "acquisition metadata", - "info": "", - "category": "", - "in": [ - { - "x": 50, - "y": 30, - "wires": [ - { - "id": "47459dcd.81b594" - }, - { - "id": "eec199a3.a5a768" - }, - { - "id": "2d278f0a.1a97a" - }, - { - "id": "4074b907.e527e8" - }, - { - "id": "bc37aba3.0d1e78" - }, - { - "id": "d973d64a.8801e8" - }, - { - "id": "277b6764.edb1f8" - }, - { - "id": "75b10c7c.8433a4" - }, - { - "id": "bc39179c.bb3c08" - } - ] - } - ], - "out": [ - { - "x": 740, - "y": 40, - "wires": [ - { - "id": "6ecc9468.0271dc", - "port": 0 - }, - { - "id": "5866c9a4.e1ca88", - "port": 0 - }, - { - "id": "259fd49a.160a3c", - "port": 0 - }, - { - "id": "5aba848a.7a861c", - "port": 0 - }, - { - "id": "7cea16e.c42ace8", - "port": 0 - }, - { - "id": "66a3425c.79aabc", - "port": 0 - }, - { - "id": "fa47061e.34a218", - "port": 0 - }, - { - "id": "6f36bd6d.154d14", - "port": 0 - } - ] - }, - { - "x": 900, - "y": 360, - "wires": [ - { - "id": "f5c1aa13.3cfbf8", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#DDAA99" - }, - { - "id": "ad5a5663.ce893", - "type": "subflow", - "name": "object metadata", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 40, - "wires": [ - { - "id": "21f41837.bb6c88" - }, - { - "id": "c2f235f2.eee388" - }, - { - "id": "2327c165.8397ae" - } - ] - } - ], - "out": [ - { - "x": 1060, - "y": 159, - "wires": [ - { - "id": "47c7db4d.5eb014", - "port": 0 - }, - { - "id": "20c46fd4.6b984", - "port": 0 - } - ] - }, - { - "x": 1060, - "y": 59, - "wires": [ - { - "id": "9b1b260f.e4b338", - "port": 0 - }, - { - "id": "86aa9817.45a2e8", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#DDAA99" - }, - { - "id": "35488f4f.00498", - "type": "subflow", - "name": "Commands", - "info": "", - "category": "", - "in": [], - "out": [], - "env": [], - "color": "#FFCC66", - "icon": "node-red-dashboard/ui_button.png" - }, - { - "id": "344146df.e4d5ba", - "type": "subflow", - "name": "Temperature regulation", - "info": "", - "category": "", - "in": [], - "out": [], - "env": [], - "color": "#FFCC66", - "icon": "font-awesome/fa-bolt" - }, - { - "id": "91e5fd54.56f58", - "type": "subflow", - "name": "MQTT Receive & Plot", - "info": "", - "category": "", - "in": [], - "out": [], - "env": [], - "color": "#F3B567", - "icon": "node-red/bridge.svg" - }, - { - "id": "4475ba6c.45604c", - "type": "subflow", - "name": "process metadata", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 80, - "wires": [ - { - "id": "d899c841.e6c178" - } - ] - } - ], - "out": [ - { - "x": 700, - "y": 80, - "wires": [ - { - "id": "23e45d82.a01f82", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#DDAA99" - }, - { - "id": "b73d5eb8.60ef3", - "type": "subflow", - "name": "Valves actuation", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 40, - "wires": [ - { - "id": "3808d004.94ea28" - }, - { - "id": "69799a39.13803c" - }, - { - "id": "f7cc1192.5a51e8" - }, - { - "id": "10ce45f6.3036ca" - }, - { - "id": "70dfb6bb.9319" - }, - { - "id": "a0b53585.93216" - } - ] - } - ], - "out": [ - { - "x": 680, - "y": 40, - "wires": [ - { - "id": "c14cf94.1413e88", - "port": 0 - }, - { - "id": "7a0b6294.e887c4", - "port": 0 - }, - { - "id": "8729ec5c.cf4ab8", - "port": 0 - }, - { - "id": "d7b55d02.e41f1", - "port": 0 - }, - { - "id": "27bbe0f0.05b2c", - "port": 0 - }, - { - "id": "b31fd152.a5489", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#A6BBCF", - "icon": "node-red-contrib-camerapi/photo.png" - }, - { - "id": "1b486ba8.f8c41c", - "type": "subflow", - "name": "Datetime update", - "info": "", - "category": "", - "in": [ - { - "x": 140, - "y": 80, - "wires": [ - { - "id": "48033b32.2bca94" - } - ] - } - ], - "out": [], - "env": [], - "color": "#DDAA99", - "icon": "font-awesome/fa-clock-o" - }, - { - "id": "66c23d37.f72cdc", - "type": "subflow", - "name": "MQQT Cmds", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 20, - "wires": [ - { - "id": "ca843dd8.d1c62" - } - ] - } - ], - "out": [], - "env": [], - "color": "#DDAA99" - }, - { - "id": "8d959937.18735", - "type": "subflow", - "name": "Acquisition actuation", - "info": "", - "category": "", - "in": [], - "out": [], - "env": [], - "color": "#A6BBCF" - }, - { - "id": "cc8bc4eb.651868", - "type": "ui_base", - "theme": { - "name": "theme-dark", - "lightTheme": { - "default": "#0094CE", - "baseColor": "#5900ce", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", - "edited": true, - "reset": false - }, - "darkTheme": { - "default": "#097479", - "baseColor": "#059276", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", - "edited": true, - "reset": false - }, - "customTheme": { - "name": "Untitled Theme 1", - "default": "#4B7930", - "baseColor": "#4B7930", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" - }, - "themeState": { - "base-color": { - "default": "#097479", - "value": "#059276", - "edited": true - }, - "page-titlebar-backgroundColor": { - "value": "#059276", - "edited": false - }, - "page-backgroundColor": { - "value": "#111111", - "edited": false - }, - "page-sidebar-backgroundColor": { - "value": "#ffffff", - "edited": false - }, - "group-textColor": { - "value": "#08dcb2", - "edited": false - }, - "group-borderColor": { - "value": "#555555", - "edited": false - }, - "group-backgroundColor": { - "value": "#333333", - "edited": false - }, - "widget-textColor": { - "value": "#eeeeee", - "edited": false - }, - "widget-backgroundColor": { - "value": "#059276", - "edited": false - }, - "widget-borderColor": { - "value": "#333333", - "edited": false - }, - "base-font": { - "value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" - } - }, - "angularTheme": { - "primary": "indigo", - "accents": "blue", - "warn": "red", - "background": "grey" - } - }, - "site": { - "name": "Node-RED Dashboard", - "hideToolbar": "false", - "allowSwipe": "false", - "lockMenu": "true", - "allowTempTheme": "true", - "dateFormat": "DD/MM/YYYY", - "sizes": { - "sx": 56, - "sy": 56, - "gx": 5, - "gy": 5, - "cx": 5, - "cy": 5, - "px": 5, - "py": 5 - } - } - }, - { - "id": "737ec584.2eea2c", - "type": "ui_tab", - "z": "", - "name": "GUI", - "icon": "fa-eyedropper", - "order": 2, - "disabled": false, - "hidden": false - }, - { - "id": "3e1ba03d.f01d8", - "type": "ui_group", - "z": "", - "name": "Sample metadata", - "tab": "737ec584.2eea2c", - "order": 2, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "cef1e703.bcf3c8", - "type": "ui_group", - "z": "", - "name": "Object metadata", - "tab": "737ec584.2eea2c", - "order": 6, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "fbd92986.1028c8", - "type": "ui_group", - "z": "", - "name": "Focus actuation", - "tab": "737ec584.2eea2c", - "order": 4, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "707d9797.c8e798", - "type": "ui_group", - "z": "", - "name": "Pump actuation", - "tab": "737ec584.2eea2c", - "order": 5, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "52159161.72187", - "type": "ui_group", - "z": "", - "name": "Acquisition metadata", - "tab": "737ec584.2eea2c", - "order": 7, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "8cfadfab.327d7", - "type": "ui_group", - "z": "", - "name": "MQTT Plots", - "tab": "737ec584.2eea2c", - "order": 11, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "b77ffa1b.942258", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "127.0.0.1", - "port": "1883", - "clientid": "test", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "cb2f36fe.1c7038", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "0.0.0.0", - "port": "1883", - "clientid": "Client_node", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "c6a276ac.3eb74", - "type": "ui_group", - "z": "", - "name": "Commands", - "tab": "737ec584.2eea2c", - "order": 12, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "f5194cae.c84688", - "type": "ui_group", - "z": "", - "name": "Streaming camera", - "tab": "737ec584.2eea2c", - "order": 3, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "b1321ea9.cfcf28", - "type": "ui_group", - "z": "", - "name": "Process metadata", - "tab": "737ec584.2eea2c", - "order": 8, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "f41d0ecb.8be06", - "type": "ui_group", - "z": "", - "name": "Valve actuation", - "tab": "737ec584.2eea2c", - "order": 9, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "9214d59d.e7b52", - "type": "ui_group", - "z": "", - "name": "Datetime", - "tab": "737ec584.2eea2c", - "order": 1, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "d170ac9c.3b4828", - "type": "ui_group", - "z": "", - "name": "Acquisition actuation", - "tab": "737ec584.2eea2c", - "order": 10, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "5b1410c.f92017", - "type": "ui_spacer", - "name": "spacer", - "group": "8cfadfab.327d7", - "order": 3, - "width": 1, - "height": 1 - }, - { - "id": "26072b87.02a7a4", - "type": "ui_spacer", - "name": "spacer", - "group": "8cfadfab.327d7", - "order": 4, - "width": 1, - "height": 1 - }, - { - "id": "a8c8abef.b19ea", - "type": "ui_spacer", - "name": "spacer", - "group": "8cfadfab.327d7", - "order": 6, - "width": 1, - "height": 1 - }, - { - "id": "41550c87.dbb054", - "type": "ui_spacer", - "name": "spacer", - "group": "8cfadfab.327d7", - "order": 7, - "width": 1, - "height": 1 - }, - { - "id": "6d0d6fc7.d30bb", - "type": "ui_text_input", - "z": "173a6e6b.e5ca6a", - "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", - "x": 590, - "y": 120, - "wires": [ - [] - ] - }, - { - "id": "43b12fe4.c5aa3", - "type": "ui_dropdown", - "z": "173a6e6b.e5ca6a", - "name": "sample_sampling_gear", - "label": "Sampling gear", - "tooltip": "", - "place": "Select", - "group": "3e1ba03d.f01d8", - "order": 4, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "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" - } - ], - "payload": "", - "topic": "sample_sampling_gear", - "x": 550, - "y": 200, - "wires": [ - [] - ] - }, - { - "id": "458408d7.2b3b68", - "type": "ui_text_input", - "z": "173a6e6b.e5ca6a", - "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", - "x": 570, - "y": 160, - "wires": [ - [] - ] - }, - { - "id": "a163194f.0b17c8", - "type": "ui_text_input", - "z": "173a6e6b.e5ca6a", - "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", - "x": 580, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "914752eb.af1b", - "type": "ui_text_input", - "z": "173a6e6b.e5ca6a", - "name": "sample_id", - "label": "ID of the station*", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 5, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "sample_id", - "x": 590, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "e001a28.555566", - "type": "function", - "z": "259c8713.b50e28", - "name": "get global", - "func": "msg.payload={\n \n \"duration_bef_cycle\":global.get(\"duration_bef_cycle\"),\n \"duration_flush\":global.get(\"duration_flush\"),\n \"nb_img\":global.get(\"nb_img\"),\n \"duration_bef_seq\":global.get(\"duration_bef_seq\"),\n \"duration_bef_img\":global.get(\"duration_bef_img\"),\n \"duration_between\":global.get(\"duration_between\"),\n \n \"sample_project\":global.get(\"sample_project\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n //\"acq_instrument_id\":global.get(\"acq_instrument_id\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_min_esd\":global.get(\"acq_min_esd\"),\n \"acq_max_esd\":global.get(\"acq_max_esd\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_magnification\":global.get(\"magnification\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \n \"acq_camera_name\":\"Pi Camera V2.1 - 8MP\",\n \n \"object_date\":global.get(\"object_date\"),\n \"object_time\":global.get(\"object_time\"),\n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \"object_depth_min\":global.get(\"object_depth_min\"),\n \"object_depth_max\":global.get(\"object_depth_max\"),\n \n \"process_pixel\":global.get(\"process_pixel\"),\n \"process_id\":global.get(\"process_id\")\n \n};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1180, - "y": 100, - "wires": [ - [ - "76a6e6bb.a08b98" - ] - ] - }, - { - "id": "f25890f5.f2549", - "type": "file", - "z": "259c8713.b50e28", - "name": "", - "filename": "/home/pi/PlanktonScope/config.txt", - "appendNewline": true, - "createDir": true, - "overwriteFile": "true", - "encoding": "none", - "x": 1520, - "y": 100, - "wires": [ - [] - ] - }, - { - "id": "f5c1aa13.3cfbf8", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "set optical config", - "func": "global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 750, - "y": 360, - "wires": [ - [] - ] - }, - { - "id": "eb9181d8.25e01", - "type": "ui_dropdown", - "z": "bdd6e33e.5db3b8", - "name": "acq_fnumber_objective", - "label": "M12 Lens*", - "tooltip": "", - "place": "Select option", - "group": "52159161.72187", - "order": 3, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "f 25mm 1/2\" 5MP IR", - "value": 25, - "type": "num" - }, - { - "label": "f 16mm 1/2.5\" 5MP IR", - "value": 16, - "type": "num" - }, - { - "label": "f 12mm 1/2.5\" 5MP IR", - "value": 12, - "type": "num" - }, - { - "label": "f 8mm 1/2.5\" 5MP IR", - "value": 8, - "type": "num" - }, - { - "label": "f 6mm 1/2.5\" 5MP IR", - "value": 6, - "type": "num" - } - ], - "payload": "", - "topic": "acq_fnumber_objective", - "x": 526, - "y": 360, - "wires": [ - [ - "f5c1aa13.3cfbf8" - ] - ] - }, - { - "id": "5aba848a.7a861c", - "type": "ui_numeric", - "z": "bdd6e33e.5db3b8", - "name": "acq_minimum_mesh", - "label": "Min fraction size (μm)", - "tooltip": "", - "group": "52159161.72187", - "order": 8, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "acq_minimum_mesh", - "format": "{{value}}", - "min": 0, - "max": "300", - "step": "10", - "x": 536, - "y": 160, - "wires": [ - [] - ] - }, - { - "id": "7cea16e.c42ace8", - "type": "ui_numeric", - "z": "bdd6e33e.5db3b8", - "name": "acq_maximum_mesh", - "label": "Max fraction size (μm)", - "tooltip": "", - "group": "52159161.72187", - "order": 4, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "acq_maximum_mesh", - "format": "{{value}}", - "min": "200", - "max": "2000", - "step": "100", - "x": 536, - "y": 200, - "wires": [ - [] - ] - }, - { - "id": "6ecc9468.0271dc", - "type": "ui_text_input", - "z": "bdd6e33e.5db3b8", - "name": "acq_id", - "label": "Acquisition unique ID*", - "tooltip": "", - "group": "52159161.72187", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "acq_id", - "x": 586, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "259fd49a.160a3c", - "type": "ui_dropdown", - "z": "bdd6e33e.5db3b8", - "name": "acq_celltype", - "label": "Thickness flowcell*", - "tooltip": "", - "place": "Select option", - "group": "52159161.72187", - "order": 7, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "200 μm µ-Slide I Luer", - "value": 200, - "type": "num" - }, - { - "label": "400 μm µ-Slide I Luer", - "value": 400, - "type": "num" - }, - { - "label": "600 μm µ-Slide I Luer", - "value": 600, - "type": "num" - }, - { - "label": "800 μm µ-Slide I Luer", - "value": 800, - "type": "num" - } - ], - "payload": "", - "topic": "acq_celltype", - "x": 566, - "y": 120, - "wires": [ - [] - ] - }, - { - "id": "66a3425c.79aabc", - "type": "ui_text_input", - "z": "bdd6e33e.5db3b8", - "name": "acq_volume", - "label": "Volume to pass (ml)", - "tooltip": "", - "group": "52159161.72187", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "acq_volume", - "x": 566, - "y": 240, - "wires": [ - [] - ] - }, - { - "id": "5866c9a4.e1ca88", - "type": "ui_text_input", - "z": "bdd6e33e.5db3b8", - "name": "acq_instrument", - "label": "Acquisition instrument", - "tooltip": "PlanktonScope V2.1", - "group": "52159161.72187", - "order": 6, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "acq_instrument", - "x": 556, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "76a6e6bb.a08b98", - "type": "json", - "z": "259c8713.b50e28", - "name": "", - "property": "payload", - "action": "str", - "pretty": true, - "x": 1310, - "y": 100, - "wires": [ - [ - "f25890f5.f2549" - ] - ] - }, - { - "id": "594ec843.9d4458", - "type": "file in", - "z": "259c8713.b50e28", - "name": "", - "filename": "/home/pi/PlanktonScope/config.txt", - "format": "utf8", - "chunk": false, - "sendError": false, - "encoding": "none", - "x": 340, - "y": 60, - "wires": [ - [ - "3bc1a977.4e9c76" - ] - ] - }, - { - "id": "d9ca0e54.f8b58", - "type": "inject", - "z": "259c8713.b50e28", - "name": "on_load", - "topic": "", - "payload": "", - "payloadType": "date", - "repeat": "", - "crontab": "", - "once": true, - "onceDelay": 0.1, - "x": 100, - "y": 60, - "wires": [ - [ - "594ec843.9d4458", - "ca38a11d.0ee54", - "807d5cce.2bb1e", - "fda01242.9576a8" - ] - ] - }, - { - "id": "3bc1a977.4e9c76", - "type": "json", - "z": "259c8713.b50e28", - "name": "", - "property": "payload", - "action": "", - "pretty": false, - "x": 550, - "y": 60, - "wires": [ - [ - "7f101b25.0da4a4", - "99b5a67.080f258", - "a71ba4a6.c44c4", - "fe5585e.a1ab078", - "da9f1367.3a17a8", - "d8dbecd.f7b3b9", - "c986ae96.860ec8" - ] - ] - }, - { - "id": "2582798f.eddcc6", - "type": "function", - "z": "173a6e6b.e5ca6a", - "name": "get sample_projet", - "func": "msg.payload = msg.payload.sample_project;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 250, - "y": 40, - "wires": [ - [ - "a163194f.0b17c8" - ] - ] - }, - { - "id": "1590a418.9166dc", - "type": "function", - "z": "173a6e6b.e5ca6a", - "name": "get sample_ship", - "func": "msg.payload = msg.payload.sample_ship;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 240, - "y": 120, - "wires": [ - [ - "6d0d6fc7.d30bb" - ] - ] - }, - { - "id": "1d28205b.58a37", - "type": "function", - "z": "173a6e6b.e5ca6a", - "name": "get sample_id", - "func": "msg.payload = msg.payload.sample_id+1;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 240, - "y": 80, - "wires": [ - [ - "914752eb.af1b" - ] - ] - }, - { - "id": "d96f9fa3.d4cfc", - "type": "function", - "z": "173a6e6b.e5ca6a", - "name": "get sample_operator", - "func": "msg.payload = msg.payload.sample_operator;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 260, - "y": 160, - "wires": [ - [ - "458408d7.2b3b68" - ] - ] - }, - { - "id": "784e2f78.9b96f", - "type": "function", - "z": "173a6e6b.e5ca6a", - "name": "get sample_sampling_gear", - "func": "msg.payload = msg.payload.sample_sampling_gear;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 280, - "y": 200, - "wires": [ - [ - "43b12fe4.c5aa3" - ] - ] - }, - { - "id": "47459dcd.81b594", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_id", - "func": "msg.payload = msg.payload.acq_id+1;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 210, - "y": 40, - "wires": [ - [ - "6ecc9468.0271dc" - ] - ] - }, - { - "id": "eec199a3.a5a768", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_instrument", - "func": "msg.payload = msg.payload.acq_instrument;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 230, - "y": 80, - "wires": [ - [ - "5866c9a4.e1ca88" - ] - ] - }, - { - "id": "2d278f0a.1a97a", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_celltype", - "func": "msg.payload = msg.payload.acq_celltype;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 120, - "wires": [ - [ - "259fd49a.160a3c" - ] - ] - }, - { - "id": "4074b907.e527e8", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_minimum_mesh", - "func": "msg.payload = msg.payload.acq_minimum_mesh;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 250, - "y": 160, - "wires": [ - [ - "5aba848a.7a861c" - ] - ] - }, - { - "id": "bc37aba3.0d1e78", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_maximum_mesh", - "func": "msg.payload = msg.payload.acq_maximum_mesh;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 250, - "y": 200, - "wires": [ - [ - "7cea16e.c42ace8" - ] - ] - }, - { - "id": "d973d64a.8801e8", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_volume", - "func": "msg.payload = msg.payload.acq_volume;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 240, - "wires": [ - [ - "66a3425c.79aabc" - ] - ] - }, - { - "id": "bc39179c.bb3c08", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_fnumber_objective", - "func": "msg.payload = msg.payload.acq_fnumber_objective;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 260, - "y": 360, - "wires": [ - [ - "eb9181d8.25e01" - ] - ] - }, - { - "id": "47c7db4d.5eb014", - "type": "ui_numeric", - "z": "ad5a5663.ce893", - "name": "object_depth_min", - "label": "Minimum depth (m)", - "tooltip": "", - "group": "cef1e703.bcf3c8", - "order": 3, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "object_depth_min", - "format": "{{value}}", - "min": "0", - "max": "2000", - "step": "1", - "x": 610, - "y": 120, - "wires": [ - [] - ] - }, - { - "id": "20c46fd4.6b984", - "type": "ui_numeric", - "z": "ad5a5663.ce893", - "name": "object_depth_max", - "label": "Maximum depth (m)", - "tooltip": "", - "group": "cef1e703.bcf3c8", - "order": 2, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "object_depth_max", - "format": "{{value}}", - "min": "0", - "max": "2000", - "step": "1", - "x": 610, - "y": 160, - "wires": [ - [] - ] - }, - { - "id": "1a5edafb.a05cf5", - "type": "function", - "z": "259c8713.b50e28", - "name": "set global", - "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1020, - "y": 60, - "wires": [ - [ - "e001a28.555566" - ] - ] - }, - { - "id": "21f41837.bb6c88", - "type": "function", - "z": "ad5a5663.ce893", - "name": "get object_depth_min", - "func": "msg.payload = msg.payload.object_depth_min;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 304, - "y": 120, - "wires": [ - [ - "47c7db4d.5eb014" - ] - ] - }, - { - "id": "c2f235f2.eee388", - "type": "function", - "z": "ad5a5663.ce893", - "name": "get object_depth_max", - "func": "msg.payload = msg.payload.object_depth_max;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 304, - "y": 160, - "wires": [ - [ - "20c46fd4.6b984" - ] - ] - }, - { - "id": "23e45d82.a01f82", - "type": "ui_text_input", - "z": "4475ba6c.45604c", - "name": "process_id", - "label": "Id of the process", - "tooltip": "", - "group": "b1321ea9.cfcf28", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "process_id", - "x": 550, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "d899c841.e6c178", - "type": "function", - "z": "4475ba6c.45604c", - "name": "get process_id", - "func": "msg.payload = msg.payload.process_id+1;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 200, - "y": 80, - "wires": [ - [ - "23e45d82.a01f82" - ] - ] - }, - { - "id": "4fa9647b.8a2ebc", - "type": "gpsd", - "z": "ad5a5663.ce893", - "name": "", - "hostname": "localhost", - "port": "2947", - "tpv": true, - "sky": false, - "info": false, - "device": false, - "gst": false, - "att": false, - "x": 90, - "y": 220, - "wires": [ - [ - "2327c165.8397ae", - "bbb7cb31.15121" - ] - ] - }, - { - "id": "767b43a1.de21dc", - "type": "ui_worldmap", - "z": "ad5a5663.ce893", - "d": true, - "group": "cef1e703.bcf3c8", - "order": 1, - "width": 0, - "height": 0, - "name": "", - "lat": "1.5", - "lon": "1.5", - "zoom": "4", - "layer": "OSM grey", - "cluster": "1", - "maxage": "", - "usermenu": "hide", - "layers": "hide", - "panit": "false", - "panlock": "false", - "zoomlock": "false", - "hiderightclick": "true", - "coords": "deg", - "showgrid": "false", - "path": "/worldmap", - "x": 640, - "y": 200, - "wires": [] - }, - { - "id": "2327c165.8397ae", - "type": "function", - "z": "ad5a5663.ce893", - "name": "get object_lat & object_lon", - "func": "\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 320, - "y": 200, - "wires": [ - [ - "767b43a1.de21dc" - ] - ] - }, - { - "id": "fa47061e.34a218", - "type": "ui_numeric", - "z": "bdd6e33e.5db3b8", - "name": "acq_min_esd", - "label": "Minimum size to segment (μm)", - "tooltip": "", - "group": "52159161.72187", - "order": 9, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "acq_min_esd", - "format": "{{value}}", - "min": 0, - "max": "300", - "step": "5", - "x": 566, - "y": 280, - "wires": [ - [] - ] - }, - { - "id": "6f36bd6d.154d14", - "type": "ui_numeric", - "z": "bdd6e33e.5db3b8", - "name": "acq_max_esd", - "label": "Maximum size to segment (μm)", - "tooltip": "", - "group": "52159161.72187", - "order": 5, - "width": 0, - "height": 0, - "wrap": false, - "passthru": true, - "topic": "acq_max_esd", - "format": "{{value}}", - "min": "100", - "max": "2000", - "step": "5", - "x": 556, - "y": 320, - "wires": [ - [] - ] - }, - { - "id": "277b6764.edb1f8", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_min_esd", - "func": "msg.payload = msg.payload.acq_min_esd;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 230, - "y": 280, - "wires": [ - [ - "fa47061e.34a218" - ] - ] - }, - { - "id": "75b10c7c.8433a4", - "type": "function", - "z": "bdd6e33e.5db3b8", - "name": "get acq_max_esd", - "func": "msg.payload = msg.payload.acq_max_esd;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 230, - "y": 320, - "wires": [ - [ - "6f36bd6d.154d14" - ] - ] - }, - { - "id": "5f4a72d1.9f6adc", - "type": "ui_text_input", - "z": "ae90e3e.7d9fba", - "name": "nb_step", - "label": "Number of step(s)", - "tooltip": "", - "group": "fbd92986.1028c8", - "order": 2, - "width": 8, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "nb_step", - "x": 520, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "81a7627c.bac92", - "type": "function", - "z": "ae90e3e.7d9fba", - "name": "get generic_nb_step", - "func": "msg.payload = msg.payload.generic_nb_step;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 240, - "y": 40, - "wires": [ - [ - "5f4a72d1.9f6adc" - ] - ] - }, - { - "id": "705dddc5.567bc4", - "type": "ui_button", - "z": "ae90e3e.7d9fba", - "name": "DOWN", - "group": "fbd92986.1028c8", - "order": 3, - "width": 6, - "height": 1, - "passthru": true, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_downward", - "payload": "DOWN", - "payloadType": "str", - "topic": "actuator/focus", - "x": 520, - "y": 120, - "wires": [ - [ - "4f74f017.00a58" - ] - ] - }, - { - "id": "b0aacff7.56651", - "type": "ui_button", - "z": "ae90e3e.7d9fba", - "name": "UP", - "group": "fbd92986.1028c8", - "order": 1, - "width": 6, - "height": 1, - "passthru": false, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_upwards", - "payload": "UP", - "payloadType": "str", - "topic": "actuator/focus", - "x": 530, - "y": 81, - "wires": [ - [ - "4f74f017.00a58" - ] - ] - }, - { - "id": "3e9c4e74.aee022", - "type": "function", - "z": "407d8cdb.3cb7cc", - "name": "pump.js", - "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar manual_volume= global.get(\"manual_volume\");\nvar flowrate= global.get(\"flowrate\");\n\nif (manual_volume === undefined || manual_volume === \"\" || manual_volume === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume to pass\";\n \n}else if (flowrate === undefined || flowrate === \"\" || flowrate === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Flowrate\";\n \n}else {\n volume = global.get(\"manual_volume\");\n nb_step=volume*507\n msg.volume = volume;\n flowrate = global.get(\"flowrate\");\n duration=(volume*60)/flowrate\n delay=(duration/nb_step)-0.005\n msg.topic = \"actuator/pump\";\n \n if(msg.payload === \"FORWARD\" & state===\"free\"){\n msg.payload='FORWARD '+delay+' '+nb_step;\n }\n if(msg.payload === \"BACKWARD\" & state===\"free\"){\n msg.payload='BACKWARD '+delay+' '+nb_step;\n }\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 620, - "y": 140, - "wires": [ - [ - "98e2e9e0.fb7418" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "3f0df968.b0d286", - "type": "ui_button", - "z": "407d8cdb.3cb7cc", - "name": "BACKWARD", - "group": "707d9797.c8e798", - "order": 2, - "width": 6, - "height": 1, - "passthru": false, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_back", - "payload": "BACKWARD", - "payloadType": "str", - "topic": "actuator/pump", - "x": 470, - "y": 120, - "wires": [ - [ - "3e9c4e74.aee022" - ] - ] - }, - { - "id": "214fb242.9abb6e", - "type": "ui_button", - "z": "407d8cdb.3cb7cc", - "name": "FORWARD", - "group": "707d9797.c8e798", - "order": 4, - "width": 6, - "height": 1, - "passthru": true, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_forward", - "payload": "FORWARD", - "payloadType": "str", - "topic": "actuator/pump", - "x": 470, - "y": 160, - "wires": [ - [ - "3e9c4e74.aee022" - ] - ] - }, - { - "id": "1d58e86f.a3a9e8", - "type": "rpi-gpio out", - "z": "259c8713.b50e28", - "name": "", - "pin": "40", - "set": "", - "level": "0", - "freq": "", - "out": "out", - "x": 400, - "y": 100, - "wires": [] - }, - { - "id": "3e58f066.366b5", - "type": "ui_template", - "z": "259c8713.b50e28", - "group": "f5194cae.c84688", - "name": "Stream Pi Camera", - "order": 1, - "width": 24, - "height": 11, - "format": "
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 750, - "y": 340, - "wires": [ - [] - ] - }, - { - "id": "b7d9455c.026588", - "type": "switch", - "z": "ae90e3e.7d9fba", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "actuator/focus", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 810, - "y": 100, - "wires": [ - [ - "fdb3b132.8b341" - ], - [ - "b9d996d6.37c2f8" - ] - ] - }, - { - "id": "b9d996d6.37c2f8", - "type": "ui_toast", - "z": "ae90e3e.7d9fba", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 970, - "y": 140, - "wires": [ - [] - ] - }, - { - "id": "ca38a11d.0ee54", - "type": "function", - "z": "259c8713.b50e28", - "name": "init LED", - "func": "msg.payload=1;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 260, - "y": 100, - "wires": [ - [ - "1d58e86f.a3a9e8" - ] - ] - }, - { - "id": "98e2e9e0.fb7418", - "type": "switch", - "z": "407d8cdb.3cb7cc", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "actuator/pump", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 770, - "y": 140, - "wires": [ - [ - "61fb057d.3c251c" - ], - [ - "46a536f0.c83138" - ] - ] - }, - { - "id": "46a536f0.c83138", - "type": "ui_toast", - "z": "407d8cdb.3cb7cc", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 930, - "y": 160, - "wires": [ - [] - ] - }, - { - "id": "24ffcf03.2a51b", - "type": "ui_button", - "z": "407d8cdb.3cb7cc", - "name": "stop pump", - "group": "707d9797.c8e798", - "order": 5, - "width": 4, - "height": 1, - "passthru": true, - "label": "STOP PUMP", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "actuator/wait", - "x": 470, - "y": 200, - "wires": [ - [ - "e2a7220a.09d43" - ] - ] - }, - { - "id": "4f74f017.00a58", - "type": "function", - "z": "ae90e3e.7d9fba", - "name": "focus.js", - "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar nb_step= global.get(\"nb_step\");\n\nif (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of steps\";\n \n}else {\n nb_step= global.get(\"nb_step\");\n if(msg.payload === \"UP\" & state===\"free\"){\n msg.payload=\"FORWARD \"+nb_step;\n }\n if(msg.payload === \"DOWN\" & state===\"free\"){\n msg.payload=\"BACKWARD \"+nb_step;\n }\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 660, - "y": 100, - "wires": [ - [ - "b7d9455c.026588" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "52cc1de5.b78e84", - "type": "ui_button", - "z": "ae90e3e.7d9fba", - "name": "stop focus", - "group": "fbd92986.1028c8", - "order": 4, - "width": 4, - "height": 1, - "passthru": true, - "label": "STOP FOCUS", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "actuator/wait", - "x": 510, - "y": 160, - "wires": [ - [ - "e46763fe.7fc83" - ] - ] - }, - { - "id": "39cad6fb.1503ca", - "type": "ui_button", - "z": "35488f4f.00498", - "name": "", - "group": "c6a276ac.3eb74", - "order": 1, - "width": 0, - "height": 0, - "passthru": false, - "label": "Reboot", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "reboot", - "x": 220, - "y": 80, - "wires": [ - [ - "95b876d4.07c708" - ] - ] - }, - { - "id": "1f53f29b.feee4d", - "type": "exec", - "z": "35488f4f.00498", - "command": "sudo", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "2", - "oldrc": false, - "name": "cmd", - "x": 530, - "y": 80, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "e325458b.95bff8", - "type": "ui_button", - "z": "35488f4f.00498", - "name": "", - "group": "c6a276ac.3eb74", - "order": 2, - "width": 0, - "height": 0, - "passthru": false, - "label": "Shutdown", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "shutdown", - "x": 220, - "y": 140, - "wires": [ - [ - "95b876d4.07c708" - ] - ] - }, - { - "id": "95b876d4.07c708", - "type": "python3-function", - "z": "35488f4f.00498", - "name": "action", - "func": "#!/usr/bin/python\nimport smbus\nimport time\nbus = smbus.SMBus(1)\ntime.sleep(1)\n#turn off fan RGB\nbus.write_byte_data(0x0d, 0x07, 0x00)\nbus.write_byte_data(0x0d, 0x07, 0x00)\n\nmsg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg", - "outputs": 1, - "x": 390, - "y": 100, - "wires": [ - [ - "d348474b.d756a8", - "1f53f29b.feee4d" - ] - ] - }, - { - "id": "d348474b.d756a8", - "type": "exec", - "z": "35488f4f.00498", - "command": "i2cdetect -y 1", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "1", - "oldrc": false, - "name": "i2c update", - "x": 550, - "y": 140, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "cdd1b550.da18e8", - "type": "mqtt in", - "z": "91e5fd54.56f58", - "name": "", - "topic": "receiver/#", - "qos": "0", - "datatype": "auto", - "broker": "b77ffa1b.942258", - "x": 80, - "y": 40, - "wires": [ - [ - "6920281d.dc9b48" - ] - ] - }, - { - "id": "6920281d.dc9b48", - "type": "switch", - "z": "91e5fd54.56f58", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "receiver/pump", - "vt": "str" - }, - { - "t": "eq", - "v": "receiver/focus", - "vt": "str" - }, - { - "t": "eq", - "v": "receiver/image", - "vt": "str" - }, - { - "t": "cont", - "v": "receiver/segmentation", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 4, - "x": 230, - "y": 40, - "wires": [ - [ - "2f66e917.fee586" - ], - [ - "363ee47e.ed522c" - ], - [ - "45a52868.fe37c8" - ], - [ - "469cc189.903d" - ] - ] - }, - { - "id": "2f66e917.fee586", - "type": "switch", - "z": "91e5fd54.56f58", - "name": "", - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Start", - "vt": "str" - }, - { - "t": "eq", - "v": "Done", - "vt": "str" - }, - { - "t": "eq", - "v": "Interrompted", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 3, - "x": 470, - "y": 40, - "wires": [ - [ - "5c0d0c35.3bcf14" - ], - [ - "cd01157d.0892d8" - ], - [ - "68e02bf4.7013e4" - ] - ] - }, - { - "id": "5c0d0c35.3bcf14", - "type": "change", - "z": "91e5fd54.56f58", - "name": "The pump has started", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The pump has started", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 920, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "cd01157d.0892d8", - "type": "change", - "z": "91e5fd54.56f58", - "name": "The pump has finished.", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The pump has finished.", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 910, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "68e02bf4.7013e4", - "type": "change", - "z": "91e5fd54.56f58", - "name": "The pump has been stopped.", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The pump has been stopped.", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 900, - "y": 120, - "wires": [ - [] - ] - }, - { - "id": "363ee47e.ed522c", - "type": "switch", - "z": "91e5fd54.56f58", - "name": "", - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Start", - "vt": "str" - }, - { - "t": "eq", - "v": "Done", - "vt": "str" - }, - { - "t": "eq", - "v": "Interrompted", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 3, - "x": 470, - "y": 200, - "wires": [ - [ - "c088b72f.326d98" - ], - [ - "36934381.14442c" - ], - [ - "89329cfe.c8f4" - ] - ] - }, - { - "id": "c088b72f.326d98", - "type": "change", - "z": "91e5fd54.56f58", - "name": "The focus has started", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The focus has started", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 920, - "y": 200, - "wires": [ - [] - ] - }, - { - "id": "36934381.14442c", - "type": "change", - "z": "91e5fd54.56f58", - "name": "The focus has finished.", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The focus has finished.", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 910, - "y": 240, - "wires": [ - [] - ] - }, - { - "id": "89329cfe.c8f4", - "type": "change", - "z": "91e5fd54.56f58", - "name": "The focus has been stopped.", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The focus has been stopped.", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 900, - "y": 280, - "wires": [ - [] - ] - }, - { - "id": "fdb3b132.8b341", - "type": "mqtt out", - "z": "ae90e3e.7d9fba", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 950, - "y": 80, - "wires": [] - }, - { - "id": "e46763fe.7fc83", - "type": "mqtt out", - "z": "ae90e3e.7d9fba", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 650, - "y": 160, - "wires": [] - }, - { - "id": "61fb057d.3c251c", - "type": "mqtt out", - "z": "407d8cdb.3cb7cc", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 910, - "y": 120, - "wires": [] - }, - { - "id": "e2a7220a.09d43", - "type": "mqtt out", - "z": "407d8cdb.3cb7cc", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 610, - "y": 200, - "wires": [] - }, - { - "id": "45a52868.fe37c8", - "type": "switch", - "z": "91e5fd54.56f58", - "name": "", - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Start", - "vt": "str" - }, - { - "t": "eq", - "v": "Done", - "vt": "str" - }, - { - "t": "eq", - "v": "Interrompted", - "vt": "str" - }, - { - "t": "cont", - "v": "jpg", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 4, - "x": 470, - "y": 360, - "wires": [ - [ - "113c9b93.455814" - ], - [ - "29a7c6de.6ac2ea" - ], - [ - "f1b07b24.b85718" - ], - [ - "446a811b.25e4b", - "a57fea5b.59eb5" - ] - ] - }, - { - "id": "177a91d4.f1016e", - "type": "switch", - "z": "91e5fd54.56f58", - "name": "", - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Start", - "vt": "str" - }, - { - "t": "eq", - "v": "Done", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 650, - "y": 560, - "wires": [ - [ - "5d717a25.3437e4" - ], - [ - "7d713b16.235164" - ] - ] - }, - { - "id": "29a7c6de.6ac2ea", - "type": "change", - "z": "91e5fd54.56f58", - "name": "The acquisition has finished.", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The acquisition has finished.", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 900, - "y": 400, - "wires": [ - [ - "a57fea5b.59eb5" - ] - ] - }, - { - "id": "f1b07b24.b85718", - "type": "change", - "z": "91e5fd54.56f58", - "name": "The acquisition has been stopped.", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The acquisition has been stopped.", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 880, - "y": 440, - "wires": [ - [ - "a57fea5b.59eb5" - ] - ] - }, - { - "id": "113c9b93.455814", - "type": "change", - "z": "91e5fd54.56f58", - "name": "The acquisition has started", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The acquisition has started", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 900, - "y": 360, - "wires": [ - [ - "a57fea5b.59eb5" - ] - ] - }, - { - "id": "446a811b.25e4b", - "type": "function", - "z": "91e5fd54.56f58", - "name": "img_counter.js", - "func": "img_counter=global.get('img_counter')\nimg_counter=img_counter+1\nglobal.set('img_counter',img_counter)\nmsg.payload = img_counter\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 780, - "y": 480, - "wires": [ - [ - "57014db.1bbe0b4" - ] - ] - }, - { - "id": "803b507f.9e38c", - "type": "function", - "z": "91e5fd54.56f58", - "name": "obj_counter.js", - "func": "obj_counter=global.get('obj_counter')\nobj_counter=obj_counter+1\nglobal.set('obj_counter',obj_counter)\nmsg.payload = obj_counter\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 780, - "y": 640, - "wires": [ - [ - "6ad4ae5e.62f4a" - ] - ] - }, - { - "id": "57014db.1bbe0b4", - "type": "ui_chart", - "z": "91e5fd54.56f58", - "name": "img_counter", - "group": "8cfadfab.327d7", - "order": 2, - "width": 23, - "height": 2, - "label": "img_counter", - "chartType": "horizontalBar", - "legend": "false", - "xformat": "HH:mm:ss", - "interpolate": "linear", - "nodata": "", - "dot": false, - "ymin": "", - "ymax": "", - "removeOlder": 1, - "removeOlderPoints": "", - "removeOlderUnit": "3600", - "cutout": 0, - "useOneColor": false, - "colors": [ - "#1f77b4", - "#aec7e8", - "#ff7f0e", - "#2ca02c", - "#98df8a", - "#d62728", - "#ff9896", - "#9467bd", - "#c5b0d5" - ], - "useOldStyle": false, - "outputs": 1, - "x": 950, - "y": 480, - "wires": [ - [] - ] - }, - { - "id": "469cc189.903d", - "type": "switch", - "z": "91e5fd54.56f58", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "receiver/segmentation", - "vt": "str" - }, - { - "t": "eq", - "v": "receiver/segmentation/object_id", - "vt": "str" - }, - { - "t": "eq", - "v": "receiver/segmentation/metric", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 3, - "x": 470, - "y": 560, - "wires": [ - [ - "177a91d4.f1016e" - ], - [ - "803b507f.9e38c" - ], - [ - "73f0f4b.8dd430c" - ] - ] - }, - { - "id": "7d713b16.235164", - "type": "change", - "z": "91e5fd54.56f58", - "name": "The segmentation has finished.", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The segmentation has finished.", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 890, - "y": 600, - "wires": [ - [ - "a57fea5b.59eb5" - ] - ] - }, - { - "id": "5d717a25.3437e4", - "type": "change", - "z": "91e5fd54.56f58", - "name": "The segmentation has started", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The segmentation has started", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 890, - "y": 560, - "wires": [ - [ - "a57fea5b.59eb5" - ] - ] - }, - { - "id": "6ad4ae5e.62f4a", - "type": "ui_chart", - "z": "91e5fd54.56f58", - "name": "obj_counter", - "group": "8cfadfab.327d7", - "order": 5, - "width": 23, - "height": 2, - "label": "obj_counter", - "chartType": "horizontalBar", - "legend": "false", - "xformat": "HH:mm:ss", - "interpolate": "linear", - "nodata": "", - "dot": false, - "ymin": "", - "ymax": "", - "removeOlder": 1, - "removeOlderPoints": "", - "removeOlderUnit": "3600", - "cutout": 0, - "useOneColor": true, - "colors": [ - "#1f77b4", - "#aec7e8", - "#ff7f0e", - "#2ca02c", - "#98df8a", - "#d62728", - "#ff9896", - "#9467bd", - "#c5b0d5" - ], - "useOldStyle": false, - "outputs": 1, - "x": 950, - "y": 640, - "wires": [ - [] - ] - }, - { - "id": "32b535dc.2d85ea", - "type": "function", - "z": "91e5fd54.56f58", - "name": "", - "func": "msg.payload=msg.payload.object_area\nmsg.topic=\"area\"\n\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 810, - "y": 700, - "wires": [ - [ - "1624f1bf.604bfe" - ] - ] - }, - { - "id": "73f0f4b.8dd430c", - "type": "json", - "z": "91e5fd54.56f58", - "name": "", - "property": "payload", - "action": "", - "pretty": false, - "x": 650, - "y": 700, - "wires": [ - [ - "32b535dc.2d85ea" - ] - ] - }, - { - "id": "6fc7332f.89431c", - "type": "exec", - "z": "91e5fd54.56f58", - "command": "free -m | grep \"Mem\" | awk -F ' ' '{print $3}'", - "addpay": false, - "append": "", - "useSpawn": "", - "timer": "", - "name": "Get memory used", - "x": 750, - "y": 780, - "wires": [ - [ - "42781732.a6ab58" - ], - [], - [] - ] - }, - { - "id": "7cdef10d.cb2f2", - "type": "inject", - "z": "91e5fd54.56f58", - "name": "", - "topic": "", - "payload": "", - "payloadType": "num", - "repeat": "1", - "crontab": "", - "once": false, - "onceDelay": "", - "x": 570, - "y": 780, - "wires": [ - [ - "6fc7332f.89431c" - ] - ] - }, - { - "id": "42781732.a6ab58", - "type": "ui_chart", - "z": "91e5fd54.56f58", - "name": "", - "group": "8cfadfab.327d7", - "order": 1, - "width": 0, - "height": 0, - "label": "Memory load", - "chartType": "line", - "legend": "false", - "xformat": "auto", - "interpolate": "linear", - "nodata": "", - "dot": false, - "ymin": "", - "ymax": "", - "removeOlder": 1, - "removeOlderPoints": "", - "removeOlderUnit": "3600", - "cutout": 0, - "useOneColor": false, - "colors": [ - "#1f77b4", - "#aec7e8", - "#ff7f0e", - "#2ca02c", - "#98df8a", - "#d62728", - "#ff9896", - "#9467bd", - "#c5b0d5" - ], - "useOldStyle": false, - "outputs": 1, - "x": 950, - "y": 760, - "wires": [ - [] - ] - }, - { - "id": "1624f1bf.604bfe", - "type": "ui_chart", - "z": "91e5fd54.56f58", - "name": "", - "group": "8cfadfab.327d7", - "order": 8, - "width": 0, - "height": 0, - "label": "chart", - "chartType": "line", - "legend": "false", - "xformat": "HH:mm:ss", - "interpolate": "linear", - "nodata": "", - "dot": true, - "ymin": "", - "ymax": "", - "removeOlder": 1, - "removeOlderPoints": "1000", - "removeOlderUnit": "3600", - "cutout": 0, - "useOneColor": false, - "colors": [ - "#1f77b4", - "#aec7e8", - "#ff7f0e", - "#2ca02c", - "#98df8a", - "#d62728", - "#ff9896", - "#9467bd", - "#c5b0d5" - ], - "useOldStyle": false, - "outputs": 1, - "x": 970, - "y": 700, - "wires": [ - [] - ] - }, - { - "id": "7f101b25.0da4a4", - "type": "subflow:173a6e6b.e5ca6a", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 750, - "y": 60, - "wires": [ - [ - "1a5edafb.a05cf5" - ] - ] - }, - { - "id": "d8dbecd.f7b3b9", - "type": "subflow:ae90e3e.7d9fba", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 740, - "y": 260, - "wires": [ - [ - "1a5edafb.a05cf5" - ] - ] - }, - { - "id": "309468bc.ac83f8", - "type": "ui_text_input", - "z": "407d8cdb.3cb7cc", - "name": "manual_volume", - "label": "Volume to pass (ml)", - "tooltip": "", - "group": "707d9797.c8e798", - "order": 3, - "width": 8, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "manual_volume", - "x": 460, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "f859eeef.c59ed", - "type": "function", - "z": "407d8cdb.3cb7cc", - "name": "get generic_manual_volume", - "func": "msg.payload = msg.payload.generic_manual_volume;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 80, - "wires": [ - [ - "309468bc.ac83f8" - ] - ] - }, - { - "id": "59b05f7f.9e83f8", - "type": "ui_slider", - "z": "407d8cdb.3cb7cc", - "name": "flowrate", - "label": "Flowrate (ml/min)*", - "tooltip": "", - "group": "707d9797.c8e798", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "outs": "end", - "topic": "flowrate", - "min": 0, - "max": "20", - "step": "0.1", - "x": 480, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "d9a85435.ced5e", - "type": "function", - "z": "407d8cdb.3cb7cc", - "name": "get generic.flowrate", - "func": "msg.payload = msg.payload.generic_flowrate;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 190, - "y": 40, - "wires": [ - [ - "59b05f7f.9e83f8" - ] - ] - }, - { - "id": "c986ae96.860ec8", - "type": "subflow:407d8cdb.3cb7cc", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 740, - "y": 300, - "wires": [ - [ - "1a5edafb.a05cf5" - ] - ] - }, - { - "id": "99b5a67.080f258", - "type": "subflow:bdd6e33e.5db3b8", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 760, - "y": 100, - "wires": [ - [ - "1a5edafb.a05cf5" - ], - [ - "e001a28.555566" - ] - ] - }, - { - "id": "a71ba4a6.c44c4", - "type": "subflow:ad5a5663.ce893", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 740, - "y": 140, - "wires": [ - [ - "1a5edafb.a05cf5" - ], - [ - "e001a28.555566" - ] - ] - }, - { - "id": "9c301fc6.9a9318", - "type": "subflow:35488f4f.00498", - "z": "259c8713.b50e28", - "name": "System commands", - "env": [], - "x": 750, - "y": 460, - "wires": [] - }, - { - "id": "4d5b9f01.270e88", - "type": "exec", - "z": "344146df.e4d5ba", - "command": "vcgencmd measure_temp | tr -d \"temp=\" | tr -d \"'C\" | tr -d \"\\n\"", - "addpay": false, - "append": "", - "useSpawn": "", - "timer": "", - "name": "RPi Temp.", - "x": 350, - "y": 80, - "wires": [ - [ - "4f3fb60b.912848" - ], - [], - [] - ] - }, - { - "id": "1c4bc7ff.94aa8", - "type": "inject", - "z": "344146df.e4d5ba", - "name": "", - "topic": "", - "payload": "", - "payloadType": "date", - "repeat": "10", - "crontab": "", - "once": false, - "onceDelay": "", - "x": 190, - "y": 80, - "wires": [ - [ - "4d5b9f01.270e88" - ] - ] - }, - { - "id": "4f3fb60b.912848", - "type": "python3-function", - "z": "344146df.e4d5ba", - "name": "fan.py", - "func": "#!/usr/bin/python\nimport smbus\nimport sys\n\ntemp = msg[\"payload\"]\n\ntemp = int(temp.split('.',1)[0])\n\nbus = smbus.SMBus(1)\n\nDEVICE_ADDRESS = 0x0d\n\nif temp < 38:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\nif temp > 42:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)", - "outputs": 1, - "x": 530, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "ee70d541.87713", - "type": "subflow:344146df.e4d5ba", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 300, - "y": 140, - "wires": [] - }, - { - "id": "c14cf94.1413e88", - "type": "ui_text_input", - "z": "b73d5eb8.60ef3", - "name": "duration_flush", - "label": "Duration of the flushing (s)", - "tooltip": "", - "group": "f41d0ecb.8be06", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "duration_flush", - "x": 520, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "d7b55d02.e41f1", - "type": "ui_text_input", - "z": "b73d5eb8.60ef3", - "name": "duration_bef_seq", - "label": "Duration before sequence (s)", - "tooltip": "", - "group": "f41d0ecb.8be06", - "order": 4, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "duration_bef_seq", - "x": 510, - "y": 160, - "wires": [ - [] - ] - }, - { - "id": "8729ec5c.cf4ab8", - "type": "ui_text_input", - "z": "b73d5eb8.60ef3", - "name": "nb_img", - "label": "Number of images per acquisition", - "tooltip": "", - "group": "f41d0ecb.8be06", - "order": 3, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "nb_img", - "x": 540, - "y": 120, - "wires": [ - [] - ] - }, - { - "id": "3808d004.94ea28", - "type": "function", - "z": "b73d5eb8.60ef3", - "name": "get duration_flush", - "func": "msg.payload = msg.payload.duration_flush;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 210, - "y": 80, - "wires": [ - [ - "c14cf94.1413e88" - ] - ] - }, - { - "id": "f7cc1192.5a51e8", - "type": "function", - "z": "b73d5eb8.60ef3", - "name": "get nb_img", - "func": "msg.payload = msg.payload.nb_img;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 190, - "y": 120, - "wires": [ - [ - "8729ec5c.cf4ab8" - ] - ] - }, - { - "id": "10ce45f6.3036ca", - "type": "function", - "z": "b73d5eb8.60ef3", - "name": "get duration_bef_seq", - "func": "msg.payload = msg.payload.duration_bef_seq;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 160, - "wires": [ - [ - "d7b55d02.e41f1" - ] - ] - }, - { - "id": "27bbe0f0.05b2c", - "type": "ui_text_input", - "z": "b73d5eb8.60ef3", - "name": "duration_bef_img", - "label": "Duration before image (s)", - "tooltip": "", - "group": "f41d0ecb.8be06", - "order": 5, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "duration_bef_img", - "x": 510, - "y": 200, - "wires": [ - [] - ] - }, - { - "id": "70dfb6bb.9319", - "type": "function", - "z": "b73d5eb8.60ef3", - "name": "get duration_bef_img", - "func": "msg.payload = msg.payload.duration_bef_img;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 200, - "wires": [ - [ - "27bbe0f0.05b2c" - ] - ] - }, - { - "id": "b31fd152.a5489", - "type": "ui_text_input", - "z": "b73d5eb8.60ef3", - "name": "duration_between", - "label": "Duration between acquisition (s)", - "tooltip": "", - "group": "f41d0ecb.8be06", - "order": 6, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "duration_between", - "x": 510, - "y": 240, - "wires": [ - [] - ] - }, - { - "id": "a0b53585.93216", - "type": "function", - "z": "b73d5eb8.60ef3", - "name": "get duration_between", - "func": "msg.payload = msg.payload.duration_between;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 240, - "wires": [ - [ - "b31fd152.a5489" - ] - ] - }, - { - "id": "fee8c0fa.108778", - "type": "subflow:91e5fd54.56f58", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 760, - "y": 380, - "wires": [] - }, - { - "id": "fe5585e.a1ab078", - "type": "subflow:4475ba6c.45604c", - "z": "259c8713.b50e28", - "name": "process metadata", - "env": [], - "x": 750, - "y": 180, - "wires": [ - [ - "1a5edafb.a05cf5" - ] - ] - }, - { - "id": "da9f1367.3a17a8", - "type": "subflow:b73d5eb8.60ef3", - "z": "259c8713.b50e28", - "d": true, - "name": "Valve actuation", - "env": [], - "x": 740, - "y": 220, - "wires": [ - [ - "1a5edafb.a05cf5" - ] - ], - "icon": "node-red-dashboard/ui_switch.png" - }, - { - "id": "69799a39.13803c", - "type": "function", - "z": "b73d5eb8.60ef3", - "name": "get duration_bef_cycle", - "func": "msg.payload = msg.payload.duration_bef_cycle;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 40, - "wires": [ - [ - "7a0b6294.e887c4" - ] - ] - }, - { - "id": "7a0b6294.e887c4", - "type": "ui_text_input", - "z": "b73d5eb8.60ef3", - "name": "duration_bef_cycle", - "label": "Duration before the cycles (s)", - "tooltip": "", - "group": "f41d0ecb.8be06", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "duration_bef_cycle", - "x": 510, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "a57fea5b.59eb5", - "type": "ui_toast", - "z": "91e5fd54.56f58", - "position": "top right", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 0, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 1220, - "y": 360, - "wires": [] - }, - { - "id": "f7d3d0c4.0203", - "type": "exec", - "z": "1b486ba8.f8c41c", - "command": "sudo date -s", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "", - "x": 1010, - "y": 240, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "c5fcaba5.184e88", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "", - "func": "d = new Date();\n//get weekday\nvar weekday = new Array(7);\nweekday[0] = \"Sun\";\nweekday[1] = \"Mon\";\nweekday[2] = \"Tue\";\nweekday[3] = \"Wed\";\nweekday[4] = \"Thu\";\nweekday[5] = \"Fri\";\nweekday[6] = \"Sat\";\nvar w = weekday[d.getUTCDay()];\n//get Month\nvar month = new Array(12);\nmonth[0] = \"Jan\";\nmonth[1] = \"Feb\";\nmonth[2] = \"Mar\";\nmonth[3] = \"Apr\";\nmonth[4] = \"May\";\nmonth[5] = \"Jun\";\nmonth[6] = \"Jul\";\nmonth[7] = \"Aug\";\nmonth[8] = \"Sep\";\nmonth[9] = \"Oct\";\nmonth[10] = \"Nov\";\nmonth[11] = \"Dec\";\nvar n = month[d.getUTCMonth()];\n \n//get day\nvar day = d.getUTCDay()\n\n//get Hours\nvar Hours = d.getUTCHours();\n//get Minutes\nvar Minutes = d.getUTCMinutes();\n//get Seconds\nvar Seconds = d.getUTCSeconds();\n//get FullYear\nvar FullYear = d.getUTCFullYear();\n\n//Thu Aug 09 2012 23:34:04 GMT+0200 (GMT+02:00)\n\n//Thu Aug 9 21:31:26 UTC 2012\n\n//msg.payload = \"Thu Aug 9 21:31:26 UTC 2012\"\n\nmsg.payload = '\"'+w+\" \"+n+\" \"+day+\" \"+Hours+\":\"+Minutes+\":\"+Seconds+\" UTC \"+FullYear+'\"';\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 490, - "y": 40, - "wires": [ - [ - "a1c2a5e3.4aea58" - ] - ] - }, - { - "id": "807d5cce.2bb1e", - "type": "subflow:1b486ba8.f8c41c", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 280, - "y": 180, - "wires": [] - }, - { - "id": "a1c2a5e3.4aea58", - "type": "ui_template", - "z": "1b486ba8.f8c41c", - "group": "9214d59d.e7b52", - "name": "", - "order": 1, - "width": 0, - "height": 0, - "format": "
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 640, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "9b1b260f.e4b338", - "type": "function", - "z": "ad5a5663.ce893", - "name": "set object_time", - "func": "var time = new Date(msg.payload);\n\nvar hour = time.getUTCHours();\nif (hour<10){hour = \"0\"+hour;}\nvar minute = time.getUTCMinutes();\nif (minute<10){minute = \"0\"+minute;}\n\nvar time_UTC = \"\"+hour+minute;\nglobal.set('object_time',time_UTC);\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 804, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "86aa9817.45a2e8", - "type": "function", - "z": "ad5a5663.ce893", - "name": "set object_date", - "func": "var date = new Date(msg.payload);\n\nvar year = date.getUTCFullYear();\nvar month = date.getUTCMonth()+1;\nif (month<10){month = \"0\"+month;}\nvar day = date.getUTCDate();\nif (day<10){day = \"0\"+day;}\n\nvar date_UTC = \"\"+year+month+day;\nglobal.set('object_date',date_UTC);\n\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 804, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "546376f8.9d25d8", - "type": "ui_numeric", - "z": "1b486ba8.f8c41c", - "name": "year", - "label": "Year", - "tooltip": "", - "group": "9214d59d.e7b52", - "order": 2, - "width": 5, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "year", - "format": "{{value}}", - "min": "2020", - "max": "2030", - "step": 1, - "x": 630, - "y": 80, - "wires": [ - [ - "dc685555.af057" - ] - ] - }, - { - "id": "8a701d46.962ed8", - "type": "ui_numeric", - "z": "1b486ba8.f8c41c", - "name": "month", - "label": "Month", - "tooltip": "", - "group": "9214d59d.e7b52", - "order": 3, - "width": 3, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "month", - "format": "{{value}}", - "min": "1", - "max": "12", - "step": 1, - "x": 630, - "y": 120, - "wires": [ - [ - "dc685555.af057" - ] - ] - }, - { - "id": "3e39bc34.b3042c", - "type": "ui_numeric", - "z": "1b486ba8.f8c41c", - "name": "day", - "label": "Day", - "tooltip": "", - "group": "9214d59d.e7b52", - "order": 4, - "width": 3, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "day", - "format": "{{value}}", - "min": "1", - "max": "31", - "step": 1, - "x": 630, - "y": 160, - "wires": [ - [ - "dc685555.af057" - ] - ] - }, - { - "id": "6edc1533.cd3ab4", - "type": "ui_numeric", - "z": "1b486ba8.f8c41c", - "name": "hour", - "label": "Hour", - "tooltip": "", - "group": "9214d59d.e7b52", - "order": 5, - "width": 3, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "hour", - "format": "{{value}}", - "min": "0", - "max": "23", - "step": 1, - "x": 630, - "y": 200, - "wires": [ - [ - "dc685555.af057" - ] - ] - }, - { - "id": "1ba0f9e6.1be54e", - "type": "ui_numeric", - "z": "1b486ba8.f8c41c", - "name": "minute", - "label": "Minute", - "tooltip": "", - "group": "9214d59d.e7b52", - "order": 6, - "width": 3, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "minute", - "format": "{{value}}", - "min": "0", - "max": "59", - "step": 1, - "x": 630, - "y": 240, - "wires": [ - [ - "dc685555.af057" - ] - ] - }, - { - "id": "fd050fce.2ffe28", - "type": "ui_numeric", - "z": "1b486ba8.f8c41c", - "name": "second", - "label": "Second", - "tooltip": "", - "group": "9214d59d.e7b52", - "order": 7, - "width": 3, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "second", - "format": "{{value}}", - "min": "0", - "max": "59", - "step": 1, - "x": 640, - "y": 280, - "wires": [ - [ - "dc685555.af057" - ] - ] - }, - { - "id": "e1cc68bb.7b045", - "type": "interval", - "z": "1b486ba8.f8c41c", - "name": "interval", - "interval": "1", - "onstart": false, - "msg": "ping", - "showstatus": true, - "unit": "seconds", - "statusformat": "YYYY-MM-D HH:mm:ss", - "x": 310, - "y": 40, - "wires": [ - [ - "c5fcaba5.184e88" - ] - ] - }, - { - "id": "23f1828c.afae3e", - "type": "ui_button", - "z": "1b486ba8.f8c41c", - "name": "", - "group": "9214d59d.e7b52", - "order": 8, - "width": 4, - "height": 1, - "passthru": false, - "label": "Update", - "tooltip": "", - "color": "black", - "bgcolor": "white", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 640, - "y": 320, - "wires": [ - [ - "cb4c9210.01c958" - ] - ] - }, - { - "id": "cb4c9210.01c958", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "update datetime", - "func": "var FullYear= global.get(\"year\");\nvar Month= global.get(\"month\");\nvar day= global.get(\"day\");\nvar Hours= global.get(\"hour\");\nvar Minutes= global.get(\"minute\");\nvar Seconds= global.get(\"second\");\n\nmsg.payload = new Date();\n//get Month\nvar month = new Array(12);\nmonth[1] = \"Jan\";\nmonth[2] = \"Feb\";\nmonth[3] = \"Mar\";\nmonth[4] = \"Apr\";\nmonth[5] = \"May\";\nmonth[6] = \"Jun\";\nmonth[7] = \"Jul\";\nmonth[8] = \"Aug\";\nmonth[9] = \"Sep\";\nmonth[10] = \"Oct\";\nmonth[11] = \"Nov\";\nmonth[12] = \"Dec\";\nvar n = month[Month];\n \nmsg.payload = '\"'+day+\" \"+n+\" \"+FullYear+\" \"+Hours+\":\"+Minutes+\":\"+Seconds+'\"';\n\n\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 800, - "y": 320, - "wires": [ - [ - "7c1c8abf.4b984c", - "f7d3d0c4.0203" - ] - ] - }, - { - "id": "dc685555.af057", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "set global", - "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 840, - "y": 60, - "wires": [ - [] - ] - }, - { - "id": "7c1c8abf.4b984c", - "type": "debug", - "z": "1b486ba8.f8c41c", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "x": 1010, - "y": 300, - "wires": [] - }, - { - "id": "92842b63.e0d7b8", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "", - "func": "d = msg.payload;\n\nvar val = d.getUTCFullYear();\n\nmsg.payload = val;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 490, - "y": 80, - "wires": [ - [ - "546376f8.9d25d8" - ] - ] - }, - { - "id": "48033b32.2bca94", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "", - "func": "d = new Date();\nmsg.payload = d\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 310, - "y": 80, - "wires": [ - [ - "92842b63.e0d7b8", - "94057891.b1a658", - "aab6990b.1cf718", - "42b00a98.b36bb4", - "e2370ad.c8e7ff8", - "9c43dfe1.eb6178" - ] - ] - }, - { - "id": "94057891.b1a658", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "", - "func": "d = msg.payload;\n\nvar val = d.getUTCMonth();\n\nmsg.payload = val+1;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 490, - "y": 120, - "wires": [ - [ - "8a701d46.962ed8" - ] - ] - }, - { - "id": "aab6990b.1cf718", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "", - "func": "d = msg.payload;\n\nvar val = d.getUTCDay();\n\nmsg.payload = val;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 490, - "y": 160, - "wires": [ - [ - "3e39bc34.b3042c" - ] - ] - }, - { - "id": "42b00a98.b36bb4", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "", - "func": "d = msg.payload;\n\nvar val = d.getUTCHours();\n\nmsg.payload = val;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 490, - "y": 200, - "wires": [ - [ - "6edc1533.cd3ab4" - ] - ] - }, - { - "id": "e2370ad.c8e7ff8", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "", - "func": "d = msg.payload;\n\nvar val = d.getUTCMinutes();\n\nmsg.payload = val;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 490, - "y": 240, - "wires": [ - [ - "1ba0f9e6.1be54e" - ] - ] - }, - { - "id": "9c43dfe1.eb6178", - "type": "function", - "z": "1b486ba8.f8c41c", - "name": "", - "func": "d = msg.payload;\n\nvar val = d.getUTCSeconds();\n\nmsg.payload = val;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 490, - "y": 280, - "wires": [ - [ - "fd050fce.2ffe28" - ] - ] - }, - { - "id": "ca843dd8.d1c62", - "type": "exec", - "z": "66c23d37.f72cdc", - "command": "python3.7 /home/pi/PlanktonScope/script/mqtt_pump_focus_image_segment_strem.py", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "", - "x": 520, - "y": 100, - "wires": [ - [], - [ - "a49ed5a6.5b73b8" - ], - [] - ] - }, - { - "id": "1af32c3e.856864", - "type": "exec", - "z": "66c23d37.f72cdc", - "command": "ps -ax | grep \"python3.7 /home/pi/PlanktonScope/script/mqtt_pump_focus_image_segment_strem.py\"| head -1 | awk -F \" \" '{print$1}' ", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "", - "x": 660, - "y": 160, - "wires": [ - [ - "ddabe48c.369c68" - ], - [], - [] - ] - }, - { - "id": "ddabe48c.369c68", - "type": "exec", - "z": "66c23d37.f72cdc", - "command": "kill", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "", - "x": 1210, - "y": 120, - "wires": [ - [ - "6382060e.460ab8" - ], - [ - "6382060e.460ab8" - ], - [ - "6382060e.460ab8" - ] - ] - }, - { - "id": "fcaca139.5ed04", - "type": "ui_button", - "z": "66c23d37.f72cdc", - "name": "", - "group": "9214d59d.e7b52", - "order": 9, - "width": 12, - "height": 1, - "passthru": false, - "label": "Kill MQTT", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 80, - "y": 160, - "wires": [ - [ - "1af32c3e.856864" - ] - ] - }, - { - "id": "9d663990.fd2908", - "type": "ui_button", - "z": "66c23d37.f72cdc", - "name": "", - "group": "9214d59d.e7b52", - "order": 10, - "width": 12, - "height": 1, - "passthru": false, - "label": "Restart MQTT", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 100, - "y": 100, - "wires": [ - [ - "ca843dd8.d1c62" - ] - ] - }, - { - "id": "a49ed5a6.5b73b8", - "type": "ui_toast", - "z": "66c23d37.f72cdc", - "position": "top right", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 0, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 920, - "y": 100, - "wires": [] - }, - { - "id": "fda01242.9576a8", - "type": "subflow:66c23d37.f72cdc", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 270, - "y": 220, - "wires": [] - }, - { - "id": "bbb7cb31.15121", - "type": "debug", - "z": "ad5a5663.ce893", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "true", - "targetType": "full", - "x": 280, - "y": 360, - "wires": [] - }, - { - "id": "6382060e.460ab8", - "type": "debug", - "z": "66c23d37.f72cdc", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "x": 1380, - "y": 120, - "wires": [] - }, - { - "id": "b23ae409.085ad8", - "type": "ui_button", - "z": "8d959937.18735", - "name": "", - "group": "d170ac9c.3b4828", - "order": 1, - "width": 0, - "height": 0, - "passthru": false, - "label": "Start Acquisition", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "actuator/image", - "x": 200, - "y": 100, - "wires": [ - [ - "715c6be9.55822c" - ] - ] - }, - { - "id": "715c6be9.55822c", - "type": "function", - "z": "8d959937.18735", - "name": "image.js", - "func": "state = global.get(\"state\");\nglobal.set('img_counter',0)\nglobal.set('obj_counter',0)\nif (state == null){state=\"free\"}\n\nvar duration_bef_cycle= global.get(\"duration_bef_cycle\");\nvar duration_flush= global.get(\"duration_flush\");\nvar nb_img= global.get(\"nb_img\");\nvar duration_bef_seq= global.get(\"duration_bef_seq\");\nvar duration_bef_img= global.get(\"duration_bef_img\");\nvar duration_between= global.get(\"duration_between\");\n\nif (duration_bef_cycle === undefined || duration_bef_cycle === \"\" || duration_bef_cycle === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration before the cycles\";\n \n}else if (duration_flush === undefined || duration_flush === \"\" || duration_flush === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration of the flushing\";\n \n}else if (nb_img === undefined || nb_img === \"\" || nb_img === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Directory to store the images\";\n \n}else if (duration_bef_seq === undefined || duration_bef_seq === \"\" || duration_bef_seq === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration before the sequence\";\n \n}else if (duration_bef_img === undefined || duration_bef_img === \"\" || duration_bef_img === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration before an image\";\n \n}else if (duration_between === undefined || duration_between === \"\" || duration_between === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration between sequence\";\n \n}else {\n nb_img=nb_img-1\n msg.payload=duration_bef_cycle+' '+duration_flush+' '+nb_img+' '+duration_bef_seq+' '+duration_bef_img+' '+duration_between;\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 360, - "y": 100, - "wires": [ - [ - "bda62ebe.dd2e4" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "bda62ebe.dd2e4", - "type": "switch", - "z": "8d959937.18735", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "actuator/image", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 510, - "y": 100, - "wires": [ - [ - "366697a.e8f6068" - ], - [ - "e2049db5.46682" - ] - ] - }, - { - "id": "e2049db5.46682", - "type": "ui_toast", - "z": "8d959937.18735", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 690, - "y": 120, - "wires": [ - [] - ] - }, - { - "id": "366697a.e8f6068", - "type": "mqtt out", - "z": "8d959937.18735", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 670, - "y": 80, - "wires": [] - }, - { - "id": "3a85a060.ad2aa", - "type": "ui_button", - "z": "8d959937.18735", - "name": "Stop Acquisition", - "group": "d170ac9c.3b4828", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "label": "STOP ACQUISITION", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "actuator/wait", - "x": 200, - "y": 140, - "wires": [ - [ - "f59d51da.c3b078" - ] - ] - }, - { - "id": "f59d51da.c3b078", - "type": "mqtt out", - "z": "8d959937.18735", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 350, - "y": 140, - "wires": [] - }, - { - "id": "8ade1ac1.5c3408", - "type": "ui_switch", - "z": "8d959937.18735", - "name": "Segmentation", - "label": "Segmentation", - "tooltip": "", - "group": "d170ac9c.3b4828", - "order": 3, - "width": 0, - "height": 0, - "passthru": false, - "decouple": "false", - "topic": "actuator/segmentation_state", - "style": "", - "onvalue": "true", - "onvalueType": "str", - "onicon": "", - "oncolor": "", - "offvalue": "false", - "offvalueType": "str", - "officon": "", - "offcolor": "", - "x": 200, - "y": 180, - "wires": [ - [ - "7751b219.9a3e1c" - ] - ] - }, - { - "id": "7751b219.9a3e1c", - "type": "mqtt out", - "z": "8d959937.18735", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 350, - "y": 180, - "wires": [] - }, - { - "id": "2a677ff0.62e0f", - "type": "subflow:8d959937.18735", - "z": "259c8713.b50e28", - "name": "", - "env": [], - "x": 750, - "y": 420, - "wires": [] - } -] From ced62d7884a8739a1d7967d86e88004c018befc2 Mon Sep 17 00:00:00 2001 From: tpollina Date: Tue, 14 Jul 2020 18:21:48 +0200 Subject: [PATCH 20/48] Delete flow_mqtt.json --- flows/flow_mqtt.json | 3502 ------------------------------------------ 1 file changed, 3502 deletions(-) delete mode 100644 flows/flow_mqtt.json diff --git a/flows/flow_mqtt.json b/flows/flow_mqtt.json deleted file mode 100644 index 3619162..0000000 --- a/flows/flow_mqtt.json +++ /dev/null @@ -1,3502 +0,0 @@ -[ - { - "id": "259c8713.b50e28", - "type": "tab", - "label": "Main", - "disabled": false, - "info": "" - }, - { - "id": "6d0d6fc7.d30bb", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "sample_ship", - "label": "Name of the ship", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 3, - "width": 12, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_ship", - "x": 1370, - "y": 140, - "wires": [ - [ - "de9708c2.d00068" - ] - ] - }, - { - "id": "43b12fe4.c5aa3", - "type": "ui_dropdown", - "z": "259c8713.b50e28", - "name": "sample_sampling_gear", - "label": "Sampling gear", - "tooltip": "", - "place": "Select", - "group": "3e1ba03d.f01d8", - "order": 5, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "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" - } - ], - "payload": "", - "topic": "sample_sampling_gear", - "x": 1330, - "y": 220, - "wires": [ - [ - "3c6a723.145778e" - ] - ] - }, - { - "id": "458408d7.2b3b68", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "sample_operator", - "label": "Name of the operator", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 4, - "width": 12, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_operator", - "x": 1350, - "y": 180, - "wires": [ - [ - "a2ae6c99.188f2" - ] - ] - }, - { - "id": "a163194f.0b17c8", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "sample_project", - "label": "Name of the project*", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 1, - "width": 12, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_project", - "x": 1360, - "y": 60, - "wires": [ - [ - "1c2c7439.47115c" - ] - ] - }, - { - "id": "914752eb.af1b", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "sample_id", - "label": "ID of the station*", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 2, - "width": 12, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "sample_id", - "x": 1370, - "y": 100, - "wires": [ - [ - "30648de6.8ebc52" - ] - ] - }, - { - "id": "8a735175.23927", - "type": "ui_date_picker", - "z": "259c8713.b50e28", - "name": "acq_date", - "label": "Date :", - "group": "52159161.72187", - "order": 2, - "width": 12, - "height": 1, - "passthru": true, - "topic": "", - "x": 1380, - "y": 1141, - "wires": [ - [ - "86aa9817.45a2e8" - ] - ] - }, - { - "id": "16d7de1c.b0c892", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "acq_time", - "label": "Time :", - "tooltip": "", - "group": "52159161.72187", - "order": 3, - "width": 12, - "height": 1, - "passthru": true, - "mode": "time", - "delay": 300, - "topic": "", - "x": 1380, - "y": 1181, - "wires": [ - [ - "9b1b260f.e4b338" - ] - ] - }, - { - "id": "9b1b260f.e4b338", - "type": "function", - "z": "259c8713.b50e28", - "name": "set object_time", - "func": "var time = new Date(msg.payload);\n\nvar hour = time.getUTCHours();\nif (hour<10){hour = \"0\"+hour;}\nvar minute = time.getUTCMinutes();\nif (minute<10){minute = \"0\"+minute;}\n\nvar time_UTC = \"\"+hour+minute+\"00\";\nglobal.set('object_time',time_UTC);\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1544, - "y": 1181, - "wires": [ - [ - "829cc940.327648" - ] - ] - }, - { - "id": "86aa9817.45a2e8", - "type": "function", - "z": "259c8713.b50e28", - "name": "set object_date", - "func": "var date = new Date(msg.payload);\n\nvar year = date.getUTCFullYear();\nvar month = date.getUTCMonth()+1;\nif (month<10){month = \"0\"+month;}\nvar day = date.getUTCDate();\nif (day<10){day = \"0\"+day;}\n\nvar date_UTC = \"\"+year+month+day;\nglobal.set('object_date',date_UTC);\n\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1544, - "y": 1141, - "wires": [ - [ - "c93577b9.a1e438" - ] - ] - }, - { - "id": "e001a28.555566", - "type": "function", - "z": "259c8713.b50e28", - "name": "get global", - "func": "msg.payload={\n \n \"generic_nb_step\":global.get(\"generic_nb_step\"),\n \"generic_flowrate\":global.get(\"generic_flowrate\"),\n \"generic_manual_volume\":global.get(\"generic_manual_volume\"),\n \"generic_sleep_before\":global.get(\"generic_sleep_before\"),\n \"generic_volume_before\":global.get(\"generic_volume_before\"),\n \"generic_path\":global.get(\"generic_path\"),\n \"generic_nb_frame\":global.get(\"generic_nb_frame\"),\n \"generic_sleep_during\":global.get(\"generic_sleep_during\"),\n \n \"sample_project\":global.get(\"sample_project\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n //\"acq_instrument_id\":global.get(\"acq_instrument_id\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_min_esd\":global.get(\"acq_min_esd\"),\n \"acq_max_esd\":global.get(\"acq_max_esd\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_magnification\":global.get(\"magnification\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \n \"acq_camera_name\":\"Pi Camera V2.1 - 8MP\",\n \n \"object_date\":global.get(\"object_date\"),\n \"object_time\":global.get(\"object_time\"),\n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \"object_depth_min\":global.get(\"object_depth_min\"),\n \"object_depth_max\":global.get(\"object_depth_max\"),\n \n \"process_pixel\":global.get(\"process_pixel\"),\n \"process_id\":global.get(\"process_id\")\n \n};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1880, - "y": 60, - "wires": [ - [ - "76a6e6bb.a08b98" - ] - ] - }, - { - "id": "f25890f5.f2549", - "type": "file", - "z": "259c8713.b50e28", - "name": "", - "filename": "/home/pi/PlanktonScope/config.txt", - "appendNewline": true, - "createDir": true, - "overwriteFile": "true", - "encoding": "none", - "x": 2233, - "y": 60, - "wires": [ - [] - ] - }, - { - "id": "f5c1aa13.3cfbf8", - "type": "function", - "z": "259c8713.b50e28", - "name": "set optical config", - "func": "global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1550, - "y": 1041, - "wires": [ - [ - "72e1e23b.a8a67c" - ] - ] - }, - { - "id": "eb9181d8.25e01", - "type": "ui_dropdown", - "z": "259c8713.b50e28", - "name": "acq_fnumber_objective", - "label": "M12 Lens*", - "tooltip": "", - "place": "Select option", - "group": "52159161.72187", - "order": 7, - "width": 12, - "height": 1, - "passthru": true, - "options": [ - { - "label": "f 25mm 1/2\" 5MP IR", - "value": 25, - "type": "num" - }, - { - "label": "f 16mm 1/2.5\" 5MP IR", - "value": 16, - "type": "num" - }, - { - "label": "f 12mm 1/2.5\" 5MP IR", - "value": 12, - "type": "num" - }, - { - "label": "f 8mm 1/2.5\" 5MP IR", - "value": 8, - "type": "num" - }, - { - "label": "f 6mm 1/2.5\" 5MP IR", - "value": 6, - "type": "num" - } - ], - "payload": "", - "topic": "acq_fnumber_objective", - "x": 1326, - "y": 1041, - "wires": [ - [ - "f5c1aa13.3cfbf8" - ] - ] - }, - { - "id": "5aba848a.7a861c", - "type": "ui_numeric", - "z": "259c8713.b50e28", - "name": "acq_minimum_mesh", - "label": "Min fraction size (μm)", - "tooltip": "", - "group": "52159161.72187", - "order": 8, - "width": 12, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "acq_minimum_mesh", - "format": "{{value}}", - "min": 0, - "max": "300", - "step": "10", - "x": 1336, - "y": 841, - "wires": [ - [ - "510bd72a.b42ea8" - ] - ] - }, - { - "id": "7cea16e.c42ace8", - "type": "ui_numeric", - "z": "259c8713.b50e28", - "name": "acq_maximum_mesh", - "label": "Max fraction size (μm)", - "tooltip": "", - "group": "52159161.72187", - "order": 9, - "width": 12, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "acq_maximum_mesh", - "format": "{{value}}", - "min": "200", - "max": "2000", - "step": "100", - "x": 1336, - "y": 881, - "wires": [ - [ - "a3f18257.8a55e" - ] - ] - }, - { - "id": "6ecc9468.0271dc", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "acq_id", - "label": "Acquisition unique ID*", - "tooltip": "", - "group": "52159161.72187", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "acq_id", - "x": 1386, - "y": 721, - "wires": [ - [ - "b26183bf.aa217" - ] - ] - }, - { - "id": "259fd49a.160a3c", - "type": "ui_dropdown", - "z": "259c8713.b50e28", - "name": "acq_celltype", - "label": "Thickness flowcell*", - "tooltip": "", - "place": "Select option", - "group": "52159161.72187", - "order": 6, - "width": 12, - "height": 1, - "passthru": true, - "options": [ - { - "label": "200 μm µ-Slide I Luer", - "value": 200, - "type": "num" - }, - { - "label": "400 μm µ-Slide I Luer", - "value": 400, - "type": "num" - }, - { - "label": "600 μm µ-Slide I Luer", - "value": 600, - "type": "num" - }, - { - "label": "800 μm µ-Slide I Luer", - "value": 800, - "type": "num" - } - ], - "payload": "", - "topic": "acq_celltype", - "x": 1366, - "y": 801, - "wires": [ - [ - "d96d32ec.f88b9" - ] - ] - }, - { - "id": "66a3425c.79aabc", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "acq_volume", - "label": "Volume to pass (ml)", - "tooltip": "", - "group": "52159161.72187", - "order": 5, - "width": 12, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "acq_volume", - "x": 1366, - "y": 921, - "wires": [ - [ - "a3ec68a2.889ca8" - ] - ] - }, - { - "id": "6722bc48.d4f354", - "type": "comment", - "z": "259c8713.b50e28", - "name": "sample", - "info": "SAMPLE: a collection event\n\n sample_id [t] : unique identifier\n sample_*** [f] or [t] : other fields relative to the sample\n", - "x": 810, - "y": 60, - "wires": [] - }, - { - "id": "f93037f1.6a6238", - "type": "comment", - "z": "259c8713.b50e28", - "name": "acquisition", - "info": "ACQUISITION: metadata relative to the image acquisition\n\n acq_id [t] : unique identifier. If your acquisition differ for each sample you must have different identifier.\n acq_instrument [t] : name of the instrument (UVP, ZOOSCAN, FLOWCAM, etc.)\n acq_*** [f] or [t] : other fields relative to the acquisition\n", - "x": 800, - "y": 720, - "wires": [] - }, - { - "id": "734ba3db.3f82fc", - "type": "comment", - "z": "259c8713.b50e28", - "name": "object", - "info": "OBJECT: one object to be classified, usually one organism. One object can be represented by several images. In this tsv file, there is one line per image which means the object data gets repeated on several lines.\n\n object_id [t] : unique object name (will be displayed in Ecotaxa object page)\n object_link [f] : URL of an associated website\n object_lat [f] : latitude, decimal degrees\n object_lon [f] : longitude, decimal degrees\n object_date [f] : ISO8601 YYYYMMJJ UTC\n object_time [f] : ISO8601 HHMMSS UTC\n object_depth_min [f] : minimum depth of object, meters\n object_depth_max [f] : maximum depth of object, meters\n\nAnd, for already classified objects\n\n object_annotation_date [t] : ISO8601 YYYYMMJJ UTC\n object_annotation_time [t] : ISO8601 YYYYMMJJ UTC\n object_annotation_category [t] : class of the object with optionnaly its direct parent following separated by left angle bracket without whitespace \"Cnidaria", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1210, - "y": 300, - "wires": [ - [] - ] - }, - { - "id": "b7d9455c.026588", - "type": "switch", - "z": "259c8713.b50e28", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "actuator/focus", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 1670, - "y": 400, - "wires": [ - [ - "fdb3b132.8b341" - ], - [ - "b9d996d6.37c2f8" - ] - ] - }, - { - "id": "b9d996d6.37c2f8", - "type": "ui_toast", - "z": "259c8713.b50e28", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 1830, - "y": 420, - "wires": [ - [] - ] - }, - { - "id": "ca38a11d.0ee54", - "type": "function", - "z": "259c8713.b50e28", - "name": "init LED", - "func": "msg.payload=1;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 240, - "y": 161, - "wires": [ - [ - "1d58e86f.a3a9e8" - ] - ] - }, - { - "id": "75701b99.c6e974", - "type": "exec", - "z": "259c8713.b50e28", - "command": "vcgencmd measure_temp | tr -d \"temp=\" | tr -d \"'C\" | tr -d \"\\n\"", - "addpay": false, - "append": "", - "useSpawn": "", - "timer": "", - "name": "RPi Temp.", - "x": 2190, - "y": 1080, - "wires": [ - [ - "aac61390.c13c6" - ], - [], - [] - ] - }, - { - "id": "1780384d.718198", - "type": "inject", - "z": "259c8713.b50e28", - "name": "", - "topic": "", - "payload": "", - "payloadType": "date", - "repeat": "10", - "crontab": "", - "once": false, - "onceDelay": "", - "x": 2030, - "y": 1080, - "wires": [ - [ - "75701b99.c6e974" - ] - ] - }, - { - "id": "aac61390.c13c6", - "type": "python3-function", - "z": "259c8713.b50e28", - "name": "fan.py", - "func": "#!/usr/bin/python\nimport smbus\nimport sys\n\ntemp = msg[\"payload\"]\n\ntemp = int(temp.split('.',1)[0])\n\nbus = smbus.SMBus(1)\n\nDEVICE_ADDRESS = 0x0d\n\nif temp < 38:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\nif temp > 42:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)", - "outputs": 1, - "x": 2370, - "y": 1060, - "wires": [ - [] - ] - }, - { - "id": "603d5fab.08f56", - "type": "comment", - "z": "259c8713.b50e28", - "name": "save config.txt", - "info": "", - "x": 1690, - "y": 20, - "wires": [] - }, - { - "id": "72e1e23b.a8a67c", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04", - "d473399b.081ae8" - ], - "x": 1675, - "y": 1040, - "wires": [] - }, - { - "id": "d473399b.081ae8", - "type": "link in", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "72e1e23b.a8a67c", - "c93577b9.a1e438", - "829cc940.327648" - ], - "x": 1635, - "y": 100, - "wires": [ - [ - "e001a28.555566" - ] - ] - }, - { - "id": "c93577b9.a1e438", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04", - "d473399b.081ae8" - ], - "x": 1675, - "y": 1140, - "wires": [] - }, - { - "id": "829cc940.327648", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04", - "d473399b.081ae8" - ], - "x": 1675, - "y": 1180, - "wires": [] - }, - { - "id": "98e2e9e0.fb7418", - "type": "switch", - "z": "259c8713.b50e28", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "actuator/pump", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 1670, - "y": 600, - "wires": [ - [ - "61fb057d.3c251c" - ], - [ - "46a536f0.c83138" - ] - ] - }, - { - "id": "46a536f0.c83138", - "type": "ui_toast", - "z": "259c8713.b50e28", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 1830, - "y": 620, - "wires": [ - [] - ] - }, - { - "id": "24ffcf03.2a51b", - "type": "ui_button", - "z": "259c8713.b50e28", - "name": "stop pump", - "group": "707d9797.c8e798", - "order": 5, - "width": 4, - "height": 1, - "passthru": true, - "label": "STOP PUMP", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "actuator/wait", - "x": 1370, - "y": 660, - "wires": [ - [ - "e2a7220a.09d43" - ] - ] - }, - { - "id": "7eb16c3b.294e54", - "type": "comment", - "z": "259c8713.b50e28", - "name": "turn ON the LED", - "info": "", - "x": 260, - "y": 121, - "wires": [] - }, - { - "id": "4f74f017.00a58", - "type": "function", - "z": "259c8713.b50e28", - "name": "focus.js", - "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar nb_step= global.get(\"nb_step\");\n\nif (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of steps\";\n \n}else {\n nb_step= global.get(\"nb_step\");\n if(msg.payload === \"UP\" & state===\"free\"){\n msg.payload=\"FORWARD \"+nb_step;\n }\n if(msg.payload === \"DOWN\" & state===\"free\"){\n msg.payload=\"BACKWARD \"+nb_step;\n }\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1520, - "y": 400, - "wires": [ - [ - "b7d9455c.026588" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "52cc1de5.b78e84", - "type": "ui_button", - "z": "259c8713.b50e28", - "name": "stop focus", - "group": "fbd92986.1028c8", - "order": 5, - "width": 4, - "height": 1, - "passthru": true, - "label": "STOP FOCUS", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "actuator/wait", - "x": 1370, - "y": 460, - "wires": [ - [ - "e46763fe.7fc83" - ] - ] - }, - { - "id": "39cad6fb.1503ca", - "type": "ui_button", - "z": "259c8713.b50e28", - "name": "", - "group": "8cfadfab.327d7", - "order": 9, - "width": 11, - "height": 1, - "passthru": false, - "label": "Reboot", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "reboot", - "x": 2060, - "y": 960, - "wires": [ - [ - "95b876d4.07c708", - "99d61fbe.b244b" - ] - ] - }, - { - "id": "1f53f29b.feee4d", - "type": "exec", - "z": "259c8713.b50e28", - "command": "sudo", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "2", - "oldrc": false, - "name": "cmd", - "x": 2370, - "y": 960, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "e325458b.95bff8", - "type": "ui_button", - "z": "259c8713.b50e28", - "name": "", - "group": "8cfadfab.327d7", - "order": 10, - "width": 13, - "height": 1, - "passthru": false, - "label": "Shutdown", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "shutdown", - "x": 2060, - "y": 1020, - "wires": [ - [ - "95b876d4.07c708", - "99d61fbe.b244b" - ] - ] - }, - { - "id": "95b876d4.07c708", - "type": "python3-function", - "z": "259c8713.b50e28", - "name": "action", - "func": "#!/usr/bin/python\nimport smbus\nimport time\nbus = smbus.SMBus(1)\ntime.sleep(1)\n#turn off fan RGB\nbus.write_byte_data(0x0d, 0x07, 0x00)\nbus.write_byte_data(0x0d, 0x07, 0x00)\n\nmsg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg", - "outputs": 1, - "x": 2230, - "y": 980, - "wires": [ - [ - "d348474b.d756a8", - "1f53f29b.feee4d" - ] - ] - }, - { - "id": "d348474b.d756a8", - "type": "exec", - "z": "259c8713.b50e28", - "command": "i2cdetect -y 1", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "1", - "oldrc": false, - "name": "i2c update", - "x": 2390, - "y": 1020, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "99d61fbe.b244b", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "3517d063.27073" - ], - "x": 2175, - "y": 920, - "wires": [] - }, - { - "id": "cdd1b550.da18e8", - "type": "mqtt in", - "z": "259c8713.b50e28", - "name": "", - "topic": "receiver/#", - "qos": "0", - "datatype": "auto", - "broker": "b77ffa1b.942258", - "x": 2340, - "y": 720, - "wires": [ - [ - "6920281d.dc9b48" - ] - ] - }, - { - "id": "6920281d.dc9b48", - "type": "switch", - "z": "259c8713.b50e28", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "receiver/pump", - "vt": "str" - }, - { - "t": "eq", - "v": "receiver/focus", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 2490, - "y": 720, - "wires": [ - [ - "2f66e917.fee586" - ], - [ - "363ee47e.ed522c" - ] - ] - }, - { - "id": "2f66e917.fee586", - "type": "switch", - "z": "259c8713.b50e28", - "name": "", - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Start", - "vt": "str" - }, - { - "t": "eq", - "v": "Done", - "vt": "str" - }, - { - "t": "eq", - "v": "Interrompted", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 3, - "x": 2650, - "y": 640, - "wires": [ - [ - "5c0d0c35.3bcf14" - ], - [ - "cd01157d.0892d8" - ], - [ - "68e02bf4.7013e4" - ] - ] - }, - { - "id": "5c0d0c35.3bcf14", - "type": "change", - "z": "259c8713.b50e28", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The pump has started", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 2820, - "y": 600, - "wires": [ - [ - "61cf0388.fb10cc" - ] - ] - }, - { - "id": "cd01157d.0892d8", - "type": "change", - "z": "259c8713.b50e28", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The pump has finished.", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 2820, - "y": 640, - "wires": [ - [ - "61cf0388.fb10cc" - ] - ] - }, - { - "id": "68e02bf4.7013e4", - "type": "change", - "z": "259c8713.b50e28", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The pump has been stopped.", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 2820, - "y": 680, - "wires": [ - [ - "61cf0388.fb10cc" - ] - ] - }, - { - "id": "61cf0388.fb10cc", - "type": "debug", - "z": "259c8713.b50e28", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "payload", - "targetType": "msg", - "x": 3030, - "y": 640, - "wires": [] - }, - { - "id": "363ee47e.ed522c", - "type": "switch", - "z": "259c8713.b50e28", - "name": "", - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Start", - "vt": "str" - }, - { - "t": "eq", - "v": "Done", - "vt": "str" - }, - { - "t": "eq", - "v": "Interrompted", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 3, - "x": 2650, - "y": 780, - "wires": [ - [ - "c088b72f.326d98" - ], - [ - "36934381.14442c" - ], - [ - "89329cfe.c8f4" - ] - ] - }, - { - "id": "c088b72f.326d98", - "type": "change", - "z": "259c8713.b50e28", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The focus has started", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 2820, - "y": 740, - "wires": [ - [ - "d11ec8dd.ad71d8" - ] - ] - }, - { - "id": "36934381.14442c", - "type": "change", - "z": "259c8713.b50e28", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The focus has finished.", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 2820, - "y": 780, - "wires": [ - [ - "d11ec8dd.ad71d8" - ] - ] - }, - { - "id": "89329cfe.c8f4", - "type": "change", - "z": "259c8713.b50e28", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "The focus has been stopped.", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 2820, - "y": 820, - "wires": [ - [ - "d11ec8dd.ad71d8" - ] - ] - }, - { - "id": "d11ec8dd.ad71d8", - "type": "debug", - "z": "259c8713.b50e28", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "payload", - "targetType": "msg", - "x": 3030, - "y": 780, - "wires": [] - }, - { - "id": "fdb3b132.8b341", - "type": "mqtt out", - "z": "259c8713.b50e28", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 1810, - "y": 380, - "wires": [] - }, - { - "id": "e46763fe.7fc83", - "type": "mqtt out", - "z": "259c8713.b50e28", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 1510, - "y": 460, - "wires": [] - }, - { - "id": "61fb057d.3c251c", - "type": "mqtt out", - "z": "259c8713.b50e28", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 1810, - "y": 580, - "wires": [] - }, - { - "id": "e2a7220a.09d43", - "type": "mqtt out", - "z": "259c8713.b50e28", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 1510, - "y": 660, - "wires": [] - }, - { - "id": "577f7f72.6b68b", - "type": "ui_button", - "z": "259c8713.b50e28", - "name": "", - "group": "8cfadfab.327d7", - "order": 7, - "width": 0, - "height": 0, - "passthru": false, - "label": "Start Acquisition", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "actuator/image", - "x": 1360, - "y": 1560, - "wires": [ - [ - "5218ba30.bbe844" - ] - ] - }, - { - "id": "d5111b87.2a64a8", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "generic_sleep_before", - "label": "Sleep duration before acquisition (s)", - "tooltip": "", - "group": "8cfadfab.327d7", - "order": 1, - "width": 12, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "generic_sleep_before", - "x": 1340, - "y": 1360, - "wires": [ - [ - "3d141631.d548ba" - ] - ] - }, - { - "id": "3d141631.d548ba", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04" - ], - "x": 1475, - "y": 1360, - "wires": [] - }, - { - "id": "74c89905.79d968", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "generic_sleep_during", - "label": "Sleep duration between acquisition (s)", - "tooltip": "", - "group": "8cfadfab.327d7", - "order": 2, - "width": 12, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "generic_sleep_during", - "x": 1340, - "y": 1520, - "wires": [ - [ - "644e95b9.04b7ac" - ] - ] - }, - { - "id": "644e95b9.04b7ac", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04" - ], - "x": 1475, - "y": 1520, - "wires": [] - }, - { - "id": "b50cf2f4.bfb84", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04" - ], - "x": 1475, - "y": 501, - "wires": [] - }, - { - "id": "1e75fd6c.234753", - "type": "ui_slider", - "z": "259c8713.b50e28", - "name": "flowrate", - "label": "Flowrate (ml/min)*", - "tooltip": "", - "group": "707d9797.c8e798", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "outs": "end", - "topic": "flowrate", - "min": 0, - "max": "20", - "step": "0.1", - "x": 1380, - "y": 501, - "wires": [ - [ - "b50cf2f4.bfb84" - ] - ] - }, - { - "id": "3345fc41.8341b4", - "type": "function", - "z": "259c8713.b50e28", - "name": "get generic.flowrate", - "func": "msg.payload = msg.payload.generic_flowrate;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1030, - "y": 501, - "wires": [ - [ - "1e75fd6c.234753" - ] - ] - }, - { - "id": "32510458.f42f9c", - "type": "link in", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "b368cae7.dd66b8" - ], - "x": 895, - "y": 501, - "wires": [ - [ - "3345fc41.8341b4" - ] - ] - }, - { - "id": "3cd0a17b.0cc42e", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04" - ], - "x": 1475, - "y": 1440, - "wires": [] - }, - { - "id": "62fea790.2840a8", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "generic_path", - "label": "DIrectory to store the images", - "tooltip": "", - "group": "8cfadfab.327d7", - "order": 3, - "width": 12, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "generic_path", - "x": 1370, - "y": 1440, - "wires": [ - [ - "3cd0a17b.0cc42e" - ] - ] - }, - { - "id": "73e051a8.5875e", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "generic_volume_before", - "label": "Volume to pass before to begin", - "tooltip": "", - "group": "8cfadfab.327d7", - "order": 5, - "width": 12, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "generic_volume_before", - "x": 1330, - "y": 1400, - "wires": [ - [ - "5ea01613.8cc9d8" - ] - ] - }, - { - "id": "5ea01613.8cc9d8", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04" - ], - "x": 1475, - "y": 1400, - "wires": [] - }, - { - "id": "26549e4b.5dbf72", - "type": "ui_text_input", - "z": "259c8713.b50e28", - "name": "generic_nb_frame", - "label": "Number of frame per acquisition", - "tooltip": "", - "group": "8cfadfab.327d7", - "order": 4, - "width": 12, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "generic_nb_frame", - "x": 1350, - "y": 1480, - "wires": [ - [ - "61382d0b.60c534" - ] - ] - }, - { - "id": "61382d0b.60c534", - "type": "link out", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "7532db82.1dcf04" - ], - "x": 1475, - "y": 1480, - "wires": [] - }, - { - "id": "d5df5489.6523e8", - "type": "function", - "z": "259c8713.b50e28", - "name": "get generic_sleep_before", - "func": "msg.payload = msg.payload.generic_sleep_before;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1050, - "y": 1360, - "wires": [ - [ - "d5111b87.2a64a8" - ] - ] - }, - { - "id": "835c262e.00b468", - "type": "link in", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "b368cae7.dd66b8" - ], - "x": 895, - "y": 1360, - "wires": [ - [ - "d5df5489.6523e8" - ] - ] - }, - { - "id": "9b2fe59b.be48c8", - "type": "function", - "z": "259c8713.b50e28", - "name": "get generic_volume_before", - "func": "msg.payload = msg.payload.generic_volume_before;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1060, - "y": 1400, - "wires": [ - [ - "73e051a8.5875e" - ] - ] - }, - { - "id": "a07dad70.7c48", - "type": "link in", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "b368cae7.dd66b8" - ], - "x": 895, - "y": 1400, - "wires": [ - [ - "9b2fe59b.be48c8" - ] - ] - }, - { - "id": "54dfe4df.c6837c", - "type": "function", - "z": "259c8713.b50e28", - "name": "get generic_path", - "func": "msg.payload = msg.payload.generic_path;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1030, - "y": 1440, - "wires": [ - [ - "62fea790.2840a8" - ] - ] - }, - { - "id": "9fb166d6.86f908", - "type": "link in", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "b368cae7.dd66b8" - ], - "x": 895, - "y": 1440, - "wires": [ - [ - "54dfe4df.c6837c" - ] - ] - }, - { - "id": "1aa409a4.7b3866", - "type": "function", - "z": "259c8713.b50e28", - "name": "get generic_nb_frame", - "func": "msg.payload = msg.payload.generic_nb_frame;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1040, - "y": 1480, - "wires": [ - [ - "26549e4b.5dbf72" - ] - ] - }, - { - "id": "51e769aa.92a138", - "type": "link in", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "b368cae7.dd66b8" - ], - "x": 895, - "y": 1480, - "wires": [ - [ - "1aa409a4.7b3866" - ] - ] - }, - { - "id": "ce6ded0a.8ee37", - "type": "function", - "z": "259c8713.b50e28", - "name": "get generic_sleep_during", - "func": "msg.payload = msg.payload.generic_sleep_during;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1050, - "y": 1520, - "wires": [ - [ - "74c89905.79d968" - ] - ] - }, - { - "id": "3fa20f41.11e61", - "type": "link in", - "z": "259c8713.b50e28", - "name": "", - "links": [ - "b368cae7.dd66b8" - ], - "x": 895, - "y": 1520, - "wires": [ - [ - "ce6ded0a.8ee37" - ] - ] - }, - { - "id": "5218ba30.bbe844", - "type": "function", - "z": "259c8713.b50e28", - "name": "image.js", - "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar generic_sleep_before= global.get(\"generic_sleep_before\");\nvar generic_volume_before= global.get(\"generic_volume_before\");\nvar generic_path= global.get(\"generic_path\");\nvar generic_nb_frame= global.get(\"generic_nb_frame\");\nvar generic_sleep_during= global.get(\"generic_sleep_during\");\n\nif (generic_sleep_before === undefined || generic_sleep_before === \"\" || generic_sleep_before === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration before start the acquisition\";\n \n}else if (generic_volume_before === undefined || generic_volume_before === \"\" || generic_volume_before === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume before acquisition\";\n \n}else if (generic_path === undefined || generic_path === \"\" || generic_path === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Directory to store the images\";\n \n}else if (generic_nb_frame === undefined || generic_nb_frame === \"\" || generic_nb_frame === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of frames per acquisition\";\n \n}else if (generic_sleep_during === undefined || generic_sleep_during === \"\" || generic_sleep_during === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration in between each acquisition\";\n \n}else {\n generic_nb_step = 507*generic_volume_before\n msg.payload=generic_sleep_before+' '+generic_nb_step+' '+generic_path+' '+generic_nb_frame+' '+generic_sleep_during;\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1520, - "y": 1560, - "wires": [ - [ - "8142bee4.882c2" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "8142bee4.882c2", - "type": "switch", - "z": "259c8713.b50e28", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "actuator/image", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 1670, - "y": 1560, - "wires": [ - [ - "a4b8aae3.cc3ad8" - ], - [ - "54420752.4a4ab8" - ] - ] - }, - { - "id": "54420752.4a4ab8", - "type": "ui_toast", - "z": "259c8713.b50e28", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 1830, - "y": 1580, - "wires": [ - [] - ] - }, - { - "id": "a4b8aae3.cc3ad8", - "type": "mqtt out", - "z": "259c8713.b50e28", - "name": "", - "topic": "", - "qos": "", - "retain": "", - "broker": "cb2f36fe.1c7038", - "x": 1810, - "y": 1540, - "wires": [] - }, - { - "id": "d7445228.4f765", - "type": "mqtt in", - "z": "259c8713.b50e28", - "name": "", - "topic": "receiver/#", - "qos": "0", - "datatype": "auto", - "broker": "b77ffa1b.942258", - "x": 2194.28564453125, - "y": 401.4285888671875, - "wires": [ - [ - "f1a6bef0.cfb" - ] - ] - }, - { - "id": "f1a6bef0.cfb", - "type": "debug", - "z": "259c8713.b50e28", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "x": 2460, - "y": 400, - "wires": [] - }, - { - "id": "3e1ba03d.f01d8", - "type": "ui_group", - "z": "", - "name": "Sample Identification", - "tab": "737ec584.2eea2c", - "order": 1, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "52159161.72187", - "type": "ui_group", - "name": "Group 1", - "tab": "737ec584.2eea2c", - "order": 5, - "disp": true, - "width": 24 - }, - { - "id": "8cfadfab.327d7", - "type": "ui_group", - "z": "", - "name": "Commad", - "tab": "737ec584.2eea2c", - "order": 6, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "cef1e703.bcf3c8", - "type": "ui_group", - "z": "", - "name": "Spatio Temporal", - "tab": "737ec584.2eea2c", - "order": 4, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "fbd92986.1028c8", - "type": "ui_group", - "z": "", - "name": "Focus Adjustment", - "tab": "737ec584.2eea2c", - "order": 2, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "707d9797.c8e798", - "type": "ui_group", - "z": "", - "name": "Fluidic Manual Manipulation", - "tab": "737ec584.2eea2c", - "order": 3, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "b77ffa1b.942258", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "127.0.0.1", - "port": "1883", - "clientid": "test", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "cb2f36fe.1c7038", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "0.0.0.0", - "port": "1883", - "clientid": "Client_node", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "737ec584.2eea2c", - "type": "ui_tab", - "z": "", - "name": "Sample", - "icon": "fa-eyedropper", - "order": 2, - "disabled": false, - "hidden": false - } -] From 9ab84b8a1c7d7dd285e1c4897bce8dcdfd0e93f6 Mon Sep 17 00:00:00 2001 From: tpollina Date: Tue, 14 Jul 2020 18:22:05 +0200 Subject: [PATCH 21/48] Delete flow_villefranche.json --- flows/flow_villefranche.json | 4807 ---------------------------------- 1 file changed, 4807 deletions(-) delete mode 100644 flows/flow_villefranche.json diff --git a/flows/flow_villefranche.json b/flows/flow_villefranche.json deleted file mode 100644 index 55de97d..0000000 --- a/flows/flow_villefranche.json +++ /dev/null @@ -1,4807 +0,0 @@ -[ - { - "id": "eaae323a.31b3", - "type": "tab", - "label": "Home", - "disabled": false, - "info": "" - }, - { - "id": "b771c342.49603", - "type": "tab", - "label": "Sample", - "disabled": false, - "info": "" - }, - { - "id": "bccd1f23.87219", - "type": "tab", - "label": "Optic Configuration", - "disabled": false, - "info": "" - }, - { - "id": "baa1e3d9.cb29d", - "type": "tab", - "label": "Fluidic Acquisition", - "disabled": false, - "info": "" - }, - { - "id": "cb95299c.2817c8", - "type": "tab", - "label": "Segmentation", - "disabled": false, - "info": "" - }, - { - "id": "c1660bc.e7ff7f8", - "type": "tab", - "label": "Gallery", - "disabled": false, - "info": "" - }, - { - "id": "1371dec5.76e671", - "type": "tab", - "label": "Settings", - "disabled": false, - "info": "" - }, - { - "id": "da2c279f.cbe318", - "type": "ui_group", - "z": "", - "name": "Controller", - "tab": null, - "order": 6, - "disp": true, - "width": 6, - "collapse": false - }, - { - "id": "833bc5bb.217ba8", - "type": "ui_group", - "z": "", - "name": "Preview", - "tab": "181bb236.1e94be", - "order": 1, - "disp": true, - "width": 14, - "collapse": false - }, - { - "id": "3a6bb13f.c9703e", - "type": "ui_tab", - "z": "", - "name": "Home", - "icon": "home", - "order": 1, - "disabled": false, - "hidden": false - }, - { - "id": "181bb236.1e94be", - "type": "ui_tab", - "z": "", - "name": "Optic Configuration", - "icon": "fa-eye", - "order": 3, - "disabled": false, - "hidden": false - }, - { - "id": "c9194f02.9d5e9", - "type": "ui_tab", - "z": "", - "name": "Fluidic Acquisition", - "icon": "fa-flask", - "order": 4, - "disabled": false, - "hidden": false - }, - { - "id": "8d16beb8.9b3fb", - "type": "ui_tab", - "z": "", - "name": "Segmentation", - "icon": "fa-crop", - "order": 5, - "disabled": false, - "hidden": false - }, - { - "id": "d9cd733b.ab73d", - "type": "ui_tab", - "z": "", - "name": "Settings", - "icon": "fa-cogs", - "order": 7, - "disabled": false, - "hidden": false - }, - { - "id": "4248342d.e55fac", - "type": "ui_group", - "z": "", - "name": "Optic Characterization", - "tab": "181bb236.1e94be", - "order": 2, - "disp": true, - "width": 10, - "collapse": false - }, - { - "id": "858a0e3c.987fe", - "type": "ui_group", - "z": "", - "name": "Preview", - "tab": "c9194f02.9d5e9", - "order": 1, - "disp": true, - "width": "14", - "collapse": false - }, - { - "id": "64903b47.4034e4", - "type": "ui_group", - "name": "Group 1", - "tab": "8d16beb8.9b3fb", - "order": 1, - "disp": true, - "width": 6 - }, - { - "id": "3da7da8f.179606", - "type": "ui_group", - "z": "", - "name": "Processor", - "tab": "d9cd733b.ab73d", - "order": 1, - "disp": true, - "width": "6", - "collapse": false - }, - { - "id": "cc8bc4eb.651868", - "type": "ui_base", - "theme": { - "name": "theme-dark", - "lightTheme": { - "default": "#0094CE", - "baseColor": "#5900ce", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", - "edited": false, - "reset": false - }, - "darkTheme": { - "default": "#097479", - "baseColor": "#097479", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", - "edited": true, - "reset": false - }, - "customTheme": { - "name": "Untitled Theme 1", - "default": "#4B7930", - "baseColor": "#4B7930", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" - }, - "themeState": { - "base-color": { - "default": "#097479", - "value": "#097479", - "edited": true - }, - "page-titlebar-backgroundColor": { - "value": "#097479", - "edited": false - }, - "page-backgroundColor": { - "value": "#111111", - "edited": false - }, - "page-sidebar-backgroundColor": { - "value": "#000000", - "edited": false - }, - "group-textColor": { - "value": "#0eb8c0", - "edited": false - }, - "group-borderColor": { - "value": "#555555", - "edited": false - }, - "group-backgroundColor": { - "value": "#333333", - "edited": false - }, - "widget-textColor": { - "value": "#eeeeee", - "edited": false - }, - "widget-backgroundColor": { - "value": "#097479", - "edited": false - }, - "widget-borderColor": { - "value": "#333333", - "edited": false - }, - "base-font": { - "value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" - } - }, - "angularTheme": { - "primary": "indigo", - "accents": "blue", - "warn": "red", - "background": "grey" - } - }, - "site": { - "name": "Node-RED Dashboard", - "hideToolbar": "false", - "allowSwipe": "false", - "lockMenu": "true", - "allowTempTheme": "true", - "dateFormat": "DD/MM/YYYY", - "sizes": { - "sx": 56, - "sy": 56, - "gx": 5, - "gy": 5, - "cx": 5, - "cy": 5, - "px": 5, - "py": 5 - } - } - }, - { - "id": "36739a35.7cce36", - "type": "ui_tab", - "z": "", - "name": "Gallery", - "icon": "fa fa-file-image-o", - "order": 6, - "disabled": false, - "hidden": false - }, - { - "id": "c0ebfc57.42527", - "type": "ui_group", - "name": "Group 1", - "tab": "36739a35.7cce36", - "order": 1, - "disp": true, - "width": 6 - }, - { - "id": "737ec584.2eea2c", - "type": "ui_tab", - "z": "", - "name": "Sample", - "icon": "fa-eyedropper", - "order": 2, - "disabled": false, - "hidden": false - }, - { - "id": "6f97e7ae.270c48", - "type": "ui_group", - "z": "", - "name": "Group 1", - "tab": "3a6bb13f.c9703e", - "order": 1, - "disp": false, - "width": "4", - "collapse": false - }, - { - "id": "3e1ba03d.f01d8", - "type": "ui_group", - "z": "", - "name": "Sample Identification", - "tab": "737ec584.2eea2c", - "order": 1, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "4e0cd5ea.17e59c", - "type": "ui_group", - "z": "", - "name": "Group 2", - "tab": "3a6bb13f.c9703e", - "order": 2, - "disp": false, - "width": "4", - "collapse": false - }, - { - "id": "ef590206.24f6", - "type": "ui_group", - "z": "", - "name": "Group 3", - "tab": "3a6bb13f.c9703e", - "order": 3, - "disp": false, - "width": "4", - "collapse": false - }, - { - "id": "ae8f6620.073358", - "type": "ui_group", - "z": "", - "name": "Group 4", - "tab": "3a6bb13f.c9703e", - "order": 4, - "disp": false, - "width": "4", - "collapse": false - }, - { - "id": "196518b2.4d53b7", - "type": "ui_group", - "z": "", - "name": "Group 5", - "tab": "3a6bb13f.c9703e", - "order": 5, - "disp": false, - "width": "4", - "collapse": false - }, - { - "id": "777a7c33.fcd804", - "type": "ui_group", - "z": "", - "name": "Group 6", - "tab": "3a6bb13f.c9703e", - "order": 6, - "disp": false, - "width": "4", - "collapse": false - }, - { - "id": "cef1e703.bcf3c8", - "type": "ui_group", - "z": "", - "name": "Spatio Temporal", - "tab": "737ec584.2eea2c", - "order": 2, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "5517c651.b2f668", - "type": "ui_group", - "z": "", - "name": "Validation", - "tab": "737ec584.2eea2c", - "order": 3, - "disp": false, - "width": 24, - "collapse": false - }, - { - "id": "fbd92986.1028c8", - "type": "ui_group", - "z": "", - "name": "Focus Adjustment", - "tab": "181bb236.1e94be", - "order": 3, - "disp": true, - "width": 10, - "collapse": false - }, - { - "id": "707d9797.c8e798", - "type": "ui_group", - "z": "", - "name": "Fluidic Manual Manipulation", - "tab": "181bb236.1e94be", - "order": 4, - "disp": true, - "width": 14, - "collapse": false - }, - { - "id": "7a0b4877.a5d268", - "type": "ui_group", - "z": "", - "name": "Validation", - "tab": "181bb236.1e94be", - "order": 5, - "disp": false, - "width": "10", - "collapse": false - }, - { - "id": "567a49a4.244cb8", - "type": "ui_group", - "z": "", - "name": "Generic Information", - "tab": "c9194f02.9d5e9", - "order": 4, - "disp": true, - "width": 10, - "collapse": false - }, - { - "id": "404c301a.19c4e", - "type": "ui_group", - "z": "", - "name": "Fraction size", - "tab": "c9194f02.9d5e9", - "order": 3, - "disp": true, - "width": "10", - "collapse": false - }, - { - "id": "4322c187.e73e5", - "type": "ui_group", - "z": "", - "name": "Acquisition", - "tab": "c9194f02.9d5e9", - "order": 4, - "disp": true, - "width": 10, - "collapse": false - }, - { - "id": "b7919ae2.c01788", - "type": "ui_group", - "z": "", - "name": "Validation", - "tab": "c9194f02.9d5e9", - "order": 5, - "disp": false, - "width": 14, - "collapse": false - }, - { - "id": "b5d61bc7.54fe48", - "type": "ui_group", - "z": "", - "name": "Group 6", - "tab": "c9194f02.9d5e9", - "order": 6, - "disp": false, - "width": 10, - "collapse": false - }, - { - "id": "1be83144.4fe4bf", - "type": "ui_group", - "z": "", - "name": "Group 2", - "tab": "d9cd733b.ab73d", - "order": 6, - "disp": false, - "width": 24, - "collapse": false - }, - { - "id": "3ca00bf9.e5cac4", - "type": "ui_group", - "z": "", - "name": "Group 3", - "tab": "d9cd733b.ab73d", - "order": 5, - "disp": false, - "width": "24", - "collapse": false - }, - { - "id": "b5ba3f26.2e722", - "type": "ui_group", - "z": "", - "name": "CPU Temperature", - "tab": "d9cd733b.ab73d", - "order": 2, - "disp": true, - "width": "6", - "collapse": false - }, - { - "id": "806d69c8.67fc58", - "type": "ui_group", - "z": "", - "name": "Memory", - "tab": "d9cd733b.ab73d", - "order": 3, - "disp": true, - "width": "6", - "collapse": false - }, - { - "id": "405183bc.d8991c", - "type": "ui_group", - "z": "", - "name": "Disk Usage", - "tab": "d9cd733b.ab73d", - "order": 4, - "disp": true, - "width": "6", - "collapse": false - }, - { - "id": "4e78af2d.90be7", - "type": "ui_ui_control", - "z": "eaae323a.31b3", - "name": "", - "events": "change", - "x": 520, - "y": 60, - "wires": [ - [] - ] - }, - { - "id": "2a65c3ec.49a6bc", - "type": "function", - "z": "eaae323a.31b3", - "name": "swtich tab", - "func": "\nmsg.payload={\"tab\":msg.payload};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 360, - "y": 60, - "wires": [ - [ - "4e78af2d.90be7" - ] - ] - }, - { - "id": "9d6abe67.6bb3d", - "type": "ui_button", - "z": "cb95299c.2817c8", - "name": "", - "group": "64903b47.4034e4", - "order": 0, - "width": 0, - "height": 0, - "passthru": false, - "label": "Home", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "home", - "payload": "", - "payloadType": "str", - "topic": "Home", - "x": 70, - "y": 40, - "wires": [ - [ - "7be6422d.73949c" - ] - ] - }, - { - "id": "f0fb77cf.8f1c28", - "type": "ui_ui_control", - "z": "cb95299c.2817c8", - "name": "", - "events": "change", - "x": 380, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "7be6422d.73949c", - "type": "function", - "z": "cb95299c.2817c8", - "name": "change tab", - "func": "\nmsg.payload={\"tab\":msg.topic};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 40, - "wires": [ - [ - "f0fb77cf.8f1c28" - ] - ] - }, - { - "id": "a66e925b.4155c", - "type": "ui_button", - "z": "1371dec5.76e671", - "name": "", - "group": "3ca00bf9.e5cac4", - "order": 1, - "width": 4, - "height": 1, - "passthru": false, - "label": "Home", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "home", - "payload": "", - "payloadType": "str", - "topic": "Home", - "x": 70, - "y": 40, - "wires": [ - [ - "75975366.93d6cc" - ] - ] - }, - { - "id": "60fd157b.8a5aac", - "type": "ui_ui_control", - "z": "1371dec5.76e671", - "name": "", - "events": "change", - "x": 380, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "75975366.93d6cc", - "type": "function", - "z": "1371dec5.76e671", - "name": "change tab", - "func": "\nmsg.payload={\"tab\":msg.topic};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 220, - "y": 40, - "wires": [ - [ - "60fd157b.8a5aac" - ] - ] - }, - { - "id": "2c8c45ab.610c0a", - "type": "ui_gauge", - "z": "1371dec5.76e671", - "name": "", - "group": "b5ba3f26.2e722", - "order": 1, - "width": 0, - "height": 0, - "gtype": "gage", - "title": "CPU Temperature", - "label": "C", - "format": "{{value}}", - "min": "35", - "max": "55", - "colors": [ - "#00b500", - "#e6e600", - "#ca3838" - ], - "seg1": "", - "seg2": "", - "x": 510, - "y": 80, - "wires": [] - }, - { - "id": "ddcbbfa5.cd158", - "type": "exec", - "z": "1371dec5.76e671", - "command": "vcgencmd measure_temp | tr -d \"temp=\" | tr -d \"'C\" | tr -d \"\\n\"", - "addpay": false, - "append": "", - "useSpawn": "", - "timer": "", - "name": "RPi Temp.", - "x": 310, - "y": 100, - "wires": [ - [ - "bc503fa5.f46dd", - "2c8c45ab.610c0a", - "cef370c7.1f7a" - ], - [], - [] - ] - }, - { - "id": "704faf02.a00b8", - "type": "inject", - "z": "1371dec5.76e671", - "name": "", - "topic": "ouquoi", - "payload": "", - "payloadType": "date", - "repeat": "10", - "crontab": "", - "once": false, - "onceDelay": "", - "x": 110, - "y": 100, - "wires": [ - [ - "ddcbbfa5.cd158", - "55749fd8.3aca5", - "c2b8d8b.0d90328" - ] - ] - }, - { - "id": "cef370c7.1f7a", - "type": "ui_chart", - "z": "1371dec5.76e671", - "name": "", - "group": "b5ba3f26.2e722", - "order": 2, - "width": 0, - "height": 0, - "label": "", - "chartType": "line", - "legend": "false", - "xformat": "HH:mm:ss", - "interpolate": "linear", - "nodata": "", - "dot": false, - "ymin": "", - "ymax": "", - "removeOlder": "20", - "removeOlderPoints": "200", - "removeOlderUnit": "60", - "cutout": 0, - "useOneColor": false, - "colors": [ - "#1f77b4", - "#aec7e8", - "#ff7f0e", - "#2ca02c", - "#98df8a", - "#d62728", - "#ff9896", - "#9467bd", - "#c5b0d5" - ], - "useOldStyle": true, - "outputs": 1, - "x": 470, - "y": 120, - "wires": [ - [] - ] - }, - { - "id": "55749fd8.3aca5", - "type": "exec", - "z": "1371dec5.76e671", - "command": "top -d 0.5 -b -n2 | grep \"Cpu(s)\"|tail -n 1 | awk '{print $2 + $4}' | tr -d \"\\n\"", - "addpay": false, - "append": "", - "useSpawn": "", - "timer": "", - "name": "CPU Load", - "x": 270, - "y": 200, - "wires": [ - [ - "e046247c.c466e8", - "4b2b9a70.6a9af4" - ], - [], - [] - ] - }, - { - "id": "c2b8d8b.0d90328", - "type": "exec", - "z": "1371dec5.76e671", - "command": "free | grep Mem | awk '{print 100*($4+$6+$7)/$2}' | awk -F \".\" '{print $1}' | tr -d \"\\n\"", - "addpay": false, - "append": "", - "useSpawn": "", - "timer": "", - "name": "Free Memory", - "x": 280, - "y": 300, - "wires": [ - [ - "e84f6e08.5d147", - "c7c8d192.3df27" - ], - [], - [] - ] - }, - { - "id": "e046247c.c466e8", - "type": "ui_gauge", - "z": "1371dec5.76e671", - "name": "", - "group": "3da7da8f.179606", - "order": 1, - "width": 0, - "height": 0, - "gtype": "gage", - "title": "Processor", - "label": "CPU", - "format": "{{value}}", - "min": 0, - "max": "100", - "colors": [ - "#00b500", - "#e6e600", - "#ca3838" - ], - "seg1": "", - "seg2": "", - "x": 480, - "y": 180, - "wires": [] - }, - { - "id": "e84f6e08.5d147", - "type": "ui_gauge", - "z": "1371dec5.76e671", - "name": "", - "group": "806d69c8.67fc58", - "order": 1, - "width": 0, - "height": 0, - "gtype": "gage", - "title": "Memory", - "label": "RAM", - "format": "{{value}}", - "min": 0, - "max": "200", - "colors": [ - "#00b500", - "#e6e600", - "#ca3838" - ], - "seg1": "", - "seg2": "", - "x": 480, - "y": 280, - "wires": [] - }, - { - "id": "3910d662.fa1f7a", - "type": "exec", - "z": "1371dec5.76e671", - "command": "df -h | grep /dev/root | awk -F ' ' '{print $3}' | tr -d G | tr \"\\n$\" \"\\ \" | sed 's/,/./' | tr -d \" \" ", - "addpay": false, - "append": "", - "useSpawn": "", - "timer": "", - "name": "Disk Usage", - "x": 270, - "y": 400, - "wires": [ - [ - "45e1912a.36a23", - "84ac8611.1a6ac8" - ], - [], - [] - ] - }, - { - "id": "45e1912a.36a23", - "type": "ui_gauge", - "z": "1371dec5.76e671", - "name": "", - "group": "405183bc.d8991c", - "order": 1, - "width": 0, - "height": 0, - "gtype": "gage", - "title": "Disk", - "label": "Go", - "format": "{{value}}", - "min": 0, - "max": "256", - "colors": [ - "#00b500", - "#e6e600", - "#ca3838" - ], - "seg1": "", - "seg2": "", - "x": 470, - "y": 380, - "wires": [] - }, - { - "id": "4b2b9a70.6a9af4", - "type": "ui_chart", - "z": "1371dec5.76e671", - "name": "", - "group": "3da7da8f.179606", - "order": 2, - "width": 0, - "height": 0, - "label": "", - "chartType": "line", - "legend": "false", - "xformat": "HH:mm:ss", - "interpolate": "linear", - "nodata": "", - "dot": false, - "ymin": "", - "ymax": "", - "removeOlder": "20", - "removeOlderPoints": "", - "removeOlderUnit": "60", - "cutout": 0, - "useOneColor": false, - "colors": [ - "#1f77b4", - "#aec7e8", - "#ff7f0e", - "#2ca02c", - "#98df8a", - "#d62728", - "#ff9896", - "#9467bd", - "#c5b0d5" - ], - "useOldStyle": true, - "outputs": 1, - "x": 470, - "y": 220, - "wires": [ - [] - ] - }, - { - "id": "c7c8d192.3df27", - "type": "ui_chart", - "z": "1371dec5.76e671", - "name": "", - "group": "806d69c8.67fc58", - "order": 2, - "width": 0, - "height": 0, - "label": "", - "chartType": "line", - "legend": "false", - "xformat": "HH:mm:ss", - "interpolate": "linear", - "nodata": "", - "dot": false, - "ymin": "", - "ymax": "", - "removeOlder": "20", - "removeOlderPoints": "", - "removeOlderUnit": "60", - "cutout": 0, - "useOneColor": false, - "colors": [ - "#1f77b4", - "#aec7e8", - "#ff7f0e", - "#2ca02c", - "#98df8a", - "#d62728", - "#ff9896", - "#9467bd", - "#c5b0d5" - ], - "useOldStyle": true, - "outputs": 1, - "x": 470, - "y": 320, - "wires": [ - [] - ] - }, - { - "id": "84ac8611.1a6ac8", - "type": "ui_chart", - "z": "1371dec5.76e671", - "name": "", - "group": "405183bc.d8991c", - "order": 2, - "width": 0, - "height": 0, - "label": "", - "chartType": "line", - "legend": "false", - "xformat": "HH:mm:ss", - "interpolate": "linear", - "nodata": "", - "dot": false, - "ymin": "", - "ymax": "", - "removeOlder": "4", - "removeOlderPoints": "", - "removeOlderUnit": "3600", - "cutout": 0, - "useOneColor": false, - "colors": [ - "#1f77b4", - "#aec7e8", - "#ff7f0e", - "#2ca02c", - "#98df8a", - "#d62728", - "#ff9896", - "#9467bd", - "#c5b0d5" - ], - "useOldStyle": true, - "outputs": 1, - "x": 470, - "y": 420, - "wires": [ - [] - ] - }, - { - "id": "1cd5b4c0.46af9b", - "type": "inject", - "z": "1371dec5.76e671", - "name": "", - "topic": "", - "payload": "", - "payloadType": "date", - "repeat": "60", - "crontab": "", - "once": false, - "onceDelay": "", - "x": 90, - "y": 280, - "wires": [ - [ - "3910d662.fa1f7a" - ] - ] - }, - { - "id": "96bbe41d.ee7928", - "type": "ui_switch", - "z": "1371dec5.76e671", - "name": "light_state", - "label": "Light", - "tooltip": "", - "group": "3ca00bf9.e5cac4", - "order": 2, - "width": 3, - "height": 1, - "passthru": true, - "decouple": "false", - "topic": "", - "style": "", - "onvalue": "on", - "onvalueType": "str", - "onicon": "wb_incandescent", - "oncolor": "red", - "offvalue": "off", - "offvalueType": "str", - "officon": "", - "offcolor": "blue", - "x": 1050, - "y": 140, - "wires": [ - [ - "51145654.0ce2d8" - ] - ] - }, - { - "id": "8485d05.444903", - "type": "ui_switch", - "z": "1371dec5.76e671", - "name": "fan_state", - "label": "Fan", - "tooltip": "", - "group": "3ca00bf9.e5cac4", - "order": 3, - "width": 3, - "height": 1, - "passthru": true, - "decouple": "false", - "topic": "", - "style": "", - "onvalue": "on", - "onvalueType": "str", - "onicon": "", - "oncolor": "", - "offvalue": "off", - "offvalueType": "str", - "officon": "", - "offcolor": "", - "x": 1040, - "y": 80, - "wires": [ - [ - "2549f778.4eb828" - ] - ] - }, - { - "id": "2549f778.4eb828", - "type": "python3-function", - "z": "1371dec5.76e671", - "name": "fan.py", - "func": "#!/usr/bin/python\nimport smbus\nimport sys\n\nstate = msg[\"payload\"]\n\nbus = smbus.SMBus(1)\n\nDEVICE_ADDRESS = 0x0d\n\nif state == \"off\":\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\nif state == \"on\":\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)", - "outputs": 1, - "x": 1190, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "a113b518.830008", - "type": "ui_button", - "z": "1371dec5.76e671", - "name": "", - "group": "3ca00bf9.e5cac4", - "order": 4, - "width": 7, - "height": 1, - "passthru": false, - "label": "Reboot", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "reboot", - "x": 720, - "y": 320, - "wires": [ - [ - "ee57d11c.ed1dd", - "d9234d01.e630d" - ] - ] - }, - { - "id": "d9a924bc.0ca078", - "type": "exec", - "z": "1371dec5.76e671", - "command": "sudo", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "2", - "oldrc": false, - "name": "cmd", - "x": 1030, - "y": 320, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "51145654.0ce2d8", - "type": "python3-function", - "z": "1371dec5.76e671", - "name": "light.py", - "func": "import RPi.GPIO as GPIO\n\nGPIO.setmode(GPIO.BCM)\nGPIO.setwarnings(False)\nGPIO.setup(21,GPIO.OUT)\n\nstate = msg[\"payload\"]\n\n \nif state == \"on\":\n GPIO.output(21,GPIO.HIGH)\nif state == \"off\":\n GPIO.output(21,GPIO.LOW)", - "outputs": 1, - "x": 1200, - "y": 140, - "wires": [ - [] - ] - }, - { - "id": "552d8bbb.cc4ca4", - "type": "ui_button", - "z": "1371dec5.76e671", - "name": "", - "group": "3ca00bf9.e5cac4", - "order": 5, - "width": 7, - "height": 1, - "passthru": false, - "label": "Shutdown", - "tooltip": "", - "color": "", - "bgcolor": "#AD1625", - "icon": "", - "payload": "off", - "payloadType": "str", - "topic": "shutdown", - "x": 720, - "y": 380, - "wires": [ - [ - "ee57d11c.ed1dd", - "d9234d01.e630d" - ] - ] - }, - { - "id": "3517d063.27073", - "type": "link in", - "z": "1371dec5.76e671", - "name": "", - "links": [ - "ec8da7a8.0eb558", - "d9234d01.e630d" - ], - "x": 895, - "y": 140, - "wires": [ - [ - "96bbe41d.ee7928", - "8485d05.444903" - ] - ] - }, - { - "id": "ee57d11c.ed1dd", - "type": "python3-function", - "z": "1371dec5.76e671", - "name": "action", - "func": "#!/usr/bin/python\nimport smbus\nimport time\nbus = smbus.SMBus(1)\ntime.sleep(1)\n#turn off fan RGB\nbus.write_byte_data(0x0d, 0x07, 0x00)\nbus.write_byte_data(0x0d, 0x07, 0x00)\n\nmsg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg", - "outputs": 1, - "x": 870, - "y": 340, - "wires": [ - [ - "b7ab1ada.1f4158", - "d9a924bc.0ca078" - ] - ] - }, - { - "id": "b7ab1ada.1f4158", - "type": "exec", - "z": "1371dec5.76e671", - "command": "i2cdetect -y 1", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "1", - "oldrc": false, - "name": "i2c update", - "x": 1050, - "y": 380, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "d9234d01.e630d", - "type": "link out", - "z": "1371dec5.76e671", - "name": "", - "links": [ - "3517d063.27073" - ], - "x": 835, - "y": 280, - "wires": [] - }, - { - "id": "bc503fa5.f46dd", - "type": "switch", - "z": "1371dec5.76e671", - "name": "", - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "gt", - "v": "45", - "vt": "num" - }, - { - "t": "lte", - "v": "38", - "vt": "num" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 670, - "y": 80, - "wires": [ - [ - "a25d6486.e1ce28" - ], - [ - "5d4f3e71.1bad4" - ] - ] - }, - { - "id": "5d4f3e71.1bad4", - "type": "change", - "z": "1371dec5.76e671", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "off", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 840, - "y": 100, - "wires": [ - [ - "8485d05.444903" - ] - ] - }, - { - "id": "a25d6486.e1ce28", - "type": "change", - "z": "1371dec5.76e671", - "name": "", - "rules": [ - { - "t": "set", - "p": "payload", - "pt": "msg", - "to": "on", - "tot": "str" - } - ], - "action": "", - "property": "", - "from": "", - "to": "", - "reg": false, - "x": 840, - "y": 60, - "wires": [ - [ - "8485d05.444903" - ] - ] - }, - { - "id": "37507791.4d5508", - "type": "http request", - "z": "1371dec5.76e671", - "name": "toggle timelapse", - "method": "GET", - "ret": "txt", - "paytoqs": false, - "url": "http://127.0.0.1/html/cmd_pipe.php?cmd={{{payload}}}", - "tls": "", - "persist": false, - "proxy": "", - "authType": "", - "x": 240, - "y": 780, - "wires": [ - [] - ] - }, - { - "id": "b9ff73e.19bd49", - "type": "ui_switch", - "z": "1371dec5.76e671", - "d": true, - "name": "timelapse", - "label": "toggle acquisition", - "tooltip": "", - "group": "1be83144.4fe4bf", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "decouple": "false", - "topic": "toggle", - "style": "", - "onvalue": "tl 1", - "onvalueType": "str", - "onicon": "", - "oncolor": "", - "offvalue": "tl 0", - "offvalueType": "str", - "officon": "", - "offcolor": "", - "x": 80, - "y": 660, - "wires": [ - [ - "37507791.4d5508", - "df47f1bb.1b0bf" - ] - ] - }, - { - "id": "9a52e6b.cbbc118", - "type": "exec", - "z": "1371dec5.76e671", - "command": "ls -l /var/www/html/media | grep \"th\" | tail -1 | awk -F \" \" '{print $9}' | tr -d \"\\n\"", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "get thumbail name", - "x": 770, - "y": 720, - "wires": [ - [ - "ca6bfbdf.4a71e8" - ], - [], - [] - ] - }, - { - "id": "df47f1bb.1b0bf", - "type": "switch", - "z": "1371dec5.76e671", - "name": "", - "property": "payload", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "tl 0", - "vt": "str" - }, - { - "t": "eq", - "v": "tl 1", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 230, - "y": 660, - "wires": [ - [ - "1cf57a24.20b176" - ], - [ - "faa67658.8edf18", - "c4524676.63b608" - ] - ] - }, - { - "id": "faa67658.8edf18", - "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, - "x": 420, - "y": 720, - "wires": [ - [ - "9a52e6b.cbbc118" - ] - ] - }, - { - "id": "ca6bfbdf.4a71e8", - "type": "ui_template", - "z": "1371dec5.76e671", - "d": true, - "group": "1be83144.4fe4bf", - "name": "", - "order": 2, - "width": 0, - "height": 0, - "format": "
\n\n\n", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 980, - "y": 700, - "wires": [ - [] - ] - }, - { - "id": "3e73267.51682da", - "type": "exec", - "z": "1371dec5.76e671", - "command": "i2cdetect -y 1", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "1", - "oldrc": false, - "name": "i2c update", - "x": 750, - "y": 620, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "e8c9d8e.f1d5428", - "type": "python3-function", - "z": "1371dec5.76e671", - "name": "wait RGB", - "func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\n \nreturn msg;", - "outputs": 1, - "x": 560, - "y": 600, - "wires": [ - [ - "3e73267.51682da" - ] - ] - }, - { - "id": "1cf57a24.20b176", - "type": "function", - "z": "1371dec5.76e671", - "name": "set free", - "func": "global.set(\"state\",\"free\");\nreturn msg", - "outputs": 1, - "noerr": 0, - "x": 420, - "y": 600, - "wires": [ - [ - "e8c9d8e.f1d5428" - ] - ] - }, - { - "id": "e3b347e3.b19f98", - "type": "python3-function", - "z": "1371dec5.76e671", - "name": "actuate RGB", - "func": "import smbus\nbus = smbus.SMBus(1)\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, 255)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 255)\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, 255)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 255)\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, 255)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 255)\nreturn msg;", - "outputs": 1, - "x": 570, - "y": 660, - "wires": [ - [ - "3e73267.51682da" - ] - ] - }, - { - "id": "c4524676.63b608", - "type": "function", - "z": "1371dec5.76e671", - "name": "set busy", - "func": "global.set(\"state\",\"busy\");\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 420, - "y": 660, - "wires": [ - [ - "e3b347e3.b19f98" - ] - ] - }, - { - "id": "6a84252a.d52a0c", - "type": "ui_template", - "z": "bccd1f23.87219", - "group": "833bc5bb.217ba8", - "name": "Stream Pi Camera", - "order": 1, - "width": 14, - "height": 9, - "format": "
\n", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 110, - "y": 100, - "wires": [ - [] - ] - }, - { - "id": "dc48dc42.98d18", - "type": "function", - "z": "bccd1f23.87219", - "name": "set global", - "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 1480, - "y": 400, - "wires": [ - [] - ] - }, - { - "id": "5b043fe6.df031", - "type": "function", - "z": "bccd1f23.87219", - "name": "focus.js", - "func": "state = global.get(\"state\");\n\nif (state == null){\n state=\"free\"\n}\n\n\nvar nb_step= global.get(\"nb_step\");\n\nif (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of step\"\n}\n\nelse {\n\n if(msg.topic === \"up\" & state ===\"free\"){\n nb_step = global.get(\"nb_step\");\n msg.nb_step = nb_step;\n msg.orientation = \"up\";\n msg.rgb = {r:255, g:0, b:255}\n msg.topic = \"Focus\"\n return msg;\n }\n \n if(msg.topic === \"down\" & state ===\"free\"){\n nb_step = global.get(\"nb_step\");\n msg.nb_step = nb_step;\n msg.orientation = \"down\";\n msg.rgb = {r:255, g:0, b:255}\n msg.topic = \"Focus\"\n return msg;\n }\n}\nreturn msg;\n", - "outputs": 1, - "noerr": 0, - "x": 980, - "y": 280, - "wires": [ - [ - "e7f18662.70dcf8" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "8c19fb64.8a1828", - "type": "python3-function", - "z": "bccd1f23.87219", - "name": "focus.py", - "func": "\nimport sys\n\nfrom adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nnb_step = int(msg[\"nb_step\"])\norientation = msg[\"orientation\"]\n\nkit = MotorKit()\n\nstage = kit.stepper2\n\nstage.release()\n\n#0.25mm/step\n#31um/microsteps\n\n \nif orientation == 'up':\n for i in range(nb_step):\n stage.onestep(direction=stepper.FORWARD, style=stepper.MICROSTEP)\n sleep(0.001)\n \nif orientation == 'down':\n for i in range(nb_step):\n stage.onestep(direction=stepper.BACKWARD, style=stepper.MICROSTEP)\n sleep(0.001)\n \nstage.release()\n\nmsg[\"topic\"] = \"focus\"\nmsg[\"payload\"] = \"done\"\n\nreturn msg", - "outputs": 1, - "x": 1280, - "y": 260, - "wires": [ - [ - "7b23bbd5.4483d4" - ] - ] - }, - { - "id": "21816a62.827a56", - "type": "python3-function", - "z": "bccd1f23.87219", - "name": "pump.py", - "func": "from adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nvolume = int(msg[\"volume\"])\norientation = str(msg[\"orientation\"])\nflowrate = float(msg[\"flowrate\"])\n\nkit = MotorKit()\n\npump_stepper = kit.stepper1\n\npump_stepper.release()\n\n \nif orientation == \"forward\":\n orientation=stepper.BACKWARD\nif orientation == \"backward\":\n orientation=stepper.FORWARD\n \nnb_step=volume*507 #if sleep(0.05) in between 2 steps\n#35000steps for 69g\n \n#nb_step=vol*460 if sleep(0) in between 2 steps\nduration=(volume*60)/flowrate\n \ndelay=(duration/nb_step)-0.005\n \nfor i in range(nb_step):\n pump_stepper.onestep(direction=orientation, style=stepper.DOUBLE)\n sleep(delay)\n \nsleep(1)\npump_stepper.release()\n\nmsg[\"topic\"] = \"pump\"\nmsg[\"payload\"] = \"done\"\n\nreturn msg", - "outputs": 1, - "x": 580, - "y": 220, - "wires": [ - [ - "90fc64b2.db5df8" - ] - ] - }, - { - "id": "7b68bdbe.e57094", - "type": "function", - "z": "bccd1f23.87219", - "name": "pump.js", - "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar manual_volume= global.get(\"manual_volume\");\nvar flowrate= global.get(\"flowrate\");\n\nif (manual_volume === undefined || manual_volume === \"\" || manual_volume === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume to pass\";\n \n}else if (flowrate === undefined || flowrate === \"\" || flowrate === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Flowrate\";\n \n}else {\n if(msg.topic === \"forward\" & state===\"free\"){\n volume = global.get(\"manual_volume\");\n msg.volume = volume;\n msg.orientation = \"forward\";\n msg.flowrate = global.get(\"flowrate\");\n msg.rgb = {r:0, g:255, b:255};\n msg.topic = \"Pump\"\n }\n if(msg.topic === \"backward\" & state===\"free\"){\n volume = global.get(\"manual_volume\");\n msg.volume = volume;\n msg.orientation = \"backward\";\n msg.flowrate = global.get(\"flowrate\");\n msg.rgb = {r:0, g:255, b:255};\n msg.topic = \"Pump\";\n }\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 280, - "y": 240, - "wires": [ - [ - "7994feb9.fcfc9" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "c0199136.20bd7", - "type": "link out", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "a208caf.0d23338", - "d17415a3.fca5c8" - ], - "x": 1235, - "y": 220, - "wires": [] - }, - { - "id": "da53c4c2.6b17b8", - "type": "python3-function", - "z": "bccd1f23.87219", - "name": "actuate RGB", - "func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nrgb=msg['rgb']\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nreturn msg;", - "outputs": 1, - "x": 1490, - "y": 460, - "wires": [ - [ - "1276a75f.d8d1a9" - ] - ] - }, - { - "id": "8778c73a.ddc6e8", - "type": "exec", - "z": "bccd1f23.87219", - "command": "i2cdetect -y 1", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "1", - "oldrc": false, - "name": "i2c update", - "x": 1830, - "y": 500, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "a208caf.0d23338", - "type": "link in", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "c0199136.20bd7", - "2dff3966.a5b2d6" - ], - "x": 1375, - "y": 460, - "wires": [ - [ - "da53c4c2.6b17b8" - ] - ] - }, - { - "id": "9b5cac2c.6de57", - "type": "python3-function", - "z": "bccd1f23.87219", - "name": "wait RGB", - "func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nreturn msg;", - "outputs": 1, - "x": 1480, - "y": 540, - "wires": [ - [ - "8479740e.6373c8" - ] - ] - }, - { - "id": "7b23bbd5.4483d4", - "type": "link out", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "e4351408.b0b288", - "2bc762dd.1115ce", - "a50134c.ed45ac8" - ], - "x": 1395, - "y": 260, - "wires": [] - }, - { - "id": "e4351408.b0b288", - "type": "link in", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "7b23bbd5.4483d4", - "90fc64b2.db5df8" - ], - "x": 1375, - "y": 540, - "wires": [ - [ - "9b5cac2c.6de57" - ] - ] - }, - { - "id": "2dff3966.a5b2d6", - "type": "link out", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "a208caf.0d23338", - "d17415a3.fca5c8" - ], - "x": 535, - "y": 180, - "wires": [] - }, - { - "id": "90fc64b2.db5df8", - "type": "link out", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "e4351408.b0b288", - "2bc762dd.1115ce", - "a50134c.ed45ac8" - ], - "x": 695, - "y": 220, - "wires": [] - }, - { - "id": "1276a75f.d8d1a9", - "type": "function", - "z": "bccd1f23.87219", - "name": "set busy", - "func": "global.set(\"state\",\"busy\");\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1640, - "y": 460, - "wires": [ - [ - "8778c73a.ddc6e8" - ] - ] - }, - { - "id": "8479740e.6373c8", - "type": "function", - "z": "bccd1f23.87219", - "name": "set free", - "func": "global.set(\"state\",\"free\");\nreturn msg", - "outputs": 1, - "noerr": 0, - "x": 1640, - "y": 540, - "wires": [ - [ - "8778c73a.ddc6e8" - ] - ] - }, - { - "id": "17a53f92.824d2", - "type": "ui_template", - "z": "baa1e3d9.cb29d", - "group": "567a49a4.244cb8", - "name": "Instrument", - "order": 2, - "width": 0, - "height": 0, - "format": "
\n Instrument :\n \n PlanktonScope V2.1\n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 150, - "y": 400, - "wires": [ - [] - ] - }, - { - "id": "d2b74a01.166498", - "type": "ui_template", - "z": "baa1e3d9.cb29d", - "group": "567a49a4.244cb8", - "name": "Software", - "order": 3, - "width": 0, - "height": 0, - "format": "
\n Software :\n \n Node-RED Dashboard V2.0\n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 160, - "y": 440, - "wires": [ - [] - ] - }, - { - "id": "a5c019f.91d15e8", - "type": "ui_template", - "z": "baa1e3d9.cb29d", - "group": "567a49a4.244cb8", - "name": "Camera", - "order": 1, - "width": 0, - "height": 0, - "format": "
\n Camera :\n \n Pi Camera v2.1\n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 160, - "y": 480, - "wires": [ - [] - ] - }, - { - "id": "f59a2f0d.5e9af", - "type": "ui_numeric", - "z": "baa1e3d9.cb29d", - "name": "acq_minimum_mesh", - "label": "Min fraction size (μm)", - "tooltip": "", - "group": "404c301a.19c4e", - "order": 2, - "width": 5, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "acq_minimum_mesh", - "format": "{{value}}", - "min": 0, - "max": "300", - "step": "10", - "x": 120, - "y": 100, - "wires": [ - [ - "fb887036.12429" - ] - ] - }, - { - "id": "6008a8bb.259f08", - "type": "ui_numeric", - "z": "baa1e3d9.cb29d", - "name": "acq_maximum_mesh", - "label": "Max fraction size (μm)", - "tooltip": "", - "group": "404c301a.19c4e", - "order": 3, - "width": 5, - "height": 1, - "wrap": false, - "passthru": true, - "topic": "acq_maximum_mesh", - "format": "{{value}}", - "min": "200", - "max": "2000", - "step": "100", - "x": 120, - "y": 160, - "wires": [ - [ - "fb887036.12429" - ] - ] - }, - { - "id": "6b34c456.83178c", - "type": "ui_text_input", - "z": "baa1e3d9.cb29d", - "name": "acq_id", - "label": "Acquisition unique ID*", - "tooltip": "", - "group": "4322c187.e73e5", - "order": 2, - "width": 5, - "height": 1, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "acq_id", - "x": 170, - "y": 300, - "wires": [ - [ - "a39af546.4c30c8" - ] - ] - }, - { - "id": "314ebbc0.040b84", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "store generic", - "func": "global.set(\"acq_instrument\",\"PlanktonScope V2.1\");\nglobal.set(\"acq_software\",\"Node-RED Dashboard\");\nglobal.set(\"acq_camera\",\"Pi Camera V2.1\");\nglobal.set(\"acq_instrument_ID\",\"copepode\");", - "outputs": 1, - "noerr": 0, - "x": 370, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "109cf039.1ca8d", - "type": "ui_button", - "z": "baa1e3d9.cb29d", - "name": "cancel", - "group": "b7919ae2.c01788", - "order": 3, - "width": 4, - "height": 1, - "passthru": false, - "label": "Cancel Acquisition", - "tooltip": "", - "color": "#AD1625", - "bgcolor": "white", - "icon": "pause_circle_filled", - "payload": "stop", - "payloadType": "str", - "topic": "cancel", - "x": 570, - "y": 120, - "wires": [ - [ - "c339e7a4.7e7608", - "995fa523.83cba8" - ] - ] - }, - { - "id": "dae10d44.76f08", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "pump.js", - "func": "state = global.get(\"state\");\n\nif (state == null){\n state=\"free\"\n}\n\nif(state===\"free\"||state===\"canceled\"){\n volume = global.get(\"acq_volume\");\n flowrate = global.get(\"sug_flowrate\");\n duration=(((volume*60)/flowrate)-2)*1000\n global.set(\"duration\",duration);\n \n msg.volume = volume;\n msg.orientation = \"forward\";\n msg.flowrate = flowrate;\n msg.rgb = {r:0, g:255, b:255}\n msg.state = state\n \n return msg;\n \n \n}", - "outputs": 1, - "noerr": 0, - "x": 1140, - "y": 560, - "wires": [ - [ - "d3ab1a14.86b8b8", - "ff805ffc.f9134" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "7789839d.69b48c", - "type": "ui_template", - "z": "eaae323a.31b3", - "group": "4e0cd5ea.17e59c", - "name": "Optic Configuration", - "order": 1, - "width": 4, - "height": 4, - "format": "\n \n
Optic Configuration
\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 130, - "y": 100, - "wires": [ - [ - "2a65c3ec.49a6bc" - ] - ] - }, - { - "id": "6ea6c306.f9c12c", - "type": "ui_template", - "z": "eaae323a.31b3", - "group": "ef590206.24f6", - "name": "Fluidic Acquisition", - "order": 1, - "width": 4, - "height": 4, - "format": "\n \n
Fluidic Acquisition
\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 130, - "y": 140, - "wires": [ - [ - "2a65c3ec.49a6bc" - ] - ] - }, - { - "id": "bb9eb153.9e36c", - "type": "ui_template", - "z": "eaae323a.31b3", - "group": "ae8f6620.073358", - "name": "Segmentation", - "order": 1, - "width": 4, - "height": 4, - "format": "\n \n
Segmentation
\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 140, - "y": 180, - "wires": [ - [ - "2a65c3ec.49a6bc" - ] - ] - }, - { - "id": "eaf8ee7f.96f44", - "type": "ui_template", - "z": "eaae323a.31b3", - "group": "196518b2.4d53b7", - "name": "Gallery", - "order": 1, - "width": 4, - "height": 4, - "format": "\n \n
Gallery
\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 160, - "y": 220, - "wires": [ - [ - "2a65c3ec.49a6bc" - ] - ] - }, - { - "id": "f37444ff.d17068", - "type": "ui_text_input", - "z": "bccd1f23.87219", - "name": "nb_step", - "label": "Number of step(s)", - "tooltip": "", - "group": "fbd92986.1028c8", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "nb_step", - "x": 820, - "y": 340, - "wires": [ - [ - "2f51f4e2.4dcaec" - ] - ] - }, - { - "id": "811cd88c.daf528", - "type": "ui_button", - "z": "bccd1f23.87219", - "name": "down", - "group": "fbd92986.1028c8", - "order": 3, - "width": 0, - "height": 0, - "passthru": true, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_downward", - "payload": "down", - "payloadType": "str", - "topic": "down", - "x": 830, - "y": 300, - "wires": [ - [ - "5b043fe6.df031" - ] - ] - }, - { - "id": "edda4df4.76de2", - "type": "ui_button", - "z": "bccd1f23.87219", - "name": "up", - "group": "fbd92986.1028c8", - "order": 1, - "width": 0, - "height": 0, - "passthru": false, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_upwards", - "payload": "up", - "payloadType": "str", - "topic": "up", - "x": 830, - "y": 260, - "wires": [ - [ - "5b043fe6.df031" - ] - ] - }, - { - "id": "bb667f4c.06e44", - "type": "link out", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "e4892a16.664bf8" - ], - "x": 235, - "y": 300, - "wires": [] - }, - { - "id": "e4892a16.664bf8", - "type": "link in", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "bb667f4c.06e44", - "2f51f4e2.4dcaec", - "4a0baa98.618744" - ], - "x": 1375, - "y": 400, - "wires": [ - [ - "dc48dc42.98d18" - ] - ] - }, - { - "id": "2f51f4e2.4dcaec", - "type": "link out", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "e4892a16.664bf8" - ], - "x": 975, - "y": 340, - "wires": [] - }, - { - "id": "68962547.34a67c", - "type": "ui_text_input", - "z": "bccd1f23.87219", - "name": "manual_volume", - "label": "Volume to pass (ml)", - "tooltip": "", - "group": "707d9797.c8e798", - "order": 3, - "width": 4, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "manual_volume", - "x": 100, - "y": 340, - "wires": [ - [ - "4a0baa98.618744" - ] - ] - }, - { - "id": "4a0baa98.618744", - "type": "link out", - "z": "bccd1f23.87219", - "name": "", - "links": [ - "e4892a16.664bf8" - ], - "x": 235, - "y": 340, - "wires": [] - }, - { - "id": "34c81624.df1cea", - "type": "ui_slider", - "z": "bccd1f23.87219", - "name": "flowrate", - "label": "Flowrate (ml/min)*", - "tooltip": "", - "group": "707d9797.c8e798", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "outs": "end", - "topic": "flowrate", - "min": 0, - "max": "20", - "step": "0.1", - "x": 120, - "y": 300, - "wires": [ - [ - "bb667f4c.06e44" - ] - ] - }, - { - "id": "c1b1469.9650eb8", - "type": "ui_template", - "z": "eaae323a.31b3", - "group": "777a7c33.fcd804", - "name": "Settings", - "order": 1, - "width": 4, - "height": 4, - "format": "\n \n
Settings
\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 160, - "y": 260, - "wires": [ - [ - "2a65c3ec.49a6bc" - ] - ] - }, - { - "id": "18afe75e.288219", - "type": "ui_gauge", - "z": "c1660bc.e7ff7f8", - "name": "", - "group": "c0ebfc57.42527", - "order": 1, - "width": 0, - "height": 0, - "gtype": "gage", - "title": "gauge", - "label": "units", - "format": "{{value}}", - "min": 0, - "max": 10, - "colors": [ - "#00b500", - "#e6e600", - "#ca3838" - ], - "seg1": "", - "seg2": "", - "x": 720, - "y": 280, - "wires": [] - }, - { - "id": "abafd6e6.04a5f8", - "type": "ui_template", - "z": "eaae323a.31b3", - "group": "6f97e7ae.270c48", - "name": "Sample", - "order": 1, - "width": 4, - "height": 4, - "format": "\n \n
Sample
\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 160, - "y": 60, - "wires": [ - [ - "2a65c3ec.49a6bc" - ] - ] - }, - { - "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", - "x": 190, - "y": 80, - "wires": [ - [ - "f37a955f.9eee88" - ] - ] - }, - { - "id": "fcfc31ae.af3af", - "type": "ui_dropdown", - "z": "b771c342.49603", - "name": "sample_sampling_gear", - "label": "Sampling gear", - "tooltip": "", - "place": "Select", - "group": "3e1ba03d.f01d8", - "order": 5, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "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" - } - ], - "payload": "", - "topic": "sample_sampling_gear", - "x": 150, - "y": 200, - "wires": [ - [ - "9f501f49.45645" - ] - ] - }, - { - "id": "82c5fc77.59c97", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "sample_operator", - "label": "Name of the operator", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 4, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_operator", - "x": 170, - "y": 160, - "wires": [ - [ - "f37a955f.9eee88" - ] - ] - }, - { - "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", - "x": 180, - "y": 40, - "wires": [ - [ - "f37a955f.9eee88" - ] - ] - }, - { - "id": "94eb4221.9b92c", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "sample_id", - "label": "ID of the station*", - "tooltip": "", - "group": "3e1ba03d.f01d8", - "order": 3, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "sample_id", - "x": 190, - "y": 120, - "wires": [ - [ - "f37a955f.9eee88" - ] - ] - }, - { - "id": "f37a955f.9eee88", - "type": "function", - "z": "b771c342.49603", - "name": "set global join", - "func": "var value = msg.payload.split(' ').join('_');\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 420, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "9f501f49.45645", - "type": "function", - "z": "b771c342.49603", - "name": "set global", - "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 400, - "y": 200, - "wires": [ - [] - ] - }, - { - "id": "cc0ca68b.4263a8", - "type": "ui_dropdown", - "z": "baa1e3d9.cb29d", - "name": "acq_celltype", - "label": "Thickness flowcell*", - "tooltip": "", - "place": "Select option", - "group": "404c301a.19c4e", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "200 μm µ-Slide I Luer", - "value": 200, - "type": "num" - }, - { - "label": "400 μm µ-Slide I Luer", - "value": 400, - "type": "num" - }, - { - "label": "600 μm µ-Slide I Luer", - "value": 600, - "type": "num" - }, - { - "label": "800 μm µ-Slide I Luer", - "value": 800, - "type": "num" - } - ], - "payload": "", - "topic": "acq_celltype", - "x": 150, - "y": 40, - "wires": [ - [ - "fb887036.12429", - "314ebbc0.040b84" - ] - ] - }, - { - "id": "fb887036.12429", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "set global", - "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 360, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "222c851d.5d0a3a", - "type": "ui_ui_control", - "z": "b771c342.49603", - "name": "", - "events": "change", - "x": 360, - "y": 480, - "wires": [ - [] - ] - }, - { - "id": "52f6b103.1efb6", - "type": "ui_toast", - "z": "b771c342.49603", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 790, - "y": 580, - "wires": [ - [] - ] - }, - { - "id": "986d960a.c75908", - "type": "function", - "z": "b771c342.49603", - "name": "Check form", - "func": "var sample_project= global.get(\"sample_project\");\nvar sample_ship= global.get(\"sample_ship\");\nvar sample_id= global.get(\"sample_id\");\nvar sample_operator= global.get(\"sample_operator\");\nvar sample_sampling_gear= global.get(\"sample_sampling_gear\");\nvar object_lat= global.get(\"object_lat\");\nvar object_lon= global.get(\"object_lon\");\nvar sample_day= global.get(\"sample_day\");\nvar sample_hour= global.get(\"sample_hour\");\n\nif (sample_project === undefined || sample_project === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample project\"\n}\n\nelse if (sample_ship === undefined || sample_ship === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample ship\"\n}\n\nelse if (sample_id === undefined || sample_id === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample ID\"\n}\n\nelse if (sample_operator === undefined || sample_operator === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample operator\"\n}\n\nelse if (sample_sampling_gear === undefined || sample_sampling_gear === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample sampling gear\"\n}\n\nelse if (object_lat === undefined || object_lat === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample latitude\"\n}\n\nelse if (object_lon === undefined || object_lon === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample longitude\"\n}\n\nelse if (sample_day === undefined || sample_day === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Date\"\n}\n\nelse if (sample_hour === undefined || sample_hour === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Time\"\n}\n\nelse {\n msg.topic = \"Change Tab\"\n msg.payload={\"tab\":\"Optic Configuration\"};\n}\nreturn msg;\n", - "outputs": 1, - "noerr": 0, - "x": 370, - "y": 540, - "wires": [ - [ - "f5e66a2f.0d09d8" - ] - ] - }, - { - "id": "18f44504.cac66b", - "type": "gpsd", - "z": "b771c342.49603", - "name": "", - "hostname": "localhost", - "port": "2947", - "tpv": true, - "sky": false, - "info": false, - "device": false, - "gst": false, - "att": false, - "x": 630, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "726a7822.cd6298", - "type": "ui_ui_control", - "z": "b771c342.49603", - "name": "", - "events": "change", - "x": 780, - "y": 520, - "wires": [ - [] - ] - }, - { - "id": "f5e66a2f.0d09d8", - "type": "switch", - "z": "b771c342.49603", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Change Tab", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 550, - "y": 540, - "wires": [ - [ - "726a7822.cd6298" - ], - [ - "52f6b103.1efb6" - ] - ] - }, - { - "id": "2d128018.6a809", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "object_lat", - "label": "Lattitude (decimal degrees)", - "tooltip": "", - "group": "cef1e703.bcf3c8", - "order": 1, - "width": 12, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "object_lat", - "x": 200, - "y": 260, - "wires": [ - [ - "9f501f49.45645" - ] - ] - }, - { - "id": "4626c0da.e0dd5", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "object_lon", - "label": "Longitude (decimal degrees)", - "tooltip": "", - "group": "cef1e703.bcf3c8", - "order": 2, - "width": 12, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "object_lon", - "x": 190, - "y": 300, - "wires": [ - [ - "9f501f49.45645" - ] - ] - }, - { - "id": "f00f321f.77d76", - "type": "ui_date_picker", - "z": "b771c342.49603", - "name": "", - "label": "Date", - "group": "cef1e703.bcf3c8", - "order": 4, - "width": 12, - "height": 1, - "passthru": true, - "topic": "", - "x": 210, - "y": 340, - "wires": [ - [ - "3dba84a2.0de1bc" - ] - ] - }, - { - "id": "207fbdbb.2fe2a2", - "type": "ui_text_input", - "z": "b771c342.49603", - "name": "", - "label": "Time :", - "tooltip": "", - "group": "cef1e703.bcf3c8", - "order": 3, - "width": 7, - "height": 1, - "passthru": true, - "mode": "time", - "delay": 300, - "topic": "", - "x": 210, - "y": 380, - "wires": [ - [ - "61f9d7df.83ffe8" - ] - ] - }, - { - "id": "61f9d7df.83ffe8", - "type": "function", - "z": "b771c342.49603", - "name": "set time global", - "func": "var dt = new Date(msg.payload);\nglobal.set('sample_hour',dt.getHours()-1);\nglobal.set('sample_min',dt.getMinutes());", - "outputs": 1, - "noerr": 0, - "x": 420, - "y": 380, - "wires": [ - [] - ] - }, - { - "id": "3dba84a2.0de1bc", - "type": "function", - "z": "b771c342.49603", - "name": "set date global", - "func": "var dt = new Date(msg.payload);\n\nglobal.set('sample_month',dt.getMonth() + 1);\nglobal.set('sample_day',dt.getDate());\nglobal.set('sample_year',dt.getFullYear());\n", - "outputs": 1, - "noerr": 0, - "x": 420, - "y": 340, - "wires": [ - [] - ] - }, - { - "id": "6c792043.b6ff9", - "type": "ui_ui_control", - "z": "bccd1f23.87219", - "name": "", - "events": "change", - "x": 700, - "y": 520, - "wires": [ - [] - ] - }, - { - "id": "902429eb.ceacb8", - "type": "ui_toast", - "z": "bccd1f23.87219", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 930, - "y": 620, - "wires": [ - [] - ] - }, - { - "id": "fe840e05.b46f3", - "type": "function", - "z": "bccd1f23.87219", - "name": "Check form", - "func": "var acq_fnumber_objective= global.get(\"acq_fnumber_objective\");\n\nif (acq_fnumber_objective === undefined || acq_fnumber_objective === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Focal Length of the objective\"\n}\n\nelse {\n msg.topic = \"Change Tab\"\n msg.payload={\"tab\":\"Fluidic Acquisition\"};\n}\nreturn msg;\n", - "outputs": 1, - "noerr": 0, - "x": 510, - "y": 580, - "wires": [ - [ - "652d812a.7d808" - ] - ] - }, - { - "id": "f58a0c4.e207df", - "type": "ui_ui_control", - "z": "bccd1f23.87219", - "name": "", - "events": "change", - "x": 920, - "y": 560, - "wires": [ - [] - ] - }, - { - "id": "652d812a.7d808", - "type": "switch", - "z": "bccd1f23.87219", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Change Tab", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 690, - "y": 580, - "wires": [ - [ - "f58a0c4.e207df" - ], - [ - "902429eb.ceacb8" - ] - ] - }, - { - "id": "5846b1d4.7971b", - "type": "ui_button", - "z": "bccd1f23.87219", - "name": "backward", - "group": "707d9797.c8e798", - "order": 2, - "width": 5, - "height": 1, - "passthru": false, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_back", - "payload": "backward", - "payloadType": "str", - "topic": "backward", - "x": 120, - "y": 220, - "wires": [ - [ - "7b68bdbe.e57094" - ] - ] - }, - { - "id": "2cab680b.baf888", - "type": "ui_button", - "z": "bccd1f23.87219", - "name": "foward", - "group": "707d9797.c8e798", - "order": 4, - "width": 5, - "height": 1, - "passthru": true, - "label": "", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "arrow_forward", - "payload": "forward", - "payloadType": "str", - "topic": "forward", - "x": 130, - "y": 260, - "wires": [ - [ - "7b68bdbe.e57094" - ] - ] - }, - { - "id": "961d27e7.da65c8", - "type": "ui_switch", - "z": "bccd1f23.87219", - "name": "light_state", - "label": "Light", - "tooltip": "", - "group": "4248342d.e55fac", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "decouple": "false", - "topic": "", - "style": "", - "onvalue": "1", - "onvalueType": "num", - "onicon": "", - "oncolor": "", - "offvalue": "0", - "offvalueType": "num", - "officon": "", - "offcolor": "", - "x": 90, - "y": 40, - "wires": [ - [ - "cbb8afed.0a026" - ] - ], - "icon": "font-awesome/fa-lightbulb-o" - }, - { - "id": "cc966678.da8d08", - "type": "ui_dropdown", - "z": "bccd1f23.87219", - "name": "acq_fnumber_objective", - "label": "M12 Lens*", - "tooltip": "", - "place": "Select option", - "group": "4248342d.e55fac", - "order": 2, - "width": 0, - "height": 0, - "passthru": true, - "options": [ - { - "label": "f 25mm 1/2\" 5MP IR", - "value": 25, - "type": "num" - }, - { - "label": "f 16mm 1/2.5\" 5MP IR", - "value": 16, - "type": "num" - }, - { - "label": "f 12mm 1/2.5\" 5MP IR", - "value": 12, - "type": "num" - }, - { - "label": "f 8mm 1/2.5\" 5MP IR", - "value": 8, - "type": "num" - }, - { - "label": "f 6mm 1/2.5\" 5MP IR", - "value": 6, - "type": "num" - } - ], - "payload": "", - "topic": "acq_fnumber_objective", - "x": 870, - "y": 40, - "wires": [ - [ - "8038414a.34461" - ] - ] - }, - { - "id": "9b515beb.4aea48", - "type": "ui_template", - "z": "bccd1f23.87219", - "group": "4248342d.e55fac", - "name": "Magnification", - "order": 3, - "width": 0, - "height": 0, - "format": "
\n Magnification : X\n \n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1430, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "8038414a.34461", - "type": "function", - "z": "bccd1f23.87219", - "name": "calculate", - "func": "global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1060, - "y": 40, - "wires": [ - [ - "ad87820f.b1d1e", - "d68a52ee.82e8e", - "238f26b1.e2089a", - "6e0f6d36.a6b854" - ] - ] - }, - { - "id": "eca088f.6ceed78", - "type": "ui_template", - "z": "bccd1f23.87219", - "group": "4248342d.e55fac", - "name": "Pi Camera settings", - "order": 7, - "width": 0, - "height": 0, - "format": "\n", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 850, - "y": 100, - "wires": [ - [] - ] - }, - { - "id": "3d2360ad.e41e7", - "type": "ui_template", - "z": "bccd1f23.87219", - "group": "4248342d.e55fac", - "name": "process_pixel", - "order": 4, - "width": 0, - "height": 0, - "format": "
\n Pixel resolution :\n \n μm\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1440, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "8e66977b.9166a8", - "type": "ui_template", - "z": "bccd1f23.87219", - "group": "4248342d.e55fac", - "name": "min_size", - "order": 5, - "width": 0, - "height": 0, - "format": "
\n Smallest cells to explore :\n \n μm\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1420, - "y": 120, - "wires": [ - [] - ] - }, - { - "id": "26b32f2c.c64fc", - "type": "ui_template", - "z": "bccd1f23.87219", - "group": "4248342d.e55fac", - "name": "max_size", - "order": 6, - "width": 0, - "height": 0, - "format": "
\n Biggest cells to explore :\n \n μm\n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 1420, - "y": 160, - "wires": [ - [] - ] - }, - { - "id": "ad87820f.b1d1e", - "type": "function", - "z": "bccd1f23.87219", - "name": "get magnification", - "func": "var magnification = global.get(\"magnification\");\nmsg.payload = magnification;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1250, - "y": 40, - "wires": [ - [ - "9b515beb.4aea48" - ] - ] - }, - { - "id": "d68a52ee.82e8e", - "type": "function", - "z": "bccd1f23.87219", - "name": "get process_pixel", - "func": "var process_pixel = global.get(\"process_pixel\");\nmsg.payload = process_pixel;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1250, - "y": 80, - "wires": [ - [ - "3d2360ad.e41e7" - ] - ] - }, - { - "id": "238f26b1.e2089a", - "type": "function", - "z": "bccd1f23.87219", - "name": "get sug_min", - "func": "var sug_min = global.get(\"sug_min\");\nmsg.payload = sug_min;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1230, - "y": 120, - "wires": [ - [ - "8e66977b.9166a8" - ] - ] - }, - { - "id": "6e0f6d36.a6b854", - "type": "function", - "z": "bccd1f23.87219", - "name": "get sug_max", - "func": "var sug_max = global.get(\"sug_max\");\nmsg.payload = sug_max;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1230, - "y": 160, - "wires": [ - [ - "26b32f2c.c64fc" - ] - ] - }, - { - "id": "bb2bb7ce.1d1458", - "type": "ui_template", - "z": "baa1e3d9.cb29d", - "group": "858a0e3c.987fe", - "name": "Stream Pi Camera", - "order": 1, - "width": 14, - "height": 11, - "format": "
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 590, - "y": 40, - "wires": [ - [] - ] - }, - { - "id": "d0c5b57d.590818", - "type": "ui_ui_control", - "z": "baa1e3d9.cb29d", - "name": "", - "events": "change", - "x": 700, - "y": 80, - "wires": [ - [] - ] - }, - { - "id": "2fb129de.024a06", - "type": "ui_toast", - "z": "baa1e3d9.cb29d", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 650, - "y": 540, - "wires": [ - [] - ] - }, - { - "id": "61b4993e.1f3fb8", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "Check form", - "func": "var 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 acq_volume= global.get(\"acq_volume\");\nvar acq_id= global.get(\"acq_id\");\n\nif (acq_celltype === undefined || acq_celltype === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Type of the flowcell\"\n}\nelse if (acq_minimum_mesh === undefined || acq_minimum_mesh === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Lower fraction size\"\n}\nelse if (acq_maximum_mesh === undefined || acq_maximum_mesh === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Upper fraction size\"\n}\nelse if (acq_volume === undefined || acq_volume === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume to image\"\n}\nelse if (acq_id === undefined || acq_id === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Acquisition ID\"\n}\nelse {\n msg.topic = \"Start\";\n}\nreturn msg;\n", - "outputs": 1, - "noerr": 0, - "x": 730, - "y": 280, - "wires": [ - [ - "9e7bd689.f9c278" - ] - ] - }, - { - "id": "9e7bd689.f9c278", - "type": "switch", - "z": "baa1e3d9.cb29d", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Start", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 870, - "y": 280, - "wires": [ - [ - "f7fa6acf.f6ed28" - ], - [ - "2fb129de.024a06" - ] - ] - }, - { - "id": "16de754c.cc969b", - "type": "ui_button", - "z": "b771c342.49603", - "name": "", - "group": "5517c651.b2f668", - "order": 1, - "width": 12, - "height": 1, - "passthru": false, - "label": "Previous", - "tooltip": "", - "color": "#097479", - "bgcolor": "white", - "icon": "keyboard_return", - "payload": "{\"tab\":\"Home\"}", - "payloadType": "json", - "topic": "", - "x": 220, - "y": 480, - "wires": [ - [ - "222c851d.5d0a3a" - ] - ] - }, - { - "id": "84f3d040.5f7ea", - "type": "ui_button", - "z": "b771c342.49603", - "name": "", - "group": "5517c651.b2f668", - "order": 2, - "width": 12, - "height": 1, - "passthru": false, - "label": "Continue", - "tooltip": "", - "color": "#097479", - "bgcolor": "white", - "icon": "keyboard_tab", - "payload": "{\"tab\":\"Home\"}", - "payloadType": "json", - "topic": "", - "x": 220, - "y": 540, - "wires": [ - [ - "986d960a.c75908" - ] - ] - }, - { - "id": "f61aaed5.1e64", - "type": "ui_button", - "z": "bccd1f23.87219", - "name": "", - "group": "7a0b4877.a5d268", - "order": 1, - "width": 5, - "height": 1, - "passthru": false, - "label": "Previous", - "tooltip": "", - "color": "#097479", - "bgcolor": "white", - "icon": "keyboard_return", - "payload": "{\"tab\":\"Sample\"}", - "payloadType": "json", - "topic": "", - "x": 360, - "y": 520, - "wires": [ - [ - "6c792043.b6ff9" - ] - ] - }, - { - "id": "9ba6ec0a.22c96", - "type": "ui_button", - "z": "bccd1f23.87219", - "name": "", - "group": "7a0b4877.a5d268", - "order": 2, - "width": 5, - "height": 1, - "passthru": false, - "label": "Continue", - "tooltip": "", - "color": "#097479", - "bgcolor": "white", - "icon": "keyboard_tab", - "payload": "{\"tab\":\"Home\"}", - "payloadType": "json", - "topic": "", - "x": 360, - "y": 580, - "wires": [ - [ - "fe840e05.b46f3" - ] - ] - }, - { - "id": "c72f8fae.23bd4", - "type": "ui_button", - "z": "baa1e3d9.cb29d", - "name": "", - "group": "b7919ae2.c01788", - "order": 2, - "width": 5, - "height": 1, - "passthru": false, - "label": "Previous", - "tooltip": "", - "color": "#097479", - "bgcolor": "white", - "icon": "keyboard_return", - "payload": "{\"tab\":\"Optic Configuration\"}", - "payloadType": "json", - "topic": "", - "x": 560, - "y": 80, - "wires": [ - [ - "d0c5b57d.590818" - ] - ] - }, - { - "id": "cf48a0b9.7f208", - "type": "ui_button", - "z": "baa1e3d9.cb29d", - "name": "", - "group": "b7919ae2.c01788", - "order": 5, - "width": 0, - "height": 0, - "passthru": false, - "label": "Start", - "tooltip": "", - "color": "#097479", - "bgcolor": "white", - "icon": "keyboard_tab", - "payload": "{\"tab\":\"Home\"}", - "payloadType": "json", - "topic": "", - "x": 570, - "y": 280, - "wires": [ - [ - "61b4993e.1f3fb8" - ] - ] - }, - { - "id": "389bef3.d94c61", - "type": "ui_text_input", - "z": "baa1e3d9.cb29d", - "name": "acq_volume", - "label": "Volume to pass (ml)", - "tooltip": "", - "group": "4322c187.e73e5", - "order": 1, - "width": 5, - "height": 1, - "passthru": true, - "mode": "number", - "delay": 300, - "topic": "acq_volume", - "x": 150, - "y": 220, - "wires": [ - [ - "fb887036.12429" - ] - ] - }, - { - "id": "a39af546.4c30c8", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "set global join", - "func": "var value = msg.payload.split(' ').join('_');\nvar key = msg.topic;\n\nglobal.set(key,value);", - "outputs": 1, - "noerr": 0, - "x": 380, - "y": 280, - "wires": [ - [] - ] - }, - { - "id": "75b738f0.cea208", - "type": "ui_toast", - "z": "bccd1f23.87219", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 1290, - "y": 320, - "wires": [ - [] - ] - }, - { - "id": "e7f18662.70dcf8", - "type": "switch", - "z": "bccd1f23.87219", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Focus", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 1130, - "y": 280, - "wires": [ - [ - "c0199136.20bd7", - "8c19fb64.8a1828" - ], - [ - "75b738f0.cea208" - ] - ] - }, - { - "id": "c2aeba5f.a2ac98", - "type": "ui_toast", - "z": "bccd1f23.87219", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 590, - "y": 280, - "wires": [ - [] - ] - }, - { - "id": "7994feb9.fcfc9", - "type": "switch", - "z": "bccd1f23.87219", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Pump", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 430, - "y": 240, - "wires": [ - [ - "21816a62.827a56", - "2dff3966.a5b2d6" - ], - [ - "c2aeba5f.a2ac98" - ] - ] - }, - { - "id": "201ad81d.4a6d78", - "type": "http request", - "z": "baa1e3d9.cb29d", - "name": "Start timelapse", - "method": "GET", - "ret": "txt", - "paytoqs": false, - "url": "http://127.0.0.1/html/cmd_pipe.php?cmd=tl%201", - "tls": "", - "persist": false, - "proxy": "", - "authType": "", - "x": 980, - "y": 800, - "wires": [ - [] - ] - }, - { - "id": "c339e7a4.7e7608", - "type": "http request", - "z": "baa1e3d9.cb29d", - "name": "Stop timelapse", - "method": "GET", - "ret": "txt", - "paytoqs": false, - "url": "http://127.0.0.1/html/cmd_pipe.php?cmd=tl%200", - "tls": "", - "persist": false, - "proxy": "", - "authType": "", - "x": 720, - "y": 120, - "wires": [ - [ - "eaab9f19.c68ba" - ] - ] - }, - { - "id": "b4d324de.a2bd28", - "type": "ui_worldmap", - "z": "b771c342.49603", - "group": "cef1e703.bcf3c8", - "order": 6, - "width": 0, - "height": 0, - "name": "", - "lat": "1.5", - "lon": "1.5", - "zoom": "4", - "layer": "OSM grey", - "cluster": "1", - "maxage": "", - "usermenu": "hide", - "layers": "hide", - "panit": "false", - "panlock": "false", - "zoomlock": "false", - "hiderightclick": "true", - "coords": "deg", - "showgrid": "false", - "path": "/worldmap", - "x": 780, - "y": 400, - "wires": [] - }, - { - "id": "cf3e1477.25af68", - "type": "function", - "z": "b771c342.49603", - "name": "set point", - "func": "var sample_id= global.get(\"sample_id\");\nvar object_lat= global.get(\"object_lat\");\nvar object_lon= global.get(\"object_lon\");\n\nif (sample_id === undefined || sample_id === \"\") {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample ID\"\n}\nelse if (object_lat === undefined || object_lat === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample latitude\"\n}\n\nelse if (object_lon === undefined || object_lon === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Sample longitude\"\n}\n\nelse {\n msg.topic = \"Place\"\n msg.payload={\"name\":sample_id, \"lat\":object_lat, \"lon\":object_lon}\n}\nreturn msg;\n", - "outputs": 1, - "noerr": 0, - "x": 360, - "y": 440, - "wires": [ - [ - "105e9b1b.725865" - ] - ] - }, - { - "id": "d7a44df2.0fb29", - "type": "ui_button", - "z": "b771c342.49603", - "name": "", - "group": "cef1e703.bcf3c8", - "order": 5, - "width": 5, - "height": 1, - "passthru": false, - "label": "Place", - "tooltip": "", - "color": "#333333", - "bgcolor": "white", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 210, - "y": 440, - "wires": [ - [ - "cf3e1477.25af68" - ] - ] - }, - { - "id": "105e9b1b.725865", - "type": "switch", - "z": "b771c342.49603", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Place", - "vt": "str" - }, - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 550, - "y": 440, - "wires": [ - [ - "b4d324de.a2bd28" - ], - [ - "10c9c12a.feae6f" - ] - ] - }, - { - "id": "10c9c12a.feae6f", - "type": "ui_toast", - "z": "b771c342.49603", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 790, - "y": 460, - "wires": [ - [] - ] - }, - { - "id": "32f57168.89cbae", - "type": "comment", - "z": "baa1e3d9.cb29d", - "name": "generic info", - "info": "", - "x": 150, - "y": 360, - "wires": [] - }, - { - "id": "44094d9d.62c6c4", - "type": "exec", - "z": "baa1e3d9.cb29d", - "command": "i2cdetect -y 1", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "1", - "oldrc": false, - "name": "i2c update", - "x": 1170, - "y": 120, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "eaab9f19.c68ba", - "type": "python3-function", - "z": "baa1e3d9.cb29d", - "name": "wait RGB", - "func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, 0)\nbus.write_byte_data(0x0d, 0x02, 255)\nbus.write_byte_data(0x0d, 0x03, 0)\nreturn msg;", - "outputs": 1, - "x": 880, - "y": 120, - "wires": [ - [ - "154d5ce1.81ed03" - ] - ] - }, - { - "id": "154d5ce1.81ed03", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "set free", - "func": "global.set(\"state\",\"free\");\nreturn msg", - "outputs": 1, - "noerr": 0, - "x": 1020, - "y": 120, - "wires": [ - [ - "44094d9d.62c6c4" - ] - ] - }, - { - "id": "f07dec1d.147ce", - "type": "ui_text_input", - "z": "baa1e3d9.cb29d", - "name": "comment", - "label": "Comment", - "tooltip": "", - "group": "b7919ae2.c01788", - "order": 1, - "width": 0, - "height": 0, - "passthru": true, - "mode": "text", - "delay": 300, - "topic": "comment", - "x": 160, - "y": 260, - "wires": [ - [ - "fb887036.12429" - ] - ] - }, - { - "id": "8bd55b54.8e3938", - "type": "file", - "z": "baa1e3d9.cb29d", - "name": "logs.json", - "filename": "/var/www/logs.json", - "appendNewline": false, - "createDir": false, - "overwriteFile": "false", - "encoding": "none", - "x": 2000, - "y": 1340, - "wires": [ - [ - "20a2d27e.7ccafe" - ] - ] - }, - { - "id": "99fd2803.0843a8", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "get global", - "func": "msg.payload = {\n \"comment\":global.get(\"comment\"),\n \"sample_project\":global.get(\"sample_project\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \n \"sample_hour\":global.get(\"sample_hour\"),\n \"sample_minute\":global.get(\"sample_minute\"),\n \"sample_day\":global.get(\"sample_day\"),\n \"sample_month\":global.get(\"sample_month\"),\n \"sample_year\":global.get(\"sample_year\"),\n \n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"process_pixel\":global.get(\"process_pixel\"),\n \n \"acq_camera\":global.get(\"acq_camera\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n \"acq_software\":global.get(\"acq_software\"),\n \"acq_instrument_ID\":global.get(\"acq_instrument_ID\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_flowrate\":global.get(\"sug_flowrate\")\n }\n\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1820, - "y": 1340, - "wires": [ - [ - "8bd55b54.8e3938" - ] - ] - }, - { - "id": "ae692178.d44d1", - "type": "python3-function", - "z": "baa1e3d9.cb29d", - "name": "pump.py", - "func": "from adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nkit = MotorKit()\npump_stepper = kit.stepper1\npump_stepper.release()\n\nstate = str(msg[\"state\"])\nvolume = int(msg[\"volume\"])\norientation = str(msg[\"orientation\"])\nflowrate = float(msg[\"flowrate\"])\n\n\nif(state==\"free\"):\n #35000steps will pass 69ml if sleep(0.05) in between 2 steps\n #1ml is about 35000/69=507steps\n nb_step=volume*507 \n #nb_step=vol*460 if sleep(0) in between 2 steps\n \n duration=(volume*60)/flowrate\n \n delay=(duration/nb_step)-0.005\n \nif(state==\"canceled\"):\n nb_step=0\n \nfor i in range(nb_step):\n pump_stepper.onestep(direction=stepper.BACKWARD, style=stepper.DOUBLE)\n sleep(delay)\n \nsleep(1)\npump_stepper.release()\n\nmsg[\"topic\"] = \"pump\"\nmsg[\"payload\"] = \"done\"\n\nreturn msg", - "outputs": 1, - "x": 1240, - "y": 1260, - "wires": [ - [ - "783209c7.51c5a8" - ] - ] - }, - { - "id": "a3fd6b29.2ef5f8", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "pump.js", - "func": "state = global.get(\"state\");\n\nif (state == null){\n state=\"free\"\n}\n\nif(state===\"free\"||state===\"canceled\"){\n volume = global.get(\"acq_volume\");\n flowrate = global.get(\"sug_flowrate\");\n duration=(((volume*60)/flowrate)-2)*1000\n global.set(\"duration\",duration);\n \n msg.volume = volume;\n msg.orientation = \"forward\";\n msg.flowrate = flowrate;\n msg.rgb = {r:0, g:255, b:255}\n msg.state = state\n \n return msg;\n \n \n}", - "outputs": 1, - "noerr": 0, - "x": 1040, - "y": 1360, - "wires": [ - [ - "ae692178.d44d1", - "e0f9efda.fa4ce" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "e0f9efda.fa4ce", - "type": "python3-function", - "z": "baa1e3d9.cb29d", - "name": "actuate RGB", - "func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nrgb=msg['rgb']\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nreturn msg;", - "outputs": 1, - "x": 1250, - "y": 1200, - "wires": [ - [ - "3b498e72.6e6292" - ] - ] - }, - { - "id": "7baf5071.dc3b2", - "type": "exec", - "z": "baa1e3d9.cb29d", - "command": "i2cdetect -y 1", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "1", - "oldrc": false, - "name": "i2c update", - "x": 1570, - "y": 1200, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "783209c7.51c5a8", - "type": "link out", - "z": "baa1e3d9.cb29d", - "name": "", - "links": [ - "e1354861.0bb648", - "2bc762dd.1115ce", - "a50134c.ed45ac8", - "f0ef065a.362028" - ], - "x": 1335, - "y": 1260, - "wires": [] - }, - { - "id": "3b498e72.6e6292", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "set busy", - "func": "global.set(\"state\",\"busy\");\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1420, - "y": 1200, - "wires": [ - [ - "7baf5071.dc3b2" - ] - ] - }, - { - "id": "cd56bb1c.8ce378", - "type": "ui_toast", - "z": "baa1e3d9.cb29d", - "position": "dialog", - "displayTime": "3", - "highlight": "", - "sendall": true, - "outputs": 1, - "ok": "OK", - "cancel": "", - "raw": false, - "topic": "", - "name": "", - "x": 1010, - "y": 1200, - "wires": [ - [] - ] - }, - { - "id": "c82e467c.99e208", - "type": "switch", - "z": "baa1e3d9.cb29d", - "name": "", - "property": "topic", - "propertyType": "msg", - "rules": [ - { - "t": "eq", - "v": "Missing entry :", - "vt": "str" - }, - { - "t": "eq", - "v": "Start", - "vt": "str" - } - ], - "checkall": "true", - "repair": false, - "outputs": 2, - "x": 850, - "y": 1220, - "wires": [ - [ - "cd56bb1c.8ce378" - ], - [ - "a3fd6b29.2ef5f8", - "a642fc0b.b6dd7" - ] - ] - }, - { - "id": "c6bd5987.c48f78", - "type": "http request", - "z": "baa1e3d9.cb29d", - "name": "Start timelapse", - "method": "GET", - "ret": "txt", - "paytoqs": false, - "url": "http://127.0.0.1/html/cmd_pipe.php?cmd=tl%201", - "tls": "", - "persist": false, - "proxy": "", - "authType": "", - "x": 1100, - "y": 1600, - "wires": [ - [] - ] - }, - { - "id": "8c15fd05.81b5", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "get duration acquisition", - "func": "msg.delay = global.get(\"duration\");\n\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1290, - "y": 1360, - "wires": [ - [ - "2ff9c0cb.7288b", - "34929df1.bfe602" - ] - ] - }, - { - "id": "2ff9c0cb.7288b", - "type": "delay", - "z": "baa1e3d9.cb29d", - "name": "wait duration", - "pauseType": "delayv", - "timeout": "1", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "x": 1510, - "y": 1360, - "wires": [ - [ - "99fd2803.0843a8", - "3475ecd5.6655f4", - "8f991d2e.6e8f3", - "e6a12f33.c7768" - ] - ] - }, - { - "id": "a642fc0b.b6dd7", - "type": "delay", - "z": "baa1e3d9.cb29d", - "name": "", - "pauseType": "delay", - "timeout": "500", - "timeoutUnits": "milliseconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "x": 810, - "y": 1540, - "wires": [ - [ - "c6bd5987.c48f78", - "8c15fd05.81b5" - ] - ] - }, - { - "id": "6aaa3bc6.b7dda4", - "type": "ui_gauge", - "z": "baa1e3d9.cb29d", - "name": "", - "group": "b5d61bc7.54fe48", - "order": 1, - "width": 10, - "height": 2, - "gtype": "donut", - "title": "", - "label": "%", - "format": "{{value}}", - "min": 0, - "max": "100", - "colors": [ - "#ffffff", - "#ffffff", - "#097479" - ], - "seg1": "", - "seg2": "", - "x": 2250, - "y": 1500, - "wires": [] - }, - { - "id": "34929df1.bfe602", - "type": "trigger", - "z": "baa1e3d9.cb29d", - "op1": "1", - "op2": "0", - "op1type": "str", - "op2type": "str", - "duration": "-1", - "extend": false, - "units": "s", - "reset": "done", - "bytopic": "all", - "name": "", - "x": 1960, - "y": 1600, - "wires": [ - [ - "e98903d2.f35c1" - ] - ] - }, - { - "id": "3475ecd5.6655f4", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "stop", - "func": "global.set(\"time_to_wait\",0);\nmsg.payload=\"done\";\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1810, - "y": 1500, - "wires": [ - [ - "34929df1.bfe602", - "6aaa3bc6.b7dda4" - ] - ] - }, - { - "id": "e98903d2.f35c1", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "pulse", - "func": "var time_to_wait= global.get(\"time_to_wait\");\n\nif (time_to_wait === undefined || time_to_wait === \"\"|| time_to_wait == NaN) {\n time_to_wait=0\n global.set(\"time_to_wait\",time_to_wait);\n}else {\n time_to_wait++;\n global.set(\"time_to_wait\",time_to_wait);\n duration=global.get(\"duration\")/1000;\n percent=(100* time_to_wait/duration).toFixed(0)\n msg.payload=percent;\n return msg;\n \n}", - "outputs": 1, - "noerr": 0, - "x": 2110, - "y": 1600, - "wires": [ - [ - "6aaa3bc6.b7dda4" - ] - ] - }, - { - "id": "f0ef065a.362028", - "type": "link in", - "z": "baa1e3d9.cb29d", - "name": "", - "links": [ - "a61d4164.135dd", - "783209c7.51c5a8", - "260e60f3.878ad", - "c5ee25c5.3c1848" - ], - "x": 1635, - "y": 1560, - "wires": [ - [ - "3475ecd5.6655f4" - ] - ] - }, - { - "id": "8f991d2e.6e8f3", - "type": "exec", - "z": "baa1e3d9.cb29d", - "command": "ls -l /var/www/html/media | grep \"th\" | tail -1 | awk -F \" \" '{print $9}' | awk -F \"_\" '{print $1\"_\"$2}'| tr -d \"\\n\"", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "get thumbail name", - "x": 1850, - "y": 1280, - "wires": [ - [ - "9dcdbf1f.4aa21" - ], - [], - [] - ] - }, - { - "id": "e6a12f33.c7768", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "mkdir", - "func": "acq_id=global.get(\"acq_id\")\nmsg.payload=\"/var/www/\"+acq_id\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1770, - "y": 1140, - "wires": [ - [ - "43c69256.b9633c" - ] - ] - }, - { - "id": "43c69256.b9633c", - "type": "exec", - "z": "baa1e3d9.cb29d", - "command": "mkdir", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "mkdir acq_id", - "x": 1910, - "y": 1140, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "517f13e8.e0793c", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "move", - "func": "file_prefix=msg.payload;\nacq_id=global.get(\"acq_id\")\nmsg.payload=\"/var/www/html/media/\"+file_prefix+\"* /var/www/\"+acq_id+\"/\";\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 2330, - "y": 1240, - "wires": [ - [ - "83a1d49e.a29a48" - ] - ] - }, - { - "id": "9dcdbf1f.4aa21", - "type": "delay", - "z": "baa1e3d9.cb29d", - "name": "", - "pauseType": "delay", - "timeout": "200", - "timeoutUnits": "milliseconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "x": 2090, - "y": 1260, - "wires": [ - [ - "517f13e8.e0793c" - ] - ] - }, - { - "id": "83a1d49e.a29a48", - "type": "exec", - "z": "baa1e3d9.cb29d", - "command": "mv", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "", - "x": 2480, - "y": 1260, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "20a2d27e.7ccafe", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "move", - "func": "file_prefix=msg.payload;\nacq_id=global.get(\"acq_id\")\nmsg.payload=\"/var/www/logs.json /var/www/\"+acq_id+\"/\";\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 2330, - "y": 1320, - "wires": [ - [ - "87cff57.f6d3708" - ] - ] - }, - { - "id": "87cff57.f6d3708", - "type": "exec", - "z": "baa1e3d9.cb29d", - "command": "mv", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "", - "x": 2480, - "y": 1340, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "d91229e3.bf0f18", - "type": "while-loop", - "z": "baa1e3d9.cb29d", - "name": "", - "condi": "global.get(\"job\")===\"run\"", - "x": 1330, - "y": 200, - "wires": [ - [ - "427871db.b4902", - "a61b71c3.afaf" - ], - [ - "427871db.b4902", - "a61b71c3.afaf" - ] - ] - }, - { - "id": "217ff214.a25c2e", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "Run", - "func": "global.set(\"job\",\"run\")\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1030, - "y": 220, - "wires": [ - [ - "d91229e3.bf0f18" - ] - ] - }, - { - "id": "995fa523.83cba8", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "Stop", - "func": "global.set(\"job\",\"stop\")\nmsg.payload=\"stop\"\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1030, - "y": 180, - "wires": [ - [ - "d91229e3.bf0f18" - ] - ] - }, - { - "id": "d3ab1a14.86b8b8", - "type": "python3-function", - "z": "baa1e3d9.cb29d", - "name": "pump.py", - "func": "from adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nkit = MotorKit()\npump_stepper = kit.stepper1\npump_stepper.release()\n\nstate = str(msg[\"state\"])\nvolume = int(msg[\"volume\"])\norientation = str(msg[\"orientation\"])\nflowrate = float(msg[\"flowrate\"])\n\n\nif(state==\"free\"):\n #35000steps will pass 69ml if sleep(0.05) in between 2 steps\n #1ml is about 35000/69=507steps\n nb_step=volume*507 \n #nb_step=vol*460 if sleep(0) in between 2 steps\n \n duration=(volume*60)/flowrate\n \n delay=(duration/nb_step)-0.005\n \nif(state==\"canceled\"):\n nb_step=0\n \nfor i in range(nb_step):\n pump_stepper.onestep(direction=stepper.BACKWARD, style=stepper.DOUBLE)\n sleep(delay)\n \nsleep(1)\npump_stepper.release()\n\nmsg[\"topic\"] = \"pump\"\nmsg[\"payload\"] = \"done\"\n\nreturn msg", - "outputs": 1, - "x": 1380, - "y": 520, - "wires": [ - [ - "444587e4.dc23a8" - ] - ] - }, - { - "id": "ff805ffc.f9134", - "type": "python3-function", - "z": "baa1e3d9.cb29d", - "name": "actuate RGB", - "func": "import smbus\nfrom time import sleep\n\nbus = smbus.SMBus(1)\n\nrgb=msg['rgb']\nbus.write_byte_data(0x0d, 0x00, 0)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 1)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nbus.write_byte_data(0x0d, 0x00, 2)\nbus.write_byte_data(0x0d, 0x01, rgb[\"r\"])\nbus.write_byte_data(0x0d, 0x02, rgb[\"g\"])\nbus.write_byte_data(0x0d, 0x03, rgb[\"b\"])\nreturn msg;", - "outputs": 1, - "x": 1390, - "y": 460, - "wires": [ - [ - "a27b3163.19c31" - ] - ] - }, - { - "id": "444587e4.dc23a8", - "type": "link out", - "z": "baa1e3d9.cb29d", - "name": "", - "links": [ - "e1354861.0bb648", - "2bc762dd.1115ce", - "a50134c.ed45ac8", - "17d09d70.b50223" - ], - "x": 1475, - "y": 520, - "wires": [] - }, - { - "id": "a27b3163.19c31", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "set busy", - "func": "global.set(\"state\",\"busy\");\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1560, - "y": 460, - "wires": [ - [] - ] - }, - { - "id": "7c974057.4d3f", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "get duration acquisition", - "func": "msg.delay = global.get(\"duration\");\n\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1430, - "y": 620, - "wires": [ - [] - ] - }, - { - "id": "482c8e09.a77df", - "type": "python3-function", - "z": "baa1e3d9.cb29d", - "name": "pump.py", - "func": "from adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nkit = MotorKit()\npump_stepper = kit.stepper1\n\npump_stepper.onestep(direction=stepper.BACKWARD, style=stepper.SIMPLE)\nsleep(0.1)", - "outputs": 1, - "x": 1820, - "y": 280, - "wires": [ - [] - ] - }, - { - "id": "427871db.b4902", - "type": "debug", - "z": "baa1e3d9.cb29d", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "x": 1850, - "y": 220, - "wires": [] - }, - { - "id": "a61b71c3.afaf", - "type": "trigger", - "z": "baa1e3d9.cb29d", - "op1": "1", - "op2": "0", - "op1type": "str", - "op2type": "str", - "duration": "-250", - "extend": false, - "units": "ms", - "reset": "stop", - "bytopic": "all", - "name": "", - "x": 1620, - "y": 280, - "wires": [ - [ - "482c8e09.a77df" - ] - ] - }, - { - "id": "f7fa6acf.f6ed28", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "pump.js", - "func": "state = global.get(\"state\");\n\nif (state == null){\n state=\"free\"\n}\n\nif(state===\"free\"||state===\"canceled\"){\n volume = global.get(\"acq_volume\");\n flowrate = global.get(\"sug_flowrate\");\n duration=(((volume*60)/flowrate)-2)*1000\n global.set(\"duration\",duration);\n \n msg.volume = volume;\n msg.orientation = \"forward\";\n msg.flowrate = flowrate;\n msg.rgb = {r:0, g:255, b:255}\n msg.state = state\n \n return msg;\n \n \n}", - "outputs": 1, - "noerr": 0, - "x": 1100, - "y": 340, - "wires": [ - [ - "dd817ccf.04ec" - ] - ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" - }, - { - "id": "dd817ccf.04ec", - "type": "python3-function", - "z": "baa1e3d9.cb29d", - "name": "pump.py", - "func": "from adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\nfrom time import sleep\n\nkit = MotorKit()\npump_stepper = kit.stepper1\npump_stepper.release()\n\nstate = str(msg[\"state\"])\nvolume = int(msg[\"volume\"])\nflowrate = float(msg[\"flowrate\"])\n\n\nif(state==\"free\"):\n #35000steps will pass 69ml if sleep(0.05) in between 2 steps\n #1ml is about 35000/69=507steps\n nb_step=volume*507 \n #nb_step=vol*460 if sleep(0) in between 2 steps\n \n duration=(volume*60)/flowrate\n \n delay=(duration/nb_step)-0.005\n \nif(state==\"canceled\"):\n nb_step=0\n \nfor i in range(nb_step):\n pump_stepper.onestep(direction=stepper.BACKWARD, style=stepper.DOUBLE)\n sleep(delay)\n \nsleep(1)\npump_stepper.release()\n\nmsg[\"topic\"] = \"pump\"\nmsg[\"payload\"] = \"done\"\n\nreturn msg", - "outputs": 1, - "x": 1280, - "y": 340, - "wires": [ - [] - ] - }, - { - "id": "7a5b8294.92ad3c", - "type": "ui_button", - "z": "baa1e3d9.cb29d", - "name": "", - "group": "b7919ae2.c01788", - "order": 4, - "width": 5, - "height": 1, - "passthru": false, - "label": "Show", - "tooltip": "", - "color": "#097479", - "bgcolor": "white", - "icon": "keyboard_tab", - "payload": "", - "payloadType": "str", - "topic": "", - "x": 470, - "y": 380, - "wires": [ - [ - "e2919164.70927" - ] - ] - }, - { - "id": "29be525e.0c87fe", - "type": "ui_template", - "z": "baa1e3d9.cb29d", - "group": "b5d61bc7.54fe48", - "name": "show global", - "order": 2, - "width": 0, - "height": 0, - "format": "
\n \n
", - "storeOutMessages": true, - "fwdInMessages": true, - "templateScope": "local", - "x": 750, - "y": 380, - "wires": [ - [] - ] - }, - { - "id": "e2919164.70927", - "type": "function", - "z": "baa1e3d9.cb29d", - "name": "get global", - "func": "msg.payload = {\n \"comment\":global.get(\"comment\"),\n \"sample_project\":global.get(\"sample_project\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \n \"sample_hour\":global.get(\"sample_hour\"),\n \"sample_minute\":global.get(\"sample_minute\"),\n \"sample_day\":global.get(\"sample_day\"),\n \"sample_month\":global.get(\"sample_month\"),\n \"sample_year\":global.get(\"sample_year\"),\n \n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"process_pixel\":global.get(\"process_pixel\"),\n \n \"acq_camera\":global.get(\"acq_camera\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n \"acq_software\":global.get(\"acq_software\"),\n \"acq_instrument_ID\":global.get(\"acq_instrument_ID\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_flowrate\":global.get(\"sug_flowrate\")\n }\n\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 600, - "y": 380, - "wires": [ - [ - "29be525e.0c87fe", - "295bd912.8d2556" - ] - ] - }, - { - "id": "295bd912.8d2556", - "type": "debug", - "z": "baa1e3d9.cb29d", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "x": 760, - "y": 440, - "wires": [] - }, - { - "id": "7ca7754c.0f731c", - "type": "inject", - "z": "eaae323a.31b3", - "name": "", - "topic": "", - "payload": "", - "payloadType": "date", - "repeat": "", - "crontab": "", - "once": false, - "onceDelay": 0.1, - "x": 120, - "y": 420, - "wires": [ - [ - "4c6d21e3.0173c" - ] - ] - }, - { - "id": "cbb8afed.0a026", - "type": "rpi-gpio out", - "z": "bccd1f23.87219", - "name": "", - "pin": "40", - "set": "", - "level": "0", - "freq": "", - "out": "out", - "x": 280, - "y": 80, - "wires": [] - }, - { - "id": "4c6d21e3.0173c", - "type": "function", - "z": "eaae323a.31b3", - "name": "", - "func": "var d = new Date();\nvar t = d.getTime();\npayload={\"time\":\"message\",\"timestamp\":msg.payload}\nmsg.payload=payload;\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 250, - "y": 420, - "wires": [ - [ - "c82b48ad.8b5478" - ] - ] - }, - { - "id": "a256071b.25a008", - "type": "file", - "z": "eaae323a.31b3", - "name": "", - "filename": "/home/pi/Desktop/log/test.log", - "appendNewline": true, - "createDir": true, - "overwriteFile": "false", - "encoding": "none", - "x": 600, - "y": 420, - "wires": [ - [ - "3cd4bf1e.11ae3" - ] - ] - }, - { - "id": "3cd4bf1e.11ae3", - "type": "debug", - "z": "eaae323a.31b3", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "x": 950, - "y": 420, - "wires": [] - }, - { - "id": "c82b48ad.8b5478", - "type": "csv", - "z": "eaae323a.31b3", - "name": "", - "sep": ",", - "hdrin": true, - "hdrout": "", - "multi": "one", - "ret": "\\n", - "temp": "timestamp,time", - "skip": "0", - "strings": true, - "x": 390, - "y": 420, - "wires": [ - [ - "a256071b.25a008" - ] - ] - } -] From 74c29fee376efebc1ca532bf20706e8cef96a810 Mon Sep 17 00:00:00 2001 From: tpollina Date: Tue, 14 Jul 2020 18:22:31 +0200 Subject: [PATCH 22/48] Update flows.json --- flows/flows.json | 4957 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 4604 insertions(+), 353 deletions(-) diff --git a/flows/flows.json b/flows/flows.json index efc88fd..84e7f3f 100644 --- a/flows/flows.json +++ b/flows/flows.json @@ -1,54 +1,488 @@ [ { - "id": "7f885510.6173fc", + "id": "ff9251a5.9c5e18", "type": "tab", - "label": "Home", + "label": "Main", "disabled": false, "info": "" }, { - "id": "55a31f5b.d4ec5", - "type": "tab", - "label": "Static Observation", - "disabled": false, - "info": "" + "id": "bba19d97.b32b1", + "type": "subflow", + "name": "Acquisition actuation", + "info": "", + "category": "", + "in": [], + "out": [], + "env": [], + "color": "#A6BBCF" }, { - "id": "c04dcc2a.47862", - "type": "tab", - "label": "Fluidic Acquisition", - "disabled": false, - "info": "" + "id": "c1d3ff7c.4384f", + "type": "subflow", + "name": "MQQT Cmds", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "5079cccb.298d14" + }, + { + "id": "197215b2.165f22" + } + ] + } + ], + "out": [], + "env": [], + "color": "#DDAA99" }, { - "id": "300f077.33624f8", - "type": "tab", - "label": "Segmentation", - "disabled": false, - "info": "" + "id": "c10e968b.87e488", + "type": "subflow", + "name": "Datetime update", + "info": "", + "category": "", + "in": [ + { + "x": 140, + "y": 80, + "wires": [ + { + "id": "93b9f3cd.759688" + } + ] + } + ], + "out": [], + "env": [], + "color": "#DDAA99", + "icon": "font-awesome/fa-clock-o" }, { - "id": "121f01ae.4c4abe", - "type": "tab", - "label": "Dashboard Control", - "disabled": false, - "info": "" + "id": "863e8384.56889", + "type": "subflow", + "name": "Acquisition inputs", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "3eaf4c98.d94b54" + }, + { + "id": "e50aa637.59ac68" + }, + { + "id": "8eeb9e9e.a50d7" + }, + { + "id": "e4e16eb9.5296c" + } + ] + } + ], + "out": [ + { + "x": 740, + "y": 40, + "wires": [ + { + "id": "c4527705.33a84", + "port": 0 + }, + { + "id": "f648e44.94e3998", + "port": 0 + }, + { + "id": "582e21b2.ad67a8", + "port": 0 + }, + { + "id": "f9705bc.3d322a8", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#A6BBCF", + "icon": "node-red-contrib-camerapi/photo.png" }, { - "id": "56d9742b.9ed99c", + "id": "5a287804.a10e2", + "type": "subflow", + "name": "Process metadata", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 80, + "wires": [ + { + "id": "dfb4b682.601e1" + } + ] + } + ], + "out": [ + { + "x": 700, + "y": 80, + "wires": [ + { + "id": "11b31baf.95996c", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#DDAA99" + }, + { + "id": "a8ad6dec.1a393", + "type": "subflow", + "name": "MQTT Receive & Plot", + "info": "", + "category": "", + "in": [], + "out": [], + "env": [], + "color": "#F3B567", + "icon": "node-red/bridge.svg" + }, + { + "id": "9882c53a.0ccc8", + "type": "subflow", + "name": "Temperature regulation", + "info": "", + "category": "", + "in": [], + "out": [], + "env": [], + "color": "#FFCC66", + "icon": "font-awesome/fa-bolt" + }, + { + "id": "fbe9590f.bd63b8", + "type": "subflow", + "name": "System Commands", + "info": "", + "category": "", + "in": [], + "out": [], + "env": [], + "color": "#FFCC66", + "icon": "node-red-dashboard/ui_button.png" + }, + { + "id": "b45c6fb6.f6dfa8", + "type": "subflow", + "name": "Object metadata", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "8a61177.8eaa1e8" + }, + { + "id": "3893c81e.a9b9e" + }, + { + "id": "bd643763.2a7768" + } + ] + } + ], + "out": [ + { + "x": 1060, + "y": 159, + "wires": [ + { + "id": "cf0b247b.e3e7c", + "port": 0 + }, + { + "id": "1675637a.1d762d", + "port": 0 + } + ] + }, + { + "x": 1060, + "y": 59, + "wires": [ + { + "id": "d485fec3.802e", + "port": 0 + }, + { + "id": "5196107b.a5eae8", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#DDAA99" + }, + { + "id": "6ca1a253.126bb4", + "type": "subflow", + "name": "Acquisition metadata", + "info": "", + "category": "", + "in": [ + { + "x": 50, + "y": 30, + "wires": [ + { + "id": "93a3fd29.c55938" + }, + { + "id": "9e9e7f8a.b66d4" + }, + { + "id": "b1105180.b4b78" + }, + { + "id": "ec403304.e34c58" + }, + { + "id": "7aac5c46.0669ec" + }, + { + "id": "c491cf7.36957b" + }, + { + "id": "e0644195.305068" + }, + { + "id": "e3fe6242.bfaf18" + }, + { + "id": "31d58fcd.ede758" + } + ] + } + ], + "out": [ + { + "x": 740, + "y": 40, + "wires": [ + { + "id": "21b35429.fe43a4", + "port": 0 + }, + { + "id": "f0595ff1.c4d568", + "port": 0 + }, + { + "id": "c4e69883.a0f3d", + "port": 0 + }, + { + "id": "12e818fa.b7301f", + "port": 0 + }, + { + "id": "b577dcd2.8d2c88", + "port": 0 + }, + { + "id": "f7f5ccc1.29a41", + "port": 0 + }, + { + "id": "bd733bef.7efd08", + "port": 0 + }, + { + "id": "a6057924.bc14", + "port": 0 + } + ] + }, + { + "x": 900, + "y": 360, + "wires": [ + { + "id": "5a5fcc9a.9ede14", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#DDAA99" + }, + { + "id": "626459d2.f9c98", + "type": "subflow", + "name": "Pump actuation", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "f7b6f5e7.7b7ca" + }, + { + "id": "50093f5.8e35ec" + } + ] + } + ], + "out": [ + { + "x": 700, + "y": 40, + "wires": [ + { + "id": "fa485315.928ae", + "port": 0 + }, + { + "id": "2f9ec1a6.d5fb66", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#A6BBCF", + "icon": "font-awesome/fa-recycle" + }, + { + "id": "5c516299.73e054", + "type": "subflow", + "name": "Focus actuation", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "60dc5851.6962b" + } + ] + } + ], + "out": [ + { + "x": 800, + "y": 200, + "wires": [ + { + "id": "7297e2f7.dce564", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#A6BBCF", + "icon": "node-red/sort.svg" + }, + { + "id": "efeebffd.34c7e", + "type": "subflow", + "name": "Sample metadata", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "78f5791d.946bd8" + }, + { + "id": "346d141f.ebab3c" + }, + { + "id": "2a09d440.119154" + }, + { + "id": "2d438355.ed942c" + }, + { + "id": "ac4a71a.c35309" + } + ] + } + ], + "out": [ + { + "x": 840, + "y": 40, + "wires": [ + { + "id": "1cb896c7.6dfc11", + "port": 0 + }, + { + "id": "288ba4b3.a9a2cc", + "port": 0 + }, + { + "id": "10f1e5c1.3cb69a", + "port": 0 + }, + { + "id": "aa90b06d.ca78e", + "port": 0 + }, + { + "id": "da0c5a96.74c0e", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#DDAA99" + }, + { + "id": "68d72e45.e7d58", "type": "ui_base", "theme": { "name": "theme-dark", "lightTheme": { "default": "#0094CE", - "baseColor": "#0094CE", + "baseColor": "#5900ce", "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", - "edited": false, + "edited": true, "reset": false }, "darkTheme": { "default": "#097479", - "baseColor": "#097479", + "baseColor": "#059276", "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", "edited": true, "reset": false @@ -62,11 +496,11 @@ "themeState": { "base-color": { "default": "#097479", - "value": "#097479", - "edited": false + "value": "#059276", + "edited": true }, "page-titlebar-backgroundColor": { - "value": "#097479", + "value": "#059276", "edited": false }, "page-backgroundColor": { @@ -74,11 +508,11 @@ "edited": false }, "page-sidebar-backgroundColor": { - "value": "#000000", + "value": "#ffffff", "edited": false }, "group-textColor": { - "value": "#0eb8c0", + "value": "#08dcb2", "edited": false }, "group-borderColor": { @@ -94,7 +528,7 @@ "edited": false }, "widget-backgroundColor": { - "value": "#097479", + "value": "#059276", "edited": false }, "widget-borderColor": { @@ -116,497 +550,4314 @@ "name": "Node-RED Dashboard", "hideToolbar": "false", "allowSwipe": "false", - "lockMenu": "false", + "lockMenu": "true", "allowTempTheme": "true", "dateFormat": "DD/MM/YYYY", "sizes": { - "sx": 48, - "sy": 48, - "gx": 6, - "gy": 6, - "cx": 6, - "cy": 6, - "px": 0, - "py": 0 + "sx": 56, + "sy": 56, + "gx": 5, + "gy": 5, + "cx": 5, + "cy": 5, + "px": 5, + "py": 5 } } }, { - "id": "c18fae15.516ce", - "type": "ui_tab", + "id": "44986592.b84004", + "type": "mqtt-broker", "z": "", - "name": "Home", - "icon": "dashboard", + "name": "", + "broker": "127.0.0.1", + "port": "1883", + "clientid": "test", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "8eac3de.7c8234", + "type": "mqtt-broker", + "z": "", + "name": "", + "broker": "0.0.0.0", + "port": "1883", + "clientid": "Client_node", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "888cbaa1.5d9318", + "type": "mqtt-broker", + "z": "", + "name": "", + "broker": "127.0.0.1", + "port": "1883", + "clientid": "test", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "f98c50f4.4bed48", + "type": "mqtt-broker", + "z": "", + "name": "", + "broker": "0.0.0.0", + "port": "1883", + "clientid": "Client_node", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "3ee94635.002c9a", + "type": "mqtt-broker", + "z": "", + "name": "", + "broker": "127.0.0.1", + "port": "1883", + "clientid": "test", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "b0b1b2bb.385fe", + "type": "mqtt-broker", + "z": "", + "name": "", + "broker": "0.0.0.0", + "port": "1883", + "clientid": "Client_node", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "659e81f6.f85fb8", + "type": "mqtt-broker", + "z": "", + "name": "", + "broker": "127.0.0.1", + "port": "1883", + "clientid": "test", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "52b67b31.c63a04", + "type": "mqtt-broker", + "z": "", + "name": "", + "broker": "0.0.0.0", + "port": "1883", + "clientid": "Client_node", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "494e9f19.80f8e8", + "type": "mqtt-broker", + "z": "", + "name": "", + "broker": "127.0.0.1", + "port": "1883", + "clientid": "test", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "5ad5df6e.1d1e6", + "type": "mqtt-broker", + "z": "", + "name": "", + "broker": "0.0.0.0", + "port": "1883", + "clientid": "Client_node", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "3ab46cf0.f57dbc", + "type": "mqtt-broker", + "z": "", + "name": "", + "broker": "127.0.0.1", + "port": "1883", + "clientid": "test", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "40f247ee.202528", + "type": "mqtt-broker", + "z": "", + "name": "", + "broker": "0.0.0.0", + "port": "1883", + "clientid": "Client_node", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "84801dc0.193d88", + "type": "mqtt-broker", + "z": "", + "name": "", + "broker": "127.0.0.1", + "port": "1883", + "clientid": "test", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "e8ab36cc.74d77", + "type": "mqtt-broker", + "z": "", + "name": "", + "broker": "0.0.0.0", + "port": "1883", + "clientid": "Client_node", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "55588d59.326124", + "type": "ui_group", + "z": "", + "name": "Acquisition actuation", + "tab": "", + "order": 10, + "disp": true, + "width": 24, + "collapse": false + }, + { + "id": "d4efe27d.5af0e", + "type": "ui_group", + "z": "", + "name": "Datetime", + "tab": "", "order": 1, - "disabled": false, - "hidden": false - }, - { - "id": "29a78fc9.b034c", - "type": "ui_group", - "z": "", - "name": "Static Observation", - "tab": "c18fae15.516ce", - "order": 1, - "disp": false, - "width": "12", + "disp": true, + "width": "24", "collapse": false }, { - "id": "10d36e29.c78b42", + "id": "4a3b889c.c4c0a", "type": "ui_group", "z": "", - "name": "Fluidic Acquisition", - "tab": "c18fae15.516ce", - "order": 2, - "disp": false, - "width": "12", + "name": "Valve actuation", + "tab": "", + "order": 9, + "disp": true, + "width": "24", "collapse": false }, { - "id": "8c1b4542.a177a8", + "id": "b2080aa8.7b048", "type": "ui_group", "z": "", - "name": "Segmentation", - "tab": "c18fae15.516ce", - "order": 3, - "disp": false, - "width": "12", + "name": "Process metadata", + "tab": "", + "order": 8, + "disp": true, + "width": 24, "collapse": false }, { - "id": "edb89598.853498", + "id": "b2ce0fd5.641a8", "type": "ui_group", "z": "", - "name": "Gallery", - "tab": "c18fae15.516ce", - "order": 4, - "disp": false, - "width": "12", + "name": "MQTT Plots", + "tab": "", + "order": 11, + "disp": true, + "width": "24", "collapse": false }, { - "id": "98e9fd1a.1bbe5", - "type": "ui_tab", + "id": "516113d5.b6b5d4", + "type": "ui_group", "z": "", - "name": "Static Observation", - "icon": "dashboard", - "order": 2, - "disabled": false, - "hidden": false + "name": "Commands", + "tab": "", + "order": 12, + "disp": true, + "width": 24, + "collapse": false }, { - "id": "2e62c9a8.c191f6", - "type": "ui_tab", + "id": "488da474.92ee5c", + "type": "ui_group", "z": "", - "name": "Fluidic Acquisition", - "icon": "", - "order": 3, - "disabled": false, - "hidden": false + "name": "Object metadata", + "tab": "", + "order": 6, + "disp": true, + "width": "24", + "collapse": false }, { - "id": "609b39b5.d91f28", - "type": "ui_tab", + "id": "a302c12b.834e8", + "type": "ui_group", "z": "", - "name": "Segmentation", - "icon": "dashboard", - "order": 4, - "disabled": false, - "hidden": false + "name": "Acquisition metadata", + "tab": "", + "order": 7, + "disp": true, + "width": "24", + "collapse": false }, { - "id": "b253b89c.1c4458", - "type": "ui_tab", + "id": "95792df3.55e6e", + "type": "ui_group", "z": "", - "name": "Dashboard Control", - "icon": "dashboard", + "name": "Pump actuation", + "tab": "", "order": 5, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "8a415d41.11df38", + "type": "ui_group", + "z": "", + "name": "Focus actuation", + "tab": "", + "order": 4, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "ead03bfe.db2268", + "type": "ui_group", + "z": "", + "name": "Sample metadata", + "tab": "", + "order": 2, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "d4c113ac.dade38", + "type": "ui_group", + "z": "", + "name": "Streaming camera", + "tab": "", + "order": 3, + "disp": true, + "width": 24, + "collapse": false + }, + { + "id": "cdb72118.692578", + "type": "ui_group", + "z": "", + "name": "Acquisition actuation", + "tab": "2b97fe34.a699fa", + "order": 10, + "disp": true, + "width": 24, + "collapse": false + }, + { + "id": "9c86b3b7.54841", + "type": "ui_group", + "z": "", + "name": "Datetime", + "tab": "2b97fe34.a699fa", + "order": 1, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "48649115.fcd01", + "type": "ui_group", + "z": "", + "name": "Acquisition inputs", + "tab": "2b97fe34.a699fa", + "order": 9, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "beeb994e.b67688", + "type": "ui_group", + "z": "", + "name": "Process metadata", + "tab": "2b97fe34.a699fa", + "order": 8, + "disp": true, + "width": 24, + "collapse": false + }, + { + "id": "eb610eb9.84fae8", + "type": "ui_group", + "z": "", + "name": "MQTT Plots", + "tab": "2b97fe34.a699fa", + "order": 11, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "82b3caaa.0518", + "type": "ui_group", + "z": "", + "name": "Commands", + "tab": "2b97fe34.a699fa", + "order": 12, + "disp": true, + "width": 24, + "collapse": false + }, + { + "id": "f377d75b.32d27", + "type": "ui_group", + "z": "", + "name": "Object metadata", + "tab": "2b97fe34.a699fa", + "order": 6, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "60b93a5.a032344", + "type": "ui_group", + "z": "", + "name": "Acquisition metadata", + "tab": "2b97fe34.a699fa", + "order": 7, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "4153382f.45437", + "type": "ui_group", + "z": "", + "name": "Pump actuation", + "tab": "2b97fe34.a699fa", + "order": 5, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "69433259.f306fc", + "type": "ui_group", + "z": "", + "name": "Focus actuation", + "tab": "2b97fe34.a699fa", + "order": 4, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "417f91c9.193ab", + "type": "ui_group", + "z": "", + "name": "Sample metadata", + "tab": "2b97fe34.a699fa", + "order": 2, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "2b97fe34.a699fa", + "type": "ui_tab", + "z": "", + "name": "GUI", + "icon": "fa-eyedropper", + "order": 2, "disabled": false, "hidden": false }, { - "id": "498d73e3.d1c94c", + "id": "dc721eb.9ef51e", "type": "ui_group", - "name": "Group 1", - "tab": "98e9fd1a.1bbe5", - "order": 1, + "z": "", + "name": "Streaming camera", + "tab": "2b97fe34.a699fa", + "order": 3, "disp": true, - "width": 6 + "width": 24, + "collapse": false }, { - "id": "72fe0cc7.df9fd4", - "type": "ui_group", - "name": "Group 1", - "tab": "2e62c9a8.c191f6", - "order": 1, - "disp": true, - "width": 6 - }, - { - "id": "54c8e6e0.223fc8", - "type": "ui_group", - "name": "Group 1", - "tab": "609b39b5.d91f28", - "order": 1, - "disp": true, - "width": 6 - }, - { - "id": "5841eafd.95e5e4", - "type": "ui_group", - "name": "Group 1", - "tab": "b253b89c.1c4458", - "order": 1, - "disp": true, - "width": 6 - }, - { - "id": "df3ac001.1d82a", + "id": "853e90d6.4afd1", "type": "ui_button", - "z": "7f885510.6173fc", + "z": "bba19d97.b32b1", "name": "", - "group": "29a78fc9.b034c", + "group": "cdb72118.692578", "order": 1, - "width": 12, - "height": 6, + "width": 0, + "height": 0, "passthru": false, - "label": "Static Observation", + "label": "Start Acquisition", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "", "payloadType": "str", - "topic": "Static Observation", - "x": 210, - "y": 260, + "topic": "actuator/image", + "x": 200, + "y": 100, "wires": [ [ - "82696634.821678" + "6e46e66c.654ff8" ] ] }, { - "id": "113ae8d3.b52867", - "type": "ui_button", - "z": "7f885510.6173fc", + "id": "6e46e66c.654ff8", + "type": "function", + "z": "bba19d97.b32b1", + "name": "image.js", + "func": "state = global.get(\"state\");\nglobal.set('img_counter',0)\nglobal.set('obj_counter',0)\nif (state == null){state=\"free\"}\n\nvar sleep_before= global.get(\"custom_sleep_before\");\nvar nb_step= global.get(\"custom_nb_step\");\nvar nb_frame= global.get(\"custom_nb_frame\");\nvar segmentation= global.get(\"custom_segmentation\");\n\nif (sleep_before === undefined || sleep_before === \"\" || sleep_before === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration before the acquisition\";\n \n}else if (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of step in between two frames\";\n \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 \n}else if (segmentation === undefined || segmentation === \"\" || segmentation === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Realize or not the segmentation\";\n \n}else {\n nb_frame=nb_frame-1\n \n msg.payload=sleep_before+' '+nb_step+' '+nb_frame+' '+segmentation;\n}\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 360, + "y": 100, + "wires": [ + [ + "5a37b9e6.6e3e58" + ] + ], + "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" + }, + { + "id": "5a37b9e6.6e3e58", + "type": "switch", + "z": "bba19d97.b32b1", "name": "", - "group": "8c1b4542.a177a8", - "order": 1, + "property": "topic", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "actuator/image", + "vt": "str" + }, + { + "t": "eq", + "v": "Missing entry :", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 510, + "y": 100, + "wires": [ + [ + "75233be8.98e6f4" + ], + [ + "bee35f80.112d" + ] + ] + }, + { + "id": "bee35f80.112d", + "type": "ui_toast", + "z": "bba19d97.b32b1", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "topic": "", + "name": "", + "x": 690, + "y": 120, + "wires": [ + [] + ] + }, + { + "id": "75233be8.98e6f4", + "type": "mqtt out", + "z": "bba19d97.b32b1", + "name": "", + "topic": "", + "qos": "", + "retain": "", + "broker": "e8ab36cc.74d77", + "x": 670, + "y": 80, + "wires": [] + }, + { + "id": "75d00421.d31e1c", + "type": "ui_button", + "z": "bba19d97.b32b1", + "name": "Stop Acquisition", + "group": "cdb72118.692578", + "order": 2, + "width": 0, + "height": 0, + "passthru": true, + "label": "STOP ACQUISITION", + "tooltip": "", + "color": "", + "bgcolor": "#AD1625", + "icon": "", + "payload": "off", + "payloadType": "str", + "topic": "actuator/wait", + "x": 200, + "y": 140, + "wires": [ + [ + "f2ce7a07.d3eff8" + ] + ] + }, + { + "id": "f2ce7a07.d3eff8", + "type": "mqtt out", + "z": "bba19d97.b32b1", + "name": "", + "topic": "", + "qos": "", + "retain": "", + "broker": "e8ab36cc.74d77", + "x": 350, + "y": 140, + "wires": [] + }, + { + "id": "977270e2.b70738", + "type": "mqtt out", + "z": "bba19d97.b32b1", + "name": "", + "topic": "", + "qos": "", + "retain": "", + "broker": "e8ab36cc.74d77", + "x": 350, + "y": 180, + "wires": [] + }, + { + "id": "23f3e613.20ad82", + "type": "exec", + "z": "c1d3ff7c.4384f", + "command": "python3.7 /home/pi/PlanktonScope/script/main.py", + "addpay": false, + "append": "", + "useSpawn": "false", + "timer": "", + "oldrc": false, + "name": "", + "x": 910, + "y": 140, + "wires": [ + [ + "87b835dc.107c6", + "2de12b49.050f44" + ], + [ + "87b835dc.107c6", + "2de12b49.050f44" + ], + [ + "87b835dc.107c6", + "2de12b49.050f44" + ] + ] + }, + { + "id": "1ef92011.66439", + "type": "exec", + "z": "c1d3ff7c.4384f", + "command": "ps -ax | grep \"python3.7 /home/pi/PlanktonScope/script/main.py\"| head -1 | awk -F \" \" '{print$1}' ", + "addpay": false, + "append": "", + "useSpawn": "false", + "timer": "", + "oldrc": false, + "name": "", + "x": 610, + "y": 200, + "wires": [ + [ + "c1fd2bf6.fa7198" + ], + [], + [] + ] + }, + { + "id": "c1fd2bf6.fa7198", + "type": "exec", + "z": "c1d3ff7c.4384f", + "command": "kill", + "addpay": true, + "append": "", + "useSpawn": "false", + "timer": "", + "oldrc": false, + "name": "", + "x": 1050, + "y": 200, + "wires": [ + [ + "87b835dc.107c6", + "2de12b49.050f44" + ], + [ + "87b835dc.107c6", + "2de12b49.050f44" + ], + [ + "87b835dc.107c6", + "2de12b49.050f44" + ] + ] + }, + { + "id": "9a6e378b.5ea938", + "type": "ui_button", + "z": "c1d3ff7c.4384f", + "name": "", + "group": "9c86b3b7.54841", + "order": 9, "width": 12, - "height": 6, + "height": 1, "passthru": false, - "label": "Segmentation", + "label": "Kill MQTT", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "", "payloadType": "str", - "topic": "Segmentation", - "x": 220, + "topic": "", + "x": 80, + "y": 200, + "wires": [ + [ + "1ef92011.66439" + ] + ] + }, + { + "id": "e74e7b3d.2ba678", + "type": "ui_button", + "z": "c1d3ff7c.4384f", + "name": "", + "group": "9c86b3b7.54841", + "order": 10, + "width": 12, + "height": 1, + "passthru": false, + "label": "Restart MQTT", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "", + "x": 100, + "y": 140, + "wires": [ + [ + "23f3e613.20ad82" + ] + ] + }, + { + "id": "87b835dc.107c6", + "type": "ui_toast", + "z": "c1d3ff7c.4384f", + "position": "top right", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 0, + "ok": "OK", + "cancel": "", + "raw": false, + "topic": "", + "name": "", + "x": 1260, + "y": 140, + "wires": [] + }, + { + "id": "b60669a0.b480d8", + "type": "exec", + "z": "c10e968b.87e488", + "command": "sudo date -s", + "addpay": true, + "append": "", + "useSpawn": "false", + "timer": "", + "oldrc": false, + "name": "", + "x": 1010, + "y": 240, + "wires": [ + [], + [], + [] + ] + }, + { + "id": "68aace8d.6bf5", + "type": "function", + "z": "c10e968b.87e488", + "name": "", + "func": "d = new Date();\n//get weekday\nvar weekday = new Array(7);\nweekday[0] = \"Sun\";\nweekday[1] = \"Mon\";\nweekday[2] = \"Tue\";\nweekday[3] = \"Wed\";\nweekday[4] = \"Thu\";\nweekday[5] = \"Fri\";\nweekday[6] = \"Sat\";\nvar w = weekday[d.getUTCDay()];\n//get Month\nvar month = new Array(12);\nmonth[0] = \"Jan\";\nmonth[1] = \"Feb\";\nmonth[2] = \"Mar\";\nmonth[3] = \"Apr\";\nmonth[4] = \"May\";\nmonth[5] = \"Jun\";\nmonth[6] = \"Jul\";\nmonth[7] = \"Aug\";\nmonth[8] = \"Sep\";\nmonth[9] = \"Oct\";\nmonth[10] = \"Nov\";\nmonth[11] = \"Dec\";\nvar n = month[d.getUTCMonth()];\n \n//get day\nvar day = d.getUTCDay()\n\n//get Hours\nvar Hours = d.getUTCHours();\n//get Minutes\nvar Minutes = d.getUTCMinutes();\n//get Seconds\nvar Seconds = d.getUTCSeconds();\n//get FullYear\nvar FullYear = d.getUTCFullYear();\n\n//Thu Aug 09 2012 23:34:04 GMT+0200 (GMT+02:00)\n\n//Thu Aug 9 21:31:26 UTC 2012\n\n//msg.payload = \"Thu Aug 9 21:31:26 UTC 2012\"\n\nmsg.payload = '\"'+w+\" \"+n+\" \"+day+\" \"+Hours+\":\"+Minutes+\":\"+Seconds+\" UTC \"+FullYear+'\"';\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 490, + "y": 40, + "wires": [ + [ + "a1db5dbb.32c998" + ] + ] + }, + { + "id": "a1db5dbb.32c998", + "type": "ui_template", + "z": "c10e968b.87e488", + "group": "9c86b3b7.54841", + "name": "", + "order": 1, + "width": 0, + "height": 0, + "format": "
", + "storeOutMessages": true, + "fwdInMessages": true, + "templateScope": "local", + "x": 640, + "y": 40, + "wires": [ + [] + ] + }, + { + "id": "b3b03af9.8edae8", + "type": "ui_numeric", + "z": "c10e968b.87e488", + "name": "tmp_year", + "label": "Year", + "tooltip": "", + "group": "9c86b3b7.54841", + "order": 2, + "width": 5, + "height": 1, + "wrap": false, + "passthru": true, + "topic": "tmp_year", + "format": "{{value}}", + "min": "2020", + "max": "2030", + "step": 1, + "x": 640, + "y": 80, + "wires": [ + [ + "8de4b398.3c755" + ] + ] + }, + { + "id": "ed1f72c4.e136e", + "type": "ui_numeric", + "z": "c10e968b.87e488", + "name": "tmp_month", + "label": "Month", + "tooltip": "", + "group": "9c86b3b7.54841", + "order": 3, + "width": 3, + "height": 1, + "wrap": false, + "passthru": true, + "topic": "tmp_month", + "format": "{{value}}", + "min": "1", + "max": "12", + "step": 1, + "x": 650, + "y": 120, + "wires": [ + [ + "8de4b398.3c755" + ] + ] + }, + { + "id": "be55a4d1.4d5fa8", + "type": "ui_numeric", + "z": "c10e968b.87e488", + "name": "tmp_day", + "label": "Day", + "tooltip": "", + "group": "9c86b3b7.54841", + "order": 4, + "width": 3, + "height": 1, + "wrap": false, + "passthru": true, + "topic": "tmp_day", + "format": "{{value}}", + "min": "1", + "max": "31", + "step": 1, + "x": 640, + "y": 160, + "wires": [ + [ + "8de4b398.3c755" + ] + ] + }, + { + "id": "ee1e92f8.a01bb8", + "type": "ui_numeric", + "z": "c10e968b.87e488", + "name": "tmp_hour", + "label": "Hour", + "tooltip": "", + "group": "9c86b3b7.54841", + "order": 5, + "width": 3, + "height": 1, + "wrap": false, + "passthru": true, + "topic": "tmp_hour", + "format": "{{value}}", + "min": "0", + "max": "23", + "step": 1, + "x": 640, + "y": 200, + "wires": [ + [ + "8de4b398.3c755" + ] + ] + }, + { + "id": "c532a0cd.b0a47", + "type": "ui_numeric", + "z": "c10e968b.87e488", + "name": "tmp_minute", + "label": "Minute", + "tooltip": "", + "group": "9c86b3b7.54841", + "order": 6, + "width": 3, + "height": 1, + "wrap": false, + "passthru": true, + "topic": "tmp_minute", + "format": "{{value}}", + "min": "0", + "max": "59", + "step": 1, + "x": 650, + "y": 240, + "wires": [ + [ + "8de4b398.3c755" + ] + ] + }, + { + "id": "5b200123.04ec98", + "type": "ui_numeric", + "z": "c10e968b.87e488", + "name": "tmp_second", + "label": "Second", + "tooltip": "", + "group": "9c86b3b7.54841", + "order": 7, + "width": 3, + "height": 1, + "wrap": false, + "passthru": true, + "topic": "tmp_second", + "format": "{{value}}", + "min": "0", + "max": "59", + "step": 1, + "x": 650, + "y": 280, + "wires": [ + [ + "8de4b398.3c755" + ] + ] + }, + { + "id": "d8f0f8d1.0550d", + "type": "interval", + "z": "c10e968b.87e488", + "name": "interval", + "interval": "1", + "onstart": false, + "msg": "ping", + "showstatus": true, + "unit": "seconds", + "statusformat": "YYYY-MM-D HH:mm:ss", + "x": 310, + "y": 40, + "wires": [ + [ + "68aace8d.6bf5" + ] + ] + }, + { + "id": "eb163e1c.a7b97", + "type": "ui_button", + "z": "c10e968b.87e488", + "name": "", + "group": "9c86b3b7.54841", + "order": 8, + "width": 4, + "height": 1, + "passthru": false, + "label": "Update", + "tooltip": "", + "color": "black", + "bgcolor": "white", + "icon": "", + "payload": "", + "payloadType": "str", + "topic": "", + "x": 640, + "y": 320, + "wires": [ + [ + "aa948c91.3895a" + ] + ] + }, + { + "id": "aa948c91.3895a", + "type": "function", + "z": "c10e968b.87e488", + "name": "update datetime", + "func": "var FullYear= global.get(\"year\");\nvar Month= global.get(\"month\");\nvar day= global.get(\"day\");\nvar Hours= global.get(\"hour\");\nvar Minutes= global.get(\"minute\");\nvar Seconds= global.get(\"second\");\n\nmsg.payload = new Date();\n//get Month\nvar month = new Array(12);\nmonth[1] = \"Jan\";\nmonth[2] = \"Feb\";\nmonth[3] = \"Mar\";\nmonth[4] = \"Apr\";\nmonth[5] = \"May\";\nmonth[6] = \"Jun\";\nmonth[7] = \"Jul\";\nmonth[8] = \"Aug\";\nmonth[9] = \"Sep\";\nmonth[10] = \"Oct\";\nmonth[11] = \"Nov\";\nmonth[12] = \"Dec\";\nvar n = month[Month];\n \nmsg.payload = '\"'+day+\" \"+n+\" \"+FullYear+\" \"+Hours+\":\"+Minutes+\":\"+Seconds+'\"';\n\n\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 800, + "y": 320, + "wires": [ + [ + "3b7403cb.d33394", + "b60669a0.b480d8" + ] + ] + }, + { + "id": "8de4b398.3c755", + "type": "function", + "z": "c10e968b.87e488", + "name": "set global", + "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 840, + "y": 60, + "wires": [ + [] + ] + }, + { + "id": "3b7403cb.d33394", + "type": "debug", + "z": "c10e968b.87e488", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "x": 1010, "y": 300, + "wires": [] + }, + { + "id": "315c5aa3.fdf5d6", + "type": "function", + "z": "c10e968b.87e488", + "name": "", + "func": "d = msg.payload;\n\nvar val = d.getUTCFullYear();\n\nmsg.payload = val;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 490, + "y": 80, "wires": [ [ - "82696634.821678" + "b3b03af9.8edae8" ] ] }, { - "id": "ec028844.198c98", - "type": "ui_button", - "z": "7f885510.6173fc", + "id": "93b9f3cd.759688", + "type": "function", + "z": "c10e968b.87e488", "name": "", - "group": "10d36e29.c78b42", - "order": 1, - "width": 12, - "height": 6, - "passthru": false, - "label": "Fluidic Acquisition", + "func": "d = new Date();\nmsg.payload = d\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 310, + "y": 80, + "wires": [ + [ + "315c5aa3.fdf5d6", + "922cecc2.dc7f68", + "c2aa11f2.0fdee8", + "915b7162.7a73e", + "b57fe145.320d28", + "d3f45b98.f05a58" + ] + ] + }, + { + "id": "922cecc2.dc7f68", + "type": "function", + "z": "c10e968b.87e488", + "name": "", + "func": "d = msg.payload;\n\nvar val = d.getUTCMonth();\n\nmsg.payload = val+1;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 490, + "y": 120, + "wires": [ + [ + "ed1f72c4.e136e" + ] + ] + }, + { + "id": "c2aa11f2.0fdee8", + "type": "function", + "z": "c10e968b.87e488", + "name": "", + "func": "d = msg.payload;\n\nvar val = d.getUTCDay();\n\nmsg.payload = val;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 490, + "y": 160, + "wires": [ + [ + "be55a4d1.4d5fa8" + ] + ] + }, + { + "id": "915b7162.7a73e", + "type": "function", + "z": "c10e968b.87e488", + "name": "", + "func": "d = msg.payload;\n\nvar val = d.getUTCHours();\n\nmsg.payload = val;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 490, + "y": 200, + "wires": [ + [ + "ee1e92f8.a01bb8" + ] + ] + }, + { + "id": "b57fe145.320d28", + "type": "function", + "z": "c10e968b.87e488", + "name": "", + "func": "d = msg.payload;\n\nvar val = d.getUTCMinutes();\n\nmsg.payload = val;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 490, + "y": 240, + "wires": [ + [ + "c532a0cd.b0a47" + ] + ] + }, + { + "id": "d3f45b98.f05a58", + "type": "function", + "z": "c10e968b.87e488", + "name": "", + "func": "d = msg.payload;\n\nvar val = d.getUTCSeconds();\n\nmsg.payload = val;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 490, + "y": 280, + "wires": [ + [ + "5b200123.04ec98" + ] + ] + }, + { + "id": "c4527705.33a84", + "type": "ui_text_input", + "z": "863e8384.56889", + "name": "custom_nb_step", + "label": "Number of steps in between two images", "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "Fluidic Acquisition", - "x": 210, - "y": 340, - "wires": [ - [ - "82696634.821678" - ] - ] - }, - { - "id": "47a9f575.dc2c8c", - "type": "ui_button", - "z": "7f885510.6173fc", - "name": "", - "group": "edb89598.853498", - "order": 1, - "width": 12, - "height": 6, - "passthru": false, - "label": "Dashboard Control", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "Dashboard Control", - "x": 270, - "y": 380, - "wires": [ - [ - "82696634.821678" - ] - ] - }, - { - "id": "c0f2a501.1677c8", - "type": "ui_ui_control", - "z": "7f885510.6173fc", - "name": "", - "events": "change", + "group": "48649115.fcd01", + "order": 2, + "width": 0, + "height": 0, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "custom_nb_step", "x": 540, - "y": 260, + "y": 80, "wires": [ [] ] }, { - "id": "c52be0d9.e6412", - "type": "ui_button", - "z": "55a31f5b.d4ec5", - "name": "", - "group": "498d73e3.d1c94c", - "order": 0, + "id": "582e21b2.ad67a8", + "type": "ui_text_input", + "z": "863e8384.56889", + "name": "custom_nb_frame", + "label": "Number of images per acquisition", + "tooltip": "", + "group": "48649115.fcd01", + "order": 3, "width": 0, "height": 0, - "passthru": false, - "label": "Home", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "Home", - "x": 70, - "y": 40, - "wires": [ - [ - "66e609a2.2d57d8" - ] - ] - }, - { - "id": "82696634.821678", - "type": "function", - "z": "7f885510.6173fc", - "name": "swtich tab", - "func": "\nmsg.payload={\"tab\":msg.topic};\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 400, - "y": 260, - "wires": [ - [ - "c0f2a501.1677c8" - ] - ] - }, - { - "id": "8059df68.0963c", - "type": "ui_ui_control", - "z": "55a31f5b.d4ec5", - "name": "", - "events": "change", - "x": 380, - "y": 40, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "custom_nb_frame", + "x": 530, + "y": 120, "wires": [ [] ] }, { - "id": "66e609a2.2d57d8", + "id": "3eaf4c98.d94b54", "type": "function", - "z": "55a31f5b.d4ec5", - "name": "change tab", - "func": "\nmsg.payload={\"tab\":msg.topic};\nreturn msg;", + "z": "863e8384.56889", + "name": "get custom_nb_step", + "func": "msg.payload = msg.payload.custom_nb_step;\nreturn msg;", "outputs": 1, "noerr": 0, "x": 220, - "y": 40, + "y": 80, "wires": [ [ - "8059df68.0963c" + "c4527705.33a84" ] ] }, { - "id": "f8c2a4c7.928f88", - "type": "ui_button", - "z": "c04dcc2a.47862", - "name": "", - "group": "72fe0cc7.df9fd4", - "order": 0, + "id": "8eeb9e9e.a50d7", + "type": "function", + "z": "863e8384.56889", + "name": "get custom_nb_frame", + "func": "msg.payload = msg.payload.custom_nb_frame;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 220, + "y": 120, + "wires": [ + [ + "582e21b2.ad67a8" + ] + ] + }, + { + "id": "e4e16eb9.5296c", + "type": "function", + "z": "863e8384.56889", + "name": "get custom_segmentation", + "func": "msg.payload = msg.payload.custom_segmentation;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 230, + "y": 160, + "wires": [ + [ + "f9705bc.3d322a8" + ] + ] + }, + { + "id": "e50aa637.59ac68", + "type": "function", + "z": "863e8384.56889", + "name": "get custom_sleep_before", + "func": "msg.payload = msg.payload.custom_sleep_before;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 230, + "y": 40, + "wires": [ + [ + "f648e44.94e3998" + ] + ] + }, + { + "id": "f648e44.94e3998", + "type": "ui_text_input", + "z": "863e8384.56889", + "name": "custom_sleep_before", + "label": "Duration before the acquisition (s)", + "tooltip": "", + "group": "48649115.fcd01", + "order": 1, "width": 0, "height": 0, - "passthru": false, - "label": "Home", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", - "payload": "", - "payloadType": "str", - "topic": "Home", - "x": 70, - "y": 40, - "wires": [ - [ - "6715b713.0ea1e8" - ] - ] - }, - { - "id": "16edbf14.c67bb1", - "type": "ui_ui_control", - "z": "c04dcc2a.47862", - "name": "", - "events": "change", - "x": 380, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "custom_sleep_before", + "x": 520, "y": 40, "wires": [ [] ] }, { - "id": "6715b713.0ea1e8", + "id": "11b31baf.95996c", + "type": "ui_text_input", + "z": "5a287804.a10e2", + "name": "process_id", + "label": "Id of the process", + "tooltip": "", + "group": "beeb994e.b67688", + "order": 1, + "width": 0, + "height": 0, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "process_id", + "x": 550, + "y": 80, + "wires": [ + [] + ] + }, + { + "id": "dfb4b682.601e1", "type": "function", - "z": "c04dcc2a.47862", - "name": "change tab", - "func": "\nmsg.payload={\"tab\":msg.topic};\nreturn msg;", + "z": "5a287804.a10e2", + "name": "get process_id", + "func": "msg.payload = msg.payload.process_id+1;\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 220, - "y": 40, + "x": 200, + "y": 80, "wires": [ [ - "16edbf14.c67bb1" + "11b31baf.95996c" ] ] }, { - "id": "e46b58fd.671568", - "type": "ui_button", - "z": "300f077.33624f8", + "id": "3777e513.35c3fa", + "type": "mqtt in", + "z": "a8ad6dec.1a393", "name": "", - "group": "54c8e6e0.223fc8", - "order": 0, + "topic": "receiver/#", + "qos": "0", + "datatype": "auto", + "broker": "84801dc0.193d88", + "x": 80, + "y": 40, + "wires": [ + [ + "9886f960.4b6268", + "589fbae2.8ff914" + ] + ] + }, + { + "id": "9886f960.4b6268", + "type": "switch", + "z": "a8ad6dec.1a393", + "name": "", + "property": "topic", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "receiver/pump", + "vt": "str" + }, + { + "t": "eq", + "v": "receiver/focus", + "vt": "str" + }, + { + "t": "eq", + "v": "receiver/image", + "vt": "str" + }, + { + "t": "cont", + "v": "receiver/segmentation", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 4, + "x": 230, + "y": 40, + "wires": [ + [ + "c90e948f.2f7348" + ], + [ + "1d54f7b3.db7ac8" + ], + [ + "d02a7968.b8874" + ], + [ + "11e60fef.079d38" + ] + ] + }, + { + "id": "c90e948f.2f7348", + "type": "switch", + "z": "a8ad6dec.1a393", + "name": "", + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "Start", + "vt": "str" + }, + { + "t": "eq", + "v": "Done", + "vt": "str" + }, + { + "t": "eq", + "v": "Interrompted", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 3, + "x": 470, + "y": 40, + "wires": [ + [ + "e16b8120.403e8" + ], + [ + "4ea155a3.d8531c" + ], + [ + "3d35b841.e6596" + ] + ] + }, + { + "id": "e16b8120.403e8", + "type": "change", + "z": "a8ad6dec.1a393", + "name": "The pump has started", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "The pump has started", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 920, + "y": 40, + "wires": [ + [ + "1597b08f.5bce8f" + ] + ] + }, + { + "id": "4ea155a3.d8531c", + "type": "change", + "z": "a8ad6dec.1a393", + "name": "The pump has finished.", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "The pump has finished.", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 910, + "y": 80, + "wires": [ + [ + "1597b08f.5bce8f" + ] + ] + }, + { + "id": "3d35b841.e6596", + "type": "change", + "z": "a8ad6dec.1a393", + "name": "The pump has been stopped.", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "The pump has been stopped.", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 900, + "y": 120, + "wires": [ + [ + "1597b08f.5bce8f" + ] + ] + }, + { + "id": "1d54f7b3.db7ac8", + "type": "switch", + "z": "a8ad6dec.1a393", + "name": "", + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "Start", + "vt": "str" + }, + { + "t": "eq", + "v": "Done", + "vt": "str" + }, + { + "t": "eq", + "v": "Interrompted", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 3, + "x": 470, + "y": 200, + "wires": [ + [ + "7ce7cf66.df449" + ], + [ + "8846b607.310e9" + ], + [ + "5a8f4613.c9989" + ] + ] + }, + { + "id": "7ce7cf66.df449", + "type": "change", + "z": "a8ad6dec.1a393", + "name": "The focus has started", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "The focus has started", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 920, + "y": 200, + "wires": [ + [ + "1597b08f.5bce8f" + ] + ] + }, + { + "id": "8846b607.310e9", + "type": "change", + "z": "a8ad6dec.1a393", + "name": "The focus has finished.", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "The focus has finished.", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 910, + "y": 240, + "wires": [ + [ + "1597b08f.5bce8f" + ] + ] + }, + { + "id": "5a8f4613.c9989", + "type": "change", + "z": "a8ad6dec.1a393", + "name": "The focus has been stopped.", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "The focus has been stopped.", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 900, + "y": 280, + "wires": [ + [ + "1597b08f.5bce8f" + ] + ] + }, + { + "id": "d02a7968.b8874", + "type": "switch", + "z": "a8ad6dec.1a393", + "name": "", + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "Start", + "vt": "str" + }, + { + "t": "eq", + "v": "Done", + "vt": "str" + }, + { + "t": "eq", + "v": "Interrompted", + "vt": "str" + }, + { + "t": "cont", + "v": "jpg", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 4, + "x": 470, + "y": 360, + "wires": [ + [ + "d7f9086b.728df8" + ], + [ + "c104db3.a287628" + ], + [ + "e99cb81d.b79df" + ], + [ + "3de45d76.06ab6a", + "1597b08f.5bce8f" + ] + ] + }, + { + "id": "90e10524.6709f", + "type": "switch", + "z": "a8ad6dec.1a393", + "name": "", + "property": "payload", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "Start", + "vt": "str" + }, + { + "t": "eq", + "v": "Done", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 650, + "y": 560, + "wires": [ + [ + "6c8a5e5c.bf0f5" + ], + [ + "90433a26.6fc278" + ] + ] + }, + { + "id": "c104db3.a287628", + "type": "change", + "z": "a8ad6dec.1a393", + "name": "The acquisition has finished.", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "The acquisition has finished.", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 900, + "y": 400, + "wires": [ + [ + "1597b08f.5bce8f" + ] + ] + }, + { + "id": "e99cb81d.b79df", + "type": "change", + "z": "a8ad6dec.1a393", + "name": "The acquisition has been stopped.", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "The acquisition has been stopped.", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 880, + "y": 440, + "wires": [ + [ + "1597b08f.5bce8f" + ] + ] + }, + { + "id": "d7f9086b.728df8", + "type": "change", + "z": "a8ad6dec.1a393", + "name": "The acquisition has started", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "The acquisition has started", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 900, + "y": 360, + "wires": [ + [ + "1597b08f.5bce8f" + ] + ] + }, + { + "id": "3de45d76.06ab6a", + "type": "function", + "z": "a8ad6dec.1a393", + "name": "img_counter.js", + "func": "img_counter=global.get('img_counter')\nimg_counter=img_counter+1\nglobal.set('img_counter',img_counter)\nmsg.payload = img_counter\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 780, + "y": 480, + "wires": [ + [ + "2f2c466d.88c6ba" + ] + ] + }, + { + "id": "aebfa8a2.b4a928", + "type": "function", + "z": "a8ad6dec.1a393", + "name": "obj_counter.js", + "func": "obj_counter=global.get('obj_counter')\nobj_counter=obj_counter+1\nglobal.set('obj_counter',obj_counter)\nmsg.payload = obj_counter\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 780, + "y": 640, + "wires": [ + [ + "add1bf6d.b7a668" + ] + ] + }, + { + "id": "2f2c466d.88c6ba", + "type": "ui_chart", + "z": "a8ad6dec.1a393", + "name": "img_counter", + "group": "eb610eb9.84fae8", + "order": 2, + "width": 23, + "height": 2, + "label": "img_counter", + "chartType": "horizontalBar", + "legend": "false", + "xformat": "HH:mm:ss", + "interpolate": "linear", + "nodata": "", + "dot": false, + "ymin": "", + "ymax": "", + "removeOlder": 1, + "removeOlderPoints": "", + "removeOlderUnit": "3600", + "cutout": 0, + "useOneColor": false, + "colors": [ + "#1f77b4", + "#aec7e8", + "#ff7f0e", + "#2ca02c", + "#98df8a", + "#d62728", + "#ff9896", + "#9467bd", + "#c5b0d5" + ], + "useOldStyle": false, + "outputs": 1, + "x": 950, + "y": 480, + "wires": [ + [] + ] + }, + { + "id": "11e60fef.079d38", + "type": "switch", + "z": "a8ad6dec.1a393", + "name": "", + "property": "topic", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "receiver/segmentation", + "vt": "str" + }, + { + "t": "eq", + "v": "receiver/segmentation/object_id", + "vt": "str" + }, + { + "t": "eq", + "v": "receiver/segmentation/metric", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 3, + "x": 470, + "y": 560, + "wires": [ + [ + "90e10524.6709f" + ], + [ + "aebfa8a2.b4a928" + ], + [ + "7dd159b.6c105a8" + ] + ] + }, + { + "id": "90433a26.6fc278", + "type": "change", + "z": "a8ad6dec.1a393", + "name": "The segmentation has finished.", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "The segmentation has finished.", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 890, + "y": 600, + "wires": [ + [ + "1597b08f.5bce8f" + ] + ] + }, + { + "id": "6c8a5e5c.bf0f5", + "type": "change", + "z": "a8ad6dec.1a393", + "name": "The segmentation has started", + "rules": [ + { + "t": "set", + "p": "payload", + "pt": "msg", + "to": "The segmentation has started", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 890, + "y": 560, + "wires": [ + [ + "1597b08f.5bce8f" + ] + ] + }, + { + "id": "add1bf6d.b7a668", + "type": "ui_chart", + "z": "a8ad6dec.1a393", + "name": "obj_counter", + "group": "eb610eb9.84fae8", + "order": 5, + "width": 23, + "height": 2, + "label": "obj_counter", + "chartType": "horizontalBar", + "legend": "false", + "xformat": "HH:mm:ss", + "interpolate": "linear", + "nodata": "", + "dot": false, + "ymin": "", + "ymax": "", + "removeOlder": 1, + "removeOlderPoints": "", + "removeOlderUnit": "3600", + "cutout": 0, + "useOneColor": true, + "colors": [ + "#1f77b4", + "#aec7e8", + "#ff7f0e", + "#2ca02c", + "#98df8a", + "#d62728", + "#ff9896", + "#9467bd", + "#c5b0d5" + ], + "useOldStyle": false, + "outputs": 1, + "x": 950, + "y": 640, + "wires": [ + [] + ] + }, + { + "id": "6f3399be.761c68", + "type": "function", + "z": "a8ad6dec.1a393", + "name": "", + "func": "msg.payload=msg.payload.object_area\nmsg.topic=\"area\"\n\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 810, + "y": 700, + "wires": [ + [ + "e50c9bb6.397a08" + ] + ] + }, + { + "id": "7dd159b.6c105a8", + "type": "json", + "z": "a8ad6dec.1a393", + "name": "", + "property": "payload", + "action": "", + "pretty": false, + "x": 650, + "y": 700, + "wires": [ + [ + "6f3399be.761c68" + ] + ] + }, + { + "id": "b56d820b.9f7b", + "type": "exec", + "z": "a8ad6dec.1a393", + "command": "free -m | grep \"Mem\" | awk -F ' ' '{print $3}'", + "addpay": false, + "append": "", + "useSpawn": "", + "timer": "", + "name": "Get memory used", + "x": 750, + "y": 780, + "wires": [ + [ + "bb46922a.0aa378" + ], + [], + [] + ] + }, + { + "id": "7c27a4b2.6fe8e4", + "type": "inject", + "z": "a8ad6dec.1a393", + "name": "", + "topic": "", + "payload": "", + "payloadType": "num", + "repeat": "1", + "crontab": "", + "once": false, + "onceDelay": "", + "x": 570, + "y": 780, + "wires": [ + [ + "b56d820b.9f7b" + ] + ] + }, + { + "id": "bb46922a.0aa378", + "type": "ui_chart", + "z": "a8ad6dec.1a393", + "name": "", + "group": "eb610eb9.84fae8", + "order": 1, + "width": 0, + "height": 0, + "label": "Memory load", + "chartType": "line", + "legend": "false", + "xformat": "auto", + "interpolate": "linear", + "nodata": "", + "dot": true, + "ymin": "", + "ymax": "", + "removeOlder": 1, + "removeOlderPoints": "200", + "removeOlderUnit": "3600", + "cutout": 0, + "useOneColor": false, + "colors": [ + "#1f77b4", + "#aec7e8", + "#ff7f0e", + "#2ca02c", + "#98df8a", + "#d62728", + "#ff9896", + "#9467bd", + "#c5b0d5" + ], + "useOldStyle": false, + "outputs": 1, + "x": 950, + "y": 760, + "wires": [ + [] + ] + }, + { + "id": "e50c9bb6.397a08", + "type": "ui_chart", + "z": "a8ad6dec.1a393", + "name": "", + "group": "eb610eb9.84fae8", + "order": 8, + "width": 0, + "height": 0, + "label": "chart", + "chartType": "line", + "legend": "false", + "xformat": "HH:mm:ss", + "interpolate": "linear", + "nodata": "", + "dot": true, + "ymin": "", + "ymax": "", + "removeOlder": 1, + "removeOlderPoints": "1000", + "removeOlderUnit": "3600", + "cutout": 0, + "useOneColor": false, + "colors": [ + "#1f77b4", + "#aec7e8", + "#ff7f0e", + "#2ca02c", + "#98df8a", + "#d62728", + "#ff9896", + "#9467bd", + "#c5b0d5" + ], + "useOldStyle": false, + "outputs": 1, + "x": 970, + "y": 700, + "wires": [ + [] + ] + }, + { + "id": "1597b08f.5bce8f", + "type": "ui_toast", + "z": "a8ad6dec.1a393", + "position": "top right", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 0, + "ok": "OK", + "cancel": "", + "raw": false, + "topic": "", + "name": "", + "x": 1220, + "y": 360, + "wires": [] + }, + { + "id": "85ced3a9.8bc898", + "type": "exec", + "z": "9882c53a.0ccc8", + "command": "vcgencmd measure_temp | tr -d \"temp=\" | tr -d \"'C\" | tr -d \"\\n\"", + "addpay": false, + "append": "", + "useSpawn": "", + "timer": "", + "name": "RPi Temp.", + "x": 350, + "y": 80, + "wires": [ + [ + "8715b9fb.194438" + ], + [], + [] + ] + }, + { + "id": "3bb0ef9d.258af8", + "type": "inject", + "z": "9882c53a.0ccc8", + "name": "", + "topic": "", + "payload": "", + "payloadType": "date", + "repeat": "10", + "crontab": "", + "once": false, + "onceDelay": "", + "x": 190, + "y": 80, + "wires": [ + [ + "85ced3a9.8bc898" + ] + ] + }, + { + "id": "8715b9fb.194438", + "type": "python3-function", + "z": "9882c53a.0ccc8", + "name": "fan.py", + "func": "#!/usr/bin/python\nimport smbus\nimport sys\n\ntemp = msg[\"payload\"]\n\ntemp = int(temp.split('.',1)[0])\n\nbus = smbus.SMBus(1)\n\nDEVICE_ADDRESS = 0x0d\n\nif temp < 38:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\nif temp > 42:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)", + "outputs": 1, + "x": 530, + "y": 80, + "wires": [ + [] + ] + }, + { + "id": "7bdf69d9.8f98e", + "type": "ui_button", + "z": "fbe9590f.bd63b8", + "name": "", + "group": "82b3caaa.0518", + "order": 1, "width": 0, "height": 0, "passthru": false, - "label": "Home", + "label": "Reboot", "tooltip": "", "color": "", - "bgcolor": "", + "bgcolor": "#AD1625", "icon": "", - "payload": "", + "payload": "off", "payloadType": "str", - "topic": "Home", - "x": 70, - "y": 40, + "topic": "reboot", + "x": 220, + "y": 80, "wires": [ [ - "5c885d69.f82f74" + "c55ff479.c166a8" ] ] }, { - "id": "c492a6c.3ff6558", - "type": "ui_ui_control", - "z": "300f077.33624f8", + "id": "f400fb5a.9bc108", + "type": "exec", + "z": "fbe9590f.bd63b8", + "command": "sudo", + "addpay": true, + "append": "", + "useSpawn": "false", + "timer": "2", + "oldrc": false, + "name": "cmd", + "x": 530, + "y": 80, + "wires": [ + [], + [], + [] + ] + }, + { + "id": "867e9bed.e2a298", + "type": "ui_button", + "z": "fbe9590f.bd63b8", "name": "", - "events": "change", - "x": 380, + "group": "82b3caaa.0518", + "order": 2, + "width": 0, + "height": 0, + "passthru": false, + "label": "Shutdown", + "tooltip": "", + "color": "", + "bgcolor": "#AD1625", + "icon": "", + "payload": "off", + "payloadType": "str", + "topic": "shutdown", + "x": 220, + "y": 140, + "wires": [ + [ + "c55ff479.c166a8" + ] + ] + }, + { + "id": "c55ff479.c166a8", + "type": "python3-function", + "z": "fbe9590f.bd63b8", + "name": "action", + "func": "#!/usr/bin/python\nimport smbus\nimport time\nbus = smbus.SMBus(1)\ntime.sleep(1)\n#turn off fan RGB\nbus.write_byte_data(0x0d, 0x07, 0x00)\nbus.write_byte_data(0x0d, 0x07, 0x00)\n\nmsg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg", + "outputs": 1, + "x": 390, + "y": 100, + "wires": [ + [ + "46f85d17.08fa54", + "f400fb5a.9bc108" + ] + ] + }, + { + "id": "46f85d17.08fa54", + "type": "exec", + "z": "fbe9590f.bd63b8", + "command": "i2cdetect -y 1", + "addpay": false, + "append": "", + "useSpawn": "false", + "timer": "1", + "oldrc": false, + "name": "i2c update", + "x": 550, + "y": 140, + "wires": [ + [], + [], + [] + ] + }, + { + "id": "cf0b247b.e3e7c", + "type": "ui_numeric", + "z": "b45c6fb6.f6dfa8", + "name": "object_depth_min", + "label": "Minimum depth (m)", + "tooltip": "", + "group": "f377d75b.32d27", + "order": 3, + "width": 0, + "height": 0, + "wrap": false, + "passthru": true, + "topic": "object_depth_min", + "format": "{{value}}", + "min": "0", + "max": "2000", + "step": "1", + "x": 610, + "y": 120, + "wires": [ + [] + ] + }, + { + "id": "1675637a.1d762d", + "type": "ui_numeric", + "z": "b45c6fb6.f6dfa8", + "name": "object_depth_max", + "label": "Maximum depth (m)", + "tooltip": "", + "group": "f377d75b.32d27", + "order": 2, + "width": 0, + "height": 0, + "wrap": false, + "passthru": true, + "topic": "object_depth_max", + "format": "{{value}}", + "min": "0", + "max": "2000", + "step": "1", + "x": 610, + "y": 160, + "wires": [ + [] + ] + }, + { + "id": "8a61177.8eaa1e8", + "type": "function", + "z": "b45c6fb6.f6dfa8", + "name": "get object_depth_min", + "func": "msg.payload = msg.payload.object_depth_min;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 304, + "y": 120, + "wires": [ + [ + "cf0b247b.e3e7c" + ] + ] + }, + { + "id": "3893c81e.a9b9e", + "type": "function", + "z": "b45c6fb6.f6dfa8", + "name": "get object_depth_max", + "func": "msg.payload = msg.payload.object_depth_max;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 304, + "y": 160, + "wires": [ + [ + "1675637a.1d762d" + ] + ] + }, + { + "id": "f478b054.024158", + "type": "gpsd", + "z": "b45c6fb6.f6dfa8", + "name": "", + "hostname": "localhost", + "port": "2947", + "tpv": true, + "sky": false, + "info": false, + "device": false, + "gst": false, + "att": false, + "x": 90, + "y": 220, + "wires": [ + [ + "bd643763.2a7768", + "edee5fda.673ae" + ] + ] + }, + { + "id": "ca169437.bb25e8", + "type": "ui_worldmap", + "z": "b45c6fb6.f6dfa8", + "d": true, + "group": "f377d75b.32d27", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "lat": "1.5", + "lon": "1.5", + "zoom": "4", + "layer": "OSM grey", + "cluster": "1", + "maxage": "", + "usermenu": "hide", + "layers": "hide", + "panit": "false", + "panlock": "false", + "zoomlock": "false", + "hiderightclick": "true", + "coords": "deg", + "showgrid": "false", + "path": "/worldmap", + "x": 640, + "y": 200, + "wires": [] + }, + { + "id": "bd643763.2a7768", + "type": "function", + "z": "b45c6fb6.f6dfa8", + "name": "get object_lat & object_lon", + "func": "\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 320, + "y": 200, + "wires": [ + [ + "ca169437.bb25e8" + ] + ] + }, + { + "id": "d485fec3.802e", + "type": "function", + "z": "b45c6fb6.f6dfa8", + "name": "set object_time", + "func": "var time = new Date(msg.payload);\n\nvar hour = time.getUTCHours();\nif (hour<10){hour = \"0\"+hour;}\nvar minute = time.getUTCMinutes();\nif (minute<10){minute = \"0\"+minute;}\n\nvar time_UTC = \"\"+hour+minute;\nglobal.set('object_time',time_UTC);\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 804, + "y": 80, + "wires": [ + [] + ] + }, + { + "id": "5196107b.a5eae8", + "type": "function", + "z": "b45c6fb6.f6dfa8", + "name": "set object_date", + "func": "var date = new Date(msg.payload);\n\nvar year = date.getUTCFullYear();\nvar month = date.getUTCMonth()+1;\nif (month<10){month = \"0\"+month;}\nvar day = date.getUTCDate();\nif (day<10){day = \"0\"+day;}\n\nvar date_UTC = \"\"+year+month+day;\nglobal.set('object_date',date_UTC);\n\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 804, "y": 40, "wires": [ [] ] }, { - "id": "5c885d69.f82f74", + "id": "edee5fda.673ae", + "type": "debug", + "z": "b45c6fb6.f6dfa8", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "x": 280, + "y": 360, + "wires": [] + }, + { + "id": "5a5fcc9a.9ede14", "type": "function", - "z": "300f077.33624f8", - "name": "change tab", - "func": "\nmsg.payload={\"tab\":msg.topic};\nreturn msg;", + "z": "6ca1a253.126bb4", + "name": "set optical config", + "func": "global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"acq_magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"acq_magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"acq_magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"acq_magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"acq_magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 220, - "y": 40, + "x": 750, + "y": 360, "wires": [ - [ - "c492a6c.3ff6558" - ] + [] ] }, { - "id": "cb7440f4.3efff", - "type": "ui_button", - "z": "121f01ae.4c4abe", - "name": "", - "group": "5841eafd.95e5e4", - "order": 0, + "id": "3d3aafbf.e907a8", + "type": "ui_dropdown", + "z": "6ca1a253.126bb4", + "name": "acq_fnumber_objective", + "label": "M12 Lens*", + "tooltip": "", + "place": "Select option", + "group": "60b93a5.a032344", + "order": 3, "width": 0, "height": 0, - "passthru": false, - "label": "Home", - "tooltip": "", - "color": "", - "bgcolor": "", - "icon": "", + "passthru": true, + "options": [ + { + "label": "f 25mm 1/2\" 5MP IR", + "value": 25, + "type": "num" + }, + { + "label": "f 16mm 1/2.5\" 5MP IR", + "value": 16, + "type": "num" + }, + { + "label": "f 12mm 1/2.5\" 5MP IR", + "value": 12, + "type": "num" + }, + { + "label": "f 8mm 1/2.5\" 5MP IR", + "value": 8, + "type": "num" + }, + { + "label": "f 6mm 1/2.5\" 5MP IR", + "value": 6, + "type": "num" + } + ], "payload": "", - "payloadType": "str", - "topic": "Home", - "x": 70, - "y": 40, + "topic": "acq_fnumber_objective", + "x": 526, + "y": 360, "wires": [ [ - "b0b1ec9.5371e1" + "5a5fcc9a.9ede14" ] ] }, { - "id": "a4505700.60eb18", - "type": "ui_ui_control", - "z": "121f01ae.4c4abe", - "name": "", - "events": "change", - "x": 380, + "id": "12e818fa.b7301f", + "type": "ui_numeric", + "z": "6ca1a253.126bb4", + "name": "acq_minimum_mesh", + "label": "Min fraction size (μm)", + "tooltip": "", + "group": "60b93a5.a032344", + "order": 8, + "width": 0, + "height": 0, + "wrap": false, + "passthru": true, + "topic": "acq_minimum_mesh", + "format": "{{value}}", + "min": 0, + "max": "300", + "step": "10", + "x": 536, + "y": 160, + "wires": [ + [] + ] + }, + { + "id": "b577dcd2.8d2c88", + "type": "ui_numeric", + "z": "6ca1a253.126bb4", + "name": "acq_maximum_mesh", + "label": "Max fraction size (μm)", + "tooltip": "", + "group": "60b93a5.a032344", + "order": 4, + "width": 0, + "height": 0, + "wrap": false, + "passthru": true, + "topic": "acq_maximum_mesh", + "format": "{{value}}", + "min": "200", + "max": "2000", + "step": "100", + "x": 536, + "y": 200, + "wires": [ + [] + ] + }, + { + "id": "21b35429.fe43a4", + "type": "ui_text_input", + "z": "6ca1a253.126bb4", + "name": "acq_id", + "label": "Acquisition unique ID*", + "tooltip": "", + "group": "60b93a5.a032344", + "order": 1, + "width": 0, + "height": 0, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "acq_id", + "x": 586, "y": 40, "wires": [ [] ] }, { - "id": "b0b1ec9.5371e1", + "id": "c4e69883.a0f3d", + "type": "ui_dropdown", + "z": "6ca1a253.126bb4", + "name": "acq_celltype", + "label": "Thickness flowcell*", + "tooltip": "", + "place": "Select option", + "group": "60b93a5.a032344", + "order": 7, + "width": 0, + "height": 0, + "passthru": true, + "options": [ + { + "label": "200 μm µ-Slide I Luer", + "value": 200, + "type": "num" + }, + { + "label": "400 μm µ-Slide I Luer", + "value": 400, + "type": "num" + }, + { + "label": "600 μm µ-Slide I Luer", + "value": 600, + "type": "num" + }, + { + "label": "800 μm µ-Slide I Luer", + "value": 800, + "type": "num" + } + ], + "payload": "", + "topic": "acq_celltype", + "x": 566, + "y": 120, + "wires": [ + [] + ] + }, + { + "id": "f7f5ccc1.29a41", + "type": "ui_text_input", + "z": "6ca1a253.126bb4", + "name": "acq_volume", + "label": "Volume to pass (ml)", + "tooltip": "", + "group": "60b93a5.a032344", + "order": 2, + "width": 0, + "height": 0, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "acq_volume", + "x": 566, + "y": 240, + "wires": [ + [] + ] + }, + { + "id": "f0595ff1.c4d568", + "type": "ui_text_input", + "z": "6ca1a253.126bb4", + "name": "acq_instrument", + "label": "Acquisition instrument", + "tooltip": "PlanktonScope V2.1", + "group": "60b93a5.a032344", + "order": 6, + "width": 0, + "height": 0, + "passthru": true, + "mode": "text", + "delay": 300, + "topic": "acq_instrument", + "x": 556, + "y": 80, + "wires": [ + [] + ] + }, + { + "id": "93a3fd29.c55938", "type": "function", - "z": "121f01ae.4c4abe", - "name": "change tab", - "func": "\nmsg.payload={\"tab\":msg.topic};\nreturn msg;", + "z": "6ca1a253.126bb4", + "name": "get acq_id", + "func": "msg.payload = msg.payload.acq_id+1;\nreturn msg;", "outputs": 1, "noerr": 0, - "x": 220, + "x": 210, "y": 40, "wires": [ [ - "a4505700.60eb18" + "21b35429.fe43a4" ] ] + }, + { + "id": "9e9e7f8a.b66d4", + "type": "function", + "z": "6ca1a253.126bb4", + "name": "get acq_instrument", + "func": "msg.payload = msg.payload.acq_instrument;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 230, + "y": 80, + "wires": [ + [ + "f0595ff1.c4d568" + ] + ] + }, + { + "id": "b1105180.b4b78", + "type": "function", + "z": "6ca1a253.126bb4", + "name": "get acq_celltype", + "func": "msg.payload = msg.payload.acq_celltype;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 220, + "y": 120, + "wires": [ + [ + "c4e69883.a0f3d" + ] + ] + }, + { + "id": "ec403304.e34c58", + "type": "function", + "z": "6ca1a253.126bb4", + "name": "get acq_minimum_mesh", + "func": "msg.payload = msg.payload.acq_minimum_mesh;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 250, + "y": 160, + "wires": [ + [ + "12e818fa.b7301f" + ] + ] + }, + { + "id": "7aac5c46.0669ec", + "type": "function", + "z": "6ca1a253.126bb4", + "name": "get acq_maximum_mesh", + "func": "msg.payload = msg.payload.acq_maximum_mesh;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 250, + "y": 200, + "wires": [ + [ + "b577dcd2.8d2c88" + ] + ] + }, + { + "id": "c491cf7.36957b", + "type": "function", + "z": "6ca1a253.126bb4", + "name": "get acq_volume", + "func": "msg.payload = msg.payload.acq_volume;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 220, + "y": 240, + "wires": [ + [ + "f7f5ccc1.29a41" + ] + ] + }, + { + "id": "31d58fcd.ede758", + "type": "function", + "z": "6ca1a253.126bb4", + "name": "get acq_fnumber_objective", + "func": "msg.payload = msg.payload.acq_fnumber_objective;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 260, + "y": 360, + "wires": [ + [ + "3d3aafbf.e907a8" + ] + ] + }, + { + "id": "bd733bef.7efd08", + "type": "ui_numeric", + "z": "6ca1a253.126bb4", + "name": "acq_min_esd", + "label": "Minimum size to segment (μm)", + "tooltip": "", + "group": "60b93a5.a032344", + "order": 9, + "width": 0, + "height": 0, + "wrap": false, + "passthru": true, + "topic": "acq_min_esd", + "format": "{{value}}", + "min": 0, + "max": "300", + "step": "5", + "x": 566, + "y": 280, + "wires": [ + [] + ] + }, + { + "id": "a6057924.bc14", + "type": "ui_numeric", + "z": "6ca1a253.126bb4", + "name": "acq_max_esd", + "label": "Maximum size to segment (μm)", + "tooltip": "", + "group": "60b93a5.a032344", + "order": 5, + "width": 0, + "height": 0, + "wrap": false, + "passthru": true, + "topic": "acq_max_esd", + "format": "{{value}}", + "min": "100", + "max": "2000", + "step": "5", + "x": 556, + "y": 320, + "wires": [ + [] + ] + }, + { + "id": "e0644195.305068", + "type": "function", + "z": "6ca1a253.126bb4", + "name": "get acq_min_esd", + "func": "msg.payload = msg.payload.acq_min_esd;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 230, + "y": 280, + "wires": [ + [ + "bd733bef.7efd08" + ] + ] + }, + { + "id": "e3fe6242.bfaf18", + "type": "function", + "z": "6ca1a253.126bb4", + "name": "get acq_max_esd", + "func": "msg.payload = msg.payload.acq_max_esd;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 230, + "y": 320, + "wires": [ + [ + "a6057924.bc14" + ] + ] + }, + { + "id": "edfb5b10.95636", + "type": "function", + "z": "626459d2.f9c98", + "name": "pump.js", + "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar manual_volume= global.get(\"pump_manual_volume\");\nvar flowrate= global.get(\"pump_flowrate\");\n\nif (manual_volume === undefined || manual_volume === \"\" || manual_volume === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume to pass\";\n \n}else if (flowrate === undefined || flowrate === \"\" || flowrate === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Flowrate\";\n \n}else {\n volume = global.get(\"pump_manual_volume\");\n nb_step=volume*507\n msg.volume = volume;\n flowrate = global.get(\"pump_flowrate\");\n duration=(volume*60)/flowrate\n delay=(duration/nb_step)-0.005\n msg.topic = \"actuator/pump\";\n \n if(msg.payload === \"FORWARD\" & state===\"free\"){\n msg.payload='FORWARD '+delay+' '+nb_step;\n }\n if(msg.payload === \"BACKWARD\" & state===\"free\"){\n msg.payload='BACKWARD '+delay+' '+nb_step;\n }\n}\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 640, + "y": 140, + "wires": [ + [ + "fb35e49.f64de18" + ] + ], + "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" + }, + { + "id": "26686514.749b4a", + "type": "ui_button", + "z": "626459d2.f9c98", + "name": "BACKWARD", + "group": "4153382f.45437", + "order": 2, + "width": 6, + "height": 1, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "arrow_back", + "payload": "BACKWARD", + "payloadType": "str", + "topic": "actuator/pump", + "x": 470, + "y": 120, + "wires": [ + [ + "edfb5b10.95636" + ] + ] + }, + { + "id": "bee2fd6d.cffb28", + "type": "ui_button", + "z": "626459d2.f9c98", + "name": "FORWARD", + "group": "4153382f.45437", + "order": 4, + "width": 6, + "height": 1, + "passthru": true, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "arrow_forward", + "payload": "FORWARD", + "payloadType": "str", + "topic": "actuator/pump", + "x": 470, + "y": 160, + "wires": [ + [ + "edfb5b10.95636" + ] + ] + }, + { + "id": "fb35e49.f64de18", + "type": "switch", + "z": "626459d2.f9c98", + "name": "", + "property": "topic", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "actuator/pump", + "vt": "str" + }, + { + "t": "eq", + "v": "Missing entry :", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 770, + "y": 140, + "wires": [ + [ + "f6aa3e03.85018" + ], + [ + "f6dcda51.633398" + ] + ] + }, + { + "id": "f6dcda51.633398", + "type": "ui_toast", + "z": "626459d2.f9c98", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "topic": "", + "name": "", + "x": 930, + "y": 160, + "wires": [ + [] + ] + }, + { + "id": "c3edd9e7.1ac36", + "type": "ui_button", + "z": "626459d2.f9c98", + "name": "stop pump", + "group": "4153382f.45437", + "order": 5, + "width": 4, + "height": 1, + "passthru": true, + "label": "STOP PUMP", + "tooltip": "", + "color": "", + "bgcolor": "#AD1625", + "icon": "", + "payload": "off", + "payloadType": "str", + "topic": "actuator/wait", + "x": 470, + "y": 200, + "wires": [ + [ + "2521ba15.88a58e" + ] + ] + }, + { + "id": "f6aa3e03.85018", + "type": "mqtt out", + "z": "626459d2.f9c98", + "name": "", + "topic": "", + "qos": "", + "retain": "", + "broker": "e8ab36cc.74d77", + "x": 910, + "y": 120, + "wires": [] + }, + { + "id": "2521ba15.88a58e", + "type": "mqtt out", + "z": "626459d2.f9c98", + "name": "", + "topic": "", + "qos": "", + "retain": "", + "broker": "e8ab36cc.74d77", + "x": 610, + "y": 200, + "wires": [] + }, + { + "id": "2f9ec1a6.d5fb66", + "type": "ui_text_input", + "z": "626459d2.f9c98", + "name": "pump_manual_volume", + "label": "Volume to pass (ml)", + "tooltip": "", + "group": "4153382f.45437", + "order": 3, + "width": 8, + "height": 1, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "pump_manual_volume", + "x": 480, + "y": 80, + "wires": [ + [] + ] + }, + { + "id": "50093f5.8e35ec", + "type": "function", + "z": "626459d2.f9c98", + "name": "get pump_manual_volume", + "func": "msg.payload = msg.payload.pump_manual_volume;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 220, + "y": 80, + "wires": [ + [ + "2f9ec1a6.d5fb66" + ] + ] + }, + { + "id": "fa485315.928ae", + "type": "ui_slider", + "z": "626459d2.f9c98", + "name": "pump_flowrate", + "label": "Flowrate (ml/min)*", + "tooltip": "", + "group": "4153382f.45437", + "order": 1, + "width": 0, + "height": 0, + "passthru": true, + "outs": "end", + "topic": "pump_flowrate", + "min": 0, + "max": "20", + "step": "0.1", + "x": 500, + "y": 40, + "wires": [ + [] + ] + }, + { + "id": "f7b6f5e7.7b7ca", + "type": "function", + "z": "626459d2.f9c98", + "name": "get pump_flowrate", + "func": "msg.payload = msg.payload.pump_flowrate;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 190, + "y": 40, + "wires": [ + [ + "fa485315.928ae" + ] + ] + }, + { + "id": "7297e2f7.dce564", + "type": "ui_text_input", + "z": "5c516299.73e054", + "name": "focus_nb_step", + "label": "Number of step(s)", + "tooltip": "", + "group": "69433259.f306fc", + "order": 2, + "width": 8, + "height": 1, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "focus_nb_step", + "x": 540, + "y": 40, + "wires": [ + [] + ] + }, + { + "id": "60dc5851.6962b", + "type": "function", + "z": "5c516299.73e054", + "name": "get focus_nb_step", + "func": "msg.payload = msg.payload.focus_nb_step;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 230, + "y": 40, + "wires": [ + [ + "7297e2f7.dce564" + ] + ] + }, + { + "id": "7200408d.a1be4", + "type": "ui_button", + "z": "5c516299.73e054", + "name": "DOWN", + "group": "69433259.f306fc", + "order": 3, + "width": 6, + "height": 1, + "passthru": true, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "arrow_downward", + "payload": "DOWN", + "payloadType": "str", + "topic": "actuator/focus", + "x": 520, + "y": 120, + "wires": [ + [ + "2e2a455b.5ff4fa" + ] + ] + }, + { + "id": "7f823e6.d3bcfc", + "type": "ui_button", + "z": "5c516299.73e054", + "name": "UP", + "group": "69433259.f306fc", + "order": 1, + "width": 6, + "height": 1, + "passthru": false, + "label": "", + "tooltip": "", + "color": "", + "bgcolor": "", + "icon": "arrow_upwards", + "payload": "UP", + "payloadType": "str", + "topic": "actuator/focus", + "x": 530, + "y": 81, + "wires": [ + [ + "2e2a455b.5ff4fa" + ] + ] + }, + { + "id": "54482c7a.a384ac", + "type": "switch", + "z": "5c516299.73e054", + "name": "", + "property": "topic", + "propertyType": "msg", + "rules": [ + { + "t": "eq", + "v": "actuator/focus", + "vt": "str" + }, + { + "t": "eq", + "v": "Missing entry :", + "vt": "str" + } + ], + "checkall": "true", + "repair": false, + "outputs": 2, + "x": 810, + "y": 100, + "wires": [ + [ + "2a7a3d34.08e2a2" + ], + [ + "4277442b.04d1b4" + ] + ] + }, + { + "id": "4277442b.04d1b4", + "type": "ui_toast", + "z": "5c516299.73e054", + "position": "dialog", + "displayTime": "3", + "highlight": "", + "sendall": true, + "outputs": 1, + "ok": "OK", + "cancel": "", + "raw": false, + "topic": "", + "name": "", + "x": 970, + "y": 140, + "wires": [ + [] + ] + }, + { + "id": "2e2a455b.5ff4fa", + "type": "function", + "z": "5c516299.73e054", + "name": "focus.js", + "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar nb_step= global.get(\"focus_nb_step\");\n\nif (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of steps\";\n \n}else {\n nb_step= global.get(\"focus_nb_step\");\n if(msg.payload === \"UP\" & state===\"free\"){\n msg.payload=\"FORWARD \"+nb_step;\n }\n if(msg.payload === \"DOWN\" & state===\"free\"){\n msg.payload=\"BACKWARD \"+nb_step;\n }\n}\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 660, + "y": 100, + "wires": [ + [ + "54482c7a.a384ac" + ] + ], + "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" + }, + { + "id": "73e0d0c.c07ab3", + "type": "ui_button", + "z": "5c516299.73e054", + "name": "stop focus", + "group": "69433259.f306fc", + "order": 4, + "width": 4, + "height": 1, + "passthru": true, + "label": "STOP FOCUS", + "tooltip": "", + "color": "", + "bgcolor": "#AD1625", + "icon": "", + "payload": "off", + "payloadType": "str", + "topic": "actuator/wait", + "x": 510, + "y": 160, + "wires": [ + [ + "8e86348d.69657" + ] + ] + }, + { + "id": "2a7a3d34.08e2a2", + "type": "mqtt out", + "z": "5c516299.73e054", + "name": "", + "topic": "", + "qos": "", + "retain": "", + "broker": "e8ab36cc.74d77", + "x": 950, + "y": 80, + "wires": [] + }, + { + "id": "8e86348d.69657", + "type": "mqtt out", + "z": "5c516299.73e054", + "name": "", + "topic": "", + "qos": "", + "retain": "", + "broker": "e8ab36cc.74d77", + "x": 650, + "y": 160, + "wires": [] + }, + { + "id": "10f1e5c1.3cb69a", + "type": "ui_text_input", + "z": "efeebffd.34c7e", + "name": "sample_ship", + "label": "Name of the ship", + "tooltip": "", + "group": "417f91c9.193ab", + "order": 2, + "width": 0, + "height": 0, + "passthru": true, + "mode": "text", + "delay": 300, + "topic": "sample_ship", + "x": 590, + "y": 120, + "wires": [ + [] + ] + }, + { + "id": "da0c5a96.74c0e", + "type": "ui_dropdown", + "z": "efeebffd.34c7e", + "name": "sample_sampling_gear", + "label": "Sampling gear", + "tooltip": "", + "place": "Select", + "group": "417f91c9.193ab", + "order": 4, + "width": 0, + "height": 0, + "passthru": true, + "options": [ + { + "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": "Flask", + "value": "flask", + "type": "str" + } + ], + "payload": "", + "topic": "sample_sampling_gear", + "x": 550, + "y": 200, + "wires": [ + [] + ] + }, + { + "id": "aa90b06d.ca78e", + "type": "ui_text_input", + "z": "efeebffd.34c7e", + "name": "sample_operator", + "label": "Name of the operator", + "tooltip": "", + "group": "417f91c9.193ab", + "order": 3, + "width": 0, + "height": 0, + "passthru": true, + "mode": "text", + "delay": 300, + "topic": "sample_operator", + "x": 570, + "y": 160, + "wires": [ + [] + ] + }, + { + "id": "1cb896c7.6dfc11", + "type": "ui_text_input", + "z": "efeebffd.34c7e", + "name": "sample_project", + "label": "Name of the project*", + "tooltip": "", + "group": "417f91c9.193ab", + "order": 1, + "width": 0, + "height": 0, + "passthru": true, + "mode": "text", + "delay": 300, + "topic": "sample_project", + "x": 580, + "y": 40, + "wires": [ + [] + ] + }, + { + "id": "288ba4b3.a9a2cc", + "type": "ui_text_input", + "z": "efeebffd.34c7e", + "name": "sample_id", + "label": "ID of the station*", + "tooltip": "", + "group": "417f91c9.193ab", + "order": 5, + "width": 0, + "height": 0, + "passthru": true, + "mode": "number", + "delay": 300, + "topic": "sample_id", + "x": 590, + "y": 80, + "wires": [ + [] + ] + }, + { + "id": "78f5791d.946bd8", + "type": "function", + "z": "efeebffd.34c7e", + "name": "get sample_projet", + "func": "msg.payload = msg.payload.sample_project;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 250, + "y": 40, + "wires": [ + [ + "1cb896c7.6dfc11" + ] + ] + }, + { + "id": "2a09d440.119154", + "type": "function", + "z": "efeebffd.34c7e", + "name": "get sample_ship", + "func": "msg.payload = msg.payload.sample_ship;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 240, + "y": 120, + "wires": [ + [ + "10f1e5c1.3cb69a" + ] + ] + }, + { + "id": "346d141f.ebab3c", + "type": "function", + "z": "efeebffd.34c7e", + "name": "get sample_id", + "func": "msg.payload = msg.payload.sample_id+1;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 240, + "y": 80, + "wires": [ + [ + "288ba4b3.a9a2cc" + ] + ] + }, + { + "id": "2d438355.ed942c", + "type": "function", + "z": "efeebffd.34c7e", + "name": "get sample_operator", + "func": "msg.payload = msg.payload.sample_operator;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 260, + "y": 160, + "wires": [ + [ + "aa90b06d.ca78e" + ] + ] + }, + { + "id": "ac4a71a.c35309", + "type": "function", + "z": "efeebffd.34c7e", + "name": "get sample_sampling_gear", + "func": "msg.payload = msg.payload.sample_sampling_gear;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 280, + "y": 200, + "wires": [ + [ + "da0c5a96.74c0e" + ] + ] + }, + { + "id": "45482528.43f93c", + "type": "function", + "z": "ff9251a5.9c5e18", + "name": "get global", + "func": "msg.payload={\n \n \"sample_project\":global.get(\"sample_project\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n //\"acq_instrument_id\":global.get(\"acq_instrument_id\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_min_esd\":global.get(\"acq_min_esd\"),\n \"acq_max_esd\":global.get(\"acq_max_esd\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_magnification\":global.get(\"magnification\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \n \"acq_camera_name\":\"Pi Camera V2.1 - 8MP\",\n \n \"object_date\":global.get(\"object_date\"),\n \"object_time\":global.get(\"object_time\"),\n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \"object_depth_min\":global.get(\"object_depth_min\"),\n \"object_depth_max\":global.get(\"object_depth_max\"),\n \n \"custom_nb_frame\":global.get(\"custom_nb_frame\"),\n \"custom_nb_step\":global.get(\"custom_nb_step\"),\n \"custom_segmentation\":global.get(\"custom_segmentation\"),\n \"custom_sleep_before\":global.get(\"custom_sleep_before\"),\n \"focus_nb_step\":global.get(\"focus_nb_step\"),\n \"pump_flowrate\":global.get(\"pump_flowrate\"),\n \"pump_manual_volume\":global.get(\"pump_manual_volume\"),\n \n \"process_pixel\":global.get(\"process_pixel\"),\n \"process_id\":global.get(\"process_id\")\n \n \n};\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 1260, + "y": 160, + "wires": [ + [ + "fe81be99.6859e8" + ] + ] + }, + { + "id": "a5f18550.68466", + "type": "file", + "z": "ff9251a5.9c5e18", + "name": "", + "filename": "/home/pi/PlanktonScope/config.json", + "appendNewline": true, + "createDir": true, + "overwriteFile": "true", + "encoding": "none", + "x": 1640, + "y": 160, + "wires": [ + [] + ] + }, + { + "id": "fe81be99.6859e8", + "type": "json", + "z": "ff9251a5.9c5e18", + "name": "config.json", + "property": "payload", + "action": "str", + "pretty": true, + "x": 1410, + "y": 160, + "wires": [ + [ + "a5f18550.68466" + ] + ] + }, + { + "id": "b24cc280.5a59b", + "type": "file in", + "z": "ff9251a5.9c5e18", + "name": "", + "filename": "/home/pi/PlanktonScope/config.json", + "format": "utf8", + "chunk": false, + "sendError": false, + "encoding": "none", + "x": 360, + "y": 80, + "wires": [ + [ + "11e5237b.e558c5" + ] + ], + "info": "# PlanktonScope Help\nThis Node will read the content of the file named **config.txt** containing all the input placeholders.\n" + }, + { + "id": "4c6084c.1b7bb7c", + "type": "inject", + "z": "ff9251a5.9c5e18", + "name": "on_load", + "topic": "", + "payload": "", + "payloadType": "date", + "repeat": "", + "crontab": "", + "once": true, + "onceDelay": 0.1, + "x": 120, + "y": 80, + "wires": [ + [ + "b24cc280.5a59b", + "845bb10c.d99208", + "a01c8373.701628" + ] + ], + "info": "# PlanktonScope Help\nWhen the **Pi** is booting, **Node-RED** will be initiated and this node will be activated once and execute the following nodes." + }, + { + "id": "11e5237b.e558c5", + "type": "json", + "z": "ff9251a5.9c5e18", + "name": "config.json", + "property": "payload", + "action": "", + "pretty": false, + "x": 610, + "y": 80, + "wires": [ + [ + "9dc8498a.4a36b", + "9b67b810.97a618", + "32282348.35c09c", + "fe7c0e45.ee983", + "3e6ceaa0.5fad56", + "9e577327.d9a1f", + "c50792f5.6b5148" + ] + ] + }, + { + "id": "f72f54db.590c9", + "type": "function", + "z": "ff9251a5.9c5e18", + "name": "set global", + "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 1080, + "y": 80, + "wires": [ + [ + "45482528.43f93c" + ] + ] + }, + { + "id": "2372125a.7f69d6", + "type": "rpi-gpio out", + "z": "ff9251a5.9c5e18", + "name": "", + "pin": "40", + "set": "", + "level": "0", + "freq": "", + "out": "out", + "x": 440, + "y": 120, + "wires": [] + }, + { + "id": "bae08e6f.11bc28", + "type": "ui_template", + "z": "ff9251a5.9c5e18", + "group": "dc721eb.9ef51e", + "name": "Stream Pi Camera", + "order": 1, + "width": 24, + "height": 11, + "format": "
", + "storeOutMessages": true, + "fwdInMessages": true, + "templateScope": "local", + "x": 850, + "y": 320, + "wires": [ + [] + ] + }, + { + "id": "845bb10c.d99208", + "type": "function", + "z": "ff9251a5.9c5e18", + "name": "init LED", + "func": "msg.payload=1;\nreturn msg;", + "outputs": 1, + "noerr": 0, + "x": 280, + "y": 120, + "wires": [ + [ + "2372125a.7f69d6" + ] + ] + }, + { + "id": "9dc8498a.4a36b", + "type": "subflow:efeebffd.34c7e", + "z": "ff9251a5.9c5e18", + "name": "", + "env": [], + "x": 830, + "y": 80, + "wires": [ + [ + "f72f54db.590c9" + ] + ] + }, + { + "id": "9e577327.d9a1f", + "type": "subflow:5c516299.73e054", + "z": "ff9251a5.9c5e18", + "name": "", + "env": [], + "x": 846, + "y": 242, + "wires": [ + [ + "f72f54db.590c9" + ] + ] + }, + { + "id": "c50792f5.6b5148", + "type": "subflow:626459d2.f9c98", + "z": "ff9251a5.9c5e18", + "name": "", + "env": [], + "x": 846, + "y": 282, + "wires": [ + [ + "f72f54db.590c9" + ] + ] + }, + { + "id": "9b67b810.97a618", + "type": "subflow:6ca1a253.126bb4", + "z": "ff9251a5.9c5e18", + "name": "", + "env": [], + "x": 840, + "y": 120, + "wires": [ + [ + "f72f54db.590c9" + ], + [ + "45482528.43f93c" + ] + ] + }, + { + "id": "32282348.35c09c", + "type": "subflow:b45c6fb6.f6dfa8", + "z": "ff9251a5.9c5e18", + "name": "", + "env": [], + "x": 820, + "y": 160, + "wires": [ + [ + "f72f54db.590c9" + ], + [ + "45482528.43f93c" + ] + ] + }, + { + "id": "8e1d0d8d.fc54d8", + "type": "subflow:fbe9590f.bd63b8", + "z": "ff9251a5.9c5e18", + "name": "System commands", + "env": [], + "x": 850, + "y": 500, + "wires": [] + }, + { + "id": "f8a906b3.a2c81", + "type": "subflow:9882c53a.0ccc8", + "z": "ff9251a5.9c5e18", + "name": "", + "env": [], + "x": 320, + "y": 280, + "wires": [] + }, + { + "id": "b1be7e1e.9ec3c8", + "type": "subflow:a8ad6dec.1a393", + "z": "ff9251a5.9c5e18", + "name": "", + "env": [], + "x": 850, + "y": 420, + "wires": [] + }, + { + "id": "fe7c0e45.ee983", + "type": "subflow:5a287804.a10e2", + "z": "ff9251a5.9c5e18", + "name": "process metadata", + "env": [], + "x": 830, + "y": 200, + "wires": [ + [ + "f72f54db.590c9" + ] + ] + }, + { + "id": "3e6ceaa0.5fad56", + "type": "subflow:863e8384.56889", + "z": "ff9251a5.9c5e18", + "name": "Acquisition inputs", + "env": [], + "x": 836, + "y": 362, + "wires": [ + [ + "f72f54db.590c9" + ] + ], + "icon": "node-red-dashboard/ui_switch.png" + }, + { + "id": "a01c8373.701628", + "type": "subflow:c10e968b.87e488", + "z": "ff9251a5.9c5e18", + "name": "", + "env": [], + "x": 300, + "y": 200, + "wires": [] + }, + { + "id": "1924ce1c.0459f2", + "type": "subflow:c1d3ff7c.4384f", + "z": "ff9251a5.9c5e18", + "name": "", + "env": [], + "x": 290, + "y": 240, + "wires": [] + }, + { + "id": "d3892f94.428a28", + "type": "subflow:bba19d97.b32b1", + "z": "ff9251a5.9c5e18", + "name": "", + "env": [], + "x": 850, + "y": 460, + "wires": [] + }, + { + "id": "e73525a.1103158", + "type": "ui_switch", + "z": "ff9251a5.9c5e18", + "name": "", + "label": "LED", + "tooltip": "", + "group": "9c86b3b7.54841", + "order": 10, + "width": 0, + "height": 0, + "passthru": true, + "decouple": "false", + "topic": "", + "style": "", + "onvalue": "true", + "onvalueType": "bool", + "onicon": "", + "oncolor": "", + "offvalue": "false", + "offvalueType": "bool", + "officon": "", + "offcolor": "", + "x": 270, + "y": 160, + "wires": [ + [ + "2372125a.7f69d6" + ] + ] + }, + { + "id": "be37d12f.0898f", + "type": "file", + "z": "c1d3ff7c.4384f", + "name": "", + "filename": "/home/pi/PlanktonScope/script/main.py", + "appendNewline": false, + "createDir": true, + "overwriteFile": "true", + "encoding": "none", + "x": 530, + "y": 100, + "wires": [ + [ + "23f3e613.20ad82" + ] + ] + }, + { + "id": "49e31e85.7ac51", + "type": "template", + "z": "c1d3ff7c.4384f", + "name": "main.py", + "field": "payload", + "fieldType": "msg", + "format": "python", + "syntax": "plain", + "template": "################################################################################\n#Actuator Libraries\n################################################################################\n\n#Library for exchaning messages with Node-RED\nimport paho.mqtt.client as mqtt\n\n#Library to control the PiCamera\nfrom picamera import PiCamera\n\n#Libraries to control the steppers for focusing and pumping\nfrom adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\n\n#Library to send command over I2C for the light module on the fan\nimport smbus\n\n################################################################################\n#Practical Libraries\n################################################################################\n\n#Library to get date and time for folder name and filename\nfrom datetime import datetime, timedelta\n\n#Library to be able to sleep for a duration\nfrom time import sleep\n\n#Libraries manipulate json format, execute bash commands\nimport json, shutil, os, subprocess\n\n################################################################################\n#Morphocut Libraries\n################################################################################\n\nfrom skimage.util import img_as_ubyte\nfrom morphocut import Call\nfrom morphocut.contrib.ecotaxa import EcotaxaWriter\nfrom morphocut.contrib.zooprocess import CalculateZooProcessFeatures\nfrom morphocut.core import Pipeline\nfrom morphocut.file import Find\nfrom morphocut.image import (ExtractROI,\n FindRegions,\n ImageReader,\n ImageWriter,\n RescaleIntensity,\n RGB2Gray\n)\nfrom morphocut.stat import RunningMedian\nfrom morphocut.str import Format\nfrom morphocut.stream import TQDM, Enumerate, FilterVariables\n\n################################################################################\n#Other image processing Libraries\n################################################################################\n\nfrom skimage.feature import canny\nfrom skimage.color import rgb2gray, label2rgb\nfrom skimage.morphology import disk\nfrom skimage.morphology import erosion, dilation, closing\nfrom skimage.measure import label, regionprops\nimport cv2\n\n################################################################################\n#Streaming PiCamera over server\n################################################################################\nimport io\nimport picamera\nimport logging\nimport socketserver\nfrom threading import Condition\nfrom http import server\nimport threading\n\n################################################################################\n#Creation of the webpage containing the PiCamera Streaming\n################################################################################\n\nPAGE=\"\"\"\\\n\n\nPlanktonScope v2 | PiCamera Streaming\n\n\n\n\n\n\"\"\"\n\n################################################################################\n#Classes for the PiCamera Streaming\n################################################################################\n\nclass StreamingOutput(object):\n def __init__(self):\n self.frame = None\n self.buffer = io.BytesIO()\n self.condition = Condition()\n\n def write(self, buf):\n if buf.startswith(b'\\xff\\xd8'):\n # New frame, copy the existing buffer's content and notify all\n # clients it's available\n self.buffer.truncate()\n with self.condition:\n self.frame = self.buffer.getvalue()\n self.condition.notify_all()\n self.buffer.seek(0)\n return self.buffer.write(buf)\n\nclass StreamingHandler(server.BaseHTTPRequestHandler):\n def do_GET(self):\n if self.path == '/':\n self.send_response(301)\n self.send_header('Location', '/index.html')\n self.end_headers()\n elif self.path == '/index.html':\n content = PAGE.encode('utf-8')\n self.send_response(200)\n self.send_header('Content-Type', 'text/html')\n self.send_header('Content-Length', len(content))\n self.end_headers()\n self.wfile.write(content)\n elif self.path == '/stream.mjpg':\n self.send_response(200)\n self.send_header('Age', 0)\n self.send_header('Cache-Control', 'no-cache, private')\n self.send_header('Pragma', 'no-cache')\n self.send_header('Content-Type', 'multipart/x-mixed-replace; boundary=FRAME')\n self.end_headers()\n try:\n while True:\n with output.condition:\n output.condition.wait()\n frame = output.frame\n self.wfile.write(b'--FRAME\\r\\n')\n self.send_header('Content-Type', 'image/jpeg')\n self.send_header('Content-Length', len(frame))\n self.end_headers()\n self.wfile.write(frame)\n self.wfile.write(b'\\r\\n')\n except Exception as e:\n logging.warning(\n 'Removed streaming client %s: %s',\n self.client_address, str(e))\n else:\n self.send_error(404)\n self.end_headers()\n\nclass StreamingServer(socketserver.ThreadingMixIn, server.HTTPServer):\n allow_reuse_address = True\n daemon_threads = True\n\n################################################################################\n#MQTT core functions\n################################################################################\n\n#Run this function in order to connect to the client (Node-RED)\ndef on_connect(client, userdata, flags, rc):\n #Print when connected\n print(\"Connected! - \" + str(rc))\n #When connected, run subscribe()\n client.subscribe(\"actuator/#\")\n #Turn green the light module\n rgb(0,255,0)\n\n#Run this function in order to subscribe to all the topics begining by actuator\ndef on_subscribe(client, obj, mid, granted_qos):\n #Print when subscribed\n print(\"Subscribed! - \"+str(mid)+\" \"+str(granted_qos))\n\n#Run this command when Node-RED is sending a message on the subscribed topic\ndef on_message(client, userdata, msg):\n #Print the topic and the message\n print(msg.topic+\" \"+str(msg.qos)+\" \"+str(msg.payload))\n #Update the global variables command, args and counter\n global command\n global args\n global counter\n #Parse the topic to find the command. ex : actuator/pump -> pump\n command=msg.topic.split(\"/\")[1]\n #Decode the message to find the arguments\n args=str(msg.payload.decode())\n #Reset the counter to 0\n counter=0\n\n################################################################################\n#LEDs Actuation\n################################################################################\ndef rgb(R,G,B):\n #Update LED n1\n bus.write_byte_data(0x0d, 0x00, 0)\n bus.write_byte_data(0x0d, 0x01, R)\n bus.write_byte_data(0x0d, 0x02, G)\n bus.write_byte_data(0x0d, 0x03, B)\n\n #Update LED n2\n bus.write_byte_data(0x0d, 0x00, 1)\n bus.write_byte_data(0x0d, 0x01, R)\n bus.write_byte_data(0x0d, 0x02, G)\n bus.write_byte_data(0x0d, 0x03, B)\n\n #Update LED n3\n bus.write_byte_data(0x0d, 0x00, 2)\n bus.write_byte_data(0x0d, 0x01, R)\n bus.write_byte_data(0x0d, 0x02, G)\n bus.write_byte_data(0x0d, 0x03, B)\n\n #Update the I2C Bus in order to really update the LEDs new values\n cmd=\"i2cdetect -y 1\"\n subprocess.Popen(cmd.split(),stdout=subprocess.PIPE)\n\n################################################################################\n#Init function - executed only once\n################################################################################\n\n#define the bus used to actuate the light module on the fan\nbus = smbus.SMBus(1)\n\n#define the names for the 2 exsting steppers\nkit = MotorKit()\npump_stepper = kit.stepper1\nfocus_stepper = kit.stepper2\n#Make sure the steppers are release and do not use any power\npump_stepper.release()\nfocus_stepper.release()\n\n#Precise the settings of the PiCamera\ncamera = PiCamera()\ncamera.resolution = (3280, 2464)\ncamera.iso = 60\ncamera.shutter_speed = 500\ncamera.exposure_mode = 'fixedfps'\n\n#Declare the global variables command, args and counter\ncommand = ''\nargs = ''\ncounter=''\n\n#MQTT Client functions definition\nclient = mqtt.Client()\nclient.connect(\"192.168.4.1\",1883,60)\nclient.on_connect = on_connect\nclient.on_subscribe = on_subscribe\nclient.on_message = on_message\nclient.loop_start()\n\n################################################################################\n#Definition of the few important metadata\n################################################################################\n\nlocal_metadata = {\n \"process_datetime\": datetime.now(),\n \"acq_camera_resolution\" : camera.resolution,\n \"acq_camera_iso\" : camera.iso,\n \"acq_camera_shutter_speed\" : camera.shutter_speed\n}\n\n#Read the content of config.json containing the metadata defined on Node-RED\nconfig_json = open('/home/pi/PlanktonScope/config.json','r')\nnode_red_metadata = json.loads(config_json.read())\n\n#Concat the local metadata and the metadata from Node-RED\nglobal_metadata = {**local_metadata, **node_red_metadata}\n\n#Define the name of the .zip file that will contain the images and the .tsv table for EcoTaxa\narchive_fn = os.path.join(\"/home/pi/PlanktonScope/\",\"export\", \"ecotaxa_export.zip\")\n\n################################################################################\n#MorphoCut Script\n################################################################################\n\n#Define processing pipeline\nwith Pipeline() as p:\n\n #Recursively find .jpg files in import_path.\n #Sort to get consective frames.\n abs_path = Find(\"/home/pi/PlanktonScope/tmp\", [\".jpg\"], sort=True, verbose=True)\n\n #Extract name from abs_path\n name = Call(lambda p: os.path.splitext(os.path.basename(p))[0], abs_path)\n\n #Set the LEDs as Green\n Call(rgb, 0,255,0)\n\n #Read image\n img = ImageReader(abs_path)\n\n #Show progress bar for frames\n TQDM(Format(\"Frame {name}\", name=name))\n\n #Apply running median to approximate the background image\n flat_field = RunningMedian(img, 5)\n\n #Correct image\n img = img / flat_field\n\n #Rescale intensities and convert to uint8 to speed up calculations\n img = RescaleIntensity(img, in_range=(0, 1.1), dtype=\"uint8\")\n\n #Filter variable to reduce memory load\n FilterVariables(name,img)\n\n #Save cleaned images\n #frame_fn = Format(os.path.join(\"/home/pi/PlanktonScope/tmp\",\"CLEAN\", \"{name}.jpg\"), name=name)\n #ImageWriter(frame_fn, img)\n\n #Convert image to uint8 gray\n img_gray = RGB2Gray(img)\n\n #?\n img_gray = Call(img_as_ubyte, img_gray)\n\n #Canny edge detection using OpenCV\n img_canny = Call(cv2.Canny, img_gray, 50,100)\n\n #Dilate using OpenCV\n kernel = Call(cv2.getStructuringElement, cv2.MORPH_ELLIPSE, (15, 15))\n img_dilate = Call(cv2.dilate, img_canny, kernel, iterations=2)\n\n #Close using OpenCV\n kernel = Call(cv2.getStructuringElement, cv2.MORPH_ELLIPSE, (5, 5))\n img_close = Call(cv2.morphologyEx, img_dilate, cv2.MORPH_CLOSE, kernel, iterations=1)\n\n #Erode using OpenCV\n kernel = Call(cv2.getStructuringElement, cv2.MORPH_ELLIPSE, (15, 15))\n mask = Call(cv2.erode, img_close, kernel, iterations=2)\n\n #Find objects\n regionprops = FindRegions(\n mask, img_gray, min_area=1000, padding=10, warn_empty=name\n )\n\n #Set the LEDs as Purple\n Call(rgb, 255,0,255)\n\n # For an object, extract a vignette/ROI from the image\n roi_orig = ExtractROI(img, regionprops, bg_color=255)\n\n # Generate an object identifier\n i = Enumerate()\n\n #Call(print,i)\n\n #Define the ID of each object\n object_id = Format(\"{name}_{i:d}\", name=name, i=i)\n\n #Call(print,object_id)\n\n #Define the name of each object\n object_fn = Format(os.path.join(\"/home/pi/PlanktonScope/\",\"OBJECTS\", \"{name}.jpg\"), name=object_id)\n\n #Save the image of the object with its name\n ImageWriter(object_fn, roi_orig)\n\n #Calculate features. The calculated features are added to the global_metadata.\n #Returns a Variable representing a dict for every object in the stream.\n meta = CalculateZooProcessFeatures(\n regionprops, prefix=\"object_\", meta=global_metadata\n )\n\n #Get all the metadata\n json_meta = Call(json.dumps,meta, sort_keys=True, default=str)\n\n #Publish the json containing all the metadata to via MQTT to Node-RED\n Call(client.publish, \"receiver/segmentation/metric\", json_meta)\n\n #Add object_id to the metadata dictionary\n meta[\"object_id\"] = object_id\n\n #Generate object filenames\n orig_fn = Format(\"{object_id}.jpg\", object_id=object_id)\n\n #Write objects to an EcoTaxa archive:\n #roi image in original color, roi image in grayscale, metadata associated with each object\n EcotaxaWriter(archive_fn, (orig_fn, roi_orig), meta)\n\n #Progress bar for objects\n TQDM(Format(\"Object {object_id}\", object_id=object_id))\n\n #Publish the object_id to via MQTT to Node-RED\n Call(client.publish, \"receiver/segmentation/object_id\", object_id)\n\n #Set the LEDs as Green\n Call(rgb, 0,255,0)\n\n################################################################################\n#While loop for capting commands from Node-RED\n################################################################################\n\noutput = StreamingOutput()\naddress = ('192.168.4.1', 8000)\nserver = StreamingServer(address, StreamingHandler)\nthreading.Thread(target=server.serve_forever).start()\ncamera.start_recording(output, format='mjpeg', resize=(640, 480))\n\nwhile True:\n\n ############################################################################\n #Pump Event\n ############################################################################\n\n #If the command is \"pump\"\n if (command==\"pump\"):\n\n #Set the LEDs as Blue\n rgb(0,0,255)\n\n #Get direction from the different received arguments\n direction=args.split(\" \")[0]\n\n #Get delay (in between steps) from the different received arguments\n delay=float(args.split(\" \")[1])\n\n #Get number of steps from the different received arguments\n nb_step=int(args.split(\" \")[2])\n\n #Print status\n print(\"The pump has been started.\")\n\n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/pump\", \"Start\");\n\n ########################################################################\n while True:\n\n #Depending on direction, select the right direction for the pump\n if direction == \"BACKWARD\":\n direction=stepper.BACKWARD\n\n if direction == \"FORWARD\":\n direction=stepper.FORWARD\n\n #Actuate the pump for one step in the right direction\n pump_stepper.onestep(direction=direction, style=stepper.DOUBLE)\n\n #Increment the counter\n counter+=1\n\n #Wait during the delay to pump at the right flowrate\n sleep(delay)\n\n ####################################################################\n #If counter reach the number of step, break\n if counter>nb_step:\n\n #Release the pump stepper to stop power draw\n pump_stepper.release()\n\n #Print status\n print(\"The pumping is done.\")\n\n #Change the command to not re-enter in this while loop\n command=\"wait\"\n\n #Publish the status \"Done\" to via MQTT to Node-RED\n client.publish(\"receiver/pump\", \"Done\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ####################################################################\n #If a new received command isn't \"pump\", break this while loop\n if command!=\"pump\":\n\n #Release the pump stepper to stop power draw\n pump_stepper.release()\n\n #Print status\n print(\"The pump has been interrompted.\")\n\n #Publish the status \"Interrompted\" to via MQTT to Node-RED\n client.publish(\"receiver/pump\", \"Interrompted\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ############################################################################\n #Focus Event\n ############################################################################\n\n #If the command is \"focus\"\n elif (command==\"focus\"):\n\n #Set the LEDs as Yellow\n rgb(255,255,0)\n\n #Get direction from the different received arguments\n direction=args.split(\" \")[0]\n\n #Get number of steps from the different received arguments\n nb_step=int(args.split(\" \")[1])\n\n #Print status\n print(\"The focus has been started.\")\n\n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/focus\", \"Start\");\n\n ########################################################################\n while True:\n\n #Depending on direction, select the right direction for the focus\n if direction == \"FORWARD\":\n direction=stepper.FORWARD\n\n if direction == \"BACKWARD\":\n direction=stepper.BACKWARD\n\n #Actuate the focus for one microstep in the right direction\n focus_stepper.onestep(direction=direction, style=stepper.MICROSTEP)\n\n #Increment the counter\n counter+=1\n\n ####################################################################\n #If counter reach the number of step, break\n if counter>nb_step:\n\n #Release the focus steppers to stop power draw\n focus_stepper.release()\n\n #Print status\n print(\"The focusing is done.\")\n\n #Change the command to not re-enter in this while loop\n command=\"wait\"\n\n #Publish the status \"Done\" to via MQTT to Node-RED\n client.publish(\"receiver/focus\", \"Done\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ####################################################################\n #If a new received command isn't \"pump\", break this while loop\n if command!=\"focus\":\n\n #Release the focus steppers to stop power draw\n focus_stepper.release()\n\n #Print status\n print(\"The stage has been interrompted.\")\n\n #Publish the status \"Done\" to via MQTT to Node-RED\n client.publish(\"receiver/focus\", \"Interrompted\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ############################################################################\n #Image Event\n ############################################################################\n\n elif (command==\"image\"):\n \n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/image\", \"Will do my best dude\");\n\n #Get duration to wait before an image from the different received arguments\n sleep_before=int(args.split(\" \")[0])\n\n #Get number of step in between two images from the different received arguments\n nb_step=int(args.split(\" \")[1])\n\n #Get the number of frames to image from the different received arguments\n nb_frame=int(args.split(\" \")[2])\n\n #Get the segmentation status (true/false) from the different received arguments\n segmentation=str(args.split(\" \")[3])\n\n #Sleep a duration before to start acquisition\n sleep(sleep_before)\n\n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/image\", \"Start\");\n\n #Set the LEDs as Blue\n rgb(0,0,255)\n\n #Pump duing a given number of steps (in between each image)\n for i in range(nb_step):\n\n #If the command is still image - pump a defined nb of steps\n if (command==\"image\"):\n\n #Actuate the pump for one step in the FORWARD direction\n pump_stepper.onestep(direction=stepper.FORWARD, style=stepper.DOUBLE)\n\n #The flowrate is fixed for now.\n sleep(0.01)\n\n #If the command isn't image anymore - break\n else:\n\n break\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n while True:\n\n #Set the LEDs as Cyan\n rgb(0,255,255)\n\n #Increment the counter\n counter+=1\n\n #Get datetime\n datetime_tmp=datetime.now().strftime(\"%H_%M_%S_%f\")\n\n #Print datetime\n print(datetime_tmp)\n\n #Define the filename of the image\n filename = os.path.join(\"/home/pi/PlanktonScope/tmp\",datetime_tmp+\".jpg\")\n\n #Capture an image with the proper filename\n camera.capture(filename)\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Publish the name of the image to via MQTT to Node-RED\n\n client.publish(\"receiver/image\", datetime_tmp+\".jpg has been imaged.\");\n \n #Set the LEDs as Blue\n rgb(0,0,255)\n\n #Pump during a given nb of steps\n for i in range(nb_step):\n\n #Actuate the pump for one step in the FORWARD direction\n pump_stepper.onestep(direction=stepper.FORWARD, style=stepper.DOUBLE)\n\n #The flowrate is fixed for now.\n sleep(0.01)\n\n #Wait a fixed delay which set the framerate as < than 2 imag/sec\n sleep(0.5)\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n ####################################################################\n #If counter reach the number of frame, break\n if(counter>nb_frame):\n\n #Publish the status \"Completed\" to via MQTT to Node-RED\n client.publish(\"receiver/image\", \"Completed\");\n\n #Release the pump steppers to stop power draw\n pump_stepper.release()\n\n if(segmentation == \"True\"):\n\n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/segmentation\", \"Start\");\n\n #Start the MorphoCut Pipeline\n p.run()\n\n #remove directory\n #shutil.rmtree(import_path)\n\n #Publish the status \"Completed\" to via MQTT to Node-RED\n client.publish(\"receiver/segmentation\", \"Completed\");\n\n #Set the LEDs as White\n rgb(255,255,255)\n\n #cmd = os.popen(\"rm -rf /home/pi/PlanktonScope/tmp/*.jpg\")\n\n #Let it happen\n sleep(1)\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #End if(segmentation == \"True\"):\n\n #Change the command to not re-enter in this while loop\n command=\"wait\"\n \n #Set the LEDs as Green\n rgb(0,255,255)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ####################################################################\n #If a new received command isn't \"image\", break this while loop\n if command!=\"image\":\n\n #Release the pump steppers to stop power draw\n pump_stepper.release()\n\n #Print status\n print(\"The imaging has been interrompted.\")\n\n #Publish the status \"Interrompted\" to via MQTT to Node-RED\n client.publish(\"receiver/image\", \"Interrompted\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n else:\n #Set the LEDs as Black\n rgb(0,0,0)\n #Its just waiting to receive command from Node-RED\n sleep(1)\n #Set the LEDs as White\n rgb(255,255,255)\n #Its just waiting to receive command from Node-RED\n sleep(1)\n", + "output": "str", + "x": 300, + "y": 100, + "wires": [ + [ + "be37d12f.0898f" + ] + ] + }, + { + "id": "f9705bc.3d322a8", + "type": "ui_switch", + "z": "863e8384.56889", + "name": "custom_segmentation", + "label": "Realize the segmentation", + "tooltip": "", + "group": "48649115.fcd01", + "order": 6, + "width": 0, + "height": 0, + "passthru": true, + "decouple": "false", + "topic": "custom_segmentation", + "style": "", + "onvalue": "True", + "onvalueType": "str", + "onicon": "", + "oncolor": "", + "offvalue": "False", + "offvalueType": "str", + "officon": "", + "offcolor": "", + "x": 520, + "y": 160, + "wires": [ + [] + ] + }, + { + "id": "2de12b49.050f44", + "type": "debug", + "z": "c1d3ff7c.4384f", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "x": 1230, + "y": 200, + "wires": [] + }, + { + "id": "5079cccb.298d14", + "type": "exec", + "z": "c1d3ff7c.4384f", + "command": "ps -ax | grep \"python3.7 /home/pi/PlanktonScope/script/main.py\"| head -1 | awk -F \" \" '{print$1}' ", + "addpay": false, + "append": "", + "useSpawn": "false", + "timer": "", + "oldrc": false, + "name": "", + "x": 430, + "y": 40, + "wires": [ + [ + "c47c2122.5eea38" + ], + [], + [] + ] + }, + { + "id": "c47c2122.5eea38", + "type": "exec", + "z": "c1d3ff7c.4384f", + "command": "kill", + "addpay": true, + "append": "", + "useSpawn": "false", + "timer": "", + "oldrc": false, + "name": "", + "x": 910, + "y": 40, + "wires": [ + [], + [], + [] + ] + }, + { + "id": "197215b2.165f22", + "type": "delay", + "z": "c1d3ff7c.4384f", + "name": "", + "pauseType": "delay", + "timeout": "1", + "timeoutUnits": "seconds", + "rate": "1", + "nbRateUnits": "1", + "rateUnits": "second", + "randomFirst": "1", + "randomLast": "5", + "randomUnits": "seconds", + "drop": false, + "x": 160, + "y": 100, + "wires": [ + [ + "49e31e85.7ac51" + ] + ] + }, + { + "id": "589fbae2.8ff914", + "type": "debug", + "z": "a8ad6dec.1a393", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "x": 240, + "y": 140, + "wires": [] } ] From ea602ede24e49f0d456df0cb97ead3dea531803d Mon Sep 17 00:00:00 2001 From: tpollina Date: Tue, 14 Jul 2020 18:27:49 +0200 Subject: [PATCH 23/48] Update flows.json --- flows/flows.json | 3139 +++++++++++++++++++--------------------------- 1 file changed, 1286 insertions(+), 1853 deletions(-) diff --git a/flows/flows.json b/flows/flows.json index 84e7f3f..4106b23 100644 --- a/flows/flows.json +++ b/flows/flows.json @@ -1,13 +1,6 @@ [ { - "id": "ff9251a5.9c5e18", - "type": "tab", - "label": "Main", - "disabled": false, - "info": "" - }, - { - "id": "bba19d97.b32b1", + "id": "97600dff.93378", "type": "subflow", "name": "Acquisition actuation", "info": "", @@ -18,1139 +11,9 @@ "color": "#A6BBCF" }, { - "id": "c1d3ff7c.4384f", - "type": "subflow", - "name": "MQQT Cmds", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 40, - "wires": [ - { - "id": "5079cccb.298d14" - }, - { - "id": "197215b2.165f22" - } - ] - } - ], - "out": [], - "env": [], - "color": "#DDAA99" - }, - { - "id": "c10e968b.87e488", - "type": "subflow", - "name": "Datetime update", - "info": "", - "category": "", - "in": [ - { - "x": 140, - "y": 80, - "wires": [ - { - "id": "93b9f3cd.759688" - } - ] - } - ], - "out": [], - "env": [], - "color": "#DDAA99", - "icon": "font-awesome/fa-clock-o" - }, - { - "id": "863e8384.56889", - "type": "subflow", - "name": "Acquisition inputs", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 40, - "wires": [ - { - "id": "3eaf4c98.d94b54" - }, - { - "id": "e50aa637.59ac68" - }, - { - "id": "8eeb9e9e.a50d7" - }, - { - "id": "e4e16eb9.5296c" - } - ] - } - ], - "out": [ - { - "x": 740, - "y": 40, - "wires": [ - { - "id": "c4527705.33a84", - "port": 0 - }, - { - "id": "f648e44.94e3998", - "port": 0 - }, - { - "id": "582e21b2.ad67a8", - "port": 0 - }, - { - "id": "f9705bc.3d322a8", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#A6BBCF", - "icon": "node-red-contrib-camerapi/photo.png" - }, - { - "id": "5a287804.a10e2", - "type": "subflow", - "name": "Process metadata", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 80, - "wires": [ - { - "id": "dfb4b682.601e1" - } - ] - } - ], - "out": [ - { - "x": 700, - "y": 80, - "wires": [ - { - "id": "11b31baf.95996c", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#DDAA99" - }, - { - "id": "a8ad6dec.1a393", - "type": "subflow", - "name": "MQTT Receive & Plot", - "info": "", - "category": "", - "in": [], - "out": [], - "env": [], - "color": "#F3B567", - "icon": "node-red/bridge.svg" - }, - { - "id": "9882c53a.0ccc8", - "type": "subflow", - "name": "Temperature regulation", - "info": "", - "category": "", - "in": [], - "out": [], - "env": [], - "color": "#FFCC66", - "icon": "font-awesome/fa-bolt" - }, - { - "id": "fbe9590f.bd63b8", - "type": "subflow", - "name": "System Commands", - "info": "", - "category": "", - "in": [], - "out": [], - "env": [], - "color": "#FFCC66", - "icon": "node-red-dashboard/ui_button.png" - }, - { - "id": "b45c6fb6.f6dfa8", - "type": "subflow", - "name": "Object metadata", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 40, - "wires": [ - { - "id": "8a61177.8eaa1e8" - }, - { - "id": "3893c81e.a9b9e" - }, - { - "id": "bd643763.2a7768" - } - ] - } - ], - "out": [ - { - "x": 1060, - "y": 159, - "wires": [ - { - "id": "cf0b247b.e3e7c", - "port": 0 - }, - { - "id": "1675637a.1d762d", - "port": 0 - } - ] - }, - { - "x": 1060, - "y": 59, - "wires": [ - { - "id": "d485fec3.802e", - "port": 0 - }, - { - "id": "5196107b.a5eae8", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#DDAA99" - }, - { - "id": "6ca1a253.126bb4", - "type": "subflow", - "name": "Acquisition metadata", - "info": "", - "category": "", - "in": [ - { - "x": 50, - "y": 30, - "wires": [ - { - "id": "93a3fd29.c55938" - }, - { - "id": "9e9e7f8a.b66d4" - }, - { - "id": "b1105180.b4b78" - }, - { - "id": "ec403304.e34c58" - }, - { - "id": "7aac5c46.0669ec" - }, - { - "id": "c491cf7.36957b" - }, - { - "id": "e0644195.305068" - }, - { - "id": "e3fe6242.bfaf18" - }, - { - "id": "31d58fcd.ede758" - } - ] - } - ], - "out": [ - { - "x": 740, - "y": 40, - "wires": [ - { - "id": "21b35429.fe43a4", - "port": 0 - }, - { - "id": "f0595ff1.c4d568", - "port": 0 - }, - { - "id": "c4e69883.a0f3d", - "port": 0 - }, - { - "id": "12e818fa.b7301f", - "port": 0 - }, - { - "id": "b577dcd2.8d2c88", - "port": 0 - }, - { - "id": "f7f5ccc1.29a41", - "port": 0 - }, - { - "id": "bd733bef.7efd08", - "port": 0 - }, - { - "id": "a6057924.bc14", - "port": 0 - } - ] - }, - { - "x": 900, - "y": 360, - "wires": [ - { - "id": "5a5fcc9a.9ede14", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#DDAA99" - }, - { - "id": "626459d2.f9c98", - "type": "subflow", - "name": "Pump actuation", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 40, - "wires": [ - { - "id": "f7b6f5e7.7b7ca" - }, - { - "id": "50093f5.8e35ec" - } - ] - } - ], - "out": [ - { - "x": 700, - "y": 40, - "wires": [ - { - "id": "fa485315.928ae", - "port": 0 - }, - { - "id": "2f9ec1a6.d5fb66", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#A6BBCF", - "icon": "font-awesome/fa-recycle" - }, - { - "id": "5c516299.73e054", - "type": "subflow", - "name": "Focus actuation", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 40, - "wires": [ - { - "id": "60dc5851.6962b" - } - ] - } - ], - "out": [ - { - "x": 800, - "y": 200, - "wires": [ - { - "id": "7297e2f7.dce564", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#A6BBCF", - "icon": "node-red/sort.svg" - }, - { - "id": "efeebffd.34c7e", - "type": "subflow", - "name": "Sample metadata", - "info": "", - "category": "", - "in": [ - { - "x": 40, - "y": 40, - "wires": [ - { - "id": "78f5791d.946bd8" - }, - { - "id": "346d141f.ebab3c" - }, - { - "id": "2a09d440.119154" - }, - { - "id": "2d438355.ed942c" - }, - { - "id": "ac4a71a.c35309" - } - ] - } - ], - "out": [ - { - "x": 840, - "y": 40, - "wires": [ - { - "id": "1cb896c7.6dfc11", - "port": 0 - }, - { - "id": "288ba4b3.a9a2cc", - "port": 0 - }, - { - "id": "10f1e5c1.3cb69a", - "port": 0 - }, - { - "id": "aa90b06d.ca78e", - "port": 0 - }, - { - "id": "da0c5a96.74c0e", - "port": 0 - } - ] - } - ], - "env": [], - "color": "#DDAA99" - }, - { - "id": "68d72e45.e7d58", - "type": "ui_base", - "theme": { - "name": "theme-dark", - "lightTheme": { - "default": "#0094CE", - "baseColor": "#5900ce", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", - "edited": true, - "reset": false - }, - "darkTheme": { - "default": "#097479", - "baseColor": "#059276", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", - "edited": true, - "reset": false - }, - "customTheme": { - "name": "Untitled Theme 1", - "default": "#4B7930", - "baseColor": "#4B7930", - "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" - }, - "themeState": { - "base-color": { - "default": "#097479", - "value": "#059276", - "edited": true - }, - "page-titlebar-backgroundColor": { - "value": "#059276", - "edited": false - }, - "page-backgroundColor": { - "value": "#111111", - "edited": false - }, - "page-sidebar-backgroundColor": { - "value": "#ffffff", - "edited": false - }, - "group-textColor": { - "value": "#08dcb2", - "edited": false - }, - "group-borderColor": { - "value": "#555555", - "edited": false - }, - "group-backgroundColor": { - "value": "#333333", - "edited": false - }, - "widget-textColor": { - "value": "#eeeeee", - "edited": false - }, - "widget-backgroundColor": { - "value": "#059276", - "edited": false - }, - "widget-borderColor": { - "value": "#333333", - "edited": false - }, - "base-font": { - "value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" - } - }, - "angularTheme": { - "primary": "indigo", - "accents": "blue", - "warn": "red", - "background": "grey" - } - }, - "site": { - "name": "Node-RED Dashboard", - "hideToolbar": "false", - "allowSwipe": "false", - "lockMenu": "true", - "allowTempTheme": "true", - "dateFormat": "DD/MM/YYYY", - "sizes": { - "sx": 56, - "sy": 56, - "gx": 5, - "gy": 5, - "cx": 5, - "cy": 5, - "px": 5, - "py": 5 - } - } - }, - { - "id": "44986592.b84004", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "127.0.0.1", - "port": "1883", - "clientid": "test", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "8eac3de.7c8234", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "0.0.0.0", - "port": "1883", - "clientid": "Client_node", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "888cbaa1.5d9318", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "127.0.0.1", - "port": "1883", - "clientid": "test", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "f98c50f4.4bed48", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "0.0.0.0", - "port": "1883", - "clientid": "Client_node", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "3ee94635.002c9a", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "127.0.0.1", - "port": "1883", - "clientid": "test", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "b0b1b2bb.385fe", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "0.0.0.0", - "port": "1883", - "clientid": "Client_node", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "659e81f6.f85fb8", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "127.0.0.1", - "port": "1883", - "clientid": "test", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "52b67b31.c63a04", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "0.0.0.0", - "port": "1883", - "clientid": "Client_node", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "494e9f19.80f8e8", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "127.0.0.1", - "port": "1883", - "clientid": "test", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "5ad5df6e.1d1e6", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "0.0.0.0", - "port": "1883", - "clientid": "Client_node", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "3ab46cf0.f57dbc", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "127.0.0.1", - "port": "1883", - "clientid": "test", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "40f247ee.202528", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "0.0.0.0", - "port": "1883", - "clientid": "Client_node", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "84801dc0.193d88", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "127.0.0.1", - "port": "1883", - "clientid": "test", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "e8ab36cc.74d77", - "type": "mqtt-broker", - "z": "", - "name": "", - "broker": "0.0.0.0", - "port": "1883", - "clientid": "Client_node", - "usetls": false, - "compatmode": false, - "keepalive": "60", - "cleansession": true, - "birthTopic": "", - "birthQos": "0", - "birthPayload": "", - "closeTopic": "", - "closeQos": "0", - "closePayload": "", - "willTopic": "", - "willQos": "0", - "willPayload": "" - }, - { - "id": "55588d59.326124", - "type": "ui_group", - "z": "", - "name": "Acquisition actuation", - "tab": "", - "order": 10, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "d4efe27d.5af0e", - "type": "ui_group", - "z": "", - "name": "Datetime", - "tab": "", - "order": 1, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "4a3b889c.c4c0a", - "type": "ui_group", - "z": "", - "name": "Valve actuation", - "tab": "", - "order": 9, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "b2080aa8.7b048", - "type": "ui_group", - "z": "", - "name": "Process metadata", - "tab": "", - "order": 8, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "b2ce0fd5.641a8", - "type": "ui_group", - "z": "", - "name": "MQTT Plots", - "tab": "", - "order": 11, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "516113d5.b6b5d4", - "type": "ui_group", - "z": "", - "name": "Commands", - "tab": "", - "order": 12, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "488da474.92ee5c", - "type": "ui_group", - "z": "", - "name": "Object metadata", - "tab": "", - "order": 6, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "a302c12b.834e8", - "type": "ui_group", - "z": "", - "name": "Acquisition metadata", - "tab": "", - "order": 7, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "95792df3.55e6e", - "type": "ui_group", - "z": "", - "name": "Pump actuation", - "tab": "", - "order": 5, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "8a415d41.11df38", - "type": "ui_group", - "z": "", - "name": "Focus actuation", - "tab": "", - "order": 4, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "ead03bfe.db2268", - "type": "ui_group", - "z": "", - "name": "Sample metadata", - "tab": "", - "order": 2, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "d4c113ac.dade38", - "type": "ui_group", - "z": "", - "name": "Streaming camera", - "tab": "", - "order": 3, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "cdb72118.692578", - "type": "ui_group", - "z": "", - "name": "Acquisition actuation", - "tab": "2b97fe34.a699fa", - "order": 10, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "9c86b3b7.54841", - "type": "ui_group", - "z": "", - "name": "Datetime", - "tab": "2b97fe34.a699fa", - "order": 1, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "48649115.fcd01", - "type": "ui_group", - "z": "", - "name": "Acquisition inputs", - "tab": "2b97fe34.a699fa", - "order": 9, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "beeb994e.b67688", - "type": "ui_group", - "z": "", - "name": "Process metadata", - "tab": "2b97fe34.a699fa", - "order": 8, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "eb610eb9.84fae8", - "type": "ui_group", - "z": "", - "name": "MQTT Plots", - "tab": "2b97fe34.a699fa", - "order": 11, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "82b3caaa.0518", - "type": "ui_group", - "z": "", - "name": "Commands", - "tab": "2b97fe34.a699fa", - "order": 12, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "f377d75b.32d27", - "type": "ui_group", - "z": "", - "name": "Object metadata", - "tab": "2b97fe34.a699fa", - "order": 6, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "60b93a5.a032344", - "type": "ui_group", - "z": "", - "name": "Acquisition metadata", - "tab": "2b97fe34.a699fa", - "order": 7, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "4153382f.45437", - "type": "ui_group", - "z": "", - "name": "Pump actuation", - "tab": "2b97fe34.a699fa", - "order": 5, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "69433259.f306fc", - "type": "ui_group", - "z": "", - "name": "Focus actuation", - "tab": "2b97fe34.a699fa", - "order": 4, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "417f91c9.193ab", - "type": "ui_group", - "z": "", - "name": "Sample metadata", - "tab": "2b97fe34.a699fa", - "order": 2, - "disp": true, - "width": "24", - "collapse": false - }, - { - "id": "2b97fe34.a699fa", - "type": "ui_tab", - "z": "", - "name": "GUI", - "icon": "fa-eyedropper", - "order": 2, - "disabled": false, - "hidden": false - }, - { - "id": "dc721eb.9ef51e", - "type": "ui_group", - "z": "", - "name": "Streaming camera", - "tab": "2b97fe34.a699fa", - "order": 3, - "disp": true, - "width": 24, - "collapse": false - }, - { - "id": "853e90d6.4afd1", + "id": "604c996b.1a8428", "type": "ui_button", - "z": "bba19d97.b32b1", + "z": "97600dff.93378", "name": "", "group": "cdb72118.692578", "order": 1, @@ -1169,14 +32,14 @@ "y": 100, "wires": [ [ - "6e46e66c.654ff8" + "b854ad48.5869e8" ] ] }, { - "id": "6e46e66c.654ff8", + "id": "b854ad48.5869e8", "type": "function", - "z": "bba19d97.b32b1", + "z": "97600dff.93378", "name": "image.js", "func": "state = global.get(\"state\");\nglobal.set('img_counter',0)\nglobal.set('obj_counter',0)\nif (state == null){state=\"free\"}\n\nvar sleep_before= global.get(\"custom_sleep_before\");\nvar nb_step= global.get(\"custom_nb_step\");\nvar nb_frame= global.get(\"custom_nb_frame\");\nvar segmentation= global.get(\"custom_segmentation\");\n\nif (sleep_before === undefined || sleep_before === \"\" || sleep_before === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Duration before the acquisition\";\n \n}else if (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of step in between two frames\";\n \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 \n}else if (segmentation === undefined || segmentation === \"\" || segmentation === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Realize or not the segmentation\";\n \n}else {\n nb_frame=nb_frame-1\n \n msg.payload=sleep_before+' '+nb_step+' '+nb_frame+' '+segmentation;\n}\nreturn msg;", "outputs": 1, @@ -1185,15 +48,15 @@ "y": 100, "wires": [ [ - "5a37b9e6.6e3e58" + "84505b75.883a48" ] ], "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" }, { - "id": "5a37b9e6.6e3e58", + "id": "84505b75.883a48", "type": "switch", - "z": "bba19d97.b32b1", + "z": "97600dff.93378", "name": "", "property": "topic", "propertyType": "msg", @@ -1216,17 +79,17 @@ "y": 100, "wires": [ [ - "75233be8.98e6f4" + "715a8f15.dc211" ], [ - "bee35f80.112d" + "3173806b.bb0c7" ] ] }, { - "id": "bee35f80.112d", + "id": "3173806b.bb0c7", "type": "ui_toast", - "z": "bba19d97.b32b1", + "z": "97600dff.93378", "position": "dialog", "displayTime": "3", "highlight": "", @@ -1244,9 +107,9 @@ ] }, { - "id": "75233be8.98e6f4", + "id": "715a8f15.dc211", "type": "mqtt out", - "z": "bba19d97.b32b1", + "z": "97600dff.93378", "name": "", "topic": "", "qos": "", @@ -1257,9 +120,9 @@ "wires": [] }, { - "id": "75d00421.d31e1c", + "id": "ed689faa.3a3e08", "type": "ui_button", - "z": "bba19d97.b32b1", + "z": "97600dff.93378", "name": "Stop Acquisition", "group": "cdb72118.692578", "order": 2, @@ -1278,14 +141,14 @@ "y": 140, "wires": [ [ - "f2ce7a07.d3eff8" + "f6bd3440.60d5a" ] ] }, { - "id": "f2ce7a07.d3eff8", + "id": "f6bd3440.60d5a", "type": "mqtt out", - "z": "bba19d97.b32b1", + "z": "97600dff.93378", "name": "", "topic": "", "qos": "", @@ -1296,9 +159,9 @@ "wires": [] }, { - "id": "977270e2.b70738", + "id": "3b827bf5.c7bc64", "type": "mqtt out", - "z": "bba19d97.b32b1", + "z": "97600dff.93378", "name": "", "topic": "", "qos": "", @@ -1309,9 +172,44 @@ "wires": [] }, { - "id": "23f3e613.20ad82", + "id": "cdb72118.692578", + "type": "ui_group", + "z": "", + "name": "Acquisition actuation", + "tab": "2b97fe34.a699fa", + "order": 10, + "disp": true, + "width": 24, + "collapse": false + }, + { + "id": "e8320d42.9a3ad8", + "type": "subflow", + "name": "MQQT Cmds", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "cf9e02a2.3feff" + }, + { + "id": "18da28e6.7b000f" + } + ] + } + ], + "out": [], + "env": [], + "color": "#DDAA99" + }, + { + "id": "a7301ba5.d56d48", "type": "exec", - "z": "c1d3ff7c.4384f", + "z": "e8320d42.9a3ad8", "command": "python3.7 /home/pi/PlanktonScope/script/main.py", "addpay": false, "append": "", @@ -1323,23 +221,23 @@ "y": 140, "wires": [ [ - "87b835dc.107c6", - "2de12b49.050f44" + "87558394.4e589", + "a11158b1.b7649" ], [ - "87b835dc.107c6", - "2de12b49.050f44" + "87558394.4e589", + "a11158b1.b7649" ], [ - "87b835dc.107c6", - "2de12b49.050f44" + "87558394.4e589", + "a11158b1.b7649" ] ] }, { - "id": "1ef92011.66439", + "id": "62b9a3b1.74dbc4", "type": "exec", - "z": "c1d3ff7c.4384f", + "z": "e8320d42.9a3ad8", "command": "ps -ax | grep \"python3.7 /home/pi/PlanktonScope/script/main.py\"| head -1 | awk -F \" \" '{print$1}' ", "addpay": false, "append": "", @@ -1351,16 +249,16 @@ "y": 200, "wires": [ [ - "c1fd2bf6.fa7198" + "66fb9ed2.8ecd3" ], [], [] ] }, { - "id": "c1fd2bf6.fa7198", + "id": "66fb9ed2.8ecd3", "type": "exec", - "z": "c1d3ff7c.4384f", + "z": "e8320d42.9a3ad8", "command": "kill", "addpay": true, "append": "", @@ -1372,23 +270,23 @@ "y": 200, "wires": [ [ - "87b835dc.107c6", - "2de12b49.050f44" + "87558394.4e589", + "a11158b1.b7649" ], [ - "87b835dc.107c6", - "2de12b49.050f44" + "87558394.4e589", + "a11158b1.b7649" ], [ - "87b835dc.107c6", - "2de12b49.050f44" + "87558394.4e589", + "a11158b1.b7649" ] ] }, { - "id": "9a6e378b.5ea938", + "id": "5df162d7.08eb34", "type": "ui_button", - "z": "c1d3ff7c.4384f", + "z": "e8320d42.9a3ad8", "name": "", "group": "9c86b3b7.54841", "order": 9, @@ -1407,14 +305,14 @@ "y": 200, "wires": [ [ - "1ef92011.66439" + "62b9a3b1.74dbc4" ] ] }, { - "id": "e74e7b3d.2ba678", + "id": "d16389e5.3bc67", "type": "ui_button", - "z": "c1d3ff7c.4384f", + "z": "e8320d42.9a3ad8", "name": "", "group": "9c86b3b7.54841", "order": 10, @@ -1433,14 +331,14 @@ "y": 140, "wires": [ [ - "23f3e613.20ad82" + "a7301ba5.d56d48" ] ] }, { - "id": "87b835dc.107c6", + "id": "87558394.4e589", "type": "ui_toast", - "z": "c1d3ff7c.4384f", + "z": "e8320d42.9a3ad8", "position": "top right", "displayTime": "3", "highlight": "", @@ -1456,9 +354,146 @@ "wires": [] }, { - "id": "b60669a0.b480d8", + "id": "500abffa.c7a788", + "type": "file", + "z": "e8320d42.9a3ad8", + "name": "", + "filename": "/home/pi/PlanktonScope/script/main.py", + "appendNewline": false, + "createDir": true, + "overwriteFile": "true", + "encoding": "none", + "x": 530, + "y": 100, + "wires": [ + [ + "a7301ba5.d56d48" + ] + ] + }, + { + "id": "985c65de.0801b", + "type": "template", + "z": "e8320d42.9a3ad8", + "name": "main.py", + "field": "payload", + "fieldType": "msg", + "format": "python", + "syntax": "plain", + "template": "################################################################################\n#Actuator Libraries\n################################################################################\n\n#Library for exchaning messages with Node-RED\nimport paho.mqtt.client as mqtt\n\n#Library to control the PiCamera\nfrom picamera import PiCamera\n\n#Libraries to control the steppers for focusing and pumping\nfrom adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\n\n#Library to send command over I2C for the light module on the fan\nimport smbus\n\n################################################################################\n#Practical Libraries\n################################################################################\n\n#Library to get date and time for folder name and filename\nfrom datetime import datetime, timedelta\n\n#Library to be able to sleep for a duration\nfrom time import sleep\n\n#Libraries manipulate json format, execute bash commands\nimport json, shutil, os, subprocess\n\n################################################################################\n#Morphocut Libraries\n################################################################################\n\nfrom skimage.util import img_as_ubyte\nfrom morphocut import Call\nfrom morphocut.contrib.ecotaxa import EcotaxaWriter\nfrom morphocut.contrib.zooprocess import CalculateZooProcessFeatures\nfrom morphocut.core import Pipeline\nfrom morphocut.file import Find\nfrom morphocut.image import (ExtractROI,\n FindRegions,\n ImageReader,\n ImageWriter,\n RescaleIntensity,\n RGB2Gray\n)\nfrom morphocut.stat import RunningMedian\nfrom morphocut.str import Format\nfrom morphocut.stream import TQDM, Enumerate, FilterVariables\n\n################################################################################\n#Other image processing Libraries\n################################################################################\n\nfrom skimage.feature import canny\nfrom skimage.color import rgb2gray, label2rgb\nfrom skimage.morphology import disk\nfrom skimage.morphology import erosion, dilation, closing\nfrom skimage.measure import label, regionprops\nimport cv2\n\n################################################################################\n#Streaming PiCamera over server\n################################################################################\nimport io\nimport picamera\nimport logging\nimport socketserver\nfrom threading import Condition\nfrom http import server\nimport threading\n\n################################################################################\n#Creation of the webpage containing the PiCamera Streaming\n################################################################################\n\nPAGE=\"\"\"\\\n\n\nPlanktonScope v2 | PiCamera Streaming\n\n\n\n\n\n\"\"\"\n\n################################################################################\n#Classes for the PiCamera Streaming\n################################################################################\n\nclass StreamingOutput(object):\n def __init__(self):\n self.frame = None\n self.buffer = io.BytesIO()\n self.condition = Condition()\n\n def write(self, buf):\n if buf.startswith(b'\\xff\\xd8'):\n # New frame, copy the existing buffer's content and notify all\n # clients it's available\n self.buffer.truncate()\n with self.condition:\n self.frame = self.buffer.getvalue()\n self.condition.notify_all()\n self.buffer.seek(0)\n return self.buffer.write(buf)\n\nclass StreamingHandler(server.BaseHTTPRequestHandler):\n def do_GET(self):\n if self.path == '/':\n self.send_response(301)\n self.send_header('Location', '/index.html')\n self.end_headers()\n elif self.path == '/index.html':\n content = PAGE.encode('utf-8')\n self.send_response(200)\n self.send_header('Content-Type', 'text/html')\n self.send_header('Content-Length', len(content))\n self.end_headers()\n self.wfile.write(content)\n elif self.path == '/stream.mjpg':\n self.send_response(200)\n self.send_header('Age', 0)\n self.send_header('Cache-Control', 'no-cache, private')\n self.send_header('Pragma', 'no-cache')\n self.send_header('Content-Type', 'multipart/x-mixed-replace; boundary=FRAME')\n self.end_headers()\n try:\n while True:\n with output.condition:\n output.condition.wait()\n frame = output.frame\n self.wfile.write(b'--FRAME\\r\\n')\n self.send_header('Content-Type', 'image/jpeg')\n self.send_header('Content-Length', len(frame))\n self.end_headers()\n self.wfile.write(frame)\n self.wfile.write(b'\\r\\n')\n except Exception as e:\n logging.warning(\n 'Removed streaming client %s: %s',\n self.client_address, str(e))\n else:\n self.send_error(404)\n self.end_headers()\n\nclass StreamingServer(socketserver.ThreadingMixIn, server.HTTPServer):\n allow_reuse_address = True\n daemon_threads = True\n\n################################################################################\n#MQTT core functions\n################################################################################\n\n#Run this function in order to connect to the client (Node-RED)\ndef on_connect(client, userdata, flags, rc):\n #Print when connected\n print(\"Connected! - \" + str(rc))\n #When connected, run subscribe()\n client.subscribe(\"actuator/#\")\n #Turn green the light module\n rgb(0,255,0)\n\n#Run this function in order to subscribe to all the topics begining by actuator\ndef on_subscribe(client, obj, mid, granted_qos):\n #Print when subscribed\n print(\"Subscribed! - \"+str(mid)+\" \"+str(granted_qos))\n\n#Run this command when Node-RED is sending a message on the subscribed topic\ndef on_message(client, userdata, msg):\n #Print the topic and the message\n print(msg.topic+\" \"+str(msg.qos)+\" \"+str(msg.payload))\n #Update the global variables command, args and counter\n global command\n global args\n global counter\n #Parse the topic to find the command. ex : actuator/pump -> pump\n command=msg.topic.split(\"/\")[1]\n #Decode the message to find the arguments\n args=str(msg.payload.decode())\n #Reset the counter to 0\n counter=0\n\n################################################################################\n#LEDs Actuation\n################################################################################\ndef rgb(R,G,B):\n #Update LED n1\n bus.write_byte_data(0x0d, 0x00, 0)\n bus.write_byte_data(0x0d, 0x01, R)\n bus.write_byte_data(0x0d, 0x02, G)\n bus.write_byte_data(0x0d, 0x03, B)\n\n #Update LED n2\n bus.write_byte_data(0x0d, 0x00, 1)\n bus.write_byte_data(0x0d, 0x01, R)\n bus.write_byte_data(0x0d, 0x02, G)\n bus.write_byte_data(0x0d, 0x03, B)\n\n #Update LED n3\n bus.write_byte_data(0x0d, 0x00, 2)\n bus.write_byte_data(0x0d, 0x01, R)\n bus.write_byte_data(0x0d, 0x02, G)\n bus.write_byte_data(0x0d, 0x03, B)\n\n #Update the I2C Bus in order to really update the LEDs new values\n cmd=\"i2cdetect -y 1\"\n subprocess.Popen(cmd.split(),stdout=subprocess.PIPE)\n\n################################################################################\n#Init function - executed only once\n################################################################################\n\n#define the bus used to actuate the light module on the fan\nbus = smbus.SMBus(1)\n\n#define the names for the 2 exsting steppers\nkit = MotorKit()\npump_stepper = kit.stepper1\nfocus_stepper = kit.stepper2\n#Make sure the steppers are release and do not use any power\npump_stepper.release()\nfocus_stepper.release()\n\n#Precise the settings of the PiCamera\ncamera = PiCamera()\ncamera.resolution = (3280, 2464)\ncamera.iso = 60\ncamera.shutter_speed = 500\ncamera.exposure_mode = 'fixedfps'\n\n#Declare the global variables command, args and counter\ncommand = ''\nargs = ''\ncounter=''\n\n#MQTT Client functions definition\nclient = mqtt.Client()\nclient.connect(\"192.168.4.1\",1883,60)\nclient.on_connect = on_connect\nclient.on_subscribe = on_subscribe\nclient.on_message = on_message\nclient.loop_start()\n\n################################################################################\n#Definition of the few important metadata\n################################################################################\n\nlocal_metadata = {\n \"process_datetime\": datetime.now(),\n \"acq_camera_resolution\" : camera.resolution,\n \"acq_camera_iso\" : camera.iso,\n \"acq_camera_shutter_speed\" : camera.shutter_speed\n}\n\n#Read the content of config.json containing the metadata defined on Node-RED\nconfig_json = open('/home/pi/PlanktonScope/config.json','r')\nnode_red_metadata = json.loads(config_json.read())\n\n#Concat the local metadata and the metadata from Node-RED\nglobal_metadata = {**local_metadata, **node_red_metadata}\n\n#Define the name of the .zip file that will contain the images and the .tsv table for EcoTaxa\narchive_fn = os.path.join(\"/home/pi/PlanktonScope/\",\"export\", \"ecotaxa_export.zip\")\n\n################################################################################\n#MorphoCut Script\n################################################################################\n\n#Define processing pipeline\nwith Pipeline() as p:\n\n #Recursively find .jpg files in import_path.\n #Sort to get consective frames.\n abs_path = Find(\"/home/pi/PlanktonScope/tmp\", [\".jpg\"], sort=True, verbose=True)\n\n #Extract name from abs_path\n name = Call(lambda p: os.path.splitext(os.path.basename(p))[0], abs_path)\n\n #Set the LEDs as Green\n Call(rgb, 0,255,0)\n\n #Read image\n img = ImageReader(abs_path)\n\n #Show progress bar for frames\n TQDM(Format(\"Frame {name}\", name=name))\n\n #Apply running median to approximate the background image\n flat_field = RunningMedian(img, 5)\n\n #Correct image\n img = img / flat_field\n\n #Rescale intensities and convert to uint8 to speed up calculations\n img = RescaleIntensity(img, in_range=(0, 1.1), dtype=\"uint8\")\n\n #Filter variable to reduce memory load\n FilterVariables(name,img)\n\n #Save cleaned images\n #frame_fn = Format(os.path.join(\"/home/pi/PlanktonScope/tmp\",\"CLEAN\", \"{name}.jpg\"), name=name)\n #ImageWriter(frame_fn, img)\n\n #Convert image to uint8 gray\n img_gray = RGB2Gray(img)\n\n #?\n img_gray = Call(img_as_ubyte, img_gray)\n\n #Canny edge detection using OpenCV\n img_canny = Call(cv2.Canny, img_gray, 50,100)\n\n #Dilate using OpenCV\n kernel = Call(cv2.getStructuringElement, cv2.MORPH_ELLIPSE, (15, 15))\n img_dilate = Call(cv2.dilate, img_canny, kernel, iterations=2)\n\n #Close using OpenCV\n kernel = Call(cv2.getStructuringElement, cv2.MORPH_ELLIPSE, (5, 5))\n img_close = Call(cv2.morphologyEx, img_dilate, cv2.MORPH_CLOSE, kernel, iterations=1)\n\n #Erode using OpenCV\n kernel = Call(cv2.getStructuringElement, cv2.MORPH_ELLIPSE, (15, 15))\n mask = Call(cv2.erode, img_close, kernel, iterations=2)\n\n #Find objects\n regionprops = FindRegions(\n mask, img_gray, min_area=1000, padding=10, warn_empty=name\n )\n\n #Set the LEDs as Purple\n Call(rgb, 255,0,255)\n\n # For an object, extract a vignette/ROI from the image\n roi_orig = ExtractROI(img, regionprops, bg_color=255)\n\n # Generate an object identifier\n i = Enumerate()\n\n #Call(print,i)\n\n #Define the ID of each object\n object_id = Format(\"{name}_{i:d}\", name=name, i=i)\n\n #Call(print,object_id)\n\n #Define the name of each object\n object_fn = Format(os.path.join(\"/home/pi/PlanktonScope/\",\"OBJECTS\", \"{name}.jpg\"), name=object_id)\n\n #Save the image of the object with its name\n ImageWriter(object_fn, roi_orig)\n\n #Calculate features. The calculated features are added to the global_metadata.\n #Returns a Variable representing a dict for every object in the stream.\n meta = CalculateZooProcessFeatures(\n regionprops, prefix=\"object_\", meta=global_metadata\n )\n\n #Get all the metadata\n json_meta = Call(json.dumps,meta, sort_keys=True, default=str)\n\n #Publish the json containing all the metadata to via MQTT to Node-RED\n Call(client.publish, \"receiver/segmentation/metric\", json_meta)\n\n #Add object_id to the metadata dictionary\n meta[\"object_id\"] = object_id\n\n #Generate object filenames\n orig_fn = Format(\"{object_id}.jpg\", object_id=object_id)\n\n #Write objects to an EcoTaxa archive:\n #roi image in original color, roi image in grayscale, metadata associated with each object\n EcotaxaWriter(archive_fn, (orig_fn, roi_orig), meta)\n\n #Progress bar for objects\n TQDM(Format(\"Object {object_id}\", object_id=object_id))\n\n #Publish the object_id to via MQTT to Node-RED\n Call(client.publish, \"receiver/segmentation/object_id\", object_id)\n\n #Set the LEDs as Green\n Call(rgb, 0,255,0)\n\n################################################################################\n#While loop for capting commands from Node-RED\n################################################################################\n\noutput = StreamingOutput()\naddress = ('192.168.4.1', 8000)\nserver = StreamingServer(address, StreamingHandler)\nthreading.Thread(target=server.serve_forever).start()\ncamera.start_recording(output, format='mjpeg', resize=(640, 480))\n\nwhile True:\n\n ############################################################################\n #Pump Event\n ############################################################################\n\n #If the command is \"pump\"\n if (command==\"pump\"):\n\n #Set the LEDs as Blue\n rgb(0,0,255)\n\n #Get direction from the different received arguments\n direction=args.split(\" \")[0]\n\n #Get delay (in between steps) from the different received arguments\n delay=float(args.split(\" \")[1])\n\n #Get number of steps from the different received arguments\n nb_step=int(args.split(\" \")[2])\n\n #Print status\n print(\"The pump has been started.\")\n\n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/pump\", \"Start\");\n\n ########################################################################\n while True:\n\n #Depending on direction, select the right direction for the pump\n if direction == \"BACKWARD\":\n direction=stepper.BACKWARD\n\n if direction == \"FORWARD\":\n direction=stepper.FORWARD\n\n #Actuate the pump for one step in the right direction\n pump_stepper.onestep(direction=direction, style=stepper.DOUBLE)\n\n #Increment the counter\n counter+=1\n\n #Wait during the delay to pump at the right flowrate\n sleep(delay)\n\n ####################################################################\n #If counter reach the number of step, break\n if counter>nb_step:\n\n #Release the pump stepper to stop power draw\n pump_stepper.release()\n\n #Print status\n print(\"The pumping is done.\")\n\n #Change the command to not re-enter in this while loop\n command=\"wait\"\n\n #Publish the status \"Done\" to via MQTT to Node-RED\n client.publish(\"receiver/pump\", \"Done\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ####################################################################\n #If a new received command isn't \"pump\", break this while loop\n if command!=\"pump\":\n\n #Release the pump stepper to stop power draw\n pump_stepper.release()\n\n #Print status\n print(\"The pump has been interrompted.\")\n\n #Publish the status \"Interrompted\" to via MQTT to Node-RED\n client.publish(\"receiver/pump\", \"Interrompted\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ############################################################################\n #Focus Event\n ############################################################################\n\n #If the command is \"focus\"\n elif (command==\"focus\"):\n\n #Set the LEDs as Yellow\n rgb(255,255,0)\n\n #Get direction from the different received arguments\n direction=args.split(\" \")[0]\n\n #Get number of steps from the different received arguments\n nb_step=int(args.split(\" \")[1])\n\n #Print status\n print(\"The focus has been started.\")\n\n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/focus\", \"Start\");\n\n ########################################################################\n while True:\n\n #Depending on direction, select the right direction for the focus\n if direction == \"FORWARD\":\n direction=stepper.FORWARD\n\n if direction == \"BACKWARD\":\n direction=stepper.BACKWARD\n\n #Actuate the focus for one microstep in the right direction\n focus_stepper.onestep(direction=direction, style=stepper.MICROSTEP)\n\n #Increment the counter\n counter+=1\n\n ####################################################################\n #If counter reach the number of step, break\n if counter>nb_step:\n\n #Release the focus steppers to stop power draw\n focus_stepper.release()\n\n #Print status\n print(\"The focusing is done.\")\n\n #Change the command to not re-enter in this while loop\n command=\"wait\"\n\n #Publish the status \"Done\" to via MQTT to Node-RED\n client.publish(\"receiver/focus\", \"Done\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ####################################################################\n #If a new received command isn't \"pump\", break this while loop\n if command!=\"focus\":\n\n #Release the focus steppers to stop power draw\n focus_stepper.release()\n\n #Print status\n print(\"The stage has been interrompted.\")\n\n #Publish the status \"Done\" to via MQTT to Node-RED\n client.publish(\"receiver/focus\", \"Interrompted\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ############################################################################\n #Image Event\n ############################################################################\n\n elif (command==\"image\"):\n \n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/image\", \"Will do my best dude\");\n\n #Get duration to wait before an image from the different received arguments\n sleep_before=int(args.split(\" \")[0])\n\n #Get number of step in between two images from the different received arguments\n nb_step=int(args.split(\" \")[1])\n\n #Get the number of frames to image from the different received arguments\n nb_frame=int(args.split(\" \")[2])\n\n #Get the segmentation status (true/false) from the different received arguments\n segmentation=str(args.split(\" \")[3])\n\n #Sleep a duration before to start acquisition\n sleep(sleep_before)\n\n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/image\", \"Start\");\n\n #Set the LEDs as Blue\n rgb(0,0,255)\n\n #Pump duing a given number of steps (in between each image)\n for i in range(nb_step):\n\n #If the command is still image - pump a defined nb of steps\n if (command==\"image\"):\n\n #Actuate the pump for one step in the FORWARD direction\n pump_stepper.onestep(direction=stepper.FORWARD, style=stepper.DOUBLE)\n\n #The flowrate is fixed for now.\n sleep(0.01)\n\n #If the command isn't image anymore - break\n else:\n\n break\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n while True:\n\n #Set the LEDs as Cyan\n rgb(0,255,255)\n\n #Increment the counter\n counter+=1\n\n #Get datetime\n datetime_tmp=datetime.now().strftime(\"%H_%M_%S_%f\")\n\n #Print datetime\n print(datetime_tmp)\n\n #Define the filename of the image\n filename = os.path.join(\"/home/pi/PlanktonScope/tmp\",datetime_tmp+\".jpg\")\n\n #Capture an image with the proper filename\n camera.capture(filename)\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Publish the name of the image to via MQTT to Node-RED\n\n client.publish(\"receiver/image\", datetime_tmp+\".jpg has been imaged.\");\n \n #Set the LEDs as Blue\n rgb(0,0,255)\n\n #Pump during a given nb of steps\n for i in range(nb_step):\n\n #Actuate the pump for one step in the FORWARD direction\n pump_stepper.onestep(direction=stepper.FORWARD, style=stepper.DOUBLE)\n\n #The flowrate is fixed for now.\n sleep(0.01)\n\n #Wait a fixed delay which set the framerate as < than 2 imag/sec\n sleep(0.5)\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n ####################################################################\n #If counter reach the number of frame, break\n if(counter>nb_frame):\n\n #Publish the status \"Completed\" to via MQTT to Node-RED\n client.publish(\"receiver/image\", \"Completed\");\n\n #Release the pump steppers to stop power draw\n pump_stepper.release()\n\n if(segmentation == \"True\"):\n\n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/segmentation\", \"Start\");\n\n #Start the MorphoCut Pipeline\n p.run()\n\n #remove directory\n #shutil.rmtree(import_path)\n\n #Publish the status \"Completed\" to via MQTT to Node-RED\n client.publish(\"receiver/segmentation\", \"Completed\");\n\n #Set the LEDs as White\n rgb(255,255,255)\n\n #cmd = os.popen(\"rm -rf /home/pi/PlanktonScope/tmp/*.jpg\")\n\n #Let it happen\n sleep(1)\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #End if(segmentation == \"True\"):\n\n #Change the command to not re-enter in this while loop\n command=\"wait\"\n \n #Set the LEDs as Green\n rgb(0,255,255)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ####################################################################\n #If a new received command isn't \"image\", break this while loop\n if command!=\"image\":\n\n #Release the pump steppers to stop power draw\n pump_stepper.release()\n\n #Print status\n print(\"The imaging has been interrompted.\")\n\n #Publish the status \"Interrompted\" to via MQTT to Node-RED\n client.publish(\"receiver/image\", \"Interrompted\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n else:\n #Set the LEDs as Black\n rgb(0,0,0)\n #Its just waiting to receive command from Node-RED\n sleep(1)\n #Set the LEDs as White\n rgb(255,255,255)\n #Its just waiting to receive command from Node-RED\n sleep(1)\n", + "output": "str", + "x": 300, + "y": 100, + "wires": [ + [ + "500abffa.c7a788" + ] + ] + }, + { + "id": "a11158b1.b7649", + "type": "debug", + "z": "e8320d42.9a3ad8", + "name": "", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "x": 1230, + "y": 200, + "wires": [] + }, + { + "id": "cf9e02a2.3feff", "type": "exec", - "z": "c10e968b.87e488", + "z": "e8320d42.9a3ad8", + "command": "ps -ax | grep \"python3.7 /home/pi/PlanktonScope/script/main.py\"| head -1 | awk -F \" \" '{print$1}' ", + "addpay": false, + "append": "", + "useSpawn": "false", + "timer": "", + "oldrc": false, + "name": "", + "x": 430, + "y": 40, + "wires": [ + [ + "945415c5.01217" + ], + [], + [] + ] + }, + { + "id": "945415c5.01217", + "type": "exec", + "z": "e8320d42.9a3ad8", + "command": "kill", + "addpay": true, + "append": "", + "useSpawn": "false", + "timer": "", + "oldrc": false, + "name": "", + "x": 910, + "y": 40, + "wires": [ + [], + [], + [] + ] + }, + { + "id": "18da28e6.7b000f", + "type": "delay", + "z": "e8320d42.9a3ad8", + "name": "", + "pauseType": "delay", + "timeout": "1", + "timeoutUnits": "seconds", + "rate": "1", + "nbRateUnits": "1", + "rateUnits": "second", + "randomFirst": "1", + "randomLast": "5", + "randomUnits": "seconds", + "drop": false, + "x": 160, + "y": 100, + "wires": [ + [ + "985c65de.0801b" + ] + ] + }, + { + "id": "6384a5e.e34465c", + "type": "subflow", + "name": "Datetime update", + "info": "", + "category": "", + "in": [ + { + "x": 140, + "y": 80, + "wires": [ + { + "id": "42ffcda3.49c30c" + } + ] + } + ], + "out": [], + "env": [], + "color": "#DDAA99", + "icon": "font-awesome/fa-clock-o" + }, + { + "id": "e3824a97.8f2c3", + "type": "exec", + "z": "6384a5e.e34465c", "command": "sudo date -s", "addpay": true, "append": "", @@ -1475,9 +510,9 @@ ] }, { - "id": "68aace8d.6bf5", + "id": "a5a13db6.4c6958", "type": "function", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "", "func": "d = new Date();\n//get weekday\nvar weekday = new Array(7);\nweekday[0] = \"Sun\";\nweekday[1] = \"Mon\";\nweekday[2] = \"Tue\";\nweekday[3] = \"Wed\";\nweekday[4] = \"Thu\";\nweekday[5] = \"Fri\";\nweekday[6] = \"Sat\";\nvar w = weekday[d.getUTCDay()];\n//get Month\nvar month = new Array(12);\nmonth[0] = \"Jan\";\nmonth[1] = \"Feb\";\nmonth[2] = \"Mar\";\nmonth[3] = \"Apr\";\nmonth[4] = \"May\";\nmonth[5] = \"Jun\";\nmonth[6] = \"Jul\";\nmonth[7] = \"Aug\";\nmonth[8] = \"Sep\";\nmonth[9] = \"Oct\";\nmonth[10] = \"Nov\";\nmonth[11] = \"Dec\";\nvar n = month[d.getUTCMonth()];\n \n//get day\nvar day = d.getUTCDay()\n\n//get Hours\nvar Hours = d.getUTCHours();\n//get Minutes\nvar Minutes = d.getUTCMinutes();\n//get Seconds\nvar Seconds = d.getUTCSeconds();\n//get FullYear\nvar FullYear = d.getUTCFullYear();\n\n//Thu Aug 09 2012 23:34:04 GMT+0200 (GMT+02:00)\n\n//Thu Aug 9 21:31:26 UTC 2012\n\n//msg.payload = \"Thu Aug 9 21:31:26 UTC 2012\"\n\nmsg.payload = '\"'+w+\" \"+n+\" \"+day+\" \"+Hours+\":\"+Minutes+\":\"+Seconds+\" UTC \"+FullYear+'\"';\nreturn msg;", "outputs": 1, @@ -1486,14 +521,14 @@ "y": 40, "wires": [ [ - "a1db5dbb.32c998" + "bafb69f.a42ea18" ] ] }, { - "id": "a1db5dbb.32c998", + "id": "bafb69f.a42ea18", "type": "ui_template", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "group": "9c86b3b7.54841", "name": "", "order": 1, @@ -1510,9 +545,9 @@ ] }, { - "id": "b3b03af9.8edae8", + "id": "81f9cd4c.8540b", "type": "ui_numeric", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "tmp_year", "label": "Year", "tooltip": "", @@ -1531,14 +566,14 @@ "y": 80, "wires": [ [ - "8de4b398.3c755" + "8f5a74df.0663f" ] ] }, { - "id": "ed1f72c4.e136e", + "id": "274f25fc.9e61ba", "type": "ui_numeric", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "tmp_month", "label": "Month", "tooltip": "", @@ -1557,14 +592,14 @@ "y": 120, "wires": [ [ - "8de4b398.3c755" + "8f5a74df.0663f" ] ] }, { - "id": "be55a4d1.4d5fa8", + "id": "4ddcb673.905a", "type": "ui_numeric", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "tmp_day", "label": "Day", "tooltip": "", @@ -1583,14 +618,14 @@ "y": 160, "wires": [ [ - "8de4b398.3c755" + "8f5a74df.0663f" ] ] }, { - "id": "ee1e92f8.a01bb8", + "id": "248eee4c.238282", "type": "ui_numeric", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "tmp_hour", "label": "Hour", "tooltip": "", @@ -1609,14 +644,14 @@ "y": 200, "wires": [ [ - "8de4b398.3c755" + "8f5a74df.0663f" ] ] }, { - "id": "c532a0cd.b0a47", + "id": "a368c4b7.2dc4b8", "type": "ui_numeric", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "tmp_minute", "label": "Minute", "tooltip": "", @@ -1635,14 +670,14 @@ "y": 240, "wires": [ [ - "8de4b398.3c755" + "8f5a74df.0663f" ] ] }, { - "id": "5b200123.04ec98", + "id": "96cc9953.9496c8", "type": "ui_numeric", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "tmp_second", "label": "Second", "tooltip": "", @@ -1661,14 +696,14 @@ "y": 280, "wires": [ [ - "8de4b398.3c755" + "8f5a74df.0663f" ] ] }, { - "id": "d8f0f8d1.0550d", + "id": "d6240495.8429c", "type": "interval", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "interval", "interval": "1", "onstart": false, @@ -1680,14 +715,14 @@ "y": 40, "wires": [ [ - "68aace8d.6bf5" + "a5a13db6.4c6958" ] ] }, { - "id": "eb163e1c.a7b97", + "id": "e8d38dc0.c7e84", "type": "ui_button", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "", "group": "9c86b3b7.54841", "order": 8, @@ -1706,14 +741,14 @@ "y": 320, "wires": [ [ - "aa948c91.3895a" + "581f71d3.bde458" ] ] }, { - "id": "aa948c91.3895a", + "id": "581f71d3.bde458", "type": "function", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "update datetime", "func": "var FullYear= global.get(\"year\");\nvar Month= global.get(\"month\");\nvar day= global.get(\"day\");\nvar Hours= global.get(\"hour\");\nvar Minutes= global.get(\"minute\");\nvar Seconds= global.get(\"second\");\n\nmsg.payload = new Date();\n//get Month\nvar month = new Array(12);\nmonth[1] = \"Jan\";\nmonth[2] = \"Feb\";\nmonth[3] = \"Mar\";\nmonth[4] = \"Apr\";\nmonth[5] = \"May\";\nmonth[6] = \"Jun\";\nmonth[7] = \"Jul\";\nmonth[8] = \"Aug\";\nmonth[9] = \"Sep\";\nmonth[10] = \"Oct\";\nmonth[11] = \"Nov\";\nmonth[12] = \"Dec\";\nvar n = month[Month];\n \nmsg.payload = '\"'+day+\" \"+n+\" \"+FullYear+\" \"+Hours+\":\"+Minutes+\":\"+Seconds+'\"';\n\n\nreturn msg;", "outputs": 1, @@ -1722,15 +757,15 @@ "y": 320, "wires": [ [ - "3b7403cb.d33394", - "b60669a0.b480d8" + "6b023a67.faa104", + "e3824a97.8f2c3" ] ] }, { - "id": "8de4b398.3c755", + "id": "8f5a74df.0663f", "type": "function", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "set global", "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);\nreturn msg;", "outputs": 1, @@ -1742,9 +777,9 @@ ] }, { - "id": "3b7403cb.d33394", + "id": "6b023a67.faa104", "type": "debug", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "", "active": true, "tosidebar": true, @@ -1756,9 +791,9 @@ "wires": [] }, { - "id": "315c5aa3.fdf5d6", + "id": "4ab089b9.1098", "type": "function", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "", "func": "d = msg.payload;\n\nvar val = d.getUTCFullYear();\n\nmsg.payload = val;\nreturn msg;", "outputs": 1, @@ -1767,14 +802,14 @@ "y": 80, "wires": [ [ - "b3b03af9.8edae8" + "81f9cd4c.8540b" ] ] }, { - "id": "93b9f3cd.759688", + "id": "42ffcda3.49c30c", "type": "function", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "", "func": "d = new Date();\nmsg.payload = d\nreturn msg;", "outputs": 1, @@ -1783,19 +818,19 @@ "y": 80, "wires": [ [ - "315c5aa3.fdf5d6", - "922cecc2.dc7f68", - "c2aa11f2.0fdee8", - "915b7162.7a73e", - "b57fe145.320d28", - "d3f45b98.f05a58" + "4ab089b9.1098", + "13529b2c.cb9d9d", + "c09bb768.0e7518", + "967b4488.670f08", + "3e3732d.273a04e", + "327729f0.afe466" ] ] }, { - "id": "922cecc2.dc7f68", + "id": "13529b2c.cb9d9d", "type": "function", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "", "func": "d = msg.payload;\n\nvar val = d.getUTCMonth();\n\nmsg.payload = val+1;\nreturn msg;", "outputs": 1, @@ -1804,14 +839,14 @@ "y": 120, "wires": [ [ - "ed1f72c4.e136e" + "274f25fc.9e61ba" ] ] }, { - "id": "c2aa11f2.0fdee8", + "id": "c09bb768.0e7518", "type": "function", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "", "func": "d = msg.payload;\n\nvar val = d.getUTCDay();\n\nmsg.payload = val;\nreturn msg;", "outputs": 1, @@ -1820,14 +855,14 @@ "y": 160, "wires": [ [ - "be55a4d1.4d5fa8" + "4ddcb673.905a" ] ] }, { - "id": "915b7162.7a73e", + "id": "967b4488.670f08", "type": "function", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "", "func": "d = msg.payload;\n\nvar val = d.getUTCHours();\n\nmsg.payload = val;\nreturn msg;", "outputs": 1, @@ -1836,14 +871,14 @@ "y": 200, "wires": [ [ - "ee1e92f8.a01bb8" + "248eee4c.238282" ] ] }, { - "id": "b57fe145.320d28", + "id": "3e3732d.273a04e", "type": "function", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "", "func": "d = msg.payload;\n\nvar val = d.getUTCMinutes();\n\nmsg.payload = val;\nreturn msg;", "outputs": 1, @@ -1852,14 +887,14 @@ "y": 240, "wires": [ [ - "c532a0cd.b0a47" + "a368c4b7.2dc4b8" ] ] }, { - "id": "d3f45b98.f05a58", + "id": "327729f0.afe466", "type": "function", - "z": "c10e968b.87e488", + "z": "6384a5e.e34465c", "name": "", "func": "d = msg.payload;\n\nvar val = d.getUTCSeconds();\n\nmsg.payload = val;\nreturn msg;", "outputs": 1, @@ -1868,14 +903,79 @@ "y": 280, "wires": [ [ - "5b200123.04ec98" + "96cc9953.9496c8" ] ] }, { - "id": "c4527705.33a84", + "id": "9c86b3b7.54841", + "type": "ui_group", + "z": "", + "name": "Datetime", + "tab": "2b97fe34.a699fa", + "order": 1, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "a156df1e.d37178", + "type": "subflow", + "name": "Acquisition inputs", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "2dd27be1.476eac" + }, + { + "id": "3883d084.feb708" + }, + { + "id": "4bf1038f.d36f9c" + }, + { + "id": "ae15c276.ec8c68" + } + ] + } + ], + "out": [ + { + "x": 740, + "y": 40, + "wires": [ + { + "id": "b996437b.1a45b8", + "port": 0 + }, + { + "id": "d56a51c1.60023", + "port": 0 + }, + { + "id": "229ade87.b1656a", + "port": 0 + }, + { + "id": "5e093b67.a32f9c", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#A6BBCF", + "icon": "node-red-contrib-camerapi/photo.png" + }, + { + "id": "b996437b.1a45b8", "type": "ui_text_input", - "z": "863e8384.56889", + "z": "a156df1e.d37178", "name": "custom_nb_step", "label": "Number of steps in between two images", "tooltip": "", @@ -1894,9 +994,9 @@ ] }, { - "id": "582e21b2.ad67a8", + "id": "229ade87.b1656a", "type": "ui_text_input", - "z": "863e8384.56889", + "z": "a156df1e.d37178", "name": "custom_nb_frame", "label": "Number of images per acquisition", "tooltip": "", @@ -1915,9 +1015,9 @@ ] }, { - "id": "3eaf4c98.d94b54", + "id": "2dd27be1.476eac", "type": "function", - "z": "863e8384.56889", + "z": "a156df1e.d37178", "name": "get custom_nb_step", "func": "msg.payload = msg.payload.custom_nb_step;\nreturn msg;", "outputs": 1, @@ -1926,14 +1026,14 @@ "y": 80, "wires": [ [ - "c4527705.33a84" + "b996437b.1a45b8" ] ] }, { - "id": "8eeb9e9e.a50d7", + "id": "4bf1038f.d36f9c", "type": "function", - "z": "863e8384.56889", + "z": "a156df1e.d37178", "name": "get custom_nb_frame", "func": "msg.payload = msg.payload.custom_nb_frame;\nreturn msg;", "outputs": 1, @@ -1942,14 +1042,14 @@ "y": 120, "wires": [ [ - "582e21b2.ad67a8" + "229ade87.b1656a" ] ] }, { - "id": "e4e16eb9.5296c", + "id": "ae15c276.ec8c68", "type": "function", - "z": "863e8384.56889", + "z": "a156df1e.d37178", "name": "get custom_segmentation", "func": "msg.payload = msg.payload.custom_segmentation;\nreturn msg;", "outputs": 1, @@ -1958,14 +1058,14 @@ "y": 160, "wires": [ [ - "f9705bc.3d322a8" + "5e093b67.a32f9c" ] ] }, { - "id": "e50aa637.59ac68", + "id": "3883d084.feb708", "type": "function", - "z": "863e8384.56889", + "z": "a156df1e.d37178", "name": "get custom_sleep_before", "func": "msg.payload = msg.payload.custom_sleep_before;\nreturn msg;", "outputs": 1, @@ -1974,14 +1074,14 @@ "y": 40, "wires": [ [ - "f648e44.94e3998" + "d56a51c1.60023" ] ] }, { - "id": "f648e44.94e3998", + "id": "d56a51c1.60023", "type": "ui_text_input", - "z": "863e8384.56889", + "z": "a156df1e.d37178", "name": "custom_sleep_before", "label": "Duration before the acquisition (s)", "tooltip": "", @@ -2000,9 +1100,81 @@ ] }, { - "id": "11b31baf.95996c", + "id": "5e093b67.a32f9c", + "type": "ui_switch", + "z": "a156df1e.d37178", + "name": "custom_segmentation", + "label": "Realize the segmentation", + "tooltip": "", + "group": "48649115.fcd01", + "order": 6, + "width": 0, + "height": 0, + "passthru": true, + "decouple": "false", + "topic": "custom_segmentation", + "style": "", + "onvalue": "True", + "onvalueType": "str", + "onicon": "", + "oncolor": "", + "offvalue": "False", + "offvalueType": "str", + "officon": "", + "offcolor": "", + "x": 520, + "y": 160, + "wires": [ + [] + ] + }, + { + "id": "48649115.fcd01", + "type": "ui_group", + "z": "", + "name": "Acquisition inputs", + "tab": "2b97fe34.a699fa", + "order": 9, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "99798a85.e62408", + "type": "subflow", + "name": "Process metadata", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 80, + "wires": [ + { + "id": "20414296.54837e" + } + ] + } + ], + "out": [ + { + "x": 700, + "y": 80, + "wires": [ + { + "id": "d5ab9061.b06a9", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#DDAA99" + }, + { + "id": "d5ab9061.b06a9", "type": "ui_text_input", - "z": "5a287804.a10e2", + "z": "99798a85.e62408", "name": "process_id", "label": "Id of the process", "tooltip": "", @@ -2021,9 +1193,9 @@ ] }, { - "id": "dfb4b682.601e1", + "id": "20414296.54837e", "type": "function", - "z": "5a287804.a10e2", + "z": "99798a85.e62408", "name": "get process_id", "func": "msg.payload = msg.payload.process_id+1;\nreturn msg;", "outputs": 1, @@ -2032,14 +1204,37 @@ "y": 80, "wires": [ [ - "11b31baf.95996c" + "d5ab9061.b06a9" ] ] }, { - "id": "3777e513.35c3fa", + "id": "beeb994e.b67688", + "type": "ui_group", + "z": "", + "name": "Process metadata", + "tab": "2b97fe34.a699fa", + "order": 8, + "disp": true, + "width": 24, + "collapse": false + }, + { + "id": "246abd43.838a5a", + "type": "subflow", + "name": "MQTT Receive & Plot", + "info": "", + "category": "", + "in": [], + "out": [], + "env": [], + "color": "#F3B567", + "icon": "node-red/bridge.svg" + }, + { + "id": "1aeca49c.10b893", "type": "mqtt in", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "", "topic": "receiver/#", "qos": "0", @@ -2049,15 +1244,15 @@ "y": 40, "wires": [ [ - "9886f960.4b6268", - "589fbae2.8ff914" + "be5de01e.45d56", + "613bee5b.042fe" ] ] }, { - "id": "9886f960.4b6268", + "id": "be5de01e.45d56", "type": "switch", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "", "property": "topic", "propertyType": "msg", @@ -2090,23 +1285,23 @@ "y": 40, "wires": [ [ - "c90e948f.2f7348" + "d39289fb.9f759" ], [ - "1d54f7b3.db7ac8" + "e2ab3af3.e61a8" ], [ - "d02a7968.b8874" + "e43e94c.c297968" ], [ - "11e60fef.079d38" + "b06c80f3.f1642" ] ] }, { - "id": "c90e948f.2f7348", + "id": "d39289fb.9f759", "type": "switch", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "", "property": "payload", "propertyType": "msg", @@ -2134,20 +1329,20 @@ "y": 40, "wires": [ [ - "e16b8120.403e8" + "267bd959.17b856" ], [ - "4ea155a3.d8531c" + "265e58c6.06de38" ], [ - "3d35b841.e6596" + "a433c901.2abd48" ] ] }, { - "id": "e16b8120.403e8", + "id": "267bd959.17b856", "type": "change", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "The pump has started", "rules": [ { @@ -2167,14 +1362,14 @@ "y": 40, "wires": [ [ - "1597b08f.5bce8f" + "3b6b4fd4.8c3368" ] ] }, { - "id": "4ea155a3.d8531c", + "id": "265e58c6.06de38", "type": "change", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "The pump has finished.", "rules": [ { @@ -2194,14 +1389,14 @@ "y": 80, "wires": [ [ - "1597b08f.5bce8f" + "3b6b4fd4.8c3368" ] ] }, { - "id": "3d35b841.e6596", + "id": "a433c901.2abd48", "type": "change", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "The pump has been stopped.", "rules": [ { @@ -2221,14 +1416,14 @@ "y": 120, "wires": [ [ - "1597b08f.5bce8f" + "3b6b4fd4.8c3368" ] ] }, { - "id": "1d54f7b3.db7ac8", + "id": "e2ab3af3.e61a8", "type": "switch", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "", "property": "payload", "propertyType": "msg", @@ -2256,20 +1451,20 @@ "y": 200, "wires": [ [ - "7ce7cf66.df449" + "bd89c468.5a4f4" ], [ - "8846b607.310e9" + "762ab12c.cc7e88" ], [ - "5a8f4613.c9989" + "ecb1efe6.7cb968" ] ] }, { - "id": "7ce7cf66.df449", + "id": "bd89c468.5a4f4", "type": "change", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "The focus has started", "rules": [ { @@ -2289,14 +1484,14 @@ "y": 200, "wires": [ [ - "1597b08f.5bce8f" + "3b6b4fd4.8c3368" ] ] }, { - "id": "8846b607.310e9", + "id": "762ab12c.cc7e88", "type": "change", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "The focus has finished.", "rules": [ { @@ -2316,14 +1511,14 @@ "y": 240, "wires": [ [ - "1597b08f.5bce8f" + "3b6b4fd4.8c3368" ] ] }, { - "id": "5a8f4613.c9989", + "id": "ecb1efe6.7cb968", "type": "change", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "The focus has been stopped.", "rules": [ { @@ -2343,14 +1538,14 @@ "y": 280, "wires": [ [ - "1597b08f.5bce8f" + "3b6b4fd4.8c3368" ] ] }, { - "id": "d02a7968.b8874", + "id": "e43e94c.c297968", "type": "switch", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "", "property": "payload", "propertyType": "msg", @@ -2383,24 +1578,24 @@ "y": 360, "wires": [ [ - "d7f9086b.728df8" + "87a2aa4d.3590c8" ], [ - "c104db3.a287628" + "da9f9e9b.7c9f5" ], [ - "e99cb81d.b79df" + "1143b916.5047b7" ], [ - "3de45d76.06ab6a", - "1597b08f.5bce8f" + "fa7f2eaf.0e6f1", + "3b6b4fd4.8c3368" ] ] }, { - "id": "90e10524.6709f", + "id": "30c9c4c9.d46e3c", "type": "switch", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "", "property": "payload", "propertyType": "msg", @@ -2423,17 +1618,17 @@ "y": 560, "wires": [ [ - "6c8a5e5c.bf0f5" + "23e5c77c.4f63f" ], [ - "90433a26.6fc278" + "5491334a.93cbfc" ] ] }, { - "id": "c104db3.a287628", + "id": "da9f9e9b.7c9f5", "type": "change", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "The acquisition has finished.", "rules": [ { @@ -2453,14 +1648,14 @@ "y": 400, "wires": [ [ - "1597b08f.5bce8f" + "3b6b4fd4.8c3368" ] ] }, { - "id": "e99cb81d.b79df", + "id": "1143b916.5047b7", "type": "change", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "The acquisition has been stopped.", "rules": [ { @@ -2480,14 +1675,14 @@ "y": 440, "wires": [ [ - "1597b08f.5bce8f" + "3b6b4fd4.8c3368" ] ] }, { - "id": "d7f9086b.728df8", + "id": "87a2aa4d.3590c8", "type": "change", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "The acquisition has started", "rules": [ { @@ -2507,14 +1702,14 @@ "y": 360, "wires": [ [ - "1597b08f.5bce8f" + "3b6b4fd4.8c3368" ] ] }, { - "id": "3de45d76.06ab6a", + "id": "fa7f2eaf.0e6f1", "type": "function", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "img_counter.js", "func": "img_counter=global.get('img_counter')\nimg_counter=img_counter+1\nglobal.set('img_counter',img_counter)\nmsg.payload = img_counter\nreturn msg;", "outputs": 1, @@ -2523,14 +1718,14 @@ "y": 480, "wires": [ [ - "2f2c466d.88c6ba" + "582d7204.ec89fc" ] ] }, { - "id": "aebfa8a2.b4a928", + "id": "498b3d58.58b1a4", "type": "function", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "obj_counter.js", "func": "obj_counter=global.get('obj_counter')\nobj_counter=obj_counter+1\nglobal.set('obj_counter',obj_counter)\nmsg.payload = obj_counter\nreturn msg;", "outputs": 1, @@ -2539,14 +1734,14 @@ "y": 640, "wires": [ [ - "add1bf6d.b7a668" + "67618ae5.b74864" ] ] }, { - "id": "2f2c466d.88c6ba", + "id": "582d7204.ec89fc", "type": "ui_chart", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "img_counter", "group": "eb610eb9.84fae8", "order": 2, @@ -2586,9 +1781,9 @@ ] }, { - "id": "11e60fef.079d38", + "id": "b06c80f3.f1642", "type": "switch", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "", "property": "topic", "propertyType": "msg", @@ -2616,20 +1811,20 @@ "y": 560, "wires": [ [ - "90e10524.6709f" + "30c9c4c9.d46e3c" ], [ - "aebfa8a2.b4a928" + "498b3d58.58b1a4" ], [ - "7dd159b.6c105a8" + "33094026.f6e8c" ] ] }, { - "id": "90433a26.6fc278", + "id": "5491334a.93cbfc", "type": "change", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "The segmentation has finished.", "rules": [ { @@ -2649,14 +1844,14 @@ "y": 600, "wires": [ [ - "1597b08f.5bce8f" + "3b6b4fd4.8c3368" ] ] }, { - "id": "6c8a5e5c.bf0f5", + "id": "23e5c77c.4f63f", "type": "change", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "The segmentation has started", "rules": [ { @@ -2676,14 +1871,14 @@ "y": 560, "wires": [ [ - "1597b08f.5bce8f" + "3b6b4fd4.8c3368" ] ] }, { - "id": "add1bf6d.b7a668", + "id": "67618ae5.b74864", "type": "ui_chart", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "obj_counter", "group": "eb610eb9.84fae8", "order": 5, @@ -2723,9 +1918,9 @@ ] }, { - "id": "6f3399be.761c68", + "id": "3c29eb4.e570414", "type": "function", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "", "func": "msg.payload=msg.payload.object_area\nmsg.topic=\"area\"\n\nreturn msg;", "outputs": 1, @@ -2734,14 +1929,14 @@ "y": 700, "wires": [ [ - "e50c9bb6.397a08" + "84dfe51a.0e9fd" ] ] }, { - "id": "7dd159b.6c105a8", + "id": "33094026.f6e8c", "type": "json", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "", "property": "payload", "action": "", @@ -2750,14 +1945,14 @@ "y": 700, "wires": [ [ - "6f3399be.761c68" + "3c29eb4.e570414" ] ] }, { - "id": "b56d820b.9f7b", + "id": "9b672325.568a18", "type": "exec", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "command": "free -m | grep \"Mem\" | awk -F ' ' '{print $3}'", "addpay": false, "append": "", @@ -2768,16 +1963,16 @@ "y": 780, "wires": [ [ - "bb46922a.0aa378" + "76a7ddb6.fbde64" ], [], [] ] }, { - "id": "7c27a4b2.6fe8e4", + "id": "7c9eaef6.142a4", "type": "inject", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "", "topic": "", "payload": "", @@ -2790,14 +1985,14 @@ "y": 780, "wires": [ [ - "b56d820b.9f7b" + "9b672325.568a18" ] ] }, { - "id": "bb46922a.0aa378", + "id": "76a7ddb6.fbde64", "type": "ui_chart", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "", "group": "eb610eb9.84fae8", "order": 1, @@ -2837,9 +2032,9 @@ ] }, { - "id": "e50c9bb6.397a08", + "id": "84dfe51a.0e9fd", "type": "ui_chart", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "name": "", "group": "eb610eb9.84fae8", "order": 8, @@ -2879,9 +2074,9 @@ ] }, { - "id": "1597b08f.5bce8f", + "id": "3b6b4fd4.8c3368", "type": "ui_toast", - "z": "a8ad6dec.1a393", + "z": "246abd43.838a5a", "position": "top right", "displayTime": "3", "highlight": "", @@ -2897,62 +2092,69 @@ "wires": [] }, { - "id": "85ced3a9.8bc898", - "type": "exec", - "z": "9882c53a.0ccc8", - "command": "vcgencmd measure_temp | tr -d \"temp=\" | tr -d \"'C\" | tr -d \"\\n\"", - "addpay": false, - "append": "", - "useSpawn": "", - "timer": "", - "name": "RPi Temp.", - "x": 350, - "y": 80, - "wires": [ - [ - "8715b9fb.194438" - ], - [], - [] - ] - }, - { - "id": "3bb0ef9d.258af8", - "type": "inject", - "z": "9882c53a.0ccc8", + "id": "613bee5b.042fe", + "type": "debug", + "z": "246abd43.838a5a", "name": "", - "topic": "", - "payload": "", - "payloadType": "date", - "repeat": "10", - "crontab": "", - "once": false, - "onceDelay": "", - "x": 190, - "y": 80, - "wires": [ - [ - "85ced3a9.8bc898" - ] - ] + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "true", + "targetType": "full", + "x": 240, + "y": 140, + "wires": [] }, { - "id": "8715b9fb.194438", - "type": "python3-function", - "z": "9882c53a.0ccc8", - "name": "fan.py", - "func": "#!/usr/bin/python\nimport smbus\nimport sys\n\ntemp = msg[\"payload\"]\n\ntemp = int(temp.split('.',1)[0])\n\nbus = smbus.SMBus(1)\n\nDEVICE_ADDRESS = 0x0d\n\nif temp < 38:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x00)\nif temp > 42:\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)\n bus.write_byte_data(DEVICE_ADDRESS, 0x08, 0x01)", - "outputs": 1, - "x": 530, - "y": 80, - "wires": [ - [] - ] + "id": "84801dc0.193d88", + "type": "mqtt-broker", + "z": "", + "name": "", + "broker": "127.0.0.1", + "port": "1883", + "clientid": "test", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" }, { - "id": "7bdf69d9.8f98e", + "id": "eb610eb9.84fae8", + "type": "ui_group", + "z": "", + "name": "MQTT Plots", + "tab": "2b97fe34.a699fa", + "order": 11, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "1273b673.4a35ea", + "type": "subflow", + "name": "System Commands", + "info": "", + "category": "", + "in": [], + "out": [], + "env": [], + "color": "#FFCC66", + "icon": "node-red-dashboard/ui_button.png" + }, + { + "id": "44a78834.e8f8b8", "type": "ui_button", - "z": "fbe9590f.bd63b8", + "z": "1273b673.4a35ea", "name": "", "group": "82b3caaa.0518", "order": 1, @@ -2971,14 +2173,14 @@ "y": 80, "wires": [ [ - "c55ff479.c166a8" + "aba9aac1.c2d198" ] ] }, { - "id": "f400fb5a.9bc108", + "id": "a32bfa65.bc6b9", "type": "exec", - "z": "fbe9590f.bd63b8", + "z": "1273b673.4a35ea", "command": "sudo", "addpay": true, "append": "", @@ -2995,9 +2197,9 @@ ] }, { - "id": "867e9bed.e2a298", + "id": "825c8791.c0bfb", "type": "ui_button", - "z": "fbe9590f.bd63b8", + "z": "1273b673.4a35ea", "name": "", "group": "82b3caaa.0518", "order": 2, @@ -3016,14 +2218,14 @@ "y": 140, "wires": [ [ - "c55ff479.c166a8" + "aba9aac1.c2d198" ] ] }, { - "id": "c55ff479.c166a8", + "id": "aba9aac1.c2d198", "type": "python3-function", - "z": "fbe9590f.bd63b8", + "z": "1273b673.4a35ea", "name": "action", "func": "#!/usr/bin/python\nimport smbus\nimport time\nbus = smbus.SMBus(1)\ntime.sleep(1)\n#turn off fan RGB\nbus.write_byte_data(0x0d, 0x07, 0x00)\nbus.write_byte_data(0x0d, 0x07, 0x00)\n\nmsg[\"payload\"] = str(msg[\"topic\"])+' now'\nreturn msg", "outputs": 1, @@ -3031,15 +2233,15 @@ "y": 100, "wires": [ [ - "46f85d17.08fa54", - "f400fb5a.9bc108" + "72b7368a.abad3", + "a32bfa65.bc6b9" ] ] }, { - "id": "46f85d17.08fa54", + "id": "72b7368a.abad3", "type": "exec", - "z": "fbe9590f.bd63b8", + "z": "1273b673.4a35ea", "command": "i2cdetect -y 1", "addpay": false, "append": "", @@ -3056,9 +2258,76 @@ ] }, { - "id": "cf0b247b.e3e7c", + "id": "82b3caaa.0518", + "type": "ui_group", + "z": "", + "name": "Commands", + "tab": "2b97fe34.a699fa", + "order": 12, + "disp": true, + "width": 24, + "collapse": false + }, + { + "id": "506e9090.6e905", + "type": "subflow", + "name": "Object metadata", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "4ab4976c.eee488" + }, + { + "id": "581c8a23.83fa8c" + }, + { + "id": "52052007.b3d0e" + } + ] + } + ], + "out": [ + { + "x": 1060, + "y": 159, + "wires": [ + { + "id": "26b33a5c.0ef82e", + "port": 0 + }, + { + "id": "9ee0935a.415808", + "port": 0 + } + ] + }, + { + "x": 1060, + "y": 59, + "wires": [ + { + "id": "d3875217.e3b668", + "port": 0 + }, + { + "id": "82fef572.49b5f", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#DDAA99" + }, + { + "id": "26b33a5c.0ef82e", "type": "ui_numeric", - "z": "b45c6fb6.f6dfa8", + "z": "506e9090.6e905", "name": "object_depth_min", "label": "Minimum depth (m)", "tooltip": "", @@ -3080,9 +2349,9 @@ ] }, { - "id": "1675637a.1d762d", + "id": "9ee0935a.415808", "type": "ui_numeric", - "z": "b45c6fb6.f6dfa8", + "z": "506e9090.6e905", "name": "object_depth_max", "label": "Maximum depth (m)", "tooltip": "", @@ -3104,9 +2373,9 @@ ] }, { - "id": "8a61177.8eaa1e8", + "id": "4ab4976c.eee488", "type": "function", - "z": "b45c6fb6.f6dfa8", + "z": "506e9090.6e905", "name": "get object_depth_min", "func": "msg.payload = msg.payload.object_depth_min;\nreturn msg;", "outputs": 1, @@ -3115,14 +2384,14 @@ "y": 120, "wires": [ [ - "cf0b247b.e3e7c" + "26b33a5c.0ef82e" ] ] }, { - "id": "3893c81e.a9b9e", + "id": "581c8a23.83fa8c", "type": "function", - "z": "b45c6fb6.f6dfa8", + "z": "506e9090.6e905", "name": "get object_depth_max", "func": "msg.payload = msg.payload.object_depth_max;\nreturn msg;", "outputs": 1, @@ -3131,14 +2400,14 @@ "y": 160, "wires": [ [ - "1675637a.1d762d" + "9ee0935a.415808" ] ] }, { - "id": "f478b054.024158", + "id": "472998cd.45f588", "type": "gpsd", - "z": "b45c6fb6.f6dfa8", + "z": "506e9090.6e905", "name": "", "hostname": "localhost", "port": "2947", @@ -3152,15 +2421,15 @@ "y": 220, "wires": [ [ - "bd643763.2a7768", - "edee5fda.673ae" + "52052007.b3d0e", + "ab40705d.43a5d" ] ] }, { - "id": "ca169437.bb25e8", + "id": "7d5701.1e1981", "type": "ui_worldmap", - "z": "b45c6fb6.f6dfa8", + "z": "506e9090.6e905", "d": true, "group": "f377d75b.32d27", "order": 1, @@ -3187,9 +2456,9 @@ "wires": [] }, { - "id": "bd643763.2a7768", + "id": "52052007.b3d0e", "type": "function", - "z": "b45c6fb6.f6dfa8", + "z": "506e9090.6e905", "name": "get object_lat & object_lon", "func": "\nreturn msg;", "outputs": 1, @@ -3198,14 +2467,14 @@ "y": 200, "wires": [ [ - "ca169437.bb25e8" + "7d5701.1e1981" ] ] }, { - "id": "d485fec3.802e", + "id": "d3875217.e3b668", "type": "function", - "z": "b45c6fb6.f6dfa8", + "z": "506e9090.6e905", "name": "set object_time", "func": "var time = new Date(msg.payload);\n\nvar hour = time.getUTCHours();\nif (hour<10){hour = \"0\"+hour;}\nvar minute = time.getUTCMinutes();\nif (minute<10){minute = \"0\"+minute;}\n\nvar time_UTC = \"\"+hour+minute;\nglobal.set('object_time',time_UTC);\nreturn msg;", "outputs": 1, @@ -3217,9 +2486,9 @@ ] }, { - "id": "5196107b.a5eae8", + "id": "82fef572.49b5f", "type": "function", - "z": "b45c6fb6.f6dfa8", + "z": "506e9090.6e905", "name": "set object_date", "func": "var date = new Date(msg.payload);\n\nvar year = date.getUTCFullYear();\nvar month = date.getUTCMonth()+1;\nif (month<10){month = \"0\"+month;}\nvar day = date.getUTCDate();\nif (day<10){day = \"0\"+day;}\n\nvar date_UTC = \"\"+year+month+day;\nglobal.set('object_date',date_UTC);\n\nreturn msg;", "outputs": 1, @@ -3231,9 +2500,9 @@ ] }, { - "id": "edee5fda.673ae", + "id": "ab40705d.43a5d", "type": "debug", - "z": "b45c6fb6.f6dfa8", + "z": "506e9090.6e905", "name": "", "active": true, "tosidebar": true, @@ -3246,9 +2515,114 @@ "wires": [] }, { - "id": "5a5fcc9a.9ede14", + "id": "f377d75b.32d27", + "type": "ui_group", + "z": "", + "name": "Object metadata", + "tab": "2b97fe34.a699fa", + "order": 6, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "97d77aeb.75afd8", + "type": "subflow", + "name": "Acquisition metadata", + "info": "", + "category": "", + "in": [ + { + "x": 50, + "y": 30, + "wires": [ + { + "id": "282cae65.749e9a" + }, + { + "id": "cc899daf.a8d5d8" + }, + { + "id": "9873f1c8.6cb608" + }, + { + "id": "e53df171.eed68" + }, + { + "id": "5f728563.cf6214" + }, + { + "id": "c1a5eaf5.8691c" + }, + { + "id": "86c63d98.eb21" + }, + { + "id": "3707a612.b8619a" + }, + { + "id": "b2d20d5d.fd9e38" + } + ] + } + ], + "out": [ + { + "x": 740, + "y": 40, + "wires": [ + { + "id": "3b267291.1eee26", + "port": 0 + }, + { + "id": "435a2dcf.a1a60c", + "port": 0 + }, + { + "id": "cc6cb58d.b2dbe8", + "port": 0 + }, + { + "id": "8b306bbc.914", + "port": 0 + }, + { + "id": "2a5a2b7a.f218d4", + "port": 0 + }, + { + "id": "28df07d8.d71ba8", + "port": 0 + }, + { + "id": "6cf2c1ac.a0fea8", + "port": 0 + }, + { + "id": "e7c4132f.f4417", + "port": 0 + } + ] + }, + { + "x": 900, + "y": 360, + "wires": [ + { + "id": "1e688c91.1b805b", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#DDAA99" + }, + { + "id": "1e688c91.1b805b", "type": "function", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "set optical config", "func": "global.set(msg.topic,msg.payload);\nvar acq_fnumber_objective = String(global.get(msg.topic));\n\nswitch(acq_fnumber_objective) {\n case \"25\":\n global.set(\"acq_magnification\",0.6);\n global.set(\"process_pixel\",1.86);\n global.set(\"sug_min\",60);\n global.set(\"sug_max\",670);\n global.set(\"sug_flowrate\",3);\n break;\n case \"16\":\n global.set(\"acq_magnification\",0.94);\n global.set(\"process_pixel\",1.19);\n global.set(\"sug_min\",40);\n global.set(\"sug_max\",430);\n global.set(\"sug_flowrate\",2.4);\n break;\n case \"12\":\n global.set(\"acq_magnification\",1.20);\n global.set(\"process_pixel\",0.94);\n global.set(\"sug_min\",30);\n global.set(\"sug_max\",340);\n global.set(\"sug_flowrate\",1.25);\n break;\n case \"8\":\n global.set(\"acq_magnification\",1.78);\n global.set(\"process_pixel\",0.63);\n global.set(\"sug_min\",20);\n global.set(\"sug_max\",230);\n global.set(\"sug_flowrate\",0.42);\n break;\n case \"6\":\n global.set(\"acq_magnification\",2.36);\n global.set(\"process_pixel\",0.48);\n global.set(\"sug_min\",15);\n global.set(\"sug_max\",170);\n global.set(\"sug_flowrate\",0.32);\n break;\n}\nreturn msg;", "outputs": 1, @@ -3260,9 +2634,9 @@ ] }, { - "id": "3d3aafbf.e907a8", + "id": "2877f2f.211cc8e", "type": "ui_dropdown", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "acq_fnumber_objective", "label": "M12 Lens*", "tooltip": "", @@ -3305,14 +2679,14 @@ "y": 360, "wires": [ [ - "5a5fcc9a.9ede14" + "1e688c91.1b805b" ] ] }, { - "id": "12e818fa.b7301f", + "id": "8b306bbc.914", "type": "ui_numeric", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "acq_minimum_mesh", "label": "Min fraction size (μm)", "tooltip": "", @@ -3334,9 +2708,9 @@ ] }, { - "id": "b577dcd2.8d2c88", + "id": "2a5a2b7a.f218d4", "type": "ui_numeric", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "acq_maximum_mesh", "label": "Max fraction size (μm)", "tooltip": "", @@ -3358,9 +2732,9 @@ ] }, { - "id": "21b35429.fe43a4", + "id": "3b267291.1eee26", "type": "ui_text_input", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "acq_id", "label": "Acquisition unique ID*", "tooltip": "", @@ -3379,9 +2753,9 @@ ] }, { - "id": "c4e69883.a0f3d", + "id": "cc6cb58d.b2dbe8", "type": "ui_dropdown", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "acq_celltype", "label": "Thickness flowcell*", "tooltip": "", @@ -3422,9 +2796,9 @@ ] }, { - "id": "f7f5ccc1.29a41", + "id": "28df07d8.d71ba8", "type": "ui_text_input", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "acq_volume", "label": "Volume to pass (ml)", "tooltip": "", @@ -3443,9 +2817,9 @@ ] }, { - "id": "f0595ff1.c4d568", + "id": "435a2dcf.a1a60c", "type": "ui_text_input", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "acq_instrument", "label": "Acquisition instrument", "tooltip": "PlanktonScope V2.1", @@ -3464,9 +2838,9 @@ ] }, { - "id": "93a3fd29.c55938", + "id": "282cae65.749e9a", "type": "function", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "get acq_id", "func": "msg.payload = msg.payload.acq_id+1;\nreturn msg;", "outputs": 1, @@ -3475,14 +2849,14 @@ "y": 40, "wires": [ [ - "21b35429.fe43a4" + "3b267291.1eee26" ] ] }, { - "id": "9e9e7f8a.b66d4", + "id": "cc899daf.a8d5d8", "type": "function", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "get acq_instrument", "func": "msg.payload = msg.payload.acq_instrument;\nreturn msg;", "outputs": 1, @@ -3491,14 +2865,14 @@ "y": 80, "wires": [ [ - "f0595ff1.c4d568" + "435a2dcf.a1a60c" ] ] }, { - "id": "b1105180.b4b78", + "id": "9873f1c8.6cb608", "type": "function", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "get acq_celltype", "func": "msg.payload = msg.payload.acq_celltype;\nreturn msg;", "outputs": 1, @@ -3507,14 +2881,14 @@ "y": 120, "wires": [ [ - "c4e69883.a0f3d" + "cc6cb58d.b2dbe8" ] ] }, { - "id": "ec403304.e34c58", + "id": "e53df171.eed68", "type": "function", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "get acq_minimum_mesh", "func": "msg.payload = msg.payload.acq_minimum_mesh;\nreturn msg;", "outputs": 1, @@ -3523,14 +2897,14 @@ "y": 160, "wires": [ [ - "12e818fa.b7301f" + "8b306bbc.914" ] ] }, { - "id": "7aac5c46.0669ec", + "id": "5f728563.cf6214", "type": "function", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "get acq_maximum_mesh", "func": "msg.payload = msg.payload.acq_maximum_mesh;\nreturn msg;", "outputs": 1, @@ -3539,14 +2913,14 @@ "y": 200, "wires": [ [ - "b577dcd2.8d2c88" + "2a5a2b7a.f218d4" ] ] }, { - "id": "c491cf7.36957b", + "id": "c1a5eaf5.8691c", "type": "function", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "get acq_volume", "func": "msg.payload = msg.payload.acq_volume;\nreturn msg;", "outputs": 1, @@ -3555,14 +2929,14 @@ "y": 240, "wires": [ [ - "f7f5ccc1.29a41" + "28df07d8.d71ba8" ] ] }, { - "id": "31d58fcd.ede758", + "id": "b2d20d5d.fd9e38", "type": "function", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "get acq_fnumber_objective", "func": "msg.payload = msg.payload.acq_fnumber_objective;\nreturn msg;", "outputs": 1, @@ -3571,14 +2945,14 @@ "y": 360, "wires": [ [ - "3d3aafbf.e907a8" + "2877f2f.211cc8e" ] ] }, { - "id": "bd733bef.7efd08", + "id": "6cf2c1ac.a0fea8", "type": "ui_numeric", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "acq_min_esd", "label": "Minimum size to segment (μm)", "tooltip": "", @@ -3600,9 +2974,9 @@ ] }, { - "id": "a6057924.bc14", + "id": "e7c4132f.f4417", "type": "ui_numeric", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "acq_max_esd", "label": "Maximum size to segment (μm)", "tooltip": "", @@ -3624,9 +2998,9 @@ ] }, { - "id": "e0644195.305068", + "id": "86c63d98.eb21", "type": "function", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "get acq_min_esd", "func": "msg.payload = msg.payload.acq_min_esd;\nreturn msg;", "outputs": 1, @@ -3635,14 +3009,14 @@ "y": 280, "wires": [ [ - "bd733bef.7efd08" + "6cf2c1ac.a0fea8" ] ] }, { - "id": "e3fe6242.bfaf18", + "id": "3707a612.b8619a", "type": "function", - "z": "6ca1a253.126bb4", + "z": "97d77aeb.75afd8", "name": "get acq_max_esd", "func": "msg.payload = msg.payload.acq_max_esd;\nreturn msg;", "outputs": 1, @@ -3651,14 +3025,65 @@ "y": 320, "wires": [ [ - "a6057924.bc14" + "e7c4132f.f4417" ] ] }, { - "id": "edfb5b10.95636", + "id": "60b93a5.a032344", + "type": "ui_group", + "z": "", + "name": "Acquisition metadata", + "tab": "2b97fe34.a699fa", + "order": 7, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "9a45991b.365bc8", + "type": "subflow", + "name": "Pump actuation", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "eb7c01ae.d00358" + }, + { + "id": "642ae1f3.cf7d28" + } + ] + } + ], + "out": [ + { + "x": 700, + "y": 40, + "wires": [ + { + "id": "4485759b.52ee74", + "port": 0 + }, + { + "id": "3283f063.31c548", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#A6BBCF", + "icon": "font-awesome/fa-recycle" + }, + { + "id": "6246d9ef.156bd", "type": "function", - "z": "626459d2.f9c98", + "z": "9a45991b.365bc8", "name": "pump.js", "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar manual_volume= global.get(\"pump_manual_volume\");\nvar flowrate= global.get(\"pump_flowrate\");\n\nif (manual_volume === undefined || manual_volume === \"\" || manual_volume === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Volume to pass\";\n \n}else if (flowrate === undefined || flowrate === \"\" || flowrate === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Flowrate\";\n \n}else {\n volume = global.get(\"pump_manual_volume\");\n nb_step=volume*507\n msg.volume = volume;\n flowrate = global.get(\"pump_flowrate\");\n duration=(volume*60)/flowrate\n delay=(duration/nb_step)-0.005\n msg.topic = \"actuator/pump\";\n \n if(msg.payload === \"FORWARD\" & state===\"free\"){\n msg.payload='FORWARD '+delay+' '+nb_step;\n }\n if(msg.payload === \"BACKWARD\" & state===\"free\"){\n msg.payload='BACKWARD '+delay+' '+nb_step;\n }\n}\nreturn msg;", "outputs": 1, @@ -3667,15 +3092,15 @@ "y": 140, "wires": [ [ - "fb35e49.f64de18" + "53bef09a.8102e" ] ], "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" }, { - "id": "26686514.749b4a", + "id": "2374d55d.a3e3a2", "type": "ui_button", - "z": "626459d2.f9c98", + "z": "9a45991b.365bc8", "name": "BACKWARD", "group": "4153382f.45437", "order": 2, @@ -3694,14 +3119,14 @@ "y": 120, "wires": [ [ - "edfb5b10.95636" + "6246d9ef.156bd" ] ] }, { - "id": "bee2fd6d.cffb28", + "id": "c8aa9753.f51c08", "type": "ui_button", - "z": "626459d2.f9c98", + "z": "9a45991b.365bc8", "name": "FORWARD", "group": "4153382f.45437", "order": 4, @@ -3720,14 +3145,14 @@ "y": 160, "wires": [ [ - "edfb5b10.95636" + "6246d9ef.156bd" ] ] }, { - "id": "fb35e49.f64de18", + "id": "53bef09a.8102e", "type": "switch", - "z": "626459d2.f9c98", + "z": "9a45991b.365bc8", "name": "", "property": "topic", "propertyType": "msg", @@ -3750,17 +3175,17 @@ "y": 140, "wires": [ [ - "f6aa3e03.85018" + "4d3bf3c2.6a380c" ], [ - "f6dcda51.633398" + "d943e58a.e85fc" ] ] }, { - "id": "f6dcda51.633398", + "id": "d943e58a.e85fc", "type": "ui_toast", - "z": "626459d2.f9c98", + "z": "9a45991b.365bc8", "position": "dialog", "displayTime": "3", "highlight": "", @@ -3778,9 +3203,9 @@ ] }, { - "id": "c3edd9e7.1ac36", + "id": "eaa22490.6843d", "type": "ui_button", - "z": "626459d2.f9c98", + "z": "9a45991b.365bc8", "name": "stop pump", "group": "4153382f.45437", "order": 5, @@ -3799,14 +3224,14 @@ "y": 200, "wires": [ [ - "2521ba15.88a58e" + "9e71b7a5.28dff8" ] ] }, { - "id": "f6aa3e03.85018", + "id": "4d3bf3c2.6a380c", "type": "mqtt out", - "z": "626459d2.f9c98", + "z": "9a45991b.365bc8", "name": "", "topic": "", "qos": "", @@ -3817,9 +3242,9 @@ "wires": [] }, { - "id": "2521ba15.88a58e", + "id": "9e71b7a5.28dff8", "type": "mqtt out", - "z": "626459d2.f9c98", + "z": "9a45991b.365bc8", "name": "", "topic": "", "qos": "", @@ -3830,9 +3255,9 @@ "wires": [] }, { - "id": "2f9ec1a6.d5fb66", + "id": "3283f063.31c548", "type": "ui_text_input", - "z": "626459d2.f9c98", + "z": "9a45991b.365bc8", "name": "pump_manual_volume", "label": "Volume to pass (ml)", "tooltip": "", @@ -3851,9 +3276,9 @@ ] }, { - "id": "50093f5.8e35ec", + "id": "642ae1f3.cf7d28", "type": "function", - "z": "626459d2.f9c98", + "z": "9a45991b.365bc8", "name": "get pump_manual_volume", "func": "msg.payload = msg.payload.pump_manual_volume;\nreturn msg;", "outputs": 1, @@ -3862,14 +3287,14 @@ "y": 80, "wires": [ [ - "2f9ec1a6.d5fb66" + "3283f063.31c548" ] ] }, { - "id": "fa485315.928ae", + "id": "4485759b.52ee74", "type": "ui_slider", - "z": "626459d2.f9c98", + "z": "9a45991b.365bc8", "name": "pump_flowrate", "label": "Flowrate (ml/min)*", "tooltip": "", @@ -3890,9 +3315,9 @@ ] }, { - "id": "f7b6f5e7.7b7ca", + "id": "eb7c01ae.d00358", "type": "function", - "z": "626459d2.f9c98", + "z": "9a45991b.365bc8", "name": "get pump_flowrate", "func": "msg.payload = msg.payload.pump_flowrate;\nreturn msg;", "outputs": 1, @@ -3901,14 +3326,58 @@ "y": 40, "wires": [ [ - "fa485315.928ae" + "4485759b.52ee74" ] ] }, { - "id": "7297e2f7.dce564", + "id": "4153382f.45437", + "type": "ui_group", + "z": "", + "name": "Pump actuation", + "tab": "2b97fe34.a699fa", + "order": 5, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "ac806d39.1682a8", + "type": "subflow", + "name": "Focus actuation", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "c631467a.569ba" + } + ] + } + ], + "out": [ + { + "x": 800, + "y": 200, + "wires": [ + { + "id": "97bf666e.4d3ad", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#A6BBCF", + "icon": "node-red/sort.svg" + }, + { + "id": "97bf666e.4d3ad", "type": "ui_text_input", - "z": "5c516299.73e054", + "z": "ac806d39.1682a8", "name": "focus_nb_step", "label": "Number of step(s)", "tooltip": "", @@ -3927,9 +3396,9 @@ ] }, { - "id": "60dc5851.6962b", + "id": "c631467a.569ba", "type": "function", - "z": "5c516299.73e054", + "z": "ac806d39.1682a8", "name": "get focus_nb_step", "func": "msg.payload = msg.payload.focus_nb_step;\nreturn msg;", "outputs": 1, @@ -3938,14 +3407,14 @@ "y": 40, "wires": [ [ - "7297e2f7.dce564" + "97bf666e.4d3ad" ] ] }, { - "id": "7200408d.a1be4", + "id": "8346f4af.5c0978", "type": "ui_button", - "z": "5c516299.73e054", + "z": "ac806d39.1682a8", "name": "DOWN", "group": "69433259.f306fc", "order": 3, @@ -3964,14 +3433,14 @@ "y": 120, "wires": [ [ - "2e2a455b.5ff4fa" + "350c388d.12cd28" ] ] }, { - "id": "7f823e6.d3bcfc", + "id": "7ee30e1c.691bd", "type": "ui_button", - "z": "5c516299.73e054", + "z": "ac806d39.1682a8", "name": "UP", "group": "69433259.f306fc", "order": 1, @@ -3990,14 +3459,14 @@ "y": 81, "wires": [ [ - "2e2a455b.5ff4fa" + "350c388d.12cd28" ] ] }, { - "id": "54482c7a.a384ac", + "id": "a2f04fac.5a338", "type": "switch", - "z": "5c516299.73e054", + "z": "ac806d39.1682a8", "name": "", "property": "topic", "propertyType": "msg", @@ -4020,17 +3489,17 @@ "y": 100, "wires": [ [ - "2a7a3d34.08e2a2" + "9fd904e.d1cbcf8" ], [ - "4277442b.04d1b4" + "ccd4fa1e.152" ] ] }, { - "id": "4277442b.04d1b4", + "id": "ccd4fa1e.152", "type": "ui_toast", - "z": "5c516299.73e054", + "z": "ac806d39.1682a8", "position": "dialog", "displayTime": "3", "highlight": "", @@ -4048,9 +3517,9 @@ ] }, { - "id": "2e2a455b.5ff4fa", + "id": "350c388d.12cd28", "type": "function", - "z": "5c516299.73e054", + "z": "ac806d39.1682a8", "name": "focus.js", "func": "state = global.get(\"state\");\n\nif (state == null){state=\"free\"}\n\nvar nb_step= global.get(\"focus_nb_step\");\n\nif (nb_step === undefined || nb_step === \"\" || nb_step === null) {\n msg.topic = \"Missing entry :\"\n msg.payload = \"Number of steps\";\n \n}else {\n nb_step= global.get(\"focus_nb_step\");\n if(msg.payload === \"UP\" & state===\"free\"){\n msg.payload=\"FORWARD \"+nb_step;\n }\n if(msg.payload === \"DOWN\" & state===\"free\"){\n msg.payload=\"BACKWARD \"+nb_step;\n }\n}\nreturn msg;", "outputs": 1, @@ -4059,15 +3528,15 @@ "y": 100, "wires": [ [ - "54482c7a.a384ac" + "a2f04fac.5a338" ] ], "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" }, { - "id": "73e0d0c.c07ab3", + "id": "da904b2b.4a1d68", "type": "ui_button", - "z": "5c516299.73e054", + "z": "ac806d39.1682a8", "name": "stop focus", "group": "69433259.f306fc", "order": 4, @@ -4086,14 +3555,14 @@ "y": 160, "wires": [ [ - "8e86348d.69657" + "8bb9c09d.bc8178" ] ] }, { - "id": "2a7a3d34.08e2a2", + "id": "9fd904e.d1cbcf8", "type": "mqtt out", - "z": "5c516299.73e054", + "z": "ac806d39.1682a8", "name": "", "topic": "", "qos": "", @@ -4104,9 +3573,9 @@ "wires": [] }, { - "id": "8e86348d.69657", + "id": "8bb9c09d.bc8178", "type": "mqtt out", - "z": "5c516299.73e054", + "z": "ac806d39.1682a8", "name": "", "topic": "", "qos": "", @@ -4117,9 +3586,102 @@ "wires": [] }, { - "id": "10f1e5c1.3cb69a", + "id": "69433259.f306fc", + "type": "ui_group", + "z": "", + "name": "Focus actuation", + "tab": "2b97fe34.a699fa", + "order": 4, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "e8ab36cc.74d77", + "type": "mqtt-broker", + "z": "", + "name": "", + "broker": "0.0.0.0", + "port": "1883", + "clientid": "Client_node", + "usetls": false, + "compatmode": false, + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "willTopic": "", + "willQos": "0", + "willPayload": "" + }, + { + "id": "5c6dd7ee.546fa8", + "type": "subflow", + "name": "Sample metadata", + "info": "", + "category": "", + "in": [ + { + "x": 40, + "y": 40, + "wires": [ + { + "id": "730e3aa0.75f6dc" + }, + { + "id": "b49441ee.07b358" + }, + { + "id": "77454044.f47e88" + }, + { + "id": "203e3416.6c480c" + }, + { + "id": "3555467a.6ba1ea" + } + ] + } + ], + "out": [ + { + "x": 840, + "y": 40, + "wires": [ + { + "id": "419967b7.b9b5f", + "port": 0 + }, + { + "id": "9b3f7b46.107718", + "port": 0 + }, + { + "id": "6f24740b.fbae5c", + "port": 0 + }, + { + "id": "bf7a47c8.a960b8", + "port": 0 + }, + { + "id": "327afe96.262122", + "port": 0 + } + ] + } + ], + "env": [], + "color": "#DDAA99" + }, + { + "id": "6f24740b.fbae5c", "type": "ui_text_input", - "z": "efeebffd.34c7e", + "z": "5c6dd7ee.546fa8", "name": "sample_ship", "label": "Name of the ship", "tooltip": "", @@ -4138,9 +3700,9 @@ ] }, { - "id": "da0c5a96.74c0e", + "id": "327afe96.262122", "type": "ui_dropdown", - "z": "efeebffd.34c7e", + "z": "5c6dd7ee.546fa8", "name": "sample_sampling_gear", "label": "Sampling gear", "tooltip": "", @@ -4186,9 +3748,9 @@ ] }, { - "id": "aa90b06d.ca78e", + "id": "bf7a47c8.a960b8", "type": "ui_text_input", - "z": "efeebffd.34c7e", + "z": "5c6dd7ee.546fa8", "name": "sample_operator", "label": "Name of the operator", "tooltip": "", @@ -4207,9 +3769,9 @@ ] }, { - "id": "1cb896c7.6dfc11", + "id": "419967b7.b9b5f", "type": "ui_text_input", - "z": "efeebffd.34c7e", + "z": "5c6dd7ee.546fa8", "name": "sample_project", "label": "Name of the project*", "tooltip": "", @@ -4228,9 +3790,9 @@ ] }, { - "id": "288ba4b3.a9a2cc", + "id": "9b3f7b46.107718", "type": "ui_text_input", - "z": "efeebffd.34c7e", + "z": "5c6dd7ee.546fa8", "name": "sample_id", "label": "ID of the station*", "tooltip": "", @@ -4249,9 +3811,9 @@ ] }, { - "id": "78f5791d.946bd8", + "id": "730e3aa0.75f6dc", "type": "function", - "z": "efeebffd.34c7e", + "z": "5c6dd7ee.546fa8", "name": "get sample_projet", "func": "msg.payload = msg.payload.sample_project;\nreturn msg;", "outputs": 1, @@ -4260,14 +3822,14 @@ "y": 40, "wires": [ [ - "1cb896c7.6dfc11" + "419967b7.b9b5f" ] ] }, { - "id": "2a09d440.119154", + "id": "77454044.f47e88", "type": "function", - "z": "efeebffd.34c7e", + "z": "5c6dd7ee.546fa8", "name": "get sample_ship", "func": "msg.payload = msg.payload.sample_ship;\nreturn msg;", "outputs": 1, @@ -4276,14 +3838,14 @@ "y": 120, "wires": [ [ - "10f1e5c1.3cb69a" + "6f24740b.fbae5c" ] ] }, { - "id": "346d141f.ebab3c", + "id": "b49441ee.07b358", "type": "function", - "z": "efeebffd.34c7e", + "z": "5c6dd7ee.546fa8", "name": "get sample_id", "func": "msg.payload = msg.payload.sample_id+1;\nreturn msg;", "outputs": 1, @@ -4292,14 +3854,14 @@ "y": 80, "wires": [ [ - "288ba4b3.a9a2cc" + "9b3f7b46.107718" ] ] }, { - "id": "2d438355.ed942c", + "id": "203e3416.6c480c", "type": "function", - "z": "efeebffd.34c7e", + "z": "5c6dd7ee.546fa8", "name": "get sample_operator", "func": "msg.payload = msg.payload.sample_operator;\nreturn msg;", "outputs": 1, @@ -4308,14 +3870,14 @@ "y": 160, "wires": [ [ - "aa90b06d.ca78e" + "bf7a47c8.a960b8" ] ] }, { - "id": "ac4a71a.c35309", + "id": "3555467a.6ba1ea", "type": "function", - "z": "efeebffd.34c7e", + "z": "5c6dd7ee.546fa8", "name": "get sample_sampling_gear", "func": "msg.payload = msg.payload.sample_sampling_gear;\nreturn msg;", "outputs": 1, @@ -4324,14 +3886,42 @@ "y": 200, "wires": [ [ - "da0c5a96.74c0e" + "327afe96.262122" ] ] }, { - "id": "45482528.43f93c", + "id": "417f91c9.193ab", + "type": "ui_group", + "z": "", + "name": "Sample metadata", + "tab": "2b97fe34.a699fa", + "order": 2, + "disp": true, + "width": "24", + "collapse": false + }, + { + "id": "2b97fe34.a699fa", + "type": "ui_tab", + "z": "", + "name": "GUI", + "icon": "fa-eyedropper", + "order": 2, + "disabled": false, + "hidden": false + }, + { + "id": "bb8dbe68.7e20a", + "type": "tab", + "label": "Main", + "disabled": false, + "info": "" + }, + { + "id": "20340bb6.5f923c", "type": "function", - "z": "ff9251a5.9c5e18", + "z": "bb8dbe68.7e20a", "name": "get global", "func": "msg.payload={\n \n \"sample_project\":global.get(\"sample_project\"),\n \"sample_id\":global.get(\"sample_id\"),\n \"sample_ship\":global.get(\"sample_ship\"),\n \"sample_operator\":global.get(\"sample_operator\"),\n \"sample_sampling_gear\":global.get(\"sample_sampling_gear\"),\n \n \"acq_id\":global.get(\"acq_id\"),\n \"acq_instrument\":global.get(\"acq_instrument\"),\n //\"acq_instrument_id\":global.get(\"acq_instrument_id\"),\n \"acq_celltype\":global.get(\"acq_celltype\"),\n \"acq_minimum_mesh\":global.get(\"acq_minimum_mesh\"),\n \"acq_maximum_mesh\":global.get(\"acq_maximum_mesh\"),\n \"acq_min_esd\":global.get(\"acq_min_esd\"),\n \"acq_max_esd\":global.get(\"acq_max_esd\"),\n \"acq_volume\":global.get(\"acq_volume\"),\n \"acq_magnification\":global.get(\"magnification\"),\n \"acq_fnumber_objective\":global.get(\"acq_fnumber_objective\"),\n \n \"acq_camera_name\":\"Pi Camera V2.1 - 8MP\",\n \n \"object_date\":global.get(\"object_date\"),\n \"object_time\":global.get(\"object_time\"),\n \"object_lat\":global.get(\"object_lat\"),\n \"object_lon\":global.get(\"object_lon\"),\n \"object_depth_min\":global.get(\"object_depth_min\"),\n \"object_depth_max\":global.get(\"object_depth_max\"),\n \n \"custom_nb_frame\":global.get(\"custom_nb_frame\"),\n \"custom_nb_step\":global.get(\"custom_nb_step\"),\n \"custom_segmentation\":global.get(\"custom_segmentation\"),\n \"custom_sleep_before\":global.get(\"custom_sleep_before\"),\n \"focus_nb_step\":global.get(\"focus_nb_step\"),\n \"pump_flowrate\":global.get(\"pump_flowrate\"),\n \"pump_manual_volume\":global.get(\"pump_manual_volume\"),\n \n \"process_pixel\":global.get(\"process_pixel\"),\n \"process_id\":global.get(\"process_id\")\n \n \n};\nreturn msg;", "outputs": 1, @@ -4340,14 +3930,14 @@ "y": 160, "wires": [ [ - "fe81be99.6859e8" + "d69f0eb1.d514d" ] ] }, { - "id": "a5f18550.68466", + "id": "aed82ae1.3a7558", "type": "file", - "z": "ff9251a5.9c5e18", + "z": "bb8dbe68.7e20a", "name": "", "filename": "/home/pi/PlanktonScope/config.json", "appendNewline": true, @@ -4361,9 +3951,9 @@ ] }, { - "id": "fe81be99.6859e8", + "id": "d69f0eb1.d514d", "type": "json", - "z": "ff9251a5.9c5e18", + "z": "bb8dbe68.7e20a", "name": "config.json", "property": "payload", "action": "str", @@ -4372,14 +3962,14 @@ "y": 160, "wires": [ [ - "a5f18550.68466" + "aed82ae1.3a7558" ] ] }, { - "id": "b24cc280.5a59b", + "id": "b57ab8b0.7bfc4", "type": "file in", - "z": "ff9251a5.9c5e18", + "z": "bb8dbe68.7e20a", "name": "", "filename": "/home/pi/PlanktonScope/config.json", "format": "utf8", @@ -4390,15 +3980,15 @@ "y": 80, "wires": [ [ - "11e5237b.e558c5" + "5b6059c3.8d4fa8" ] ], "info": "# PlanktonScope Help\nThis Node will read the content of the file named **config.txt** containing all the input placeholders.\n" }, { - "id": "4c6084c.1b7bb7c", + "id": "7880a269.4817ac", "type": "inject", - "z": "ff9251a5.9c5e18", + "z": "bb8dbe68.7e20a", "name": "on_load", "topic": "", "payload": "", @@ -4411,17 +4001,18 @@ "y": 80, "wires": [ [ - "b24cc280.5a59b", - "845bb10c.d99208", - "a01c8373.701628" + "b57ab8b0.7bfc4", + "10d8393.60498c7", + "dba45961.85d67", + "8231cfcc.0c5dd8" ] ], "info": "# PlanktonScope Help\nWhen the **Pi** is booting, **Node-RED** will be initiated and this node will be activated once and execute the following nodes." }, { - "id": "11e5237b.e558c5", + "id": "5b6059c3.8d4fa8", "type": "json", - "z": "ff9251a5.9c5e18", + "z": "bb8dbe68.7e20a", "name": "config.json", "property": "payload", "action": "", @@ -4430,20 +4021,20 @@ "y": 80, "wires": [ [ - "9dc8498a.4a36b", - "9b67b810.97a618", - "32282348.35c09c", - "fe7c0e45.ee983", - "3e6ceaa0.5fad56", - "9e577327.d9a1f", - "c50792f5.6b5148" + "9b872b59.667ee", + "67bab5e1.2c7dcc", + "8e5a1fb0.dc878", + "bfc59fc4.be21a8", + "80434aac.22226", + "a3453d30.ca9a28", + "e25e094c.60fb1" ] ] }, { - "id": "f72f54db.590c9", + "id": "1b45a311.c993ed", "type": "function", - "z": "ff9251a5.9c5e18", + "z": "bb8dbe68.7e20a", "name": "set global", "func": "var value = msg.payload;\nvar key = msg.topic;\n\nglobal.set(key,value);\nreturn msg;", "outputs": 1, @@ -4452,14 +4043,14 @@ "y": 80, "wires": [ [ - "45482528.43f93c" + "20340bb6.5f923c" ] ] }, { - "id": "2372125a.7f69d6", + "id": "1d54c0bf.fbcf07", "type": "rpi-gpio out", - "z": "ff9251a5.9c5e18", + "z": "bb8dbe68.7e20a", "name": "", "pin": "40", "set": "", @@ -4471,9 +4062,9 @@ "wires": [] }, { - "id": "bae08e6f.11bc28", + "id": "7da863d0.f7d41c", "type": "ui_template", - "z": "ff9251a5.9c5e18", + "z": "bb8dbe68.7e20a", "group": "dc721eb.9ef51e", "name": "Stream Pi Camera", "order": 1, @@ -4483,16 +4074,16 @@ "storeOutMessages": true, "fwdInMessages": true, "templateScope": "local", - "x": 850, + "x": 830, "y": 320, "wires": [ [] ] }, { - "id": "845bb10c.d99208", + "id": "10d8393.60498c7", "type": "function", - "z": "ff9251a5.9c5e18", + "z": "bb8dbe68.7e20a", "name": "init LED", "func": "msg.payload=1;\nreturn msg;", "outputs": 1, @@ -4501,149 +4092,139 @@ "y": 120, "wires": [ [ - "2372125a.7f69d6" + "1d54c0bf.fbcf07" ] ] }, { - "id": "9dc8498a.4a36b", - "type": "subflow:efeebffd.34c7e", - "z": "ff9251a5.9c5e18", + "id": "9b872b59.667ee", + "type": "subflow:5c6dd7ee.546fa8", + "z": "bb8dbe68.7e20a", "name": "", "env": [], "x": 830, "y": 80, "wires": [ [ - "f72f54db.590c9" + "1b45a311.c993ed" ] ] }, { - "id": "9e577327.d9a1f", - "type": "subflow:5c516299.73e054", - "z": "ff9251a5.9c5e18", + "id": "a3453d30.ca9a28", + "type": "subflow:ac806d39.1682a8", + "z": "bb8dbe68.7e20a", "name": "", "env": [], - "x": 846, - "y": 242, + "x": 820, + "y": 240, "wires": [ [ - "f72f54db.590c9" + "1b45a311.c993ed" ] ] }, { - "id": "c50792f5.6b5148", - "type": "subflow:626459d2.f9c98", - "z": "ff9251a5.9c5e18", + "id": "e25e094c.60fb1", + "type": "subflow:9a45991b.365bc8", + "z": "bb8dbe68.7e20a", "name": "", "env": [], - "x": 846, - "y": 282, + "x": 820, + "y": 280, "wires": [ [ - "f72f54db.590c9" + "1b45a311.c993ed" ] ] }, { - "id": "9b67b810.97a618", - "type": "subflow:6ca1a253.126bb4", - "z": "ff9251a5.9c5e18", + "id": "67bab5e1.2c7dcc", + "type": "subflow:97d77aeb.75afd8", + "z": "bb8dbe68.7e20a", "name": "", "env": [], "x": 840, "y": 120, "wires": [ [ - "f72f54db.590c9" + "1b45a311.c993ed" ], [ - "45482528.43f93c" + "20340bb6.5f923c" ] ] }, { - "id": "32282348.35c09c", - "type": "subflow:b45c6fb6.f6dfa8", - "z": "ff9251a5.9c5e18", + "id": "8e5a1fb0.dc878", + "type": "subflow:506e9090.6e905", + "z": "bb8dbe68.7e20a", "name": "", "env": [], "x": 820, "y": 160, "wires": [ [ - "f72f54db.590c9" + "1b45a311.c993ed" ], [ - "45482528.43f93c" + "20340bb6.5f923c" ] ] }, { - "id": "8e1d0d8d.fc54d8", - "type": "subflow:fbe9590f.bd63b8", - "z": "ff9251a5.9c5e18", + "id": "14b78383.7457bc", + "type": "subflow:1273b673.4a35ea", + "z": "bb8dbe68.7e20a", "name": "System commands", "env": [], - "x": 850, - "y": 500, + "x": 830, + "y": 480, "wires": [] }, { - "id": "f8a906b3.a2c81", - "type": "subflow:9882c53a.0ccc8", - "z": "ff9251a5.9c5e18", + "id": "e6403eaf.54f7e", + "type": "subflow:246abd43.838a5a", + "z": "bb8dbe68.7e20a", "name": "", "env": [], - "x": 320, - "y": 280, + "x": 840, + "y": 400, "wires": [] }, { - "id": "b1be7e1e.9ec3c8", - "type": "subflow:a8ad6dec.1a393", - "z": "ff9251a5.9c5e18", - "name": "", - "env": [], - "x": 850, - "y": 420, - "wires": [] - }, - { - "id": "fe7c0e45.ee983", - "type": "subflow:5a287804.a10e2", - "z": "ff9251a5.9c5e18", + "id": "bfc59fc4.be21a8", + "type": "subflow:99798a85.e62408", + "z": "bb8dbe68.7e20a", "name": "process metadata", "env": [], "x": 830, "y": 200, "wires": [ [ - "f72f54db.590c9" + "1b45a311.c993ed" ] ] }, { - "id": "3e6ceaa0.5fad56", - "type": "subflow:863e8384.56889", - "z": "ff9251a5.9c5e18", + "id": "80434aac.22226", + "type": "subflow:a156df1e.d37178", + "z": "bb8dbe68.7e20a", "name": "Acquisition inputs", "env": [], - "x": 836, - "y": 362, + "x": 830, + "y": 360, "wires": [ [ - "f72f54db.590c9" + "1b45a311.c993ed" ] ], "icon": "node-red-dashboard/ui_switch.png" }, { - "id": "a01c8373.701628", - "type": "subflow:c10e968b.87e488", - "z": "ff9251a5.9c5e18", + "id": "dba45961.85d67", + "type": "subflow:6384a5e.e34465c", + "z": "bb8dbe68.7e20a", "name": "", "env": [], "x": 300, @@ -4651,9 +4232,9 @@ "wires": [] }, { - "id": "1924ce1c.0459f2", - "type": "subflow:c1d3ff7c.4384f", - "z": "ff9251a5.9c5e18", + "id": "8231cfcc.0c5dd8", + "type": "subflow:e8320d42.9a3ad8", + "z": "bb8dbe68.7e20a", "name": "", "env": [], "x": 290, @@ -4661,19 +4242,19 @@ "wires": [] }, { - "id": "d3892f94.428a28", - "type": "subflow:bba19d97.b32b1", - "z": "ff9251a5.9c5e18", + "id": "557afe0d.33d97", + "type": "subflow:97600dff.93378", + "z": "bb8dbe68.7e20a", "name": "", "env": [], - "x": 850, - "y": 460, + "x": 830, + "y": 440, "wires": [] }, { - "id": "e73525a.1103158", + "id": "af4f780b.068368", "type": "ui_switch", - "z": "ff9251a5.9c5e18", + "z": "bb8dbe68.7e20a", "name": "", "label": "LED", "tooltip": "", @@ -4697,167 +4278,19 @@ "y": 160, "wires": [ [ - "2372125a.7f69d6" + "1d54c0bf.fbcf07" ] ] }, { - "id": "be37d12f.0898f", - "type": "file", - "z": "c1d3ff7c.4384f", - "name": "", - "filename": "/home/pi/PlanktonScope/script/main.py", - "appendNewline": false, - "createDir": true, - "overwriteFile": "true", - "encoding": "none", - "x": 530, - "y": 100, - "wires": [ - [ - "23f3e613.20ad82" - ] - ] - }, - { - "id": "49e31e85.7ac51", - "type": "template", - "z": "c1d3ff7c.4384f", - "name": "main.py", - "field": "payload", - "fieldType": "msg", - "format": "python", - "syntax": "plain", - "template": "################################################################################\n#Actuator Libraries\n################################################################################\n\n#Library for exchaning messages with Node-RED\nimport paho.mqtt.client as mqtt\n\n#Library to control the PiCamera\nfrom picamera import PiCamera\n\n#Libraries to control the steppers for focusing and pumping\nfrom adafruit_motor import stepper\nfrom adafruit_motorkit import MotorKit\n\n#Library to send command over I2C for the light module on the fan\nimport smbus\n\n################################################################################\n#Practical Libraries\n################################################################################\n\n#Library to get date and time for folder name and filename\nfrom datetime import datetime, timedelta\n\n#Library to be able to sleep for a duration\nfrom time import sleep\n\n#Libraries manipulate json format, execute bash commands\nimport json, shutil, os, subprocess\n\n################################################################################\n#Morphocut Libraries\n################################################################################\n\nfrom skimage.util import img_as_ubyte\nfrom morphocut import Call\nfrom morphocut.contrib.ecotaxa import EcotaxaWriter\nfrom morphocut.contrib.zooprocess import CalculateZooProcessFeatures\nfrom morphocut.core import Pipeline\nfrom morphocut.file import Find\nfrom morphocut.image import (ExtractROI,\n FindRegions,\n ImageReader,\n ImageWriter,\n RescaleIntensity,\n RGB2Gray\n)\nfrom morphocut.stat import RunningMedian\nfrom morphocut.str import Format\nfrom morphocut.stream import TQDM, Enumerate, FilterVariables\n\n################################################################################\n#Other image processing Libraries\n################################################################################\n\nfrom skimage.feature import canny\nfrom skimage.color import rgb2gray, label2rgb\nfrom skimage.morphology import disk\nfrom skimage.morphology import erosion, dilation, closing\nfrom skimage.measure import label, regionprops\nimport cv2\n\n################################################################################\n#Streaming PiCamera over server\n################################################################################\nimport io\nimport picamera\nimport logging\nimport socketserver\nfrom threading import Condition\nfrom http import server\nimport threading\n\n################################################################################\n#Creation of the webpage containing the PiCamera Streaming\n################################################################################\n\nPAGE=\"\"\"\\\n\n\nPlanktonScope v2 | PiCamera Streaming\n\n\n\n\n\n\"\"\"\n\n################################################################################\n#Classes for the PiCamera Streaming\n################################################################################\n\nclass StreamingOutput(object):\n def __init__(self):\n self.frame = None\n self.buffer = io.BytesIO()\n self.condition = Condition()\n\n def write(self, buf):\n if buf.startswith(b'\\xff\\xd8'):\n # New frame, copy the existing buffer's content and notify all\n # clients it's available\n self.buffer.truncate()\n with self.condition:\n self.frame = self.buffer.getvalue()\n self.condition.notify_all()\n self.buffer.seek(0)\n return self.buffer.write(buf)\n\nclass StreamingHandler(server.BaseHTTPRequestHandler):\n def do_GET(self):\n if self.path == '/':\n self.send_response(301)\n self.send_header('Location', '/index.html')\n self.end_headers()\n elif self.path == '/index.html':\n content = PAGE.encode('utf-8')\n self.send_response(200)\n self.send_header('Content-Type', 'text/html')\n self.send_header('Content-Length', len(content))\n self.end_headers()\n self.wfile.write(content)\n elif self.path == '/stream.mjpg':\n self.send_response(200)\n self.send_header('Age', 0)\n self.send_header('Cache-Control', 'no-cache, private')\n self.send_header('Pragma', 'no-cache')\n self.send_header('Content-Type', 'multipart/x-mixed-replace; boundary=FRAME')\n self.end_headers()\n try:\n while True:\n with output.condition:\n output.condition.wait()\n frame = output.frame\n self.wfile.write(b'--FRAME\\r\\n')\n self.send_header('Content-Type', 'image/jpeg')\n self.send_header('Content-Length', len(frame))\n self.end_headers()\n self.wfile.write(frame)\n self.wfile.write(b'\\r\\n')\n except Exception as e:\n logging.warning(\n 'Removed streaming client %s: %s',\n self.client_address, str(e))\n else:\n self.send_error(404)\n self.end_headers()\n\nclass StreamingServer(socketserver.ThreadingMixIn, server.HTTPServer):\n allow_reuse_address = True\n daemon_threads = True\n\n################################################################################\n#MQTT core functions\n################################################################################\n\n#Run this function in order to connect to the client (Node-RED)\ndef on_connect(client, userdata, flags, rc):\n #Print when connected\n print(\"Connected! - \" + str(rc))\n #When connected, run subscribe()\n client.subscribe(\"actuator/#\")\n #Turn green the light module\n rgb(0,255,0)\n\n#Run this function in order to subscribe to all the topics begining by actuator\ndef on_subscribe(client, obj, mid, granted_qos):\n #Print when subscribed\n print(\"Subscribed! - \"+str(mid)+\" \"+str(granted_qos))\n\n#Run this command when Node-RED is sending a message on the subscribed topic\ndef on_message(client, userdata, msg):\n #Print the topic and the message\n print(msg.topic+\" \"+str(msg.qos)+\" \"+str(msg.payload))\n #Update the global variables command, args and counter\n global command\n global args\n global counter\n #Parse the topic to find the command. ex : actuator/pump -> pump\n command=msg.topic.split(\"/\")[1]\n #Decode the message to find the arguments\n args=str(msg.payload.decode())\n #Reset the counter to 0\n counter=0\n\n################################################################################\n#LEDs Actuation\n################################################################################\ndef rgb(R,G,B):\n #Update LED n1\n bus.write_byte_data(0x0d, 0x00, 0)\n bus.write_byte_data(0x0d, 0x01, R)\n bus.write_byte_data(0x0d, 0x02, G)\n bus.write_byte_data(0x0d, 0x03, B)\n\n #Update LED n2\n bus.write_byte_data(0x0d, 0x00, 1)\n bus.write_byte_data(0x0d, 0x01, R)\n bus.write_byte_data(0x0d, 0x02, G)\n bus.write_byte_data(0x0d, 0x03, B)\n\n #Update LED n3\n bus.write_byte_data(0x0d, 0x00, 2)\n bus.write_byte_data(0x0d, 0x01, R)\n bus.write_byte_data(0x0d, 0x02, G)\n bus.write_byte_data(0x0d, 0x03, B)\n\n #Update the I2C Bus in order to really update the LEDs new values\n cmd=\"i2cdetect -y 1\"\n subprocess.Popen(cmd.split(),stdout=subprocess.PIPE)\n\n################################################################################\n#Init function - executed only once\n################################################################################\n\n#define the bus used to actuate the light module on the fan\nbus = smbus.SMBus(1)\n\n#define the names for the 2 exsting steppers\nkit = MotorKit()\npump_stepper = kit.stepper1\nfocus_stepper = kit.stepper2\n#Make sure the steppers are release and do not use any power\npump_stepper.release()\nfocus_stepper.release()\n\n#Precise the settings of the PiCamera\ncamera = PiCamera()\ncamera.resolution = (3280, 2464)\ncamera.iso = 60\ncamera.shutter_speed = 500\ncamera.exposure_mode = 'fixedfps'\n\n#Declare the global variables command, args and counter\ncommand = ''\nargs = ''\ncounter=''\n\n#MQTT Client functions definition\nclient = mqtt.Client()\nclient.connect(\"192.168.4.1\",1883,60)\nclient.on_connect = on_connect\nclient.on_subscribe = on_subscribe\nclient.on_message = on_message\nclient.loop_start()\n\n################################################################################\n#Definition of the few important metadata\n################################################################################\n\nlocal_metadata = {\n \"process_datetime\": datetime.now(),\n \"acq_camera_resolution\" : camera.resolution,\n \"acq_camera_iso\" : camera.iso,\n \"acq_camera_shutter_speed\" : camera.shutter_speed\n}\n\n#Read the content of config.json containing the metadata defined on Node-RED\nconfig_json = open('/home/pi/PlanktonScope/config.json','r')\nnode_red_metadata = json.loads(config_json.read())\n\n#Concat the local metadata and the metadata from Node-RED\nglobal_metadata = {**local_metadata, **node_red_metadata}\n\n#Define the name of the .zip file that will contain the images and the .tsv table for EcoTaxa\narchive_fn = os.path.join(\"/home/pi/PlanktonScope/\",\"export\", \"ecotaxa_export.zip\")\n\n################################################################################\n#MorphoCut Script\n################################################################################\n\n#Define processing pipeline\nwith Pipeline() as p:\n\n #Recursively find .jpg files in import_path.\n #Sort to get consective frames.\n abs_path = Find(\"/home/pi/PlanktonScope/tmp\", [\".jpg\"], sort=True, verbose=True)\n\n #Extract name from abs_path\n name = Call(lambda p: os.path.splitext(os.path.basename(p))[0], abs_path)\n\n #Set the LEDs as Green\n Call(rgb, 0,255,0)\n\n #Read image\n img = ImageReader(abs_path)\n\n #Show progress bar for frames\n TQDM(Format(\"Frame {name}\", name=name))\n\n #Apply running median to approximate the background image\n flat_field = RunningMedian(img, 5)\n\n #Correct image\n img = img / flat_field\n\n #Rescale intensities and convert to uint8 to speed up calculations\n img = RescaleIntensity(img, in_range=(0, 1.1), dtype=\"uint8\")\n\n #Filter variable to reduce memory load\n FilterVariables(name,img)\n\n #Save cleaned images\n #frame_fn = Format(os.path.join(\"/home/pi/PlanktonScope/tmp\",\"CLEAN\", \"{name}.jpg\"), name=name)\n #ImageWriter(frame_fn, img)\n\n #Convert image to uint8 gray\n img_gray = RGB2Gray(img)\n\n #?\n img_gray = Call(img_as_ubyte, img_gray)\n\n #Canny edge detection using OpenCV\n img_canny = Call(cv2.Canny, img_gray, 50,100)\n\n #Dilate using OpenCV\n kernel = Call(cv2.getStructuringElement, cv2.MORPH_ELLIPSE, (15, 15))\n img_dilate = Call(cv2.dilate, img_canny, kernel, iterations=2)\n\n #Close using OpenCV\n kernel = Call(cv2.getStructuringElement, cv2.MORPH_ELLIPSE, (5, 5))\n img_close = Call(cv2.morphologyEx, img_dilate, cv2.MORPH_CLOSE, kernel, iterations=1)\n\n #Erode using OpenCV\n kernel = Call(cv2.getStructuringElement, cv2.MORPH_ELLIPSE, (15, 15))\n mask = Call(cv2.erode, img_close, kernel, iterations=2)\n\n #Find objects\n regionprops = FindRegions(\n mask, img_gray, min_area=1000, padding=10, warn_empty=name\n )\n\n #Set the LEDs as Purple\n Call(rgb, 255,0,255)\n\n # For an object, extract a vignette/ROI from the image\n roi_orig = ExtractROI(img, regionprops, bg_color=255)\n\n # Generate an object identifier\n i = Enumerate()\n\n #Call(print,i)\n\n #Define the ID of each object\n object_id = Format(\"{name}_{i:d}\", name=name, i=i)\n\n #Call(print,object_id)\n\n #Define the name of each object\n object_fn = Format(os.path.join(\"/home/pi/PlanktonScope/\",\"OBJECTS\", \"{name}.jpg\"), name=object_id)\n\n #Save the image of the object with its name\n ImageWriter(object_fn, roi_orig)\n\n #Calculate features. The calculated features are added to the global_metadata.\n #Returns a Variable representing a dict for every object in the stream.\n meta = CalculateZooProcessFeatures(\n regionprops, prefix=\"object_\", meta=global_metadata\n )\n\n #Get all the metadata\n json_meta = Call(json.dumps,meta, sort_keys=True, default=str)\n\n #Publish the json containing all the metadata to via MQTT to Node-RED\n Call(client.publish, \"receiver/segmentation/metric\", json_meta)\n\n #Add object_id to the metadata dictionary\n meta[\"object_id\"] = object_id\n\n #Generate object filenames\n orig_fn = Format(\"{object_id}.jpg\", object_id=object_id)\n\n #Write objects to an EcoTaxa archive:\n #roi image in original color, roi image in grayscale, metadata associated with each object\n EcotaxaWriter(archive_fn, (orig_fn, roi_orig), meta)\n\n #Progress bar for objects\n TQDM(Format(\"Object {object_id}\", object_id=object_id))\n\n #Publish the object_id to via MQTT to Node-RED\n Call(client.publish, \"receiver/segmentation/object_id\", object_id)\n\n #Set the LEDs as Green\n Call(rgb, 0,255,0)\n\n################################################################################\n#While loop for capting commands from Node-RED\n################################################################################\n\noutput = StreamingOutput()\naddress = ('192.168.4.1', 8000)\nserver = StreamingServer(address, StreamingHandler)\nthreading.Thread(target=server.serve_forever).start()\ncamera.start_recording(output, format='mjpeg', resize=(640, 480))\n\nwhile True:\n\n ############################################################################\n #Pump Event\n ############################################################################\n\n #If the command is \"pump\"\n if (command==\"pump\"):\n\n #Set the LEDs as Blue\n rgb(0,0,255)\n\n #Get direction from the different received arguments\n direction=args.split(\" \")[0]\n\n #Get delay (in between steps) from the different received arguments\n delay=float(args.split(\" \")[1])\n\n #Get number of steps from the different received arguments\n nb_step=int(args.split(\" \")[2])\n\n #Print status\n print(\"The pump has been started.\")\n\n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/pump\", \"Start\");\n\n ########################################################################\n while True:\n\n #Depending on direction, select the right direction for the pump\n if direction == \"BACKWARD\":\n direction=stepper.BACKWARD\n\n if direction == \"FORWARD\":\n direction=stepper.FORWARD\n\n #Actuate the pump for one step in the right direction\n pump_stepper.onestep(direction=direction, style=stepper.DOUBLE)\n\n #Increment the counter\n counter+=1\n\n #Wait during the delay to pump at the right flowrate\n sleep(delay)\n\n ####################################################################\n #If counter reach the number of step, break\n if counter>nb_step:\n\n #Release the pump stepper to stop power draw\n pump_stepper.release()\n\n #Print status\n print(\"The pumping is done.\")\n\n #Change the command to not re-enter in this while loop\n command=\"wait\"\n\n #Publish the status \"Done\" to via MQTT to Node-RED\n client.publish(\"receiver/pump\", \"Done\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ####################################################################\n #If a new received command isn't \"pump\", break this while loop\n if command!=\"pump\":\n\n #Release the pump stepper to stop power draw\n pump_stepper.release()\n\n #Print status\n print(\"The pump has been interrompted.\")\n\n #Publish the status \"Interrompted\" to via MQTT to Node-RED\n client.publish(\"receiver/pump\", \"Interrompted\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ############################################################################\n #Focus Event\n ############################################################################\n\n #If the command is \"focus\"\n elif (command==\"focus\"):\n\n #Set the LEDs as Yellow\n rgb(255,255,0)\n\n #Get direction from the different received arguments\n direction=args.split(\" \")[0]\n\n #Get number of steps from the different received arguments\n nb_step=int(args.split(\" \")[1])\n\n #Print status\n print(\"The focus has been started.\")\n\n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/focus\", \"Start\");\n\n ########################################################################\n while True:\n\n #Depending on direction, select the right direction for the focus\n if direction == \"FORWARD\":\n direction=stepper.FORWARD\n\n if direction == \"BACKWARD\":\n direction=stepper.BACKWARD\n\n #Actuate the focus for one microstep in the right direction\n focus_stepper.onestep(direction=direction, style=stepper.MICROSTEP)\n\n #Increment the counter\n counter+=1\n\n ####################################################################\n #If counter reach the number of step, break\n if counter>nb_step:\n\n #Release the focus steppers to stop power draw\n focus_stepper.release()\n\n #Print status\n print(\"The focusing is done.\")\n\n #Change the command to not re-enter in this while loop\n command=\"wait\"\n\n #Publish the status \"Done\" to via MQTT to Node-RED\n client.publish(\"receiver/focus\", \"Done\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ####################################################################\n #If a new received command isn't \"pump\", break this while loop\n if command!=\"focus\":\n\n #Release the focus steppers to stop power draw\n focus_stepper.release()\n\n #Print status\n print(\"The stage has been interrompted.\")\n\n #Publish the status \"Done\" to via MQTT to Node-RED\n client.publish(\"receiver/focus\", \"Interrompted\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ############################################################################\n #Image Event\n ############################################################################\n\n elif (command==\"image\"):\n \n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/image\", \"Will do my best dude\");\n\n #Get duration to wait before an image from the different received arguments\n sleep_before=int(args.split(\" \")[0])\n\n #Get number of step in between two images from the different received arguments\n nb_step=int(args.split(\" \")[1])\n\n #Get the number of frames to image from the different received arguments\n nb_frame=int(args.split(\" \")[2])\n\n #Get the segmentation status (true/false) from the different received arguments\n segmentation=str(args.split(\" \")[3])\n\n #Sleep a duration before to start acquisition\n sleep(sleep_before)\n\n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/image\", \"Start\");\n\n #Set the LEDs as Blue\n rgb(0,0,255)\n\n #Pump duing a given number of steps (in between each image)\n for i in range(nb_step):\n\n #If the command is still image - pump a defined nb of steps\n if (command==\"image\"):\n\n #Actuate the pump for one step in the FORWARD direction\n pump_stepper.onestep(direction=stepper.FORWARD, style=stepper.DOUBLE)\n\n #The flowrate is fixed for now.\n sleep(0.01)\n\n #If the command isn't image anymore - break\n else:\n\n break\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n while True:\n\n #Set the LEDs as Cyan\n rgb(0,255,255)\n\n #Increment the counter\n counter+=1\n\n #Get datetime\n datetime_tmp=datetime.now().strftime(\"%H_%M_%S_%f\")\n\n #Print datetime\n print(datetime_tmp)\n\n #Define the filename of the image\n filename = os.path.join(\"/home/pi/PlanktonScope/tmp\",datetime_tmp+\".jpg\")\n\n #Capture an image with the proper filename\n camera.capture(filename)\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Publish the name of the image to via MQTT to Node-RED\n\n client.publish(\"receiver/image\", datetime_tmp+\".jpg has been imaged.\");\n \n #Set the LEDs as Blue\n rgb(0,0,255)\n\n #Pump during a given nb of steps\n for i in range(nb_step):\n\n #Actuate the pump for one step in the FORWARD direction\n pump_stepper.onestep(direction=stepper.FORWARD, style=stepper.DOUBLE)\n\n #The flowrate is fixed for now.\n sleep(0.01)\n\n #Wait a fixed delay which set the framerate as < than 2 imag/sec\n sleep(0.5)\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n ####################################################################\n #If counter reach the number of frame, break\n if(counter>nb_frame):\n\n #Publish the status \"Completed\" to via MQTT to Node-RED\n client.publish(\"receiver/image\", \"Completed\");\n\n #Release the pump steppers to stop power draw\n pump_stepper.release()\n\n if(segmentation == \"True\"):\n\n #Publish the status \"Start\" to via MQTT to Node-RED\n client.publish(\"receiver/segmentation\", \"Start\");\n\n #Start the MorphoCut Pipeline\n p.run()\n\n #remove directory\n #shutil.rmtree(import_path)\n\n #Publish the status \"Completed\" to via MQTT to Node-RED\n client.publish(\"receiver/segmentation\", \"Completed\");\n\n #Set the LEDs as White\n rgb(255,255,255)\n\n #cmd = os.popen(\"rm -rf /home/pi/PlanktonScope/tmp/*.jpg\")\n\n #Let it happen\n sleep(1)\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #End if(segmentation == \"True\"):\n\n #Change the command to not re-enter in this while loop\n command=\"wait\"\n \n #Set the LEDs as Green\n rgb(0,255,255)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n ####################################################################\n #If a new received command isn't \"image\", break this while loop\n if command!=\"image\":\n\n #Release the pump steppers to stop power draw\n pump_stepper.release()\n\n #Print status\n print(\"The imaging has been interrompted.\")\n\n #Publish the status \"Interrompted\" to via MQTT to Node-RED\n client.publish(\"receiver/image\", \"Interrompted\");\n\n #Set the LEDs as Green\n rgb(0,255,0)\n\n #Reset the counter to 0\n counter=0\n\n break\n\n else:\n #Set the LEDs as Black\n rgb(0,0,0)\n #Its just waiting to receive command from Node-RED\n sleep(1)\n #Set the LEDs as White\n rgb(255,255,255)\n #Its just waiting to receive command from Node-RED\n sleep(1)\n", - "output": "str", - "x": 300, - "y": 100, - "wires": [ - [ - "be37d12f.0898f" - ] - ] - }, - { - "id": "f9705bc.3d322a8", - "type": "ui_switch", - "z": "863e8384.56889", - "name": "custom_segmentation", - "label": "Realize the segmentation", - "tooltip": "", - "group": "48649115.fcd01", - "order": 6, - "width": 0, - "height": 0, - "passthru": true, - "decouple": "false", - "topic": "custom_segmentation", - "style": "", - "onvalue": "True", - "onvalueType": "str", - "onicon": "", - "oncolor": "", - "offvalue": "False", - "offvalueType": "str", - "officon": "", - "offcolor": "", - "x": 520, - "y": 160, - "wires": [ - [] - ] - }, - { - "id": "2de12b49.050f44", - "type": "debug", - "z": "c1d3ff7c.4384f", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "true", - "targetType": "full", - "x": 1230, - "y": 200, - "wires": [] - }, - { - "id": "5079cccb.298d14", - "type": "exec", - "z": "c1d3ff7c.4384f", - "command": "ps -ax | grep \"python3.7 /home/pi/PlanktonScope/script/main.py\"| head -1 | awk -F \" \" '{print$1}' ", - "addpay": false, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "", - "x": 430, - "y": 40, - "wires": [ - [ - "c47c2122.5eea38" - ], - [], - [] - ] - }, - { - "id": "c47c2122.5eea38", - "type": "exec", - "z": "c1d3ff7c.4384f", - "command": "kill", - "addpay": true, - "append": "", - "useSpawn": "false", - "timer": "", - "oldrc": false, - "name": "", - "x": 910, - "y": 40, - "wires": [ - [], - [], - [] - ] - }, - { - "id": "197215b2.165f22", - "type": "delay", - "z": "c1d3ff7c.4384f", - "name": "", - "pauseType": "delay", - "timeout": "1", - "timeoutUnits": "seconds", - "rate": "1", - "nbRateUnits": "1", - "rateUnits": "second", - "randomFirst": "1", - "randomLast": "5", - "randomUnits": "seconds", - "drop": false, - "x": 160, - "y": 100, - "wires": [ - [ - "49e31e85.7ac51" - ] - ] - }, - { - "id": "589fbae2.8ff914", - "type": "debug", - "z": "a8ad6dec.1a393", - "name": "", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "true", - "targetType": "full", - "x": 240, - "y": 140, - "wires": [] + "id": "dc721eb.9ef51e", + "type": "ui_group", + "z": "", + "name": "Streaming camera", + "tab": "2b97fe34.a699fa", + "order": 3, + "disp": true, + "width": 24, + "collapse": false } ] From 09c5fccf83c7a07e67291333d3fe4334bfa1b771 Mon Sep 17 00:00:00 2001 From: tpollina Date: Tue, 14 Jul 2020 18:32:57 +0200 Subject: [PATCH 24/48] Rename flows.json to dude.json --- flows/{flows.json => dude.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename flows/{flows.json => dude.json} (100%) diff --git a/flows/flows.json b/flows/dude.json similarity index 100% rename from flows/flows.json rename to flows/dude.json From 63fc124d534b4928d1220451a7dbc4f14fcf9aea Mon Sep 17 00:00:00 2001 From: tpollina Date: Tue, 14 Jul 2020 18:34:53 +0200 Subject: [PATCH 25/48] Rename dude.json to main.json --- flows/{dude.json => main.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename flows/{dude.json => main.json} (100%) diff --git a/flows/dude.json b/flows/main.json similarity index 100% rename from flows/dude.json rename to flows/main.json From f234b50cfe19a9d9b34f6348c94749a53560d453 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Sun, 19 Jul 2020 17:38:17 +0200 Subject: [PATCH 26/48] update README.md, typo and small changes --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c7ceaaa..2731a86 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,8 @@ Finally, select `5 Interfacing Options`, then `P6 Serial`. This time, choose `No` to deactivate the login shell on the serial connection, but then choose `Yes` to keep the Serial port hardware enabled. +These steps can also be done from the Raspberry Pi Configuration GUI tool that you can find in `Main Menu > Preferences`. Go to the `Interfaces` tab. Pay attention, here the Serial Port must be enabled, but the Serial Port Console must be disabled. + Reboot your Pi safely. ``` sudo reboot now @@ -90,7 +92,7 @@ sudo pip3 install adafruit-circuitpython-motorkit ### Install RPi Cam Web Interface -You can find more information about the RPi Cam Web Interface on [eLinux' website]](https://elinux.org/RPi-Cam-Web-Interface). +You can find more information about the RPi Cam Web Interface on [eLinux' website](https://elinux.org/RPi-Cam-Web-Interface). To set it up, clone the code from Github and enable and run the install script with the following commands ``` @@ -107,7 +109,8 @@ sudo ip addr show | grep 'inet 1' ``` You can test the interface locally by accessing this url in from the browser in the Raspberry: `http://localhost/html` -You can also try to access this page from another computer connected to the same network with the IP address previously found : `http://[IP_ADDRESS]/html/`. +You can also try to access this page from another computer connected to the same network with the IP address previously found : `http://[IP_ADDRESS]/html/`. If your computer has `avahi` or the `Bonjour` service installed and running, you can also use this url: http://raspberrypi.local/html/ . + ### Install Ultimate GPS HAT [Installing Adafruit GPS HAT](https://learn.adafruit.com/adafruit-ultimate-gps-hat-for-raspberry-pi/pi-setup) From ede66258bf5b3cc80d7547c133d962b39b7a9f82 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Sun, 19 Jul 2020 19:21:33 +0200 Subject: [PATCH 27/48] Add basic information about computer setup --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 327bb86..a8f990a 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,9 @@ After getting your kit and finding the necessary components, but before assembli ## Install and setup Raspbian on your Raspberry Pi +### Computer setup +In order to make it easy to connect to the PlanktoScop, you may want to install [avahi](https://en.wikipedia.org/wiki/Avahi_%28software%29) or the [Bonjour](https://en.wikipedia.org/wiki/Bonjour_%28software%29) service on any computer you will use to access the PlanktoScop interface. This will allow you to connect to the PlantoScop using an address similar such as http://planktoscope.local instead of an IP address. + ### Download the image The latest Raspbian version can always be downloaded from [the Raspberry Pi Downloads page](https://www.raspberrypi.org/downloads/raspbian/). From fd0f0e42690243dfb3cdb9175296a19ab7253903 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Sun, 19 Jul 2020 19:22:32 +0200 Subject: [PATCH 28/48] Add type to code lines --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a8f990a..9b39f4d 100644 --- a/README.md +++ b/README.md @@ -45,13 +45,13 @@ The first boot to the desktop may take up to 120 seconds. This is normal and is Make sure you have access to internet and update/upgrade your fresh Raspbian install. Update your Pi first. Open up a terminal, and do the following: -``` +```sh sudo apt-get update -y sudo apt-get upgrade -y ``` You can now reboot your Pi safely. -``` +```sh sudo reboot now ``` @@ -60,7 +60,7 @@ sudo reboot now ### Enable Camera/SSH/I2C in raspi-config Open up a terminal once again, and access the configuration tool: -``` +```sh sudo raspi-config ``` @@ -79,7 +79,7 @@ This time, choose `No` to deactivate the login shell on the serial connection, b These steps can also be done from the Raspberry Pi Configuration GUI tool that you can find in `Main Menu > Preferences`. Go to the `Interfaces` tab. Pay attention, here the Serial Port must be enabled, but the Serial Port Console must be disabled. Reboot your Pi safely. -``` +```sh sudo reboot now ``` @@ -89,7 +89,7 @@ sudo reboot now Start by following [Adafruit's guide](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi). You can start at the chapter `Install Python Libraries`. For the record, the command are as following, however, Adafruit's page might have been updated, so please make sure this is still needed: -``` +```sh pip3 install RPI.GPIO pip3 install adafruit-blinka sudo pip3 install adafruit-circuitpython-motorkit @@ -100,7 +100,7 @@ sudo pip3 install adafruit-circuitpython-motorkit You can find more information about the RPi Cam Web Interface on [eLinux' website](https://elinux.org/RPi-Cam-Web-Interface). To set it up, clone the code from Github and enable and run the install script with the following commands -``` +```sh git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git cd RPi_Cam_Web_Interface ./install.sh @@ -158,7 +158,7 @@ node-red-pi --max-old-space-size=256 #### Autostart on boot Run Node-RED when the Pi is turned on, or re-booted, enable the service to autostart by running the command: -``` +```sh sudo systemctl enable nodered.service ``` From f344cf3c3e386293e74e2c35362d90d3c4343ca7 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Sun, 19 Jul 2020 19:22:42 +0200 Subject: [PATCH 29/48] Small typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b39f4d..50574e2 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ You can now reboot your Pi safely. sudo reboot now ``` -## Raspberry Pi configurations +## Raspberry Pi configuration ### Enable Camera/SSH/I2C in raspi-config From 9a77df136e40beae724fb6c47f74e391b7c7ba21 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Sun, 19 Jul 2020 19:23:10 +0200 Subject: [PATCH 30/48] Hostname change and camera configuration setup --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 50574e2..52fc762 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,12 @@ sudo raspi-config While you're here, a wise thing to do would be to change the default password for the `pi` user. This is very warmly recommended if your PlanktoScop is connected to a shared network you do not control. Just select the first option `1 Change User Password`. +You may also want to change the default hostname of your Raspberry. To do so, choose option `2 Network Options` then `N1 Hostname`. Choose a new hostname. We recommend using `planktoscope`. + +We need to activate a few things for the PlanktoScop to work properly. + +First, we need to activate the camera interface. Choose `5 Interfacing Options`, then `P1 Camera` and `Yes`. + Now, you can go to `5 Interfacing Options`, then `P2 SSH`. Choose `Yes` to activate the SSH access. Again, select `5 Interfacing Options`, then `P4 SPI`. Choose `Yes` to enable the SPI interface. From 3726a25903d5468e518f114b412bd527c08d8db5 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Sun, 19 Jul 2020 19:23:22 +0200 Subject: [PATCH 31/48] basic setup --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 52fc762..baeb5f5 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,16 @@ sudo reboot now ## Install the needed libraries for the PlanktoScop +Most of the following happens in a command line environment. If you are using the desktop, please start a terminal emulator. + +You can also connect to your PlanktoScop by using ssh using `ssh pi@planktoscope.local`. + +You can then run the following to make sure your Raspberry has the necessary components to install and build everything it needs: + +```sh +sudo apt-get install build-essential python3 python3-pip git +``` + ### Install CircuitPython Start by following [Adafruit's guide](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi). You can start at the chapter `Install Python Libraries`. From 46e721a80f4cb79857c2203c401370ee68fc1b45 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Sun, 19 Jul 2020 19:23:37 +0200 Subject: [PATCH 32/48] script to test adafruit blinka --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index baeb5f5..1784072 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,47 @@ pip3 install adafruit-blinka sudo pip3 install adafruit-circuitpython-motorkit ``` +It is recommended to test this setup by creating this small script under the name `blinkatest.py` and running it: +```python +#!/usr/bin/python3 +import board +import digitalio +import busio + + +print("Hello blinka!") + +# Try to great a Digital input +pin = digitalio.DigitalInOut(board.D4) +print("Digital IO ok!") + +# Try to create an I2C device +i2c = busio.I2C(board.SCL, board.SDA) +print("I2C ok!") + +# Try to create an SPI device +spi = busio.SPI(board.SCLK, board.MOSI, board.MISO) +print("SPI ok!") + +print("done!") +``` + +To run the script, just run the following: +```sh +chmod +x blinkatest.py +./blinkatest.py +``` + +The output should be similar to this: +``` +pi@planktoscope:~ $ ./test/blinkatest.py +Hello blinka! +Digital IO ok! +I2C ok! +SPI ok! +done! +``` + ### Install RPi Cam Web Interface You can find more information about the RPi Cam Web Interface on [eLinux' website](https://elinux.org/RPi-Cam-Web-Interface). From f65438a14f3f5453efd01f3e89f32d7d58b228de Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Sun, 19 Jul 2020 19:28:20 +0200 Subject: [PATCH 33/48] RPI Web Camera Interface setup --- README.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1784072..ef94e19 100644 --- a/README.md +++ b/README.md @@ -163,15 +163,22 @@ cd RPi_Cam_Web_Interface ./install.sh ``` -Press Enter to allow default setting of the installation. -Press Enter to start RPi Cam Web Interface now. -Found what is the IP of your Raspberry Pi. -``` +Press Enter to allow default setting of the installation. Once everything is installed, press Enter to start the RPi Cam Web Interface now. + +To test the interface locally, try accessing this url from the browser in the Raspberry: http://localhost/html + +You can also try to access this page from another computer connected to the same network. + +If your computer has `avahi` or the `Bonjour` service installed and running, you can directly use this url: http://raspberrypi.local/html/ . + +If this is not the case, you first need to find the IP address of your Raspberry Pi by running the following: +```sh sudo ip addr show | grep 'inet 1' ``` -You can test the interface locally by accessing this url in from the browser in the Raspberry: `http://localhost/html` -You can also try to access this page from another computer connected to the same network with the IP address previously found : `http://[IP_ADDRESS]/html/`. If your computer has `avahi` or the `Bonjour` service installed and running, you can also use this url: http://raspberrypi.local/html/ . +The web page can then be accessed at `http://[IP_ADDRESS]/html/`. + +If the interface is loading and a picture is displayed, you can stop this interface for now by simply running `./stop.sh`. ### Install Ultimate GPS HAT From bd2694b6b31e1553a7b7d85be38db25ec0ae0d5b Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Sun, 19 Jul 2020 19:28:33 +0200 Subject: [PATCH 34/48] GPS HAT Setup --- README.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ef94e19..65daced 100644 --- a/README.md +++ b/README.md @@ -182,12 +182,31 @@ If the interface is loading and a picture is displayed, you can stop this interf ### Install Ultimate GPS HAT -[Installing Adafruit GPS HAT](https://learn.adafruit.com/adafruit-ultimate-gps-hat-for-raspberry-pi/pi-setup) -[Use Python Thread with GPS HAT](http://www.danmandle.com/blog/getting-gpsd-to-work-with-python/) +You can start by testing that the GPS module is working. Either install your PlanktoScop with a view of the sky, or connect the external antenna. +Now you need to run the following: +```sh +sudo apt-get install gpsd gpsd-clients +stty -F /dev/serial0 raw 9600 cs8 clocal -cstopb +cat /dev/serial0 ``` -sudo apt-get install python gpsd gpsd-clients + +If the GPS works, you should now see NMEA sentences scrolling: +``` +$GPGGA,000908.799,,,,,0,00,,,M,,M,,*7E +$GPGSA,A,1,,,,,,,,,,,,,,,*1E +$GPGSV,1,1,00*79 +$GPRMC,000908.799,V,,,,,0.00,0.00,060180,,,N*44 +$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32 +$GPGGA,000909.799,,,,,0,00,,,M,,M,,*7F +$GPGSA,A,1,,,,,,,,,,,,,,,*1E +$GPRMC,000909.799,V,,,,,0.00,0.00,060180,,,N*45 +$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32 +$GPGGA,000910.799,,,,,0,00,,,M,,M,,*77 +$GPGSA,A,1,,,,,,,,,,,,,,,*1E +$GPRMC,000910.799,V,,,,,0.00,0.00,060180,,,N*4D +$GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32 ``` ### Install RGB Cooling HAT From 18b19238c40759948a845abaa1767b96c8ec6305 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Sun, 19 Jul 2020 19:28:55 +0200 Subject: [PATCH 35/48] RGB HAT Setup --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 65daced..59706e8 100644 --- a/README.md +++ b/README.md @@ -209,15 +209,19 @@ $GPRMC,000910.799,V,,,,,0.00,0.00,060180,,,N*4D $GPVTG,0.00,T,,M,0.00,N,0.00,K,N*32 ``` -### Install RGB Cooling HAT -[Installing RGB Cooling HAT](https://www.yahboom.net/study/RGB_Cooling_HAT) +Until you get a GPS fix, most of the sentences are empty (see the lines starting with GPGSA and with lot of commas). -Type these command to install: -``` + +You can find more information in this hardware module in Adafruit documentation at [Installing Adafruit GPS HAT](https://learn.adafruit.com/adafruit-ultimate-gps-hat-for-raspberry-pi/overview) or on this page to [use Python Thread with GPS HAT](http://www.danmandle.com/blog/getting-gpsd-to-work-with-python/) + + +### Install RGB Cooling HAT +To setup the RGB Cooling HAT, you just need to clone and build the WiringPi library: +```sh git clone https://github.com/WiringPi/WiringPi.git cd WiringPi sudo ./build -sudo apt-get install gcc +gpio -v ``` ### Install Node-RED From eb532068a7acc19a259b187a1252b111dafa4358 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Sun, 19 Jul 2020 19:29:55 +0200 Subject: [PATCH 36/48] Node-RED changes --- README.md | 66 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 59706e8..182a150 100644 --- a/README.md +++ b/README.md @@ -224,48 +224,62 @@ sudo ./build gpio -v ``` -### Install Node-RED -[Installing Node-RED on Raspberry Pi](https://nodered.org/docs/getting-started/raspberrypi) +The last command should output something similar to the following: +``` +gpio version: 2.60 +Copyright (c) 2012-2018 Gordon Henderson +This is free software with ABSOLUTELY NO WARRANTY. +For details type: gpio -warranty + +Raspberry Pi Details: + Type: Pi 4B, Revision: 01, Memory: 4096MB, Maker: Sony + * Device tree is enabled. + *--> Raspberry Pi 4 Model B Rev 1.1 + * This Raspberry Pi supports user-level GPIO access. -#### Prerequisites -Ensure npm is able to build any binary modules it needs to install. -``` -sudo apt-get install build-essential ``` +More information can be found on Yahboom website, on the page [Installing RGB Cooling HAT](https://www.yahboom.net/study/RGB_Cooling_HAT). + + +### Install Node-RED + #### Download and installation -To install Node.js, npm and Node-RED onto a Raspberry Pi, run the following command will that download and install them: -``` +To install Node.js, npm and Node-RED onto a Raspberry Pi, you just need to run the following command. You can review the content of this script [here](https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered). +```sh bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) ``` -Due to the limited memory of the Raspberry Pi, you will need to start Node-RED with an additional argument to tell the underlying Node.js process to free up unused memory sooner than it would otherwise. -``` -node-red-pi --max-old-space-size=256 -``` +Type `y` at both prompts to accept the installation and its settings. -#### Autostart on boot -Run Node-RED when the Pi is turned on, or re-booted, enable the service to autostart by running the command: +#### Enable start on boot and launch Node-RED +To run Node-RED when the Pi is turned on or restarted, you need to enable the systemd service by running this command: ```sh sudo systemctl enable nodered.service ``` -#### Check the installation -Make sure NodeRed is correctly installed by reaching the following page from the broswer of your pi : http://localhost:1880. - -#### Install few nodes -These nodes will be used in Node-RED: +You can now start Node-RED by running the following: +```sh +sudo systemctl start nodered.service ``` -cd .node-red/ -npm install node-red-dashboard -npm install node-red-contrib-python3-function -npm install node-red-contrib-camerapi -npm install node-red-contrib-gpsd -npm install node-red-contrib-web-worldmap + +#### Check the installation +Make sure Node-RED is correctly installed by reaching the following page from the browser of your pi http://localhost:1880 or http://planktoscope.local:1880 from another computer on the same network. + +#### Install the necessary nodes +These nodes will be used by the PlanktoScop software and needs to be installed: +```sh +cd ~/.node-red/ +npm install node-red-dashboard node-red-contrib-python3-function node-red-contrib-camerapi node-red-contrib-gpsd node-red-contrib-web-worldmap node-red-contrib-interval +sudo systemctl restart nodered.service ``` #### Import the last GUI -Import the lastest version of the GUI from https://raw.githubusercontent.com/tpollina/PlanktonScope/master/scripts/flows_planktonscope.json> +From Node-RED gui in your browser, choose the Hamburger menu top right, and then Import. You can paste the code directly from the lastest version of the GUI available [here](https://raw.githubusercontent.com/tpollina/PlanktonScope/blob/master/flows/main.json). + +#### More information +[Installing Node-RED on Raspberry Pi](https://nodered.org/docs/getting-started/raspberrypi) + ### Install Mosquitto MQTT From d1701f18ccf2cc82ebf899e6d2650abfebfed611 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Sun, 19 Jul 2020 19:30:16 +0200 Subject: [PATCH 37/48] MQTT changes --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 182a150..4a0203a 100644 --- a/README.md +++ b/README.md @@ -283,7 +283,7 @@ From Node-RED gui in your browser, choose the Hamburger menu top right, and then ### Install Mosquitto MQTT -In order to send and receive from Node-RED: +In order to send and receive data from Node-RED, you need to install this. Run the following: ``` sudo apt-get install mosquitto mosquitto-clients @@ -291,7 +291,7 @@ sudo apt-get install mosquitto mosquitto-clients ### Install mqtt-paho -In order to send and receive from python: +In order to send and receive data from python, you need this library. Run the following: ``` pip3 install paho-mqtt ``` From 28c52fd73a432a49bd12cdc698c064bc4c8d23e8 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Sun, 19 Jul 2020 19:47:48 +0200 Subject: [PATCH 38/48] Download flow directly to library --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 4a0203a..4f13f3b 100644 --- a/README.md +++ b/README.md @@ -277,6 +277,12 @@ sudo systemctl restart nodered.service From Node-RED gui in your browser, choose the Hamburger menu top right, and then Import. You can paste the code directly from the lastest version of the GUI available [here](https://raw.githubusercontent.com/tpollina/PlanktonScope/blob/master/flows/main.json). +You can also download it directly: +```sh +wget -N -P ~/.node-red/lib/flows https://raw.githubusercontent.com/tpollina/PlanktonScope/master/flows/main.json +sudo systemctl restart nodered.service +``` + #### More information [Installing Node-RED on Raspberry Pi](https://nodered.org/docs/getting-started/raspberrypi) From b2df75665723b012d27b08e2925b550c8fe8e3b7 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Mon, 20 Jul 2020 22:06:23 +0200 Subject: [PATCH 39/48] update to OpenCV section --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4f13f3b..0cbedab 100644 --- a/README.md +++ b/README.md @@ -302,10 +302,32 @@ In order to send and receive data from python, you need this library. Run the fo pip3 install paho-mqtt ``` + ### Install OpenCV -Use the quick version without virtual env -https://www.pyimagesearch.com/2019/09/16/install-opencv-4-on-raspberry-pi-4-and-raspbian-buster/ +We need to install the latest OpenCV version. Unfortunately, it is not available in the repositories. We are going to install it directly by using pip. + +First, we need to install the needed dependencies, then we will directly install opencv: +```sh +sudo apt install libgtk-3-0 libavformat58 libtiff5 libcairo2 libqt4-test libpango-1.0-0 libopenexr23 libavcodec58 libilmbase23 libatk1.0-0 libpangocairo-1.0-0 libwebp6 libqtgui4 libavutil56 libjasper1 libqtcore4 libcairo-gobject2 libswscale5 libgdk-pixbuf2.0-0 libhdf5-dev libilmbase-dev libopenexr-dev libgstreamer1.0-dev libavcodec-dev libavformat-dev libswscale-dev libwebp-dev libatlas-base-dev +sudo pip3 install opencv-contrib-python==4.1.0.25 +``` + +You can now check that opencv is properly installed by running a python interpreter and importing the cv2 module. +```sh +pi@planktoscope:~ $ python3 +Python 3.7.3 (default, Dec 20 2019, 18:57:59) +[GCC 8.3.0] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> import cv2 +>>> cv2.__version__ +'4.1.0' +>>> quit() +``` + +If all goes well, the displayed version number should be `4.1.0`. + +More detailed information can be found on this [website](https://www.pyimagesearch.com/2019/09/16/install-opencv-4-on-raspberry-pi-4-and-raspbian-buster/). ### Install MorphoCut From 56f2fcc482b3610ae069551031b2460c89c9a0b5 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Mon, 20 Jul 2020 22:21:58 +0200 Subject: [PATCH 40/48] Repo cloning addition --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0cbedab..0d1cbbe 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ Update your Pi first. Open up a terminal, and do the following: ```sh sudo apt-get update -y sudo apt-get upgrade -y +sudo apt-get install git ``` You can now reboot your Pi safely. @@ -57,9 +58,18 @@ sudo reboot now ## Raspberry Pi configuration +### Clone this repository! + +First of all, and to ensure you have the latest documentation available locally, you should clone this repository using git. + +Simply run the following in a terminal: +```sh +git clone https://github.com/PlanktonPlanet/PlanktonScope/ +``` + ### Enable Camera/SSH/I2C in raspi-config -Open up a terminal once again, and access the configuration tool: +You can now launch the configuration tool: ```sh sudo raspi-config ``` @@ -98,7 +108,7 @@ You can also connect to your PlanktoScop by using ssh using `ssh pi@planktoscope You can then run the following to make sure your Raspberry has the necessary components to install and build everything it needs: ```sh -sudo apt-get install build-essential python3 python3-pip git +sudo apt-get install build-essential python3 python3-pip ``` ### Install CircuitPython From 0d4f314de0dfcd1eb8e2a26bef8ad28909eca3a4 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Mon, 20 Jul 2020 22:22:26 +0200 Subject: [PATCH 41/48] Morphocut update --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d1cbbe..b668b6e 100644 --- a/README.md +++ b/README.md @@ -341,7 +341,6 @@ More detailed information can be found on this [website](https://www.pyimagesear ### Install MorphoCut -[Installing MorphoCut](https://morphocut.readthedocs.io/en/stable/installation.html) MorphoCut is packaged on PyPI and can be installed with pip: @@ -350,6 +349,21 @@ sudo apt-get install python3-scipy pip3 install -U git+https://github.com/morphocut/morphocut.git ``` +To test the installation, open up once again a python interpreter and import the morphocut module: +```sh +pi@planktoscope:~ $ python3 +Python 3.7.3 (default, Dec 20 2019, 18:57:59) +[GCC 8.3.0] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> import morphocut +>>> morphocut.__version__ +'0.1.1+42.g01a051e' +>>> quit() +``` + +The MorphoCut documentation can be found [on this page](https://morphocut.readthedocs.io/en/stable/index.html). + + ## Finishing the install Make sure to update your Pi From ccd5da6f74ee1a3e34920cd1a52d045dcf9d563f Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Mon, 20 Jul 2020 22:23:13 +0200 Subject: [PATCH 42/48] update ref from tpollina/PlanktonScope to PlanktonPlanet/PlanktonScope --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b668b6e..79a59cf 100644 --- a/README.md +++ b/README.md @@ -285,11 +285,11 @@ sudo systemctl restart nodered.service #### Import the last GUI -From Node-RED gui in your browser, choose the Hamburger menu top right, and then Import. You can paste the code directly from the lastest version of the GUI available [here](https://raw.githubusercontent.com/tpollina/PlanktonScope/blob/master/flows/main.json). +From Node-RED gui in your browser, choose the Hamburger menu top right, and then Import. You can paste the code directly from the lastest version of the GUI available [here](https://raw.githubusercontent.com/PlanktonPlanet/PlanktonScope/blob/master/flows/main.json). You can also download it directly: ```sh -wget -N -P ~/.node-red/lib/flows https://raw.githubusercontent.com/tpollina/PlanktonScope/master/flows/main.json +wget -N -P ~/.node-red/lib/flows https://raw.githubusercontent.com/PlanktonPlanet/PlanktonScope/master/flows/main.json sudo systemctl restart nodered.service ``` From c4bc1fa32abc54745cee752d6a74b8cf5f974acf Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Mon, 20 Jul 2020 22:23:32 +0200 Subject: [PATCH 43/48] Update latest information part --- README.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 79a59cf..d4e2f5a 100644 --- a/README.md +++ b/README.md @@ -380,18 +380,20 @@ sudo reboot now ## Useful later maybe -### Download the GitHub repo -At this link : https://github.com/tpollina/PlanktonScope/archive/master.zip -Unzip to a specific location: -``` -unzip /home/pi/Downloads/PlanktonScope-master.zip -d /home/pi/ -mv /home/pi/PlanktonScope-master /home/pi/PlanktonScope +### Update the cloned repository + +Updates are published on Github regurlarly. Make sure to update once in a while by running this command: +```sh +cd PlanktonScope +git pull ``` +This will pull and merge all the changes made since your last update. + ### Update node-RED interface -To update the interface, you can just download the lastest .json file: -``` -wget -P $HOME/.node-red https://raw.githubusercontent.com/tpollina/PlanktonScope/master/scripts/flows_planktonscope.json +To update the interface and make sure you run the latest version, you need to copy the json config file from the cloned repository to the Node-RED library: +```sh +cp ~/PlanktonScope/flows/main.json ~/.node-red/lib/flows ``` ### Share WiFi via Ethernet From 3738ba3cd9c981257ca029b287e026fcdca2b0e2 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Mon, 20 Jul 2020 22:39:49 +0200 Subject: [PATCH 44/48] Small typo changes and cleanup of folders --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d4e2f5a..d45399b 100644 --- a/README.md +++ b/README.md @@ -105,10 +105,11 @@ Most of the following happens in a command line environment. If you are using th You can also connect to your PlanktoScop by using ssh using `ssh pi@planktoscope.local`. -You can then run the following to make sure your Raspberry has the necessary components to install and build everything it needs: +You can then run the following to make sure your Raspberry has the necessary components to install and build everything it needs and to create the necessary folders: ```sh sudo apt-get install build-essential python3 python3-pip +mkdir test libraries ``` ### Install CircuitPython @@ -121,7 +122,7 @@ pip3 install adafruit-blinka sudo pip3 install adafruit-circuitpython-motorkit ``` -It is recommended to test this setup by creating this small script under the name `blinkatest.py` and running it: +It is recommended to test this setup by creating this small script under the name `test/blinkatest.py` and running it (you can use the editor nano if you are using the terminal). ```python #!/usr/bin/python3 import board @@ -148,8 +149,8 @@ print("done!") To run the script, just run the following: ```sh -chmod +x blinkatest.py -./blinkatest.py +chmod +x test/blinkatest.py +./test/blinkatest.py ``` The output should be similar to this: @@ -168,6 +169,7 @@ You can find more information about the RPi Cam Web Interface on [eLinux' websit To set it up, clone the code from Github and enable and run the install script with the following commands ```sh +cd ~/libraries git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git cd RPi_Cam_Web_Interface ./install.sh @@ -228,6 +230,7 @@ You can find more information in this hardware module in Adafruit documentation ### Install RGB Cooling HAT To setup the RGB Cooling HAT, you just need to clone and build the WiringPi library: ```sh +cd ~/libraries git clone https://github.com/WiringPi/WiringPi.git cd WiringPi sudo ./build @@ -289,7 +292,7 @@ From Node-RED gui in your browser, choose the Hamburger menu top right, and then You can also download it directly: ```sh -wget -N -P ~/.node-red/lib/flows https://raw.githubusercontent.com/PlanktonPlanet/PlanktonScope/master/flows/main.json +wget -N -O ~/.node-red/flows_planktoscope.json https://raw.githubusercontent.com/PlanktonPlanet/PlanktonScope/master/flows/main.json sudo systemctl restart nodered.service ``` @@ -393,7 +396,7 @@ This will pull and merge all the changes made since your last update. ### Update node-RED interface To update the interface and make sure you run the latest version, you need to copy the json config file from the cloned repository to the Node-RED library: ```sh -cp ~/PlanktonScope/flows/main.json ~/.node-red/lib/flows +cp ~/PlanktonScope/flows/main.json ~/.node-red/flows_planktoscope.json ``` ### Share WiFi via Ethernet From 493915c7b446846db171140025d3da287d084b90 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Mon, 20 Jul 2020 23:23:30 +0200 Subject: [PATCH 45/48] Replace apt-get command by apt --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d45399b..b8ffaf8 100644 --- a/README.md +++ b/README.md @@ -46,9 +46,9 @@ Make sure you have access to internet and update/upgrade your fresh Raspbian ins Update your Pi first. Open up a terminal, and do the following: ```sh -sudo apt-get update -y -sudo apt-get upgrade -y -sudo apt-get install git +sudo apt update -y +sudo apt upgrade -y +sudo apt install git ``` You can now reboot your Pi safely. @@ -108,7 +108,7 @@ You can also connect to your PlanktoScop by using ssh using `ssh pi@planktoscope You can then run the following to make sure your Raspberry has the necessary components to install and build everything it needs and to create the necessary folders: ```sh -sudo apt-get install build-essential python3 python3-pip +sudo apt install build-essential python3 python3-pip mkdir test libraries ``` @@ -199,7 +199,7 @@ You can start by testing that the GPS module is working. Either install your Pla Now you need to run the following: ```sh -sudo apt-get install gpsd gpsd-clients +sudo apt install gpsd gpsd-clients stty -F /dev/serial0 raw 9600 cs8 clocal -cstopb cat /dev/serial0 ``` @@ -304,7 +304,7 @@ sudo systemctl restart nodered.service In order to send and receive data from Node-RED, you need to install this. Run the following: ``` -sudo apt-get install mosquitto mosquitto-clients +sudo apt install mosquitto mosquitto-clients ``` @@ -348,7 +348,7 @@ More detailed information can be found on this [website](https://www.pyimagesear MorphoCut is packaged on PyPI and can be installed with pip: ```sh -sudo apt-get install python3-scipy +sudo apt install python3-scipy pip3 install -U git+https://github.com/morphocut/morphocut.git ``` @@ -371,8 +371,8 @@ The MorphoCut documentation can be found [on this page](https://morphocut.readth Make sure to update your Pi ``` -sudo apt-get update -y -sudo apt-get full-upgrade -y +sudo apt update -y +sudo apt full-upgrade -y ``` Reboot your Pi safely From 620c1940cef95990f30bd1f9b49465e202c52c1c Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Mon, 20 Jul 2020 23:24:06 +0200 Subject: [PATCH 46/48] Make sure pip3 command are run with sudo to install globally --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b8ffaf8..7ceab1c 100644 --- a/README.md +++ b/README.md @@ -117,8 +117,8 @@ Start by following [Adafruit's guide](https://learn.adafruit.com/circuitpython-o For the record, the command are as following, however, Adafruit's page might have been updated, so please make sure this is still needed: ```sh -pip3 install RPI.GPIO -pip3 install adafruit-blinka +sudo pip3 install RPI.GPIO +sudo pip3 install adafruit-blinka sudo pip3 install adafruit-circuitpython-motorkit ``` @@ -312,7 +312,7 @@ sudo apt install mosquitto mosquitto-clients In order to send and receive data from python, you need this library. Run the following: ``` -pip3 install paho-mqtt +sudo pip3 install paho-mqtt ``` @@ -349,7 +349,7 @@ MorphoCut is packaged on PyPI and can be installed with pip: ```sh sudo apt install python3-scipy -pip3 install -U git+https://github.com/morphocut/morphocut.git +sudo pip3 install -U git+https://github.com/morphocut/morphocut.git ``` To test the installation, open up once again a python interpreter and import the morphocut module: From 32e903f2a1016fac8774f365b71464c46af49c7e Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Mon, 20 Jul 2020 23:24:23 +0200 Subject: [PATCH 47/48] Missing python lib for OpenCV --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 7ceab1c..2230605 100644 --- a/README.md +++ b/README.md @@ -323,6 +323,7 @@ We need to install the latest OpenCV version. Unfortunately, it is not available First, we need to install the needed dependencies, then we will directly install opencv: ```sh sudo apt install libgtk-3-0 libavformat58 libtiff5 libcairo2 libqt4-test libpango-1.0-0 libopenexr23 libavcodec58 libilmbase23 libatk1.0-0 libpangocairo-1.0-0 libwebp6 libqtgui4 libavutil56 libjasper1 libqtcore4 libcairo-gobject2 libswscale5 libgdk-pixbuf2.0-0 libhdf5-dev libilmbase-dev libopenexr-dev libgstreamer1.0-dev libavcodec-dev libavformat-dev libswscale-dev libwebp-dev libatlas-base-dev +sudo pip3 install "picamera[array]" sudo pip3 install opencv-contrib-python==4.1.0.25 ``` From f15e3f67f46fcc432033a8d4d54015c361156023 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Mon, 20 Jul 2020 23:24:40 +0200 Subject: [PATCH 48/48] Missing python modules for RGB Led HAT --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 2230605..97a15fa 100644 --- a/README.md +++ b/README.md @@ -252,6 +252,12 @@ Raspberry Pi Details: ``` +You will also need to install some python modules: +```sh +sudo apt install python3-smbus i2c-tools +sudo pip3 install Adafruit-SSD1306 +``` + More information can be found on Yahboom website, on the page [Installing RGB Cooling HAT](https://www.yahboom.net/study/RGB_Cooling_HAT).