Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
This page will guide you through a basic setup of a Leosac generic board connected with a R10 card reader from HID.
What you will need:
- A debian based board (Raspbian ...)
- R10 RFID card reader
- A breadboard with a few cables and resistors
1. Install Leosac
First, make sure you have installed all the dependencies:
sudo apt-get install build-essential cmake git libtclap-dev libboost-dev
Also make sure g++ version is recent enough (4.8 or above).
If not, that probably means you're still under wheezy or older. See this tutorial
Then you can follow instructions on this page for a standard install.
Copy the example configuration in your working directory (don't forget to replace installdir)
cp -r installdir/share/leosac/cfg/basic . cd basic
The default configuration should be enough to get you up and running, but feel free to tinker a bit with these files. For more details take a look at the configuration section.
If you don't care about electronic and are looking for something that looks like an end-product, see hardware releases.
Note: A Wiegand reader will usually use +5V as its "high" voltage level.
This requires a RaspberryPi board with Raspbian installed. This introduction will not explain how to install Raspbian on your RaspberryPi, but plenty of tutorials are available on the web for that.
Use this pin-out and the diagram above to wire the reader.
The values on the resistors are not strictly fixed. As long as the ratio between the upper and lower resistor value is 1/2 for the voltage divider, the 5k resistor can be safely replaced with another in the range from 2k to 10k depending on what you have. If you only have 10k resistors, you could even put 2 in series to obtain 20k.
Do not forget to plug the reader on a 12V current source. 5V is also suitable if you don't have another choice but is less recommended.
The relay is used to control the door. Here it is materialized by a lamp for the sake of simplicity, but feel free to replace it by the mechanism you want to use to open the door, like an electric strike. If you really don't have this hardware now, you could also just left the controlled circuit open (just wire the GPIO), and you'll hear the relay click when the door is activated.
4. Start Leosac
To start, just execute this command:
sudo leosac -g hw.xml -f core.xml
Leosac is run as root solely for gpio access and network configuration (if specified).
5. Test it !
You can now place a badge in front of the reader and see if it is recognized and opens the door. You can manage authorized IDs via the
auth.conf file, Leosac will make sure to reload this file every time it changes.