leosac / access-control

Leosac Access Control - Open Source Physical Access Control System
https://leosac.com
GNU Affero General Public License v3.0
240 stars 40 forks source link

Help Configuring leosac #67

Closed Gbengat closed 8 years ago

Gbengat commented 9 years ago

I have a little confusion as to what file to edit inorder to show leosac where my config files are. I assumed that once installed on the pi it could be launched from any directory containing the configuration files. I have tried launching leosac with the command in the documentation 'leosac -g hw.xml -f core.xml' where I named my hw and core files 'auth.xml' and 'leosac.xml' respectively. However it tells me it can't find a match for the arguement. screenshot from 2015-08-04 12 36 18 I would really appreciate it if I could have a small demonstration or view some example working config files. I used the documentation to create my config files. Then I am using SYSFS_GPIO instead of the PIFACEDIGITAL_GPIO. In short I need a quick walk through from after the installation of leosac to launching the program with a simple configuration files.

xaqq commented 9 years ago

The hw file doesn't exist anymore. Hardware is fully configured through modules. The only configuration file you pass to Leosac is the core configuration file. It's given with -k.

The auth module will find it's configuration file on its own, because the path to this additional config file is specified in the core configuration file.

Could you use pastebin to upload your auth and core config file?

Gbengat commented 9 years ago

Oh ok, I pasted the code to gist. Here is my core file {% gist 684a6b19b39bc29965df gist.md %} and auth file {% gist 5dee3150bd3988762886 gist.md %}

xaqq commented 9 years ago

The core configuration is mostly correct, except the part where you configure the SYSFS gpio module. More info on the module SYSFS_GPIO: http://leosac.github.io/leosac/doc_output/develop/html/d2/d1b/mod_sysfsgpio_main.html

The configuration for the auth is also incorrect.

 <map>
            <user>Samuel Idowu</user>
            <WiegandCard>Sammy_Idowu</WiegandCard>
        </map>

WiegandCard should contain a card_id and bits field. See http://leosac.github.io/leosac/doc_output/develop/html/d0/d25/mod_auth_file_main.html#mod_auth_cred_wiegandcard

Gbengat commented 9 years ago

Oh ok, I'll change that now. So when I have all those fixed, I just execute leosac from the directory with my configuration file ie ./leosac -d ["Door_Locks" which is the directory where I have all my files] -k leosac.xml and it should run?

xaqq commented 9 years ago

Yes it should.

Gbengat commented 9 years ago

Thank you for your help. "./leosac" doesn't work so I just used "leosac" and it I'm getting the error below. screenshot from 2015-08-04 16 00 03

xaqq commented 9 years ago

Hum this is weird. Can you give me the following:

Gbengat commented 9 years ago
Gbengat commented 9 years ago
xaqq commented 9 years ago

I don't really know what is happening. After comparing your Leosac output to mine it looks like you are not using the version 0.6.0. I am saying this because the usage don't match mine.

Can you post the ouput of:

Gbengat commented 9 years ago

No its 0.4 Version: screenshot from 2015-08-04 19 03 10 Which leosac screenshot from 2015-08-04 19 03 47 I installed this one with the .deb package

xaqq commented 9 years ago

Well, I guess this is the explanation then. The leosac binary at /usr/local/bin/leosac is actually the result of your manual compilation and installation of Leosac from the master branch.

The debian package put the binary in /usr/bin/ but since /usr/local/bin has the priority in the PATH, the wrong binary is invoked. You can safely rm /usr/local/bin/leosac and hopefully that should fix the issue.

Gbengat commented 9 years ago

Oh I see..let me do that now

Gbengat commented 9 years ago

Now bash is complaining that the /usr/local/bin/leosac path is missing

Gbengat commented 9 years ago

Or let me purge leosac and do a fresh install of the .deb package and I will get back to you if it still doesn't launch

Gbengat commented 9 years ago

