Closed psamtam closed 4 months ago
What I actually want to do is:
Ideal pseudocode:
reader = BasicMFRC522()
while True:
id = read_id_no_block()
if not id:
continue
log the id
sleep(x seconds)
Is this a good approach?
Update:
I git clone the repository to my local storage, create a setup.py, and run sudo python setup.py install
and it works. It doesn't hang.
setup.py:
from setuptools import setup, find_packages
setup(
name='mfrc522',
version='0.0.7+1',
description='Based on mfrc522-python 0.0.7',
packages=find_packages('src'),
package_dir={'': 'src'},
install_requires=[
'spidev==3.6',
],
)
Still not sure why using the package with pip install mfrc522-python
does not work. But if it works, it works (?)
Hi. I am trying to read the tag with the MFRC522 reader. Here is my problem:
If I put the tag on the reader before executing the code, it works; If I put the tag on the reader after executing the code, it hangs/freezes for ~700 seconds.
Here is my code:
Here is the output when i put the tag on the reader before executing the code:
Here is the output when I put the tag on the reader after executing the code:
I was wondering if this causes the problem: (Screenshot of MFRC522.py)![image](https://github.com/1AdityaX/mfrc522-python/assets/69910078/bfcccf11-4fe1-4787-8e86-cb71b777a304)
Reasons:
MI_ERR
, which is the default state ofMFRC522_ToCard
If you have any idea about this, please let me know. Thanks!!
P.S. I am running the script on a Raspberry Pi Zero 2 W (32-bit Raspberry Pi OS Lite)