Skip to content
master
Switch branches/tags
Code
This branch is 427 commits ahead, 52 commits behind Rimco:master.
Contribute
Fetch upstream

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
api
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ssl
 
 
 
 
web
 
 
 
 
 
 
 
 
 
 
 
 

OSPy

Open Sprinkler Python

OSPy is a free Raspberry Pi based Python 2.7 (no support for python 3 yet) program for controlling irrigation systems (sprinkler, drip, IoT, etc). This is my fork from Rimco/OSPy and Dan-in-CA/SIP with My modifications.

More information visit

Pihrt.com and OpenSprinkler

YouTube OpenSprinkler channel

Hardware diagram

Multisensor ESP32



Sensors by Pihrt.com

INSTALLATION:

Operating system (Debian >= 9) for Raspberry Pi

  1. Install latest operating system: "Raspbian Buster or next new version - with desktop and recommended software" https://www.raspberrypi.org/downloads/raspbian/
  2. Change password for acces from "raspberry" to own
  3. Enabling in raspi-config SSH, I²C
  4. Install OSPy using Git

Setup

A setup file has been provided to help you setting up your environment to contain all required packages. This setup also helps you in case you want to run the program as a service (on Raspbian). Go to the folder where the setup.py file is located (cd OSPy)

Execute:

sudo apt-get update

and follow the procedures

sudo apt-get upgrade

and follow the procedures

sudo python setup.py install 

and follow the procedures of the script

Preferred option (using Git)

(This option does support automatic updating.) Ensure git is installed (and the git executable is in your path) Use git to clone:

git clone -b master https://github.com/martinpihrt/OSPy

Next use step "Setup"

Manual OSPy-system update

Uusing Git, without system update plugin if plugin not work. Go to the folder where the run.py file is located (cd OSPy)

Execute:

sudo git config core.filemode false
sudo git reset --hard
sudo git pull

Second option (without Git)

(This option does not support automatic updating.)

  1. Download a copy of the program from Github
  2. Extract the contents to a location of your choice

For enable SSL access in options (for HTTPS connections)

For using "https" in OSPy options you must follow these procedures. SSL certificate via Let’s Encrypt certification authority. The Certbot and Let’s Encrypt for enabling SSL security.

Execute:

sudo apt-get install certbot
certbot --version
sudo certbot certonly --standalone -d your_domain_name
sudo certbot renew
sudo cp /etc/letsencrypt/live/your.domain.com/fullchain.pem /home/pi/OSPy/ssl
sudo cp /etc/letsencrypt/live/your.domain.com/privkey.pem /home/pi/OSPy/ssl
sudo service ospy restart

Notice: Before starting the certification service, make sure that you have correctly configured your NAT network router (redirecting external port 443 to Raspberry Pi's internal IP address 80 for certification service.) After the certificate is generated, it is necessary to route your port to the OSPy port in the router (the default OSPy port is 8080). The certification service is trying to use a connection using IP version 6. If we do not use IPV6 (we do not have a router set for IPV6, or do not want to use IPV6 for any other reason), we must disable the use of IPV6 addreses in Raspberry Pi!

sudo nano /etc/modprobe.d/ipv6.conf

Add to file.

alias net-pf-10 off
options ipv6 disable_ipv6=1
blacklist ipv6

And next restart.

sudo reboot

If "Use Own HTTPS access" is selected in OSPy options, file: fullchain.pem and privkey.pem must You insert to folder ssl in OSPy location. For manual generating certificate example:

cd ssl  
sudo openssl req -new -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -out fullchain.pem -keyout privkey.pem  

Warning: OSPy must be next restarted.

For enable I²C device (I²C LCD plugin and more I²C plugins)

Execute:

sudo raspi-config

and follow enabling I²C bus

sudo reboot

and reboot OS system

For translate OSPy to other language

The OSPy system is currently in three languages: English, Czech, Slovak. For other languages and step by step, how to use is typed in MD file Any user who joins the "OSPy" project is welcome! Translation of strings into other languages is not demanding (using the Poedit)

Changelog and Issues

Help with to user web Interfaces

Communication with other systems

OSPy can be controlled and monitored using HTTP GET commands. With the addition of available plugins OSPy can communicate with other systems via MQTT. OSPy can also issue Linux shell commands when a station is turned on or off. This is useful for controlling wireless remote devices and for I²C relay hats and boards. The Blinker package that is shipped with OSPy sends messages to other Python modules such as plugins to report changes in status. See the signaling examples file in OSPy's plugins folder for examples.

Sensors

OSPy allows to read data from wireless sensors (ESP32, ESP8266...) Docs

Remote Controller for OSPy based on M5stick-C

This controller allows you to select a program stored in the OSPy on the LCD display and start it with the button. The controller is connected to the home Wi-Fi network. We do not even need a mobile phone or a computer to quickly select programs. We will use this miniature controller. Docs

License

OpenSprinkler Py (OSPy) Interval Program Creative Commons Attribution-ShareAlike 3.0 license

Acknowledgements

The program makes use of

  1. Webpy for the web interface.
  2. Python markdown2 to render the help and readme pages written in markdown.
  3. Pygments to provide syntax highlighting in the help pages.
  4. OpenStreetMap to convert locations into coordinates.
  5. Dark Sky API for weather information.
  6. Blinker package that is shipped with OSPy sends messages to other Python modules such as plugins to report changes in status.
  7. Arduino ESP32, Atmega328 and more HW boards pro OSPy aditional sensors, water tank monitor...

About

A highly cusomizable DIY timer/controller based on Raspberry Pi

Resources

Releases

No releases published

Packages

No packages published