Giter Club home page Giter Club logo

pin-monitor's Introduction

pin-monitor

Monitor GPIO on Raspberry Pi and send an email when GPIO goes low.

I wrote this to because:

  1. I wanted to try writing something in Python
  2. because I wanted to build something on the Raspberry Pi.

Anyway, first program in Python so if I made some fundamental mistakes or if it looks awfully like C# in places, so be it.

Note: I tested this on Arch linux ARM

   After installing Arch on your SD card:
     1. pacman -Sy base-devel python pip
     2. pip install RPi.GPIO 
   
   You will also want to configure the NTP using timedatectl like so (using your time zone):
     1. timedatectl set-timezone Europe/Dublin
     2. nano /etc/ntp.conf
         server 0.ie.pool.ntp.org
         server 1.ie.pool.ntp.org
         server 2.ie.pool.ntp.org
     3. timedatectl set-ntp yes 

Using the RPi.GPIO library the service monitors a given pin on the Pi. When that pin goes low for more than 1 second then an email will be sent using the values obtained from a configuration file (pin-monitor.conf), i.e. host,sender,recipients etc. Depending on the use_camera value in the config file the email cam also include a JPEG from an IP camera which is attached to the email. The IP address of the camera is also taken from the config file as is the unique url used to request the JPEG. A sample pin-monitor.conf file is included in the repo and is called demo_pin-monitor.conf.

   To run the service copy the pin-monitor.service file into the /usr/lib/systemd/system directory as root and then type
     1. systemctl start pin-monitor
     2. systemctl enable pin-monitor (To have service start a boot)
     3. systemctl status pin-moniotr (to see if service is running and/or if it has thrown any errors)

pin-monitor's People

Contributors

vipx1 avatar

Watchers

 avatar James Cloos 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.