Leosac  0.8.0
Open Source Access Control
Module: Piface Digital GPIO

Explain how to use the Piface board as a GPIO backend.

PifaceDigital Module Documentation


Documentation for the PifaceDigital module. This provide support for using the PifaceDigital device as a GPIO controller. This can be very handy because it eases wiring.

This module requires that the Linux Kernel Module SPI be enabled. You can do this through raspi-config on Raspbian.

Configuration Options

See below for various configuration options.

Options Options Description Mandatory
use_database If true, use database-backed configuration. NO (defaults to false)
gpios GPIOS definitions YES
—> name A name for the GPIO device YES
—> no The GPIO number of the piface. Range from 0 to 7 YES
—> direction Direction of the PIN. in or out YES
—> value Only for out PIN. The default value of the PIN YES for output pin
—> hardware_address Address of the physical pfdigital. NO (defaults to 0)


  • If use_database is true, the module will expose its configuration API over websocket (provided that a Websocket module is available). All other XML configuration option are ignored.
  • value is a boolean. It's only for output GPIO and represents the default value.
  • hardware_address is used when there are multiple pifacedigital connected to the PI. When there is only 1 piface device, its hardware address is 0.

Database Configuration Notes

It is not possible to mix both database configuration and XML configuration. If the XML configuration set use_database to true, then all other XML configuration values are ignored.

When configuration is updated (create/update/delete gpio objects) is not loaded by the module. Restarting Leosac is required to apply new configuration.

XML Config Example

<!-- Prepare GPIO for our Wiegand reader -->