wendlers / micropython-mfrc522 Goto Github PK
View Code? Open in Web Editor NEW(Micro)Python class to access the MFRC522 RFID reader
License: MIT License
(Micro)Python class to access the MFRC522 RFID reader
License: MIT License
Hi,
I am trying to run the do_read example but my status keeps being 2. What does this mean? What should I do.
Hello.
You made a mistake when you described the authentication process. According to the documentation, you need to transfer the last 4 bytes of the UID, and you are transferred the first 4 bytes.
This can be fixed as follows:
code
return self._tocard(0x0E, [mode, addr] + sect + ser[:4])[0]
replaced by
return self._tocard(0x0E, [mode, addr] + sect + ser[-4:])[0]
Hi
I am working on a project and want to enter Hexadecimal values for input data rather than ACII.
I am really new to RPi and also to Python. I dont know where to ask and how to get help.
Can someone help me with this
Hello.
Is there any way to use the IRQ pin to call an interrupt?
I could not find any solution for micropython.
I have mifare ultralight with 7byte uid. The software dont have the feature to read my RFID. Do someone here have the time to implement this feature?
Hi,
I'm trying to use the library on my wipy, the code seems to run because it prints
"Place card before reader to read from address 0x08")
However it looks like the RFID card isn't detected, Am I the only one?
I'm using the code with some modification on the pin because they're called G17 and not GP17
I just installed the libraries and called the do_read function from screen/serial-REPL. I'm not getting any readings (the reader works fine with my Arduino Mega). I would assume this has to do with the pinout, I'm really not sure how the pins map from the vanilla ESP8266 to the Adafruit Feather Huzzah. Here's the pinout I've been referencing: https://cdn-learn.adafruit.com/assets/assets/000/046/249/original/adafruit_products_Huzzah_ESP8266_Pinout_v1.2-1.png?1504885873. Any information you can offer would be greatly appreciated!
No Issue FYI
Thanks a lot // DANKE STEFAN! @wendlers !!! - that saved me a whole bunch of time...
***GREAT NEWS *** ESP32 (S) also works 😃
using upython 1.9.3 -> with some, real small, code extensions: that was a no brainer ... brain work has been done by Stefan.
SPI used ("HSPI") - remark: 1st, standard esp32 SPI didn't work, VSPI might work too, just try map the VSPI pins...
define HSPI pin mappings + RST aka reset module
#HSPI BUS #NodeMCU ESP32 WROOM printed on Pin@board
ESP32_HSPI_CLOCK = 14 #P14 (HSPICLK in ESP32 Docs)
ESP32_HSPI_SLAVE_SELECT = 15 #P15 (HSPICS0 in ESP32 Docs)
ESP32_HSPI_MISO = 12 #P12 (HSPIQ[uery] in ESP32 Docs)
ESP32_HSPI_MOSI = 13 #P13 (HSPID[ata] in ESP32 Docs)
ESP32_MFRC522_RST = 3 #SD3, as plain GPIO - can be any unused GPIO
and create in reader/writer:
elif board == 'esp32':
#hspi sck, mosi, miso, rst, cs
rdr = mfrc522.MFRC522(ESP32_HSPI_CLOCK, ESP32_HSPI_MOSI, ESP32_HSPI_MISO, ESP32_MFRC522_RST, ESP32_HSPI_SLAVE_SELECT)
further more allow esp32 same as esp8266 in mrfc522.py:
elif board == 'esp8266' or board == 'esp32':
that's all. Tags shipped with the MFRC522 are recognized fully, other china's set reads at least UID, but not the 0x08-address ("Auth error") - nevertheless for a good/bad recognition this is really fine for me.
Hi there, @wendlers and thanks for giving me the confidence to combine mfrc522 with micropython in a project!
I have tested the read and write examples and they are functional on the Mifare 1k tag I have.
However, I am struggling to know, for example, how to write to any other parts of the card than '8', whatever that means. If I could figure it out, I could perhaps prepare a PR with documentation which someone could sanity-check for me.
Given in both read.py and write.py only 16 bytes are manipulated, it must be a single sector and block which is being read/written, but I cannot pin down where the block index is specified, assuming 8 is the sector. Given a specific target sector has been unlocked (via auth) I understand I should be able to write up to the first 3 blocks of 16 bytes, but mystified how to fully specify sector and block for reads and writes I am afraid.
It's not clear from the reader's method signatures, whether the write method's addr
relates to sector or block or some combination of the two (e.g. all blocks are numbered 0-64). It can't be block as there's only 4 blocks, and the demo writes to 8. However, if that isn't the block address, I am struggling to find at which point of the api you can, for example address block 2 in sector 8.
Equally, the auth
method which unlocks access to a sector takes a 'sect' argument, but in the write.py example a 'key' is passed to it, containing multiple bytes, so that can't be the sector argument. There appears to just be a single addr argument throughout, rather than separate indexes for sector and block.
All in all, I am struggling to interpret the available functions without documentation, at least identifying what the parameters represent, given you have sensibly given them short names for a low-resource environment like micropython.
8266 case
how to realize the function of clone.
https://www.python.org/dev/peps/pep-0008/
Most python coders follow that fully or mostly and it recommends "Spaces are the preferred indentation method." and "Use 4 spaces per indentation level.".
One of the still open PRs is rather messy to review because @wendlers code uses tabs and the code in the PR was (maybe automatically) reformatted to use 4 spaces per indentation level.
Such issues could be avoided by following pep8's "4 spaces" advice.
If a pure fix-pep8 PR is welcome I'ld offer to do it (no functionality changes, just fix code formatting).
Hi. Thanks for sharing. You wouldn't happen to know which pins to use with an Wemos D1 mini (esp8266)?
https://micropython-on-wemos-d1-mini.readthedocs.io/en/latest/setup.html#development-board
You listed GPIO pins like this: "GP14", "GP16", "GP15", "GP22", "GP14" and it must be
"GP14", "GP16", "GP15", "GP22", "GP17".
Hello,
In the readme file the table for WiPy pins which seems to be different for WiPy 2.0
I see in the WiPy 2.0 documentation the pins for CLK - SCK (P10) MOSI (P11) & MISO (P12) .
https://docs.pycom.io/chapter/firmwareapi/pycom/machine/SPI.html
My problem is that I do not know how to identify the WiPy 2.0 pins for "rst" and "cs" as in the readme table.
Thank you in advance.
Hi.
I tried to use the micropython-mfrc522 ... is it possible to read the saved dataset on a RFID-tag and the UID of that tag with this code? What do I have to change in read.py to achieve this?
I also tried to identify the UID (scanned as hex-code) ... i.e. the mfrc522-scanner gives me
"0x880419ee" whereas I get "04:19:EE:B2:75:71:81" on a smatphone (with the App "NFC-Tools"). How to convert the former to the latter?
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.