Giter Site home page Giter Site logo

pi-rc522's Introduction

Python RC522 library

pi-rc522 consists of two Python classes for controlling an SPI RFID module "RC522" using Raspberry Pi or Beaglebone Black. You can get this module on AliExpress or Ebay for $3.

Based on MFRC522-python.

Install using pip:

pip install pi-rc522

Or get source code from Github:

git clone https://github.com/ondryaso/pi-rc522.git
cd pi-rc522
python setup.py install

You'll also need to install the spidev and RPi.GPIO libraries on Raspberry PI, and Adafruit_BBIO on Beaglebone Black (which should be installed by default).

MIFARE datasheet can be useful.

Sectors? Blocks?

Classic 1K MIFARE tag has 16 sectors, each contains 4 blocks. Each block has 16 bytes. All this stuff is indexed - you must count from zero. The library uses "block addresses", which are positions of blocks - so block address 5 is second block of second sector, thus it's block 1 of sector 1 (indexes). Block addresses 0, 1, 2, 3 are from the first sector - sector 0. Block addresses 4, 5, 6, 7 are from the second sector - sector 1, and so on. You should not write to first block - S0B0, because it contains manufacturer data. Each sector has it's sector trailer, which is located at it's last block - block 3. This block contains keys and access bits for corresponding sector. For more info, look at page 10 of the datasheet. You can use this useful utility to calculate access bits.

Connecting

Connecting RC522 module to SPI is pretty easy. You can use this neat website for reference.

Board pin name Board pin Physical RPi pin RPi pin name Beaglebone Black pin name
SDA 1 24 GPIO8, CE0 P9_17, SPI0_CS0
SCK 2 23 GPIO11, SCKL P9_22, SPI0_SCLK
MOSI 3 19 GPIO10, MOSI P9_18, SPI0_D1
MISO 4 21 GPIO9, MISO P9_21, SPI0_D0
IRQ 5 18 GPIO24 P9_15, GPIO_48
GND 6 6, 9, 20, 25 Ground Ground
RST 7 22 GPIO25 P9_23, GPIO_49
3.3V 8 1,17 3V3 VDD_3V3

