Skip to content

RaspberryPiPlantMonitor/backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plant Monitor System

Demo video

  • Want to see the system in action? Watch this video:

Plant Monitor System Video

Circuit Diagram

circuit_setup

List of components:

Arduino Setup

[WARNING] The following instructions were done in a Arduino Uno

Raspberry Pi Setup

[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 the build directory to the backend folder

    • npm 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

Running the Raspberry Pi server

  • 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 with https

Extra commands

  • Check server logs:

    • tail -f ~/Desktop/workspace/backend/ngrok.log
  • Check your nohups jobs by running:

    • jobs -l

Releases

No releases published

Packages

No packages published