InOut的NFC接口

inout-nfc的Python项目详细描述


inout nfc公司

扫描

Usage: inout_nfc scan [OPTIONS]

  Listen for chip cards to be scanned with an nfc reader/writer and make an
  API call to InOut for each detected chip-id.

Options:
  --usb_port [ul|bl|ur|br]  USB port the NFC reader is connected to.
  --api_url TEXT            InOut API url.  [required]
  --api_key TEXT            InOut API key.
  --scanner TEXT            Unique scanner name, ie: "reception1".  [required]
  --help                    Show this message and exit.

ACR122 nfc读写器

ACR122 nfc读写器不向USB暴露序列号 接口。当将多个读卡器连接到一个树莓Pi时,它是 找到特定阅读器的USB地址是很重要的。在

^{pr2}$

此ACR122已分配USB设备001:013。这个数字会增加 插入USB设备。在

$ lsusb |grep 072f
Bus 001 Device 014: ID 072f:2200 Advanced Card Systems, Ltd ACR122U

您可以使用udevadm命令跟踪USB路径:

$ udevadm info -q name /sys/bus/usb/devices/1-1.3
bus/usb/001/014

nfcpy模块允许以不同的方式指定usb读卡器设备:

assert clf.open('usb:003:009') is True    # open device 9 on bus 3
>>> assert clf.open('usb:054c:02e1') is True  # open first PaSoRi 330
>>> assert clf.open('usb:003') is True        # open first Reader on bus 3
>>> assert clf.open('usb:054c') is True       # open first Sony Reader
>>> assert clf.open('usb') is True            # open first USB Reader

因为我将在这个应用程序中使用Raspberry Pi,所以我决定使用 用于寻址nfc读卡器的物理USB路径。在

这是树莓皮3B+的布局:

  +--------+
  | ether- |   [ 1-1.1.2 ]   [   1-1.3 ]
  |   net  |   [ 1-1.1.3 ]   [   1-1.2 ]
  +--------+ 
===========================================

这对π2来说略有不同。在

以下代码用于将usb nfc读卡器分配给物理usb端口:

  +--------+
  | ether- |   [ tl ]   [   tr ]
  |   net  |   [ bl ]   [   br ]
  +--------+ 
===========================================

带有usb nfc读卡器的扫描仪进程的命令行示例 连接到左上角的usb端口如下所示:

inout_nfc scan --usb-port tl --scanner reception1 --api_url https://inout.example.com --api_key MYSECRETKEY

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java从Dropwizard中的Minio检索文件时,GET请求中的超时是如何处理的?   带Hibernate的java Jackson用于序列化以避免枚举   Raspberry Pi上的java Jave分段错误   java在屏幕旋转时不保存当前片段和数据   java War文件未在Heroku上正确部署   如何使用Java处理Selenium webdriver中的促销广告或cookie   java处理“用法:PApplet[options]<classname>[sketch args]”   java文本文件错误扫描程序   运行第一个JavaFX模块化程序时出现java异常   java将fileoutputstream转换为字符串   如何调试gstreamerjava?   java Spring RestTemplate ResponseBody类是什么样的   如何将JSON数组转换为Java列表。我在用斯文森   javascript在显示div按钮后进入新页面