You can also connect the SDA pin to CE1 (GPIO7, pin #26) and call the RFID constructor with bus=0, device=1 and you can connect RST pin to any other free GPIO pin and call the constructor with pin_rst=BOARD numbering pin. Furthermore, the IRQ pin is configurable by passing pin_irq=BOARD numbering pin.

NOTE: For RPi A+/B+/2/3 with 40 pin connector, SPI1/2 is available on top of SPI0. Kernel 4.4.x or higher and dtoverlay configuration is required. For SPI1/2, pin_ce=BOARD numbering pin is required.

NOTE: On Beaglebone Black, use pin names (e.g. "P9_17").

NOTE: On Beaglebone Black, generally you have to enable the SPI for the spidev device to show up; you can enable SPI0 by doing echo BB-SPIDEV0 > /sys/devices/bone_capemgr.9/slots. SPI1 is available only if you disable HDMI.

NOTE: If you are not using IRQ, you can pass pin_irq = None to the constructor.

You may change BOARD pinout to BCM py passing pin_mode=RPi.GPIO.BCM. Please note, that you then have to define all pins (irq+rst, ce if neccessary). Otherwise they would default to perhaps wrong pins (rst to pin 15/GPIO22, irq to pin 12/GPIO18).

Usage

The library is split to two classes - RFID and RFIDUtil. You can use only RFID, RFIDUtil just makes life a little bit better. You basically want to start with while True loop and "poll" the tag state. That's done using request method. Most of the methods return error state, which is simple boolean - True is error, False is not error. The request method returns True if tag is not present. If request is successful, you should call anticoll method. It runs anti-collision algorithms and returns used tag UID, which you'll use for select_tag method. Now you can do whatever you want. Important methods are documented. You can also look at the Read and KeyChange examples for RFIDUtil usage.

from pirc522 import RFID
rdr = RFID()

try:
  while True:
    rdr.wait_for_tag()
    (error, tag_type) = rdr.request()
    if not error:
      print("Tag detected")
      (error, uid) = rdr.anticoll()
      if not error:
        print("UID: " + str(uid))
        # Select Tag is required before Auth
        if not rdr.select_tag(uid):
          # Auth for block 10 (block 2 of sector 2) using default shipping key A
          if not rdr.card_auth(rdr.auth_a, 10, [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF], uid):
            # This will print something like (False, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
            print("Reading block 10: " + str(rdr.read(10)))
            # Always stop crypto1 when done working
            rdr.stop_crypto()

except KeyboardInterrupt:
  # Calls GPIO cleanup
  rdr.cleanup()

To retrieve tag UID in either 4 or 7 byte form, you can use:

from pirc522 import RFID
rdr = RFID()

while True:
  rdr.wait_for_tag()
  uid = rdr.read_id(as_number = True)
  if uid is not None:
    print(f'UID: {uid:X}')

# Calls GPIO cleanup
reader.cleanup()

Util usage

RFIDUtil contains a few useful methods for dealing with tags.

from pirc522 import RFID
import signal
import time

rdr = RFID()
util = rdr.util()
# Set util debug to true - it will print what's going on
util.debug = True

while True:
    # Wait for tag
    rdr.wait_for_tag()

    # Request tag
    (error, data) = rdr.request()
    if not error:
        print("\nDetected")

        (error, uid) = rdr.anticoll()
        if not error:
            # Print UID
            print("Card read UID: "+str(uid[0])+","+str(uid[1])+","+str(uid[2])+","+str(uid[3]))

            # Set tag as used in util. This will call RFID.select_tag(uid)
            util.set_tag(uid)
            # Save authorization info (key B) to util. It doesn't call RFID.card_auth(), that's called when needed
            util.auth(rdr.auth_b, [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF])
            # Print contents of block 4 in format "S1B0: [contents in decimal]". RFID.card_auth() will be called now
            util.read_out(4)
            # Print it again - now auth won't be called, because it doesn't have to be
            util.read_out(4)
            # Print contents of different block - S1B2 - RFID.card_auth() will be called again
            util.read_out(6)
            # We can change authorization info if you have different key in other sector
            util.auth(rdr.auth_a, [0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF])
            #If you want to use methods from RFID itself, you can use this for authorization
            # This will authorize for block 1 of sector 2 -> block 9
            # This is once more called only if it's not already authorized for this block
            util.do_auth(util.block_addr(2, 1))
            # Now we can do some "lower-level" stuff with block 9
            rdr.write(9, [0x01, 0x23, 0x45, 0x67, 0x89, 0x98, 0x76, 0x54, 0x32, 0x10, 0x69, 0x27, 0x46, 0x66, 0x66, 0x64])
            # We can rewrite specific bytes in block using this method. None means "don't change this byte"
            # Note that this won't do authorization, because we've already called do_auth for block 9
            util.rewrite(9, [None, None, 0xAB, 0xCD, 0xEF])
            # This will write S2B1: [0x01, 0x23, 0xAB, 0xCD, 0xEF, 0x98, 0x76......] because we've rewritten third, fourth and fifth byte
            util.read_out(9)
            # Let's see what do we have in whole tag
            util.dump()
            # We must stop crypto
            util.deauth()

pi-rc522's People

Contributors

anguslmm avatar aterfax avatar cmur2 avatar cvtsi2sd avatar faultylee avatar galarzaa90 avatar jo-me avatar kevinvalk avatar layereight avatar ludwigknuepfer avatar meltinglava avatar mileippert avatar mortbauer avatar ondryaso avatar penguintutor avatar s-martin avatar soundstorm avatar stevenroh avatar thijstriemstra avatar wie-niet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pi-rc522's Issues

Integration into other project

I find it difficult to integrate this lib into other python project : as it has not setup.py to install it, it must be included directly into the source of the application using it.
That's not really a problem, except that RFID.py and RFIDUtil.py import each other, meaning that if you simply copy the ChipReader directory in the application source tree, these import fails (there are not relative import).

AFAIK there are several way of solving this kind of problem, the cleanest it probably to make it an actual library (with a setup.py). I could work on a pull request for this if you want.

Errno 2 directory does not exist

I am using a raspberry pi 4 model b running the latest version of raspbian (2020-02-13). I followed this tutorial on how to use the rc522 RFID scanner with a raspberry pi: https://pimylifeup.com/raspberry-pi-rfid-rc522/ / https://www.youtube.com/watch?v=evRuZRxvPFI&t=172s .When I got to the point where I needed to run Write.py it gave me the error: python3: can’t open file ‘Write.py’ : [Errno 2] No such file or directory

Thank you for your time, and I hope you can help.

Something wrong while running the demo code.

  • When I run your first demo code with no util, I gotta an error while reading cards.
  • I tried to debug in RFID.py, found that when I call the function rdr.read(block_address), In RFID.py, the write() function in read() returns an empty list.
  • Your second demo code runs well, I have no idea why this happens.
  • At last, could you please tell me can this RF522 module with your lib rewrite the uid of some cards whose uid have been declared to be able to be modified.

Thanks a lot !

Two Readers (CS0 and CS1) not working in one program

Hi,
using one reader (spidev0.0 and spidev0.1) in one program works (Read.py).

Two readers are not working. Only the first initialized is working.
Any idea?

Thomas

`import RFID
import signal
import time

run = True
rdr0 = RFID.RFID("/dev/spidev0.1")
rdr1 = RFID.RFID("/dev/spidev0.0")
util1 = rdr1.util()
util1.debug = True
util0 = rdr0.util()
util0.debug = True

def end_read(signal,frame):
global run
print ("\nCtrl+C captured, ending read.")
run = False
rdr0.cleanup()
rdr1.cleanup()

signal.signal(signal.SIGINT, end_read)

print ("Starting")
while run:
(error, data) = rdr0.request()

(error, uid) = rdr0.anticoll()
if not error:
    print ("In Card read UID: "+str(uid[0])+","+str(uid[1])+","+str(uid[2])+","+str(uid[3]))

(error, data) = rdr1.request()
(error, uid) = rdr1.anticoll()
if not error:
    print ("Out Card read UID: "+str(uid[0])+","+str(uid[1])+","+str(uid[2])+","+str(uid[3]))

 time.sleep(0.1)

`

How can use the SPI1 ?

How can use SPI1 for communication on raspberry pi with your library? GPIO7 belongs to SPI0 so it does not solve my problem unfortunately.

KeyChange

after running the KeyChange file i understand i now need that key to read sector 1 however sectors 2-15 still use the default key..

i am very new to this rfid stuff and still trying to understand most of it.. was wondering is there a way to reset the key back to default on the first sector ?

any way any help would be greatly appreciated..
thank you for your time

Reader not reading

Hi all,

I'm trying to connect an AZ-Delivery RC522 reader to a Raspberry Pi (have tried both 3A+ and Zero 2 W), but the reader just won't read the RFID chip and card that came in the package.

I am using the wiring with IRQ to GPIO24, and have double-checked that all wires are connected correctly.

I am using the current version of Raspberry Pi OS, and have enabled SPI in raspi-config. The kernel modules are loading:

$ uname -a
Linux raspberrypi 5.10.17-v7+ #1414 SMP Fri Apr 30 13:18:35 BST 2021 armv7l GNU/Linux

$ lsmod|grep spi
spidev                 20480  0
spi_bcm2835            20480  0

$ ls -la /dev/spi*
crw-rw---- 1 root spi 153, 0 Nov  7 09:42 /dev/spidev0.0
crw-rw---- 1 root spi 153, 1 Nov  7 09:42 /dev/spidev0.1

However, when I run the "util" test program from the README, it hangs on rdr.wait_for_tag(), no matter how long I hold the chip or card to the reader.

I have tried this both with spidev 3.5 and 3.4, as suggested in #71.

Any idea what I could try to make this work? Or how I would even debug this?

pi-rc522 not working with spidev 3.5

Hello.

I discovered recently that pi-rc522 does not work with spidev version 3.5. Reverting back to version 3.4 works.

I'm a fairly novice programmer so I'm not certain why that is the case, but I'd be happy to provide any information or try any potential fixes if needed. Please just let me know if I can help!

Thanks!

RFID-THM3030

Do you have any idea if and how this reader pictured below would map to the pins mentioned in the documentation?

9176 png

How to reduce electromagnetic emissions?

It might sound finicky, but I would like to reduce the electromagnetic emissions from the RFID reader.

I build a speaker with an RFID reader inside and kids are putting their heads on it, I don't want their brains to be fried over time. (Mobile phone usage [GSM, UMTS, LTE] is strongly discouraged for small kids.)

It there a way to reduce 1) the field strength and 2) the emission interval? I would be happy to experiment to set the strength as low as possible and for me a 3 second interval would be enough. I am just a RFID user, so I am to sure if this is doable at all.

