Git Product home page Git Product logo

micropython-mfrc522's People

Contributors

jr-k avatar wendlers 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

micropython-mfrc522's Issues

MFRC522 Hexadecimal input

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

Problem with the library on my wipy

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

stat is 2 (error status)

Hi,

I am trying to run the do_read example but my status keeps being 2. What does this mean? What should I do.

Improved documentation

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.

Authenticatшт mistake

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]

Can not read 7 or 10 bytes uid

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?

also fine on esp32s

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.

Readme mistake

You listed GPIO pins like this: "GP14", "GP16", "GP15", "GP22", "GP14" and it must be
"GP14", "GP16", "GP15", "GP22", "GP17".

Reading the Dataset and the UID of a RFID-Tag?

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!

ESP8266 Adafruit Feather Huzzah

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!

Interrupt with IRQ

Hello.

Is there any way to use the IRQ pin to call an interrupt?
I could not find any solution for micropython.

follow pep8?

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).

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.