Hauptmenü

RFID Module

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

Vorheriges Thema - Nächstes Thema

andrejs

It was my pleasure working with you Dani and thank you agin for the testing and patience.
My next project will be to add some of NFC readers and I hope I will be successful.

Andrej

breezybadger

Hey,

this model looks awesome. I ordered a Reader from Ebay, it looks the same from the outside, but its a different one. I was trying to wire it, but as it seems Iam to stupid to find the right Ports. I have a picture of it, could someone please provide me the right ports ( D0, D1, VCC and GND) to wire it.

Thanks a lot

Regards Breezy

andrejs

hi,
at the photo below you can see the PCB of USB RFID Reader 125 kHz (back side) and the connections:
green white wire - GND
green wire - +5V
orange white wire - RX

I hope I helped you.

Andrej

breezybadger

Hello,

now some new HW (http://www.ebay.de/itm/331221365816?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT) arrived directly from my glory china. I try to connect it directly to the GIOP on my Raspi, i Connect it to PIN 10 and I am able to read the TAG No with a python script - but in  FHEM the sate is still disconnect, any Idea what Iam doing wrong ?

The Fhem.cfg entry is : define RFIDIO RFID system /dev/ttyAMA0 RDM630 keylock


#!/usr/bin/python
# coding=utf-8

import serial

def read_rfid():
    ser = serial.Serial("/dev/ttyAMA0")
    ser.baudrate = 9600
    daten = ser.read(14)
    ser.close()
    daten = daten.replace("\x02", "" )
    daten = daten.replace("\x03", "" )
    return daten

id = read_rfid()
print id


And still: awesome work! Thanks for it

andrejs

Hi Breezy,
the RFID module works if you use RFID reader with USB 2.0 to UART TTL 6PIN Connector Module. I have never tested or tried to connect  RFID reader to GIOP of Rpi. Please tell what does it mean 14 in your pyton code daten = ser.read(14)?
Can you tell have you manged to solve the problem of RFID module connection posted in this forum at 07 Februar 2015?

Andrej

breezybadger

Hello,

thank you for you help. I was assuming it works the same way as over USB because the Raspi has a UART Converter integrated in the Ports. To be honest I just copied the script from http://www.elektronx.de/tutorials/rfid-tags-auslesen/ to test if I wired everything correctly. I would assume it works the same way only by changing the input port.

My Old Hardware doesn't work, thats why I ordered the new one. My Problem is I don't have a Port available for USB thats why I wanted to connect it via RX over GIOP

Thanks again for your awesome work and help!

andrejs

#81
Breezy,
please download the attached 99_RFID.pm file in my post at 16.10.2014 and define RFID module as following:
define RFIDIO RFID system /dev/ttyAMA0@9600 RDM630

If this is not the solution I am not sure where is the issue. Maybe the problem is in diference between pyton script and RFID module where the numer of bytes which are read is not the same. In pyton script 14 bytes of data is read, the RFID module reads 1 byte of data at once. This can be changed in RFID module but the rest of the script will not work as it should be. Anyway you can change the following code in sub RFID_DoSimpleRead:
from
$buf = $hash->{USBDev}->read(1); 
to
$buf = $hash->{USBDev}->read(14);

Please let me now how it goes.

Andrej

breezybadger

Hello Andrej,

thanks again for you help. I tried to change what you wrote before. The status is still "disconnected" in the Everthing overview. Is there a line that maybe limit the input to USB Devices only? When I set a soft link in the /mnt area to a USB Device from ttyAMA0 could this may help?

BTW my Logfile is full of "2: ready" entries

The Problem I have seems not the readability from the tags, its more to get your Modul running.

Thanks for you help!

Greetings Daniel

andrejs

Daniel,
I am sorry my directions are not sucesful but in order to help you I will need to connect my RFID reader (it is not your model but it will sufficent) directly to GIOP of Rpi and make some testing. Right now I am not at home but I will be at end of this week.

Andrej

andrejs

Daniel,
I connected my RFID reader (+5,GND,txd) to Rpi using GPIO and I succeeded to get opened status. In order to get TXD (GPIO14) pin of Rpi available for general UART use I followed this instructions https://sites.google.com/site/semilleroadt/raspberry-pi-tutorials/gpio (see section UART).  To define rfid reader in FHEM use "define RFIDIO RFID system /dev/ttyAMA0@9600 RDM630". I replaced 99_RFID.pm file with new one in my post at 16.10.2014 because I made some corrections which are not linked to GPIO issue.   

Andrej

breezybadger

#85
Hi,
thanks so much for you work, I shows the state open! AWESOME work, but now the tags don't show any reaction. I added a user with the right ID.
Any Ideas how to fix this ?

BTW this is my user configuration :
ZitatAUTH
ALL
CARDNR
0009953857
DEF   
user 0009953857 ALL
NAME
daniel
NR
44
STATE
unknown 498226160193
SUBTYPE
user
TYPE
RFID
Thank you!

andrejs

#86
Daniel,
strange but it seems  the output format of data is different so I will need to amend the script and add another type of reader. I propose to make a test. Please use the attached 99_RFID.pm file in my post at 16.10.2014 and change in fhem.cfg verbose to 5 (this will enable to write the read raw data from rfid reader to log file). After that swip the card over the reader and send me fhem log file.

Andrej

breezybadger

Hey Andrejs,

thanks again, I really appreciate your help. I assume I did something wrong, I added verbos 5 as attr. to the RFID but nothing appeared in the LOG , only in the Eventmonitor "RFID RFIDIO 498226160193: unknown 498226160193"
My def. was :
define RFIDIO RFID system /dev/ttyAMA0@9600 RDM630
attr RFIDIO verbose 5

Any Idea what I did wrong?

andrejs

Daniel,

you need to find in fhem.cfg file this "attr global verbose 3" and change the number from 3 to 5.

Andrej   

breezybadger

Thanks man, I guess I found what you need to solve my issue:
2015.05.12 17:13:45 5: Triggering RFIDIO (1 changes)
2015.05.12 17:13:45 5: Notify loop for RFIDIO 498226160193: unknown 498226160193
2015.05.12 17:13:45 5: Triggering RFIDIO (1 changes)
2015.05.12 17:13:45 5: Notify loop for RFIDIO 498226160193: unknown 498226160193
2015.05.12 17:13:45 5: 2 + 0 +
2015.05.12 17:13:45 5: 55 + 1 + 7
2015.05.12 17:13:45 5: 52 + 2 + 74
2015.05.12 17:13:45 5: 48 + 3 + 740
2015.05.12 17:13:45 5: 48 + 4 + 7400
2015.05.12 17:13:45 5: 57 + 5 + 74009
2015.05.12 17:13:45 5: 55 + 6 + 740097
2015.05.12 17:13:45 5: 69 + 7 + 740097E
2015.05.12 17:13:45 5: 50 + 8 + 740097E2
2015.05.12 17:13:45 5: 52 + 9 + 740097E24
2015.05.12 17:13:45 5: 49 + 10 + 740097E241
2015.05.12 17:13:45 5: 52 + 11 + 740097E241
2015.05.12 17:13:45 5: 48 + 12 + 740097E241
2015.05.12 17:13:45 5: 3 + 13 + 740097E241
2015.05.12 17:13:45 5: fname: RFIDIO cnr_attr: 0009953857 cnr_reader: 498226160193 status: closed action: unknown 498226160193
2015.05.12 17:13:45 5: Triggering RFIDIO (1 changes)
2015.05.12 17:13:45 5: Notify loop for RFIDIO 498226160193: unknown 498226160193
2015.05.12 17:13:45 5: Triggering RFIDIO (1 changes)
2015.05.12 17:13:45 5: Notify loop for RFIDIO 498226160193: unknown 498226160193
2015.05.12 17:13:45 5: 2 + 0 +
2015.05.12 17:13:45 5: 55 + 1 + 7
2015.05.12 17:13:45 5: 52 + 2 + 74
2015.05.12 17:13:45 5: 48 + 3 + 740
2015.05.12 17:13:45 5: 48 + 4 + 7400
2015.05.12 17:13:45 5: 57 + 5 + 74009
2015.05.12 17:13:46 5: 55 + 6 + 740097
2015.05.12 17:13:46 5: 69 + 7 + 740097E
2015.05.12 17:13:46 5: 50 + 8 + 740097E2
2015.05.12 17:13:46 5: 52 + 9 + 740097E24
2015.05.12 17:13:46 5: 49 + 10 + 740097E241
2015.05.12 17:13:46 5: 52 + 11 + 740097E241
2015.05.12 17:13:46 5: 48 + 12 + 740097E241
2015.05.12 17:13:46 5: 3 + 13 + 740097E241
2015.05.12 17:13:46 5: fname: RFIDIO cnr_attr: 0009953857 cnr_reader: 498226160193 status: closed action: unknown 498226160193
2015.05.12 17:13:46 5: Triggering RFIDIO (1 changes)
2015.05.12 17:13:46 5: Notify loop for RFIDIO 498226160193: unknown 498226160193
2015.05.12 17:13:46 5: Triggering RFIDIO (1 changes)
2015.05.12 17:13:46 5: Notify loop for RFIDIO 498226160193: unknown 498226160193


Thanks a lot!