Reader not reading certain Card

Hi I bought my MFRC22 Reader on amazon and wired it up. It was shipped with a blue round dongle and with a white blank plastic card. Both are reporting to be type ISO 14443-3A MIFARE Classic 1k

Using the example program reading the blue dongle is working very stable. However it does not work at all with the white plastic card. It always returns with the error flag set to True.
I also tried reading with my android phone using the app NFC Tools. The phone reads both cards without any problem.

I wasn't able to find any clue on how to deal with this. Are there any options I can adjust in the library regarding this issue? The cards doesn't seem to be broken, but will the behavior the same with other cards? I want to use several of the cards. Are there cards which I can safely buy or will those also be affected by this problem?

Thanks

Cannot import on Beaglebone

Hi,
I'm trying to use this module on BeagleBone Black.
But I fail to import the module and get an error.

Must be used on Raspberry Pi
ImportError: cannot import name 'RFID'

I'm wondering how to use the module on BeagleBone Black.

what pin can I remove?

I'm limited to 7 pins for now, can I possibly skip something like IRQ and what would I lose

I cant read my card

I use pi3 , I see this, so one step by step i do,
but nothing print , no error,no uid,
I waste a day to fix , but i am fail.
I think it is my gpio not right ,can you tell me how i should do.
I use Physical pin same to you , but I think it is not right with pi3

