rfid-rc522 标签未读取 [英] rfid-rc522 Tag is not read

查看:66
本文介绍了rfid-rc522 标签未读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 https://pimylifeup.com/raspberry-pi-的说明-rfid-rc522/ 学习如何阅读我的 rfid-rc522.

I am using the instructions of https://pimylifeup.com/raspberry-pi-rfid-rc522/ to learn how to read my rfid-rc522.

我安装了所有需要的东西,并从 git 克隆了所有文件.我相应地连接并仔细检查了电线.

I installed all the things needed, and cloned from git all the files. I connected accordingly and double checked the wire.

Write.py 中的代码是

The code in Write.py is

#!/usr/bin/env python

import RPi.GPIO as GPIO
import SimpleMFRC522

reader = SimpleMFRC522.SimpleMFRC522()

try:
        text = raw_input('New data:')
        print("Now place your tag to write")
        reader.write(text)
        print("Written")
finally:
        GPIO.cleanup()

当我运行它时 - 结果在现在放置您的标签以写入"之后停止,并且当我放置标签时没有任何反应.请问有什么帮助吗?这里有什么问题?模块亮红灯表示已连接.真的有联系吗?我怎么知道?请帮忙.

When I run it- The result stops after "Now place your tag to write" and nothing happens when I place my tag. Any help please? What's wrong here? The module gives red light meaning it is connected. Is it really connected? How do I know? Please help.

由于已经保存了数据,我在这个问题中的标题和标签是错误的.我编辑了.:)

My title and tags were wrong in this question due to already saved data. I edited. :)

推荐答案

阅读器无法检索任何数据的原因可能有多种:

It can be multiple reasons why your reader is not retrieving any data:

  • The RFID cards that you are providing to the reader are not supported by the ISO 14443: Mifare Classic, 4K. (Some DesFire, etc...) are the cards you want to try. Source: https://en.wikipedia.org/wiki/ISO/IEC_14443

MFRC522 没有接收到足够的输入电压.尝试从 3.3V 增加到 4V.我已经尝试了 5V 个月,阅读器仍然运行良好,但要小心.NXP 的安全范围是 2.5V3.6V.来源:https://www.nxp.com/docs/en/数据表/MFRC522.pdf

The MFRC522 is not receiving enough input voltage. Try to increase from 3.3V to 4V. I have tried with 5V months and the reader is still running perfectly, but be cautious. The safe range in NXP is from 2.5V to 3.6V. Source: https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf

您使用的不支持 IRQ(中断请求).这意味着读取 UID 的过程是高 CPU 消耗和低性能的.尝试使用这个支持中断的流行库:https://github.com/ondryaso/pi-rc522 .您需要将另一根线从 MFRC522 中的 IRQ 引脚连接到 Raspberry 中一个免费且支持读/写操作的 GPIO 引脚.

The library you are using does not support IRQ (Interruption Request). This means the process of reading UIDs is high CPU consuming and low in performance. Try to use this popular library which supports interruptions: https://github.com/ondryaso/pi-rc522 . You will need to connect another wire from the IRQ pin in the MFRC522 to one GPIO pin in the Raspberry that is free and supports reading/writing operations.

检查 SPI 接口是否在 Raspbian 中启用.打开终端并运行:

Check if SPI interfaces are enable in Raspbian. Open a terminal and run:

ls -l/dev/spi

最后,可能是您的阅读器坏了.一些中文版本不能正常工作.也许你应该再买一个,试试运气.

Lastly, it could be that your reader is broken. Some chinese versions do not work as they should do. Maybe you should buy another one and try more luck.

我想您已经以正确的方式在 MFRC522 和 Raspberry Pi 之间连接了所有电缆.再检查一下.

I suppose you have connected all cables in the correct way between the MFRC522 and the Raspberry Pi. Check that again.

这篇关于rfid-rc522 标签未读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