- Want to see the system in action? Watch this video:
List of components:
- Raspberry Pi 3 or greater
- Arduino Uno
- Protoboard
- Relay 1
- Relay 2
- Moisture Sensor
- Water Pump
- USB Camera
- Jumper Wires
[WARNING] The following instructions were done in a Arduino Uno
-
Install the Arduino IDE in your computer
-
Connect your Arduino Uno via USB to your computer
-
Copy the code located here and upload it to your Arduino Uno
- For a step by step tutorial on how to upload code to your Arduino watch: https://www.youtube.com/watch?v=y5znFDmY5V4&ab_channel=talofer99
[WARNING] The following instructions were done in a RaspberryPi 3
-
Open the terminal inside your Raspberry Pi
-
Update your Raspberry Pi
sudo apt update
-
Install NodeJS 10 or greater:
- Follow the steps here
-
Install the Go lang compiler:
- Follow the steps here
-
Install GoCV:
- Follow the steps here
-
Create a
workspace
folder:mkdir ~/Desktop/workspace
-
Navigate to the
workspace
folder:cd ~/Desktop/workspace
-
Clone this repository:
git clone https://github.com/RaspberryPiPlantMonitor/backend
-
Navigate inside the
backend
folder:cd ~/Desktop/workspace/backend
-
Install project dependencies:
go mod tidy
-
Navigate back to the
workspace
folder:cd ~/Desktop/workspace
-
Clone the frontend repository:
git clone https://github.com/RaspberryPiPlantMonitor/frontend
-
Navigate inside the
frontend
folder:cd ~/Desktop/workspace/frontend
-
Build the
frontend
code and move thebuild
directory to thebackend
foldernpm install
npm run build
mv ~/Desktop/workspace/frontend/build ~/Desktop/workspace/backend/build
-
Navigate back to
backend
:cd ~/Desktop/workspace/backend
-
Change the
~/Desktop/workspace/backend/.env
file with the setting you desire
-
Install ngrok
sudo apt install unzip
cd ~/Desktop
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip
unzip ngrok-stable-linux-arm.zip
-
Run
ngrok
:nohup ./ngrok http 8080 > ngrok.log &
-
Navigate to
backend
folder:cd ~/Desktop/workspace/backend
-
Run the server:
nohup go run main.go fifo.go > ngrok.log &
-
Check your ngrok endpoint by doing:
curl http://localhost:4040/api/tunnels
- Copy the
public_url
url. It starts withhttps
-
Check server logs:
tail -f ~/Desktop/workspace/backend/ngrok.log
-
Check your
nohups
jobs by running:jobs -l