So I checked my package again carefully and it turns out I accidentally installed the 0.4 version. Following the link you sent me earlier I was able to download the 0.6 version. This time it launched started it. But I'm getting this error below. screenshot from 2015-08-05 11 19 40

xaqq commented 9 years ago

Oh yes that's my bad. A new <instance_name>blah</instance_name> tag is required in the general section of the configuration (http://leosac.github.io/leosac/doc_output/develop/html/d2/d94/general_config_main.html#general_instance_name). This is rather new -- I need to update the documentation of the getting-started guide.

Gbengat commented 9 years ago

Oh ok...I've just added that to the config file. However there is another error with the SysFsGpio when it tries to run. screenshot from 2015-08-05 14 33 59

xaqq commented 9 years ago

Are you missing the various configuration option like:

<aliases>
<default>gpio__NO__</default>
</aliases>
<export_path>/sys/class/gpio/export</export_path>
<unexport_path>/sys/class/gpio/unexport</unexport_path>
<edge_path>/sys/class/gpio/__REPLACE_ME__/edge</edge_path>
<value_path>/sys/class/gpio/__REPLACE_ME__/value</value_path>
<direction_path>/sys/class/gpio/__REPLACE_ME__/value</direction_path> 

See http://leosac.github.io/leosac/doc_output/develop/html/d2/d1b/mod_sysfsgpio_main.html

You can actually leave it like in the example as they are fine for a Raspberry Pi.

Gbengat commented 9 years ago

Turns out I was. I have entered those and changed "_REPLACEME" to a gpio number. This is the output. I think I am still missing things in my configuration file.

screenshot from 2015-08-05 16 15 17

Gbengat commented 9 years ago

Ok I have used exactly as the example. So the error above has gone. But it is complaining that there is a problem with my auth.xml file. Let me check it. This is the output: screenshot from 2015-08-05 16 26 25

Gbengat commented 9 years ago

Ok I am unable to figure out what is wrong with the auth.xml file

xaqq commented 9 years ago

Can you post the content of your auth.xml file?

Gbengat commented 9 years ago

Sure...Find it here: {% gist 5dee3150bd3988762886 gist.md %}

xaqq commented 9 years ago

Mmm, your definition for WiegandCard are wrong. it's supposed to be something like:

<WiegandCard>
<card_id>aa:bb:cc:dd</card_id>
<bits>32</bits>
</WiegandCard>
Gbengat commented 9 years ago

Ok..Ive changed that but I still have the same error. The changes are here: {% gist 5dee3150bd3988762886 gist.md %}

xaqq commented 9 years ago

You still have <bits>32<bits/> instead of <bits>32</bits>.

Gbengat commented 9 years ago

Oh oh oh...my bad! That was it! It's running now :-) Thank you very much. This issue can now be closed.

xaqq commented 9 years ago

I hope it works for you :).

By the way, know that all your troubles were not for nothing. We'll be working at improving error reporting so that it's easier for users to know what's wrong.

Gbengat commented 9 years ago

Thanks :-) If any other modules give errors I'll be sure to let you know.

Gbengat commented 9 years ago

Hi, I am having a slight issue with wiegand_data_high and wiegand_data_low. Leosac says my pins do not exist. Or possibly I am not naming the pins correctly. This is the output. screenshot from 2015-08-24 15 24 41

My code for my core file is here: {% gist 684a6b19b39bc29965df gist.md %}

I've tried naming my gpio pins as eg GPIO1 , just numbers but still it tells me the pins do not exist.

xaqq commented 9 years ago

Hello, This should be harmless as it's, IIRC, just a message into the log (unless you run in strict mode).

This has been reported and fixed already: see https://github.com/islog/leosac/issues/63 Installing the new Debian package will fix the issue.

Gbengat commented 9 years ago

Oh ok, let me install the latest package.

Gbengat commented 9 years ago