Request: timeout on wait_for_tag

It would be nice to have a timeout argument on the wait_for_tag function. I'm using it to listen for tags on a looping thread that checks on a 'global' exit flag at each loop, but since wait_for_tag can never exit I have no nice way of killing it so I was forced to make my own modified version.

It should be a simple change, like this:

def wait_for_tag(self, timeout):
	# enable IRQ on detect
	start_time = time.time()
	rdr.init()
	rdr.irq.clear()
	rdr.dev_write(0x04, 0x00)
	rdr.dev_write(0x02, 0xA0)
	# wait for it
	waiting = True
	while waiting and time.time() - startTime < timeout:
		rdr.dev_write(0x09, 0x26)
		rdr.dev_write(0x01, 0x0C)
		rdr.dev_write(0x0D, 0x87)
		waiting = not rdr.irq.wait(0.1)
	rdr.irq.clear()
	self.init()

It's just a little detail that would improve usability.

Port to SpiDev

It’s maybe good to use SPIDEV instead of SPI-Py.
See mxgxw/MFRC522-python#31
As long as I am aware of (I am not a pro), SpiDev is more popular than SPI-Py.
It doesn’t make much sense in my setup to run two different SPI lib, since it may cause compatibility issues.

OLED with RFID

Hi,
I am trying to combine an OLED display with a RFID reader. The OLED should give status informations about the user. I used the procedure described here (https://www.raspberrypi-spy.co.uk/2018/04/i2c-oled-display-module-with-raspberry-pi/) to run the display. In separate it works perfectly but when I try to combine both it does not work. The display library Adafruit_SSD1306 (SSD1306_128_32) is using GPIO.BCM. The pirc522 library is using GPIO.BOARD. According to the Readme it is possible to switch to BCM: “You may change BOARD pinout to BCM py passing pin_mode=RPi.GPIO.BCM.” I tried to change the values but it doesn’t work like this.
Could you please explain more in detail how to change from BOARD to BCM ?

Best regards
Norbert

getting E1 or E2 error

whenever I screen the card, it only prints E1 or E2, but I have no idea where E1 or E2 comes from? I follow the instruction in here:

http://www.penguintutor.com/news/raspberrypi/rfid-rc522

how to avoid the errors to print "Detected" successfully?

#!/usr/bin/python3

import sys
sys.path.insert(0, "/home/pi/pi-rc522/ChipReader")
from pirc522 import RFID
import signal
import time
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522

reader = RFID()
util = reader.util()
util.debug = False

print("reader= ", reader)
print("util= ", util)

while True:
    (error, data) = reader.request()
    print("reader.request()= ", reader.request()) 
    if not error:
        print("\nDetected")
        (error, uid) = reader.anticoll()
        if not error:
            print ("str(uid[0]) " +str(uid[0])+ ", "+str(uid[1])+", "+str(uid[2])+", "+str(uid[3]))
            time.sleep(1)

print E1/E2 cannot print Detected, all connection and installation should work.

all seemd ok but don't read

Hi,
your library seems to be the most recent so it's very usefull for me, thank you.
I have a RPI3 and:

  1. connected the RFID reader as the schema
  2. cloned and install SPI and your library
  3. configured /boot/config.txt with
device_tree_param=spi=on
dtoverlay=spi-bcm2708

But when I launch python Read.py nothing happen :(

I read in README that you said:

pin_ce=BOARD numbering pi

What does it mean exactly?

Can't read HID iClass

I cannot get any HID iClass DH cards to work. I'm not sure if it's a software or hardware issue. Any help is much appreciated.

Wake up?

May #7 #10 be caused because of the card was not sent the wake up command?

The library reads two times the module and one is wrong

The code is from the readMe:

rdr = RFID.RFID()
while True:
  (error, tag_type) = rdr.request()
  if not error:
    print ("Tag detected")
    (error, uid) = rdr.anticoll()
    if not error:
      print("1")
      rdr.stop_crypto()
    else:
        print("0")
  else:
      print("0")

and the output is something like this
OUTPUT:
0
0
0
0
0
0
1
0
1
0
1
0
1
0
0
0
0
0

Reading Cards on Events

Hi guys.

I am new to Raspberry Pi and for my fist project I set RC522 and your library. It works fine from the samples. But the thing is, I want to get away from While true loop(CPU consumption) and move to an event listening. How can I do that? Any hints are welcome.

Read fails after some time

Hi,

i got two problems.

  1. wait_for_tag is not working for me - it just hangs there waiting. However i can read tags after commenting out the wait_for_tag bit
  2. After like 40 reads in a row ( not a specific number it just happens after some time ) not tags can be read anymore. It always errors out after rdr.request()

System is a fresh raspian on a raspberry zero w

get_access_bits function not callable

Trying to call the def get_access_bits(self, c1, c2, c3) function, defined in pirc522/util.py, line 138 I get an
AttributeError: 'RFIDUtil' object has no attribute 'get_access_bits'

I just added

# transport configuration
c1 = (0,0,0,0) 
c2 = (0,0,0,0)
c3 = (0,0,0,1)
b1,b2,b3 = util.get_access_bits(c1, c2, c3)

in the examples/UtilExample.py, line 12. Also tried to call get_access_bits within the loop, e.g. line 49.

Any suggestions?

No way to modify antenna gain.

This would be extremely useful for situations when cards need to be read from greater than 1cm. I know the MFRC522-Python library this is based on supports this.

Reading card content to text

Could you please include or point me to an example for how to read the whole content of a card and print it as a string?

I have checked your examples but could not wrap my head around the whole logic for reading the data from the card.

I understand the sectors and blocks, but what exactly should be done in order to read the whole card and output the whole data as a textual content?

Clean pip install fails

Installing in a virtualenv fails as spidev is missing. Once that has been installed, it fails again because RPi.GPIO is missing. After installing that, pip install pi-rc522 works.

setup.py should be updated to install these dependencies. I'll submit a PR later this week if I find time

continous reading fails after 16-20 reads

Hi, great rc522 lib, thanks for this contribution! (CPU usage is low and reading works fine...on raspberry)
my goal is to call a function on tag detection and another on tag removal.
tag detection works fine...
but now i leave the rfid tag on the reader after every 16-20 reads (rdr.request()) returns No Card detected (None/False) and resumes reading the tag fine afterwards ...
problem is, this error makes me think the tag was removed... wrongly :(

am i using the wrong function? or do i need to throttle down reading?

thx gus

SPI1 instead of SPI0

As RaspberryPi Zero uses SPI0 for display it seems to be interesting how to use other SPI interface. The task is complicated because of GPIO18 (used by the current design) is CE0 of SPI1, so there seem to be some interferences. Furthermore there is a conflict between the display and the RFID receiver with GPIO24 and with GPIO25. How to make this working?

Can't read cards

I changed from MFRC522-python because of the "list index out of bounds" issue that has been mentioned there.

If I run the Read.py and swipe my card nothing happens. No error, no nothing.
I'm on a Pi 2B, raspbian, everything is wired correctly and I installed spidev.
If I type "ls /dev/spi*" there is spidev0.0 and spidev0.1. Anything wrong there?

Everything was setup correctly for my project on MFRC522-python and now I have to implement it with pi-rc522 and it stops me right at the beginning :'(

Read faster?

Hi,

first of all thank you for you rc bib. It works fine :)
Do you have any idea to read faster? We have the RFID reader under remote-controlled cars and the Tags lie on the ground. The problem is, that the cars drive too fast over the tags, so that the reader can't read.

We have no idea to improve that. Maybe you have an idea? :)

Thank you :)

