Bluetooth server application intended for opening garage doors with bluetooth enabled phones or devices. Implemented in python 3.
- Raspberry Pi 3 Model B
- Waveshare RPi Relay Board
- Some wires
- Camera Module V2
- A push button
Garagepi requires:
- bcm2835
- wiringPi
- More (in requirements.txt)
First, clone the repo
git clone https://github.com/Eliasin/garagepi.git
To install wiringPi
sudo apt install wiringpi
To install bcm2835
- Download the latest version of the library from here
- 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
As an interface to AWS, boto3 requires the user to provide credentials. Instructions can be found here.
Since sdptool is broken in BlueZ 5, to run the garagepi server, you must use a workaround.
Edit the file
/etc/systemd/system/dbus-org.bluez.service
and change
ExecStart=/usr/lib/bluetooth/bluetoothd
to
ExecStart=/usr/lib/bluetooth/bluetoothd --compat
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: 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)
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.
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.
- Refactor and cleanup