如何使用树莓派和ACR122U读取NFC标签数据
我正在开发一个 python 项目,该项目需要从 NFC 标签(特别是 URL)读取数据。
我购买了 USB NFC 读卡器,并且正在使用 libnfc 库。我的树莓派可以正确识别阅读器和标签,并且它可以使用 nfc-poll 正确识别标签何时存在。但是,它只提供有关标签 ID、ATQA 和 SAK 的信息(我不确定最后两个是什么)。它本身没有给我数据/网址。
任何在读取标签数据方面的帮助,无论是使用 libnfc 还是其他方式,我们将不胜感激。我在 Python 方面经验丰富,但以前从未做过类似的项目,因此尽可能简单将不胜感激。
我的 python 代码非常简单:
from subprocess import call
while True:
try:
call('nfc-poll')
except:
print('Error')
break
呈现标签时的输出如下所示:
ISO/IEC 14443A (106 kbps) target:
ATQA (SENS_REF): 00 44
UID (NFC1D1): 04 7b a7 2c d0 6c 80
SAK (SEL_RES): 00
I'm working on a python project that requires reading data from NFC tags- specifically URLs.
I purchased a USB NFC reader and am using the libnfc library. I have my raspberry pi recognizing the reader and tags properly, and it correctly identifies when a tag is present using nfc-poll. However, it only gives me information on the tag's ID, ATQA, and SAK (I'm not sure what the last two are). It doesn't give me the data/url itself.
Any help would be appreciated in reading the tag data, either with libnfc or something else. I'm experienced in Python but have never done a project anything like this before so as simple as possible would be appreciated.
My python code is pretty simple:
from subprocess import call
while True:
try:
call('nfc-poll')
except:
print('Error')
break
And the output when a tag is presented looks like this:
ISO/IEC 14443A (106 kbps) target:
ATQA (SENS_REF): 00 44
UID (NFC1D1): 04 7b a7 2c d0 6c 80
SAK (SEL_RES): 00
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论