install fails on BeagleBone black (RPi libs are installed)

install fails on BeagleBone black.

setup will install the libs needed for Raspberry Pi ( spidev and RPi.GPIO ) not the one needed for BeagleBone Black ( Adafruit_BBIO ).

Work around is to remove the RPi libraries after pip install and install the lib needed for BBB.

git clone https://github.com/ondryaso/pi-rc522.git
cd pi-rc522
python setup.py install

pip uninstall spidev
pip uninstall rpi.gpio
pip install Adafruit_BBIO

Best would be to automate this in setup.py, or perhaps even easier - if possible - to switch to use Adafruit_GPIO.SPI ?

rdr.request() fails one time in two

When polling the state while a while loop (like in the example) the rdr.request() fails one time in two if the tag is always kept close to the reader.

More precisely : when I place my tag on the reader and leave it there I would expect rdr.request() to return True at each iteration of the loop, but instead it returns a sequence like this :

(True, data) 
(False, None)
(True, data)
(False, None)
...

This behavior make it more complicated to detect a tag removal.

7-byte tag support

Hi,
Tags with 7-byte id's do not seem to be read. These tags are detected, but the id is not returned. Am I doing something wrong?
Thanks!

Doubts

1 - What are authentication methods A and B?
2 - Why does the read_out () method always display the message "Not calling card_auth - already authed"?

auth fail always

sorry . my poor english .

if auth fail , always fail.
[0xFF,0xFF,0xFF,0xFF,0xFF,0xFF] is true
[0xF1,0xF1,0xF1,0xF1,0xF1,0xF1] is false

from pirc522 import RFID
rdr = RFID()
rdr.wait_for_tag()
(error, tag_type) = rdr.request()
(error, uid) = rdr.anticoll()
rdr.select_tag(uid)
False
rdr.card_auth(rdr.auth_a, 10, [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF], uid)
False
rdr.card_auth(rdr.auth_a, 10, [0xF1,0xF1,0xF1,0xF1,0xF1,0xF1], uid)
True
rdr.card_auth(rdr.auth_a, 10, [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF], uid)
True

"E1"/"E2" error messages when increasing antenna gain above default

When adjust the antenna gain above the default value of 4 using the RFID.set_antenna_gain() method introduced in #32, e.g. in a slightly modified Read.py example, sequences of "E1" and "E2" are printed. They seem to originate from the RFID.card_write() method, however the code there is a bit opaque to me.

deauth() doesn't reset the authentication data

print "\nChanging Key"
util.write_trailer(1, (0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF), (0xFF, 0x07, 0x80), 105, (0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF))
util.deauth()

util.auth(rdr.auth_a, [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF])
util.do_auth(util.block_addr(1, 0))  # OUTPUT : Not calling card_auth - already authed
print "\nWriting modified bytes"   
rdr.write(4, [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])

I am changing the Trailer first and call the deauth(), but I called the do_auth, it said already authed.

I am wonder deauth() can give a total reset or not.
So I can change the Data Block after I changed the Trailer
Thanks!

stuck at wait_for_tag()

I follow exactly the instructions and double check them I'am using raspberry pi 3b+
I used to work with MFRC522 library and now decided to change this one but it seems reader does not read any card at all. No warning, no error.

What should I do?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.