Leosac  0.8.0
Open Source Access Control
Installation Guide (part 1): Raspbian

Installation guide

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.


  1. A pico-pc (and a SD card).
  2. An I/O extension board
  3. A Wiegand card reader.
  4. A Door.


  1. A SD card with a dumped Raspbian image.
  2. Leosac and all its dependencies

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.

Getting Started

There is 2 thing to make sure before installing Leosac:

  1. You have an updated system. Run apt-get update && apt-get upgrade to make sure of this.
  2. The SPI kernel module is installed. The PifaceDigital card needs this module to work.
    On Raspbian you can turn it on using raspi-config --> Advanced Options --> SPI.
    Otherwise you can try to manually load the module: modprobe spi_bcm2708.

Installing Leosac

You have your first choice to make:

  1. Building from source.
  2. Using the provided .deb package.

From Source

If you chose to build from source, follow Building Leosac. Note that building on Raspberry Pi will take quite a while

Debian Package

See Build and install Debian package

Basic Configuration

Okay, so we now have Leosac installed. It needs to be configured before being useful. Below is a base configuration file:

<?xml version="1.0"?>
<!-- Specific module configuration -->


  • 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).
  • For modules:
    1. The name is at your discretion, but it make to use something close to the shared library file.
    2. file is the name of the shared library (.so) file.
    3. level is the order of module loading. The closer to 0 it is, the sooner the module will be load.
    4. module_config is for per-module specific configuration information.


Adding modules

We need a few modules to make thing works:

  • We also need the wiegand module to interact with the card reader.
  • The file auth module will be used to grant (or deny) access after receiving data rom the card reader. This module will also store our card and time slice configuration.
  • Last but not least, we need the doorman module to react to an authentication attempt.

We will do this step by step, as modules configuration will depends on our hardware.

Configure the Wiegand module

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.

Configure the auth-file module

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".

<!-- Has full access on monday and sunday -->

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.

Configuring 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.

Hardware specific configuration examples

Select an installation guide labeled part 2 from Guides.