Skip to content

Bluetooth server built in python 3 for opening garage doors.

License

Notifications You must be signed in to change notification settings

Eliasin/garagepi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

garagepi

Bluetooth server application intended for opening garage doors with bluetooth enabled phones or devices. Implemented in python 3.

Parts

Facial Verification

Dependencies

Garagepi requires:

  • bcm2835
  • wiringPi
  • More (in requirements.txt)

Installation

Installing Dependencies

First, clone the repo

git clone https://github.com/Eliasin/garagepi.git

To install wiringPi

sudo apt install wiringpi

To install bcm2835

  1. Download the latest version of the library from here
  2. Follow the instructions given on the page

To install pip libraries (You may want to use a virtualenv):

cd garagepi
pip3 install -r requirements.txt

Configuring boto3

As an interface to AWS, boto3 requires the user to provide credentials. Instructions can be found here.

Workarounds

Since sdptool is broken in BlueZ 5, to run the garagepi server, you must use a workaround.

Running the bluetoothd daemon in compatibility mode:

Edit the file

/etc/systemd/system/dbus-org.bluez.service

and change

ExecStart=/usr/lib/bluetooth/bluetoothd

to

ExecStart=/usr/lib/bluetooth/bluetoothd --compat

Changing sdp permissions:

Run

sudo chmod 777 /var/run/sdp

Note: This will have to be run every time the pi restarts, so you may want to put it in rc.local.

Usage

usage: garagepi.py [-h] [--keyfile KEYFILE] [--face]
                   [--trusted_faces TRUSTED_FACES | --bucket BUCKET BUCKET]

optional arguments:
  -h, --help            show this help message and exit
  --keyfile KEYFILE     path to keyfile
  --face                enable facial verification
  --trusted_faces TRUSTED_FACES
                        path to trusted faces (implicity adds --face)
  --bucket BUCKET BUCKET
                        AWS S3 bucket name and object pair for trusted faces
                        (implicity adds --face)

Wiring

Garagepi is intended to be used for opening garage doors that are controlled by simply completing a circuit, though it could be used for anything that requires the quick toggling of a relay remotely.

On any garage door opened like this there should be two connection points on the back for wires to be connected. Simply wire one of these points to each point on the relay channel 1, one to the middle and one to the normally closed point. Relay Wiring Example

Facial Verification

The button used to trigger the camera module should be wired to pin 16 (board notation) and a ground pin. If pin 16 is unavailable for use, feel free to change the definition of button_input_pin in the main source file.

Planned Features

  • Refactor and cleanup

About

Bluetooth server built in python 3 for opening garage doors.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages