Leosac
0.8.0
Open Source Access Control
|
This tutorial describes the full install process of Leosac on Raspbian. It will walk you through a complete install on a Raspbian system.
The goals of this tutorial is to end-up with a simple and working setup.
You'll have the ability to control a door. A card reader will read your input card, and Leosac (running on a pico-pc) will take care of orchestrating the whole thing.
Here is a list of requirements, both hardware and software. The hardware requirements hard requirements for this tutorial to work.
Note: Leosac will work with something else than Raspbian, but some steps may change. If you know what you are doing and are fluent with Linux you shouldn't have any problem following this guide even if you don't use Raspbian.
There is 2 thing to make sure before installing Leosac:
apt-get update && apt-get upgrade
to make sure of this.raspi-config
--> Advanced Options
--> SPI
.modprobe spi_bcm2708
.You have your first choice to make:
If you chose to build from source, follow Building Leosac. Note that building on Raspberry Pi will take quite a while
See Build and install Debian package
Okay, so we now have Leosac installed. It needs to be configured before being useful. Below is a base configuration file:
Explanations:
plugin_dir
is a folder use to try and find Leosac's dynamic libraries (aka modules). This path will NOT be search recursively.network
configure the network. Unless you need to, we recommend you leave it disabled and configure networking through your system utility (/etc/network/interfaces
or whatever you use).name
is at your discretion, but it make to use something close to the shared library file.file
is the name of the shared library (.so
) file.level
is the order of module loading. The closer to 0 it is, the sooner the module will be load.module_config
is for per-module specific configuration information.MAKE SURE YOU DONT USE THE SAME LEVEL
TWICE
We need a few modules to make thing works:
We will do this step by step, as modules configuration will depends on our hardware.
Now that our configured GPIO are available to the rest of the application, we can configure the module that will understand our Wiegand Card Reader.
We have 1 reader to configure, and we will use both INPUT pin: wiegand_data_low
and wiegand_data_high
.
As you can see, we are using wiegand_data_low
and wiegand_data_high
. These are usually GPIOs defined on a GPIO module. It will be defined on the dedicated. We assign them to our reader (MY_WIEGAND_1
). Note: Most wiegand card readers also have a green led and a buzzer than you can activate. We are not using them in this tutorial, we are leaving them out in the configuration.
In every access control system we need a component that is able to determine if an access should be granted or denied. This is what the auth file module is doing.
For this module we need a new configuration file, dedicated to this module only. This file will holds cards informations, group and user mapping and time slice informations.
Lets say this file is named "auth.xml".
For more information about the authentication and authorization config file, you can read this.
To enable this module, we also need to add something in the main configuration file. This something looks like this:
The <target>
match <door>
in the auth.xml
file. <auth_source>
is the name of the reader that will generate access attempt.
When an attempt is detect, this module will analyze it and either grant the access, or deny it. This response is then read by the doorman module.
At last, we need to react to those "grant access" or "deny access" from the auth module. In our scenario, we want to open the door for a few seconds when an access is successful. In case an access is failed, we do nothing. This is easy to do using the doorman module.
We are defining an action that will target my_door_gpio
and send the ON
command for 3000
ms.
Select an installation guide labeled part 2 from Guides.