GithubHelp home page GithubHelp logo

ashang / raspberrydog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from terence-deng/raspberrydog

0.0 1.0 0.0 128 KB

Watch dog for raspberry pi

License: MIT License

Makefile 5.74% Shell 19.89% M4 10.65% C 63.72%

raspberrydog's Introduction

Raspberry Dog

By Terence Deng

What it is

Watch dog for raspberry pi

  • shutdown raspberry pi when the 12th pin (GPIO 1/GPIO18) is set as high
  • reboot raspberry pi when the 13th pin (GPIO 2/GPIO27) is set as high

Build Requirements

Required:

  • wiringPi
  • apt-get install autoconf automake

How to get started

build.sh
./configure && make
make install
sudo raspberrydog

To shutdown the Raspberry Pi, you can connet 12th pin (GPIO 1/GPIO18) with 11th pin (GPIO 0/GPIO17)

+----------+-Rev2-+------+--------+------+-------+
| wiringPi | GPIO | Phys | Name   | Mode | Value |
+----------+------+------+--------+------+-------+
|      0   |  17  |  11  | GPIO 0 | OUT  | High  |   ----> 11th pin
|      1   |  18  |  12  | GPIO 1 | IN   | Low   |   ----> 12th pin
|      2   |  27  |  13  | GPIO 2 | IN   | Low   |   ----> 13th pin
|      3   |  22  |  15  | GPIO 3 | IN   | Low   |
|      4   |  23  |  16  | GPIO 4 | IN   | Low   |
|      5   |  24  |  18  | GPIO 5 | IN   | Low   |
|      6   |  25  |  22  | GPIO 6 | IN   | Low   |
|      7   |   4  |   7  | GPIO 7 | IN   | Low   |
|      8   |   2  |   3  | SDA    | IN   | High  |
|      9   |   3  |   5  | SCL    | IN   | High  |
|     10   |   8  |  24  | CE0    | ALT0 | High  |
|     11   |   7  |  26  | CE1    | ALT0 | High  |
|     12   |  10  |  19  | MOSI   | ALT0 | Low   |
|     13   |   9  |  21  | MISO   | ALT0 | Low   |
|     14   |  11  |  23  | SCLK   | ALT0 | Low   |
|     15   |  14  |   8  | TxD    | ALT0 | High  |
|     16   |  15  |  10  | RxD    | ALT0 | High  |
|     17   |  28  |   3  | GPIO 8 | IN   | Low   |
|     18   |  29  |   4  | GPIO 9 | IN   | Low   |
|     19   |  30  |   5  | GPIO10 | IN   | Low   |
|     20   |  31  |   6  | GPIO11 | IN   | Low   |
+----------+------+------+--------+------+-------+

Start it at boot time

cp scripts/debian/init.d/raspberrydog /etc/init.d/
update-rc.d raspberrydog defaults
service raspberrydog start

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.