2019-12-17 02:15:37 +01:00
==========================
2019-12-11 03:34:24 +01:00
PlanktonScope Installation
==========================
2019-12-11 17:34:34 +01:00
2019-12-17 04:22:33 +01:00
***** ***** ***** ***** ***** ***** ***** **
2019-12-11 03:34:24 +01:00
Install Raspbian on your Raspberry Pi
2019-12-17 04:22:33 +01:00
***** ***** ***** ***** ***** ***** ***** **
2019-12-11 17:34:34 +01:00
2019-12-11 03:34:24 +01:00
Download the image
2019-12-17 04:23:20 +01:00
==================
2019-12-11 17:30:03 +01:00
2019-12-11 03:34:24 +01:00
Download the .zip file of Raspbian Buster with desktop from the Raspberry Pi website Downloads page.
Writing an image to the SD card
2019-12-11 17:30:03 +01:00
2019-12-11 03:34:24 +01:00
Download the latest version of balenaEtcher and install it.
2019-12-11 17:30:03 +01:00
2019-12-11 03:34:24 +01:00
Connect an SD card reader with the micro SD card inside.
2019-12-11 17:30:03 +01:00
2019-12-11 03:34:24 +01:00
Open balenaEtcher and select from your hard drive the Raspberry Pi .zip file you wish to write to the SD card.
2019-12-11 17:30:03 +01:00
2019-12-11 03:34:24 +01:00
Select the SD card you wish to write your image to.
2019-12-11 17:30:03 +01:00
2019-12-11 03:34:24 +01:00
Review your selections and click 'Flash!' to begin writing data to the SD card.
Prepare your Raspberry Pi
2019-12-17 04:22:33 +01:00
-------------------------
`Getting Started with your Raspberry Pi <https://projects.raspberrypi.org/en/projects/raspberry-pi-getting-started/> `_
2019-12-11 17:30:03 +01:00
2019-12-11 03:34:24 +01:00
Plug the SD Card in your Raspberry Pi
2019-12-11 17:30:03 +01:00
2019-12-11 03:34:24 +01:00
Connect your Pi to a screen, mouse, keyboard and power
2019-12-11 17:30:03 +01:00
2019-12-11 03:34:24 +01:00
Finish the setup
Make sure you have access to internet and update/upgrade your fresh raspbian
2019-12-11 17:34:34 +01:00
2019-12-17 04:22:33 +01:00
Update your Pi first
2019-12-11 03:52:31 +01:00
::
2019-12-11 03:34:24 +01:00
sudo apt-get update -y
sudo apt-get upgrade -y
2019-12-11 03:52:31 +01:00
Reboot your Pi safely
::
2019-12-11 03:34:24 +01:00
sudo reboot now
2019-12-17 04:22:33 +01:00
***** ***** ***** ***** ***** **
2019-12-11 03:55:58 +01:00
Raspberry Pi configurations
2019-12-17 04:23:20 +01:00
***** ***** ***** ***** ***** **
2019-12-11 17:34:34 +01:00
2019-12-11 03:55:58 +01:00
Enable Camera/SSH/I2C in raspi-config
Open up the configuration page and select Interfacing Options by typing this command:
::
sudo raspi-config
2019-12-17 02:14:06 +01:00
Select **Serial**
2019-12-11 03:55:58 +01:00
2019-12-17 02:14:06 +01:00
Select **NO**
2019-12-11 03:55:58 +01:00
2019-12-17 02:14:06 +01:00
Keep the **Serial Port Hardware enabled**
2019-12-11 03:55:58 +01:00
Reboot your Pi safely
::
sudo reboot now
2019-12-17 04:23:20 +01:00
***** ***** ***** ***** ***** ***** ***** ***** ***** *****
2019-12-11 17:34:34 +01:00
Install the needed libraries for the PlanktonScope
2019-12-17 04:23:20 +01:00
***** ***** ***** ***** ***** ***** ***** ***** ***** *****
2019-12-11 17:34:34 +01:00
2019-12-11 03:34:24 +01:00
Install CircuitPython
2019-12-17 04:22:33 +01:00
=====================
`Installing CircuitPython on Raspberry Pi <https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi> `_
2019-12-02 04:24:25 +01:00
2019-12-11 03:52:31 +01:00
Run the following command to install adafruit_blinka
::
2019-12-11 03:34:24 +01:00
pip3 install adafruit-blinka
sudo pip3 install adafruit-circuitpython-motorkit
Install RPi Cam Web Interface
2019-12-17 04:22:33 +01:00
=============================
`RPi Cam Web Interface <https://elinux.org/RPi-Cam-Web-Interface> `_
2019-12-11 03:34:24 +01:00
2019-12-11 03:52:31 +01:00
Clone the code from github and enable and run the install script with the following commands
::
2019-12-11 03:34:24 +01:00
git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git
cd RPi_Cam_Web_Interface
./install.sh
2019-12-02 04:24:25 +01:00
2019-12-11 03:34:24 +01:00
Press Enter to allow default setting of the installation
Press Enter to start RPi Cam Web Interface now
2019-12-11 03:52:31 +01:00
Found what is the IP of your Raspberry Pi
::
2019-12-11 03:34:24 +01:00
sudo ip addr show | grep 'inet 1'
Reach the url on a local browser : http://127.0.0.1/html/
Install Ultimate GPS HAT
2019-12-17 04:23:20 +01:00
========================
2019-12-25 23:22:05 +01:00
`Installing Adafruit GPS HAT <https://learn.adafruit.com/adafruit-ultimate-gps-hat-for-raspberry-pi/pi-setup> `_
2019-12-17 04:22:33 +01:00
2019-12-25 23:22:05 +01:00
`Use Python Thread with GPS HAT <http://www.danmandle.com/blog/getting-gpsd-to-work-with-python/> `_
2019-12-17 04:22:33 +01:00
2020-01-09 11:37:38 +01:00
::
sudo apt-get install python gpsd gpsd-clients
2019-12-11 03:34:24 +01:00
Install RGB Cooling HAT
2019-12-17 04:23:20 +01:00
=======================
2019-12-17 04:27:03 +01:00
`Installing RGB Cooling HAT <https://www.yahboom.net/study/RGB_Cooling_HAT> `_
2020-01-09 11:37:38 +01:00
Type these command to install:
2019-12-11 03:52:31 +01:00
::
2019-12-11 03:34:24 +01:00
git clone https://github.com/WiringPi/WiringPi.git
cd WiringPi
sudo ./build
sudo apt-get install gcc
Install Node-RED
2019-12-11 03:52:31 +01:00
==================
2019-12-17 04:22:33 +01:00
`Installing Node-RED on Raspberry Pi <https://nodered.org/docs/getting-started/raspberrypi> `_
2019-12-11 17:30:03 +01:00
Prerequisites
2019-12-17 04:22:33 +01:00
-------------
2019-12-11 17:30:03 +01:00
Ensure npm is able to build any binary modules it needs to install.
::
sudo apt-get install build-essential
2019-12-17 04:22:33 +01:00
2019-12-11 17:30:03 +01:00
Download and installation
2019-12-17 04:22:33 +01:00
-------------------------
2019-12-11 17:30:03 +01:00
To install Node.js, npm and Node-RED onto a Raspberry Pi, run the following command will that download and install them:
2019-12-11 03:52:31 +01:00
::
2019-12-11 03:34:24 +01:00
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
2019-12-11 17:30:03 +01:00
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
2019-12-17 04:22:33 +01:00
2019-12-11 17:30:03 +01:00
Autostart on boot
2019-12-17 04:22:33 +01:00
-----------------
2019-12-11 17:30:03 +01:00
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
2019-12-17 04:22:33 +01:00
2019-12-11 17:30:03 +01:00
Check the installation
2019-12-17 04:22:33 +01:00
----------------------
2019-12-11 17:30:03 +01:00
Make sure NodeRed is correctly installed by reaching the following page from the broswer of your pi :
::
2019-12-17 04:22:33 +01:00
http://localhost:1880.
2019-12-11 03:34:24 +01:00
2019-12-13 05:19:41 +01:00
Install few nodes
2019-12-17 04:22:33 +01:00
-----------------
2019-12-13 19:24:51 +01:00
These nodes will be used in Node-RED:
2019-12-13 19:31:31 +01:00
::
cd .node-red/
2019-12-13 05:19:41 +01:00
npm install node-red-dashboard
npm install node-red-contrib-python3-function
2019-12-13 09:18:48 +01:00
npm install node-red-contrib-camerapi
2020-01-09 11:37:38 +01:00
npm install node-red-contrib-gpsd
2020-01-09 11:45:52 +01:00
npm install node-red-contrib-web-worldmap
2019-12-14 10:31:44 +01:00
2019-12-17 04:13:27 +01:00
Import the last GUI
2019-12-17 04:22:33 +01:00
-------------------
2019-12-17 04:27:03 +01:00
Import the `lastest version of the GUI <https://raw.githubusercontent.com/tpollina/PlanktonScope/master/scripts/flows_planktonscope.json> `_
2019-12-17 04:13:27 +01:00
2020-01-31 05:25:46 +01:00
Install Mosquitto MQTT
======================
2019-12-17 04:27:03 +01:00
2020-01-31 05:25:46 +01:00
In order to send and receive from Node-RED:
2019-12-17 04:15:15 +01:00
::
2020-01-31 05:25:46 +01:00
sudo apt-get install mosquitto mosquitto-clients
2019-12-23 14:40:19 +01:00
2020-01-31 04:48:03 +01:00
Install mqtt-paho
2020-01-31 05:25:46 +01:00
=================
2019-12-23 14:40:19 +01:00
2020-01-31 05:25:46 +01:00
In order to send and receive from python:
2020-01-28 05:38:03 +01:00
::
2020-01-31 04:48:03 +01:00
pip3 install paho-mqtt
2020-01-31 05:25:46 +01:00
2020-02-01 22:19:11 +01:00
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/
2020-01-31 05:25:46 +01:00
Install 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
2020-01-31 08:40:36 +01:00
pip3 install -U git+https://github.com/morphocut/morphocut.git@pyrocystis
2019-12-23 14:40:19 +01:00
Finishing the install
=====================
Make sure to update your Pi
::
sudo apt-get update -y
2019-12-23 14:49:45 +01:00
sudo apt-get full-upgrade -y
2019-12-23 14:40:19 +01:00
Reboot your Pi safely
::
sudo reboot now
2019-12-23 14:49:45 +01:00
2020-01-31 08:41:14 +01:00
***** ***** ***** *** *
2020-01-31 08:40:36 +01:00
Usefull later maybe
2020-01-31 08:41:14 +01:00
***** ***** ***** *** *
2020-01-31 08:40:36 +01:00
2019-12-23 14:49:45 +01:00
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
2019-12-25 23:19:55 +01:00
Update node-RED interface
=========================
2019-12-25 23:22:05 +01:00
To update the interface, you can just download the lastest .json file:
2019-12-25 23:19:55 +01:00
::
wget -P $HOME/.node-red https://raw.githubusercontent.com/tpollina/PlanktonScope/master/scripts/flows_planktonscope.json
2020-02-01 20:03:27 +01:00
Share WiFi via Ethernet
=======================
At this link : https://www.instructables.com/id/Share-WiFi-With-Ethernet-Port-on-a-Raspberry-Pi/