GithubHelp home page GithubHelp logo

mthapa / garage-from-brent Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gitsuren/garage-from-brent

0.0 2.0 0.0 143 KB

little modified version of garage from brent

License: MIT License

JavaScript 79.22% HTML 20.78%

garage-from-brent's Introduction

Garage-node

This is the node.js app that is controlling my garage door openers via Raspberry Pi. To get the full details on my project check out my post on my blog.

Requirements

Install node.js and npm onto your Raspberry Pi.

[sudo] apt-get install nodejs npm

I recommend using forever to run your app so that it stays up.

[sudo] npm install forever -g

Installation

After checking out this code from Github, just run npm install from the app directory to install all dependencies.

Dependencies Used

I used pi-gpio over rpi-gpio because I liked the fact pi-gpio made use of GPIO Admin, allowing you to be able to control the gpio pins without being the root user. Couldn't get rpi-gpio to use that.

Configuration

In the root directory there is a file called config.js. In here you will find several variables that should be changed to work for your garage.

  • LEFT_GARAGE_PIN - Location of the gpio pin controlling the left garage door. Using the pin map from the pi-gpio README.
  • RIGHT_GARAGE_PIN - Same as above but for the right garage door.
  • RELAY_ON - Relay on state.
  • RELAY_OFF - Relay off state.
  • RELAY_TIMEOUT - How long the relay should stay on before turning off.

Gotchas

My particular relay I used turns on when you fire low 0, and off when firing high 1. The app them use the RELAY_TIMEOUT to simulate a half second press, as if you pushed the wall switch.

The Raspberry Pi defaults the GPIO pin to low, but the pin is default set to input so it will not immediately fire on bootup. On first call the pin is opened for output and immediately low which turns on the relay since it's in the low state and making the set low call redundant but the relay is set high in the next call so it will need to be set low again on the next call.

Todo

  • Error handling, currently there really is none.
  • Logging.

Parts

Links

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.