-
Notifications
You must be signed in to change notification settings - Fork 0
4 Installation
You can clone the Git project with the following command:
git clone https://github.com/alknopfler/alkalarm.git
If you want oauth and alexa -> the release is 3.x.x but now is on testing internally If you want just the easy alarm environment -> the stable release is v.2.3.2 To use this release (git checkout v.2.3.2 once clone repo in your local)
This will download the latest version of the project into a folder with the name alkalarm (you can define this folder as additional argument to the git clone e.g.: git clone ). This won't be the final installation location, so you can clone it, for example, in your home directory.
If you don't have git installed you can install it using your distributions package manager (e.g.: on Raspbian apt-get install git).
The distribution of directories and the meaning of all of them inside the project:
-
./api/: This is the main directory for the API server listening in :8080 -
./webinterface/: This directory contains the web inteface files. There are static files, style css files, and javascript files -
./scripts/: This is an auxiliary directory with the discoverCode script in order to discover new sensors/controllers -
./examples/: This dir contains the Json examples in order to register new sensors, control, mail, as well as the curl command to do that directly using the API server. -
./config/: This directory contains the main configuration and the database schemes and tables creation command. - Main Modules:
-
./alarms/: This directory contains the functions to create, delete and query all the alarms registered once triggered by a sensor. -
./control/: This directory contains the functions to create, delete, and query the remote controllers -
./database/: This directory contains the operation with the database. This one will be called by the other modules. -
./kernel/: This is the main directory that contains the alarm algorithm as well as the notification functions used by the system. -
./mailer/: This directory contains the functions to be able to send emails -
./sensors/: This directory contains the functions to create, delete and query all the sensores available. -
./states/: This directory contains all the functions to operate with the global state for the alarm system.
-
Into the main folder you could find:
-
./install.sh: Installation script (the first point of contact to create a new installation) -
./alkalarm.go: This is the main alkalarm exec go program integrated with systemd:-
./alkalarm: Exec binary which will be executed by systemd after the installation phase -
./alkalarm.service: This is the systemd file to convert into a system daemon -
./alkalarm-webserver.service: This is the systemd file to convert the webserver into a system daemon
-
-
./30-alkalarm.conf: Rsyslog config file to redirect all events to a specific file with logrotate feature included. -
./_433.py: This is the python file which will be dedicated to snif the new codes into the alarm system.
After clonning the project you could run the install.sh script as root (maybe using sudo -s):
@raspberrypi:~/alkalarm# ./install.sh
The script will cover the next steps:
- Installing package and dependencies. You don't have to keep in mind nothing else
- Creating the folders for the project (/opt/alkalarm by default)
- Copy the python script and the binary
- Installing the web server and copy the binary to the project directory
- Installing the alarm binary and copy it to hte project directory
- Configure the SMTP account (just works for hotmail -> smtp-mail.outlook.com:587) and password in order to send the notifications by email. Also you have to configure the access password required in the webserver.
- Enabling the systemd services for all modules implicated
- Configure the log system.
- Starting all the services. After all steps, you should have access to:

After the installation the next resources will be available:
WebInterface: http://<localhost/ip/dns>/
API server: http://<localhost/ip/dns>:8080/
If you need to reinstall for some issues, you have to clear the previous installation doing:
systemctl stop alkalarm
systemctl stop alkalarm-webserver
rm -fr /opt/alkalarm
rm -fr /var/log/alkalarm
rm -fr /var/tmp/alkalarm