Skip to content

swheatma/garagedoor

Repository files navigation

garagedoor

Setup Raspberry Pi

  1. Install Raspian Download latest Raspian to your PC
  2. To enable SSH: create an empty file in the root os the SD card called "ssh" (no extension)
  3. To enable WiFi create a file called wpa_supplicant.conf Enter the following data:
	country=us
	update_config=1
	ctrl_interface=/var/run/wpa_supplicant

	network={
 	scan_ssid=1
 	ssid="MyNetworkSSID" #enter your network SSID
 	psk="Pa55w0rd1234"  #enter your Wifi password
	}
  1. Insert SD card into Raspberry Pi and boot up

  2. Connect to Raspberry Pi using ssh (ssh raspberrypi) username = pi password = raspberry

    Use ifconfig to find the ip addres of your raspberry pi

  3. Update the raspian OS

	$sudo apt-get update
	$sudo apt-get upgrade
  1. If you want to connect to raspberry pi using vnc, enable it in the configuration
$sudo raspi-config
  1. Set static IP address on Pi: Edit the file /etc/dhcpcd.conf $ sudo nano /etc/dhcpcd.conf Add the following lines to the end of the file: interface eth0 static ip_address=192.168.1.150 (or whatever address you want to use)

     interface wlan0
     static ip_address=192.168.1.151 (or whatever address you want to use)
    
     static routers=192.168.1.1 (the actual  address of your router)
    
  2. Reboot the raspberry pi to make the changes take effect

$sudo reboot

Steps to install Garage Door Program

  1. Install WebIOPi
	wget http://sourceforge.net/projects/webiopi/files/webiopi-0.7.1.tar.gz
    or download from: http://webiopi.trouch.com/DOWNLOADS.html
Unarchive and Install:
		$ tar xvzf WebIOPi-x.y.z.tar.gz
		$ cd WebIOPi-x.y.z
		$ sudo ./setup.sh
  1. Install Garage Door Controller: Go to the folder: /home/pi/Projects
              $ cd /home/pi/Projects
Copy the files from GitHub:
             $ git clone https://github.com/swheatma/garagedoor
        This will create a folder called garagedoor in the current folder.
	Notes:
		This should create the html and python sub-folders
		The root folder will contain the config file which will need to be copied as stated below
		The python folder will contain:
			garage.py (the garage controller program)
			script.py (the web interface program)
		The html folder contains index.html for the web interface

3. Copy config file to WebOIPi folder
      $sudo cp /home/pi/Projects/garagedoor/config-garage /etc/webiopi/config
4. Make the program executable:

	$ chmod +x /home/pi/Projects/garagedoor/python/garage.py
  1. To start Garage program at startup:
        Option-1:
		Add to LXDE-pi/autostart file
		Add the following line of text to the bottom of: /home/pi/.config/lxsession/LXDE-pi/autostart
		/home/pi/Projects/garagedoor/python/garage.py
	Option-2:
		Add to crontab
		Edit the crontab file
		$ sudo crontab -e
		add the following line:
		@reboot python /home/pi/Projects/garagedoor/python/garage.py &
		to add a delay before the program starts (recommended)
		@reboot sleep 20 && python /home/pi/Projects/garagedoor/python/garage.py &
  1. To start web service at startup:
	$ sudo update-rc.d webiopi defaults
  1. Access WebIOPi over local network Open a browser to http://raspberrypi:8000/ with any device of your network. Replace raspberrypi by its IP.

    Default user is "webiopi" and password is "raspberry"

Hardware Installation:

  1. Connect Door-1 Sensor between pin-11 (GPIO17) and Ground
  2. Connect Door-2 Sensor between pin-12 (GPIO18) and Ground
  3. Connect Door-1 output to pin-18 (GPIO24)
  4. Connect Door-2 output to pin-17 (GPIO-22)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published