Skip to content

danofsteel32/garage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Garage

Uses a HC-SR04 ultrasonic distance sensor hooked up to a Raspberry Pi Zero WiFi to monitor whether my garage door is open. I made this so I don't have to turn around after leaving my house to check if I remembered to close the garage.

Written in python using the Quart framework.

  • X-Api-Key header to prevent randos from posting fake data to my server
  • SSE (server sent events) for live updates

TODO

  • Remove all assumptions from deployment
  • Generate ./config/garage-env based on .env
  • Maybe send text message when opened
  • Table of past open events
  • Script for downloading new versions of htmx

Develop

Deploy

Assumptions
  • .env exists and has the Env vars PI_USER,PI_SSH_HOST,SERVER_USER,SERVER_SSH_HOST set
  • Raspi GPIO libs and python3-httpx are installed on the pi
  • SERVER_USER exists on SERVER_SSH_HOST
  • loginctl enable-linger SERVER_USER
  • ./config/garage-env exists and has the Env vars GARAGE_API_KEY
Sensor

./run.sh deploy-sensor

  • Copy sensor.py and it's systemd service and environment files to the raspberry pi
  • Stop and reload systemd service
  • check status
Server

./run.sh deploy-server does the following:

  • Build .whl file for the garage package
  • Copy the .whl file and it's systemd service/env files to my VPS
  • Stop garage-server.service systemd service
  • Clean up any previous virtual environments
  • Create fresh venv
  • Install build deps (wheel, setuptools) and .whl package into venv
  • Load new service files systemctl daemon-reload
  • Start garage-server.service
  • Check status of garage-server

About

Small webpage to tell me if my garage is open

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published