Hauptmenü

RFID Module

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

Vorheriges Thema - Nächstes Thema

eppi

Hi Andrej
Wooow, verry nice - works!

Good to know that are active and restricted User-Attributs! Its possible to rename it to rfid_active and rfid_restricted?

another question:
for which the attribute fname is required? Is that a user attribute?

Thank you Andrej again!
Greets Dani

andrejs

Hi Dani,
I changed the attributes to rfid_active and rfid_restricted. I also removed the attribute fname - this is the full name of the user but I do not use it any more.

eppi

thank you verry much Andrej!!!
if my RFID solution is completed with front- and garage door, I will post my solution here.
nice evening -Dani

eppi

Hi Andrej
your RFID works fine! ;D but i have a question.
I would like to use the RFID modules with ser2net so that I can run on a remote Debian system the USB-TTL with the reader. Is it possible that I like the Jeelink Modules USB-TTL by:
define Garagentor RFID system 192.168.2.102:9501 RDM630
can integrate?

On RemoteSystem i have following define in ser2net.conf:
9501:telnet:600:/dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0:9600

Thank you!
Greets Dani

andrejs

#34
Dani,
this is new for me but I can install on my ubuntu server package ser2net and see how it works. I still do not understand your request to use Jeelink Module. Could you please draw a scheme with connections between RDM360, Jeelink USB, FHEM Server, remote Debian system.... in order to understand correctly?

Andrej

eppi

Hi Andrej
I made a drawing from my installation.

On the FHEM server 192.168.2.12 I have the RFID module installed configured as follows:
define Garagentor RFID system 192.168.2.102:9501 RDM630

The remote Debian system (192.168.2.102) I have the USB-TTL connected with the RDM630 and ser2net configured as follows (/etc/ser2net.conf):
9501:telnet:600:/dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0:9600

The RFID module says after a restart of FHEM always "disconnected".

The example with the JeeLink I have just mentioned, because it worked perfectly with ser2net.
Have you tried your EM4100 to connect with ser2net? If so, how did you configure it?

Thanks and regards Dani

andrejs

Dani, nice picture  :) . Now it is clear to me what is your request. RFID module is not prepared to access to RFID module using telnet and access to serial port through network. If you look at 99_RFID.pm module you will noticed that SerialPort perl module (Linux/POSIX emulation of Win32::SerialPort functions) is used.  The solution is to use perl Net::Telnet module in  99_RFID.pm.
Do you know perhaps if any other FHEM module already use Net::Telnet module ore maybe some other perl module for telnet because I really do not want to start from the scratch but to use created example.

Andrej 

rudolfkoenig

@Andrej: take a look at DevIo, they are used by a lot of modules.

andrejs

@Rudolf: Thanks for the useful proposal.
@Dani: I will use Devio.pm module to modify 99_RFID.pm to cover connection to RFID device directly through serial port or over the network but I will start to work on this at the end of this week.

Andrej

eppi

Cool  :)
thank you -regards Dani

andrejs

#40
Dani,
it was really easy to correct the script (of course I was not able to test it). Please set in cfg file "attr global verbose 5" and in the case of any strange results or errors send fhem log file.
In order to define the RFID unit please use the following:

define Garagentor RFID system 192.168.2.102:9501 RDM630

OR

define Garagentor RFID system /dev/ttyUSB3@9600 RDM630


Andrej

eppi

thank you Andrej!
Aftler reload the Modul i receive the follow error:
Not enough arguments for main::DevIo_SimpleWrite at ./FHEM/99_RFID.pm line 189, near "$init)"
BEGIN not safe after errors--compilation aborted at ./FHEM/99_RFID.pm line 225.


attached find you my LogFile with verbose 5.

regards Dani

andrejs

Oops! The script is corrected and tested but just for serial connection.

Andrej

eppi

Hi Andrej
Modul downloaded, replaced, reloaded - works fine!! :D
Thank you! regards Dani

eppi

Hi Andrej
Sorry, I only now noticed:
With the latest version which I use by ser2net, I get no readings.
Do you have any idea?

list RFID_Reader_Haustuere
Internals:
   CFGFN      /opt/fhem/FHEM/fhem_rfid.cfg
   COUNTER    0
   DEF        system 192.168.2.102:9501 RDM630 unknown unknown
   DOORSTATE  unknown
   DeviceName 192.168.2.102:9501
   FD         125
   KEYLOCK    unknown
   MODEL      RDM630
   NAME       RFID_Reader_Haustuere
   NR         555
   PARTIAL
   STATE
   SUBTYPE    system
   TYPE       RFID
   Readings:
     Rfid_user_dani:
       TIME       2014-09-06 15:51:35
       VAL
Attributes:
   rfid_active 1
   room       RFID
   verbose    0


list RFID_User_Dani
Internals:
   CARDNR     0006994919
   CFGFN      /opt/fhem/FHEM/fhem_rfid.cfg
   DEF        user 0006994919
   NAME       RFID_User_Dani
   NR         559
   STATE
   SUBTYPE    user
   TYPE       RFID
   Readings:
     Rfid_user_dani:
       TIME       2014-09-06 15:51:35
       VAL
Attributes:
   rfid_active 1
   rfid_restricted 0
   room       RFID
   verbose    0