Skip to content

Setup and Install

Kyriakos Giannakis edited this page Aug 20, 2017 · 2 revisions

Install:

  1. git clone --recursive https://github.com/kerk12/PiLock

  2. Follow the hardware configuration guide, in order to set up your components for the project.

  3. Run the first setup script as root. This will install all the required stuff including apache, wsgi, pip, along with all the required python libraries needed for the server to function. This creates a directory to the default apache working directory and copies everything there.

cd PiLock
chmod 777 setup_apache.sh
sudo ./setup_apache.sh

When done, a new SSL certificate, along with its private key will be generated and stored within /etc/apache2/ssl. You will need to connect it with apache. See here for more.

  1. Now run the wsgi setup script as root. This will copy the wsgi configuration file to the main apache configuration folder.
chmod 777 setup_wsgi.sh
sudo ./setup_wsgi.sh

It will also initialize the default database used by the server, create a new superuser (used when managing the server with the admin CP) and last but not least, will add the user www-data to the dialout group. This is needed for accessing the Serial Port of the RPi.

  1. Your system will now be restarted.

  2. After your system has restarted, navigate to:

https://<your_rpi_ip>

You should see an SSL warning on your browser. Allow it (we are using a self-signed certificate so this is to be expected).

If you see some JSON output, then the server has been configured correctly and is up and running.

  1. Check if the switch is working. Navigate to /var/www/PiLock/main/PiLockUnlockScripts/ and run the unlock script once:
python unlock.py

If the relay clicks, then you're all set! Great job 👍 !

  1. You can continue with the installation by setting up the app.
Clone this wiki locally