So it turns out there are some unmet dependencies which weren't there before with 0.6.0. #62 mentions the libboost-serialization1.55.0 but when I checked, I have the latest installed. However I'm not sure what this libboost-regex1.55.0 dependency is. screenshot from 2015-08-24 16 33 43

xaqq commented 9 years ago

https://github.com/leosac/leosac/blob/develop/pkg/debian/control is the file that declares dependency but it didn't change for a while. Try updating your system because the update should happen without trouble. What boost packages do you have installed? dpkg -l | grep boost.

Gbengat commented 9 years ago

Hmmm, that's odd. Updating is the first thing I did, but the dependency error still comes. Boost packages: http://pastebin.com/2xFs5dKX

xaqq commented 9 years ago

Hum... okay. Can you run apt-get install -f after running dpkg -i leosac_0.6.1-1.deb ? This should correctly setup the dependency.

Gbengat commented 9 years ago

Ok..I've tried a couple of things but I'm still getting the dependency error.

xaqq commented 9 years ago

This is a bit weird. Can you confirm that you have the Jessie repositories enabled in your /etc/apt/source.list ?

Gbengat commented 9 years ago

Yea, Jessie is enabled screenshot from 2015-08-24 18 43 58

xaqq commented 9 years ago

Okay... Well I admit I have no idea. I did the upgrade on my own Pi and it went without trouble.

Maybe try fully removing Leosac and reinstalling (assuming you haven't already). But this is a random guess :(

Gbengat commented 9 years ago

Hmmm, ok. Let me try that and get back to you later. I uninstalled but there could be some files still hiding somewhere on the system.

Gbengat commented 9 years ago

HI, Ive tried abit of this and that over the past couple of days but I still get these two dependency errors screenshot from 2015-08-28 11 59 29 and can't install the package. 0.6.0 installs fine but it has that bug that was fixed in 0.6.1. Was the one you installed on your pi, the same .deb package that is uploaded here: https://github.com/leosac/leosac/releases? I suspect there could be a problem with the package. I want to do a clean install of raspian on another raspberry pi just to be sure it is not my system. My last resort would probably be to try and build from source.

xaqq commented 9 years ago

Yes it is this package I have installed.

I want to do a clean install of raspian on another raspberry pi just to be sure it is not my system.

That's something worth trying.

However, can't you install libboost-regex1.55-dev using apt ? Maybe you need to reinstall boost using the Jessie repository (instead of Wheezy?). I've checked with dpkg -I and indeed the package 0.6.1 requires boost-regex-1.55 while 0.6.0 requires 1.49. I don't know why. I didn't spot the problem because I have multiple boost installled, so it worked fine I guess.

I'll need to investigate.

Gbengat commented 9 years ago

Oh ok, thank you. I'm currently getting a 101 network unreachable error for the distros both wheezy and jessie. Could be some temporary down time, I will try again later on.

Gbengat commented 9 years ago

Hi, quick update on the issue I had several days ago. I was finally able to update libboost and leosac 0.6.1 was able to install. Now that I've got it running. I can't seem to get my reader to read any cards or the pin code to work either. Here is my auth.xml file http://pastebin.com/mmCfXjSk I'm pretty sure I haven't configured it well. Could it be that my main config file isn't reading it or telling the right pins to fire? Here is my main config http://pastebin.com/06uLnuyr And incase of successful card reading, will leosac give some kind of command-line notification?

xaqq commented 9 years ago

Running with your configuration fails with:

exception: Module::Unable to init module AUTH_FILE: Actor Initialization Exception
|--> exception: Actor Initialization Exception
|----> exception: Module::AuthFile cannot load configuration
|------> exception: Configuration error in file {auth.xml}: Invalid config file content

Indeed, you have a few configuration errors in both the main config file and the auth file. This should work better.

auth: http://paste2.org/eC7kV01p main: http://paste2.org/cIfcaVjK

Gbengat commented 9 years ago

Thank you very much! Let me try again with the new configuration.