Git Product home page Git Product logo

greenpithumb's Introduction

GreenPiThumb

Build Status Coverage Status

GreenPiThumb is a program that automatically waters a plant based on soil moisture levels, and records and displays the following:

  • Ambient temperature
  • Ambient humidity
  • Ambient light
  • Soil moisture level
  • Photographs of the plant

Installation

Standard Installation

Run this on a Raspberry Pi device:

sudo apt-get update
sudo apt-get install build-essential python-dev python-picamera
git clone https://github.com/adafruit/Adafruit_Python_DHT.git
cd Adafruit_Python_DHT
python setup.py install

cd ..
git clone https://github.com/JeetShetty/GreenPiThumb.git
cd GreenPiThumb
sudo pip install -r requirements.txt
cp greenpithumb/wiring_config.ini.example greenpithumb/wiring_config.ini

Running GreenPiThumb

After running the above installation steps on your Pi, run GreenPiThumb with a command following the template below:

sudo python greenpithumb/greenpithumb.py \
  --poll_interval 15 \
  --photo_interval 240 \
  --sleep_window "23:15-07:00" \
  --sleep_window "14:30-15:45" \
  --image_path "images/" \
  --moisture_threshold 900

Dev Installation

Run this on a system for development:

sudo apt-get update
sudo apt-get install build-essential python-dev
git clone https://github.com/adafruit/Adafruit_Python_DHT.git
cd Adafruit_Python_DHT
sudo python setup.py install --force-test

cd ..
git clone https://github.com/JeetShetty/GreenPiThumb.git
cd GreenPiThumb
sudo pip install -r requirements.txt
sudo pip install -r dev_requirements.txt
cp greenpithumb/wiring_config.ini.example greenpithumb/wiring_config.ini

Ansible Installation

This repository contains the GreenPiThumb backend, but GreenPiThumb also offers a web frontend so you can check status of GreenPiThumb in your browser.

The instructions below explain how to install all backend and frontend components of GreenPiThumb to a Raspberry Pi device.

Local Self-Provision

If you're not familiar with Ansible, the simplest way to deploy GreenPiThumb is to install Ansible on the Pi itself and then use Ansible to self-provision the machine.

From a shell on the Raspberry Pi device itself, enter the following:

sudo apt-get update

# Install Ansible and dependencies
sudo apt-get install -y \
  libffi-dev \
  libyaml-dev \
  libpython2.7-dev \
  libssl-dev \
  python-pip \
  python2.7-dev
sudo pip install ansible paramiko PyYAML Jinja2 httplib2 six

# Install the Ansible GreenPiThumb role
sudo ansible-galaxy install JeetShetty.ansible-role-greenpithumb

# Create a minimal Ansible playbook to install GreenPiThumb
echo "- hosts: localhost
  roles:
    - { role: JeetShetty.ansible-role-greenpithumb }" > install.yml

# Self-provision for GreenPiThumb
sudo ansible-playbook install.yml

After this process completes, GreenPiThumb's backend and frontend will be running as services on the Pi. If you navigate to the Pi in a web browser (e.g. http://raspberrypi/ for a Pi named raspberrypi), you will see a dashboard similar to greenpithumb.mtlynch.io.

Remote Deployment

You can also use Ansible to deploy GreenPiThumb to a Raspberry Pi device from another Linux machine on the same network. You'll need to install Ansible on your deployment machine (the non-Pi system).

Run the following commands on a Linux machine that has network access to your Pi device (e.g. on same local network):

PI_USER=pi                 # Change to the user on your Pi
PI_HOSTNAME=raspberrypi    # Change to your Pi's hostname.

# Install the Ansible GreenPiThumb role
sudo ansible-galaxy install JeetShetty.ansible-role-greenpithumb

# Create a minimal Ansible playbook to install GreenPiThumb
echo "- hosts: all
  roles:
    - { role: JeetShetty.ansible-role-greenpithumb}" > install.yml

# Provision the Pi using the playbook.
ansible-playbook install.yml \
  --user "${PI_USER}" \
  --ask-pass \
  --ask-sudo-pass \
  --become \
  --become-method sudo \
  -i "${PI_HOSTNAME},"

Ansible will prompt you for a password. Enter the password for the PI_USER account.

After this process completes, GreenPiThumb's backend and frontend will be running as services on the Pi. If you navigate to the Pi in a web browser (e.g. http://raspberrypi/ for a Pi named raspberrypi), you will see a dashboard similar to greenpithumb.mtlynch.io.

Hardware

GreenPiThumb is designed for compatibility with a Raspberry Pi device running the Raspbian OS.

An example wiring can be found below:

Fritzing wiring diagram

The Fritzing diagram file for this diagram is available in the doc folder.

Related Repositories

greenpithumb's People

Contributors

mtlynch avatar jeetshetty avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.