Giter Site home page Giter Site logo

benjefferies / gogo-garage-opener Goto Github PK

View Code? Open in Web Editor NEW
44.0 5.0 5.0 15.95 MB

Go implementation of a Raspberry Pi garage door opener

License: GNU General Public License v3.0

Go 81.06% JavaScript 7.14% HTML 9.57% HCL 1.44% Shell 0.79%
garage automation raspberry-pi google-assistant google-actions home-automation

gogo-garage-opener's Introduction

Build Status

gogo-garage-opener

Go implementation of a Raspberry Pi garage door opener

Features

Open garage door using an app

Garage Opener on Play Store (source)

Use one time pin

To use a one time pin go to http://localhost:8080/user/one-time-pin/abcd1234. The pin at the end is the generated pin, once the open button has been pressed the pin will be marked as used.

Open garage door notification

The application can be configured to notify users which have accounts via their email address if the garage door has been left open for a configurable period. The CLI argument -notification=15m configures the app to notify all users if the door has been left open longer than the configuration duration. It uses AWS SES as an SMTP service for sending the emails. To configure the application to use your SES account you will need to set the environmental variables $AWS_ACCESS_KEY_ID, $AWS_SECRET_KEY and $AWS_SES_ENDPOINT environmental variables. See go-ses

Autoclose

Auto close the door if it's left open between 10PM and 8AM.

Guide

Prerequisites

To build

Look to Dockerfile for the latest instructions for building

Auth0 Setup

Authentication has been setup using Auth0. More details can be found here

Running

The easier way to use gogo-garage-opener is by using the docker image built on every commit

  1. Clone this repo on the raspberry pi
  2. Update .env
    • AWS_ACCESS_KEY_ID is your AWS access key used for sending email notifications
    • AWS_SECRET_KEY is your AWS secret key used for sending email notifications
    • AWS_SES_ENDPOINT is the SES endpoint used for sending email notifications (more information https://aws.amazon.com/getting-started/tutorials/send-an-email/)
    • AS is the domain of the authorisation server
    • RS is the domain of the resource server (domain set for API in) and used in Caddy (reverse proxy
    • RELAY the pin number used to toggle the relay
    • SWITCH the pin number used to read from the contact switch
  3. Run the application docker-compose up -d

Hardware

I will describe how to set up your Raspberry Pi and the peripherals referring to the GPIO pins set up my Raspberry PI. Check that they are the same for your version. GPIO documentation

Wiring up the relay

  1. Connect up a (black) GPIO wire to pin 2 which is a 5v output
  2. Connect up a (white) GPIO wire to pin 6 which is a ground
  3. Connect up a (grey) GPIO wire to pin 18 which is a GPIO pin. This will be used in "out" mode to toggle the relay
  4. Connect up the (black) 5v output GPIO pin 2 wire to the VCC on the relay
  5. Connect up the (white) ground GPIO pin 6 wire to the GND on the relay
  6. Connect up the (grey) GPIO pin 18 wire to IN1 on the relay
  7. Connect the positive from the garage door to the NO1 connector on the relay
  8. Connect the negative from the garage to the COM1 connector on the relay

It should now look like the images below

Pins right view Relay switch Relay switch garage door opener wires Garage door opener wiring

Wiring up the magnetic switch

  1. Fix the magnet to the garage door
  2. Fix the sensor to the garage door frame
  3. Connect up a (brown) GPIO wire to pin 15 which is a GPIO pin. This will be used in "in" mode to read from the sensor
  4. Connect up a (red) GPIO wire to pin 9 which a ground
  5. Connect up the (red) ground GPIO pin 9 wire to a terminal strip on the breadboard
  6. Connect up the (brown/blue) GPIO pin 15 wire to a different terminal strip on the breadboard
  7. Connect one wire of the magnetic switch to the terminal strip for GPIO pin 9 and the other to the terminal strip for GPIO pin 15

Pins left view Breadboard with magnetic switch wiring

Future

  • Open garage door via location i.e. Automatically open garage within 100 metres of your garage. I have found a nice way to do this using Automate.

gogo-garage-opener's People

Contributors

benjefferies avatar dependabot-preview[bot] avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gogo-garage-opener's Issues

Docker error : exec format error

Hi!
I wanted to do this projet and saw yours so why not use it instead. So I've installed docker on my raspberry pi. I test that it works with this command :
docker run armhf/hello-world
and it works great.
Now I have build your project with the instructions you have mentionned. If I do docker images, here's the result :

REPOSITORY                   TAG                 IMAGE ID            CREATED             SIZE
gogo-garage-opener-builder   latest              ef2e6b2124b2        30 minutes ago      674.6 MB
golang                       1.7                 7afbc2b03b9e        3 weeks ago         674.6 MB
hello-world                  latest              48b5124b2768        5 weeks ago         1.84 kB
armhf/hello-world            latest              d40384c3f861        5 months ago        1.636 kB

When I want to run the docker image, I get this error :

$ docker run --rm -v "$PWD":/go/src/gogo-garage-opener -w /go/src/gogo-garage-opener gogo-garage-opener-builder:latest
exec format error
docker: Error response from daemon: Cannot start container dd4174ace6b5c628190bb919e7c01549b9990ff3f63152151740062ca06fe870: [9] System error: exec format error.

Seems like the image has not been build for the good architecture. Any idea how I could resume this?

Thank you!
Mathieu

Dependabot can't resolve your Go dependency files

Dependabot can't resolve your Go dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:


If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Revoke one time pins

As a garage Opener user I want to be able to revoke one time pins so that if I am in to take a delivery I can revoke the access bin held by a delivery person

Unable to authenticate

After creating a uaer with the command line, I am unable to authenticate through the garage door opener ui android app after having entered the right credentials.

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.