greensopinion / irrigatalizer

Software for driving an irrigation schedule from a Raspberry Pi.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About

This project provides a NodeJS application for operating a Raspberry Pi that drives an irrigation system via GPIO pins, with two major components:

  1. A web UI for configuring an irrigation schedule
  2. A scheduler that turns GPIO pins on and off

Status

This project is in the early stages. Lots of features are missing.

Continuous Integration: CI

Related

There are several related projects out there, most of which are more mature, have more features and are better supported:

Application

Configuration

The irrigation schedule can be configured using a web browser. Normally this would occur over WiFi by having your computer or phone on the same wireless network as the Raspberry Pi.

Schedule

Schedule

Click on the schedule to add or remove a scheduled watering:

Schedule

Dashboard

Dashboard

Start

$ node index.js
Server listening on port 8000...

It's recommended to use a NodeJS process management system to ensure that the process runs as a daemon. Examples are pm2 and forever.

Start Development Mode

Development mode rebuilds the application when files are changed, to enable quick experimentation.

$ npm run start-dev
Server listening on port 8000...

Pi Setup

NodeJS 12

Follow Debian instructions here: github.com/nodesource/distributions

Daemon and Process Management

Install pm2:

sudo npm install pm2 -g
pm2 startup

Follow pm2 instructions to setup pm2 to start with systemd

Configure pm2

pm2 start index.js --name irrigatalizer

Handy pm2 Commands

pm2 ls
pm2 stop irrigatalizer
pm2 start irrigatalizer
pm2 save
pm2 monit
pm2 logs

Networking

Firewall and Port 80

Redirect port 80 to port 8000 so that root access is not needed:

sudo iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8000

Also see saving-iptables-firewall-rules-permanently to have that stick on reboot.

SSH

Raspberry Pi SSH Setup

License

Copyright 2020 David Green

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Software for driving an irrigation schedule from a Raspberry Pi.

License:Apache License 2.0


Languages

Language:JavaScript 63.4%Language:Pug 18.2%Language:SCSS 15.8%Language:CSS 1.4%Language:Shell 1.2%