Hauptmenü

RFID Module

Begonnen von andrejs, 25 April 2014, 17:15:25

Vorheriges Thema - Nächstes Thema

eppi

Ok Andrej
I'll wait, you're the RDM630 have. No problem!
Thanks and regards Dani

andrejs

Dani,
finally I set up Raspberry PI (model B) and connect EM4100 using UART TTL 6PIN Connector Module. I also installed ser2net following the instruction here: http://networklessons.com/network-management/raspberry-pi-as-cisco-console-server/. In ser2net.conf I added two lines:
BANNER:banner:NETWORKLESSONS.COM Terminal Server TCP port p device d rn
4001:telnet:0:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT banner

After i started "ser2net" using ser2net -n I also tested the connection with telnet from other computer where Fhem server is running. The test was successful (check if the port is not blocked by firewall!). 
The next step was to test RFID module if card reader is connected on RPI. I defined first the "system" define door_acess RFID system 192.168.1.123:4001 EM4100 and the users. The test was OK and I got the status "opened". I swiped the card over the reader and everything was OK.
So the RFID should also work if the card reader is attached on other linux computer using ser2net package. I used EM4100 but it should work also with RDM630. Please test the attached FHEM module (use attr global verbose 5) and in the case of any errors send me the log file.

Andrej 

eppi

Hello Andrej
Wow, very cool !!
I have defined it according to your instructions and works perfectly! I'll watch it a few more hours ....

I have a question:
If i have 2 RFID reader has now, one for the front door and one for the garage door, is this supported from the modul? If so, how is the define? Is it possible to authorize different users to different reader?

Many thanks!

regrads Dani

andrejs

Great to hear that  :D. The module works with 2 or more RFID readers but the users and all attributes (active, restricted) are the same for all defined readers. I will take a look in the script and try to find the solution in order to define and set the user/authorization for all reader or just for specific one.

Andrej

andrejs

#64
Dani,
I changed the 99_RFID module in order to define authorization of user for a different rfid readers. The syntax to define the user is changed because additional "authorization" parameter (it is mandatory) should defined:
Define <name> RFID  user  <card number> <authorisation>
Parameter <authorisation> specifies for which RFID reader or readers is user authorised. Possible values:
ALL - user has access/authorisation to all RFID readers
NONE - user has no access/authorisation to RFID readers
PART(reader1,reader2,...)  - user has access/authorisation to RFID readers defined in brackets seperated by comma

Example: define user1 RFID user 0005354301 PART(door_acess,door_acess1)
In this particular case the user1 has authorization for 2 rfid readers (defined with subtype system)
Example1: define user1 RFID user 0005354301 ALL
User1 has authorization for all rfid readers defined by subtype system.
Example3: define user1 RFID user 0005354301 NONE
User1 has no authorization.

if the user does not have authorization for rfid reader the value of Reading will be "no_auth".
The attributes rfid_restricted, rfid_active can defined only for the user and not for particular rfid reader.
I tested the changes with 2 rfid readers and everything was OK.

Andrej






 

eppi

Hello Andrej
Thanks for the adjustments. I have not received my second RFID reader. But I will give it to me over the weekend to the existing testing and feedback.
Thanks a lot, regards Dani

eppi

Hi Andrej
I tested with authorization ALL, that works- thank you! The other authorization i will test as soon as my second RFID Reader has arrived.

What I noticed is that with each RFID following message in the log is:
2014.10.11 09:21:09 1: PERL WARNING: Hexadecimal number > 0xffffffff non-portable at ./FHEM/99_RFID.pm line 240.
2014.10.11 09:21:09 1: PERL WARNING: Hexadecimal number > 0xffffffff non-portable at ./FHEM/99_RFID.pm line 240.
2014.10.11 09:21:08 1: PERL WARNING: Hexadecimal number > 0xffffffff non-portable at ./FHEM/99_RFID.pm line 240.
2014.10.11 09:21:08 1: PERL WARNING: Hexadecimal number > 0xffffffff non-portable at ./FHEM/99_RFID.pm line 240.
2014.10.11 09:21:08 1: PERL WARNING: Hexadecimal number > 0xffffffff non-portable at ./FHEM/99_RFID.pm line 240.


And when i start FHEM (shutdown restart) is following in the log:
2014.10.11 09:15:44 1: PERL WARNING: Argument "" isn't numeric in numeric ge (>=) at ./FHEM/99_RFID.pm line 344.
2014.10.11 09:15:44 1: PERL WARNING: Argument "" isn't numeric in numeric ge (>=) at ./FHEM/99_RFID.pm line 344.
2014.10.11 09:15:44 1: PERL WARNING: Argument "" isn't numeric in numeric ge (>=) at ./FHEM/99_RFID.pm line 344.
2014.10.11 09:15:44 1: PERL WARNING: Argument "" isn't numeric in numeric ge (>=) at ./FHEM/99_RFID.pm line 344.
2014.10.11 09:15:44 1: PERL WARNING: Argument "" isn't numeric in numeric ge (>=) at ./FHEM/99_RFID.pm line 344.
2014.10.11 09:15:44 1: PERL WARNING: Argument "" isn't numeric in numeric ge (>=) at ./FHEM/99_RFID.pm line 344.
2014.10.11 09:15:44 1: PERL WARNING: Argument "" isn't numeric in numeric ge (>=) at ./FHEM/99_RFID.pm line 344.
2014.10.11 09:15:44 1: PERL WARNING: Argument "" isn't numeric in numeric ge (>=) at ./FHEM/99_RFID.pm line 344.


I use the current version of FHEM:
# $Id: fhem.pl 6730 2014-10-09 19:21:23Z rudolfkoenig $ 
# $Id: 99_RFID.pm 1098 2014-10-09 21:40:08Z andrejs $


Thank you for your feedback.
regards Dani

andrejs

Dani,
thanks for the testing and error messages.
I removed the second error after you "shutdown restart" FHEM but I am not sure if PERL WARNING with hexadecimal number is still present. Please test again and in the case of the warnings or errors send me the log file (use verbose 5).

Andrej 

eppi

hi Andrej
the error message after reboot are solved in this version - thank you!
On every RFID-read i receive the following error mesage in my log (see attached file).

regards Dani

andrejs

Dani,

could you tell me the RFID card number?

Thanks

Andrej

eppi

Yes, i send you a pm...

andrejs

Dani,

I think I solved the problem with PERL WARNING and I attached the amended script to this message.

Andrej

eppi

Hello Andejs
This Module Version crash immediately after the first RFID read. Logfile with verbose 5 is emty....
regards Dani

andrejs

#73
Dani,

I solved the problem with "PERL WARNING: Argument "" isn't numeric in numeric ge (>=) at ./FHEM/99_RFID.pm" using function Math::Bigint. I hope now everything will work without any strange warnings in log file.

Andrej

eppi

Hi Andrejs
Sorry for the delay. Everything is stable and both RFID reader working without problems.
Many thanks for the nice module and the hard work!

regards Dani