Giter Site home page Giter Site logo

libnfc's Introduction

An attempt to add make a libnfc driver for the RC522 module.
/!\ It's not working :(  I never finish this !


*-
* Free/Libre Near Field Communication (NFC) library
* 
* Libnfc historical contributors:
* Copyright (C) 2009      Roel Verdult
* Copyright (C) 2009-2015 Romuald Conty
* Copyright (C) 2010-2012 Romain Tartière
* Copyright (C) 2010-2013 Philippe Teuwen
* Copyright (C) 2012-2013 Ludovic Rousseau
* Additional contributors:
* See AUTHORS file
-*

General Information
===================

libnfc is a library which allows userspace application access to NFC devices.

The official web site is:
  http://www.nfc-tools.org/

The official forum site is:
  http://www.libnfc.org/community/

The official development site is:
  https://github.com/nfc-tools/libnfc

Important note: this file covers POSIX systems, for Windows please read README-Windows.txt

Requirements
============

Some NFC drivers depend on third party software:

* pn53x_usb & acr122_usb:

   - libusb-0.1 http://libusb.sf.net

* acr122_pcsc:

   - pcsc-lite http://pcsclite.alioth.debian.org/

The regression test suite depends on the cutter framework:
http://cutter.sf.net

Installation
============

See the file 'INSTALL' for configure, build and install details.

Additionnally, you may need to grant permissions to your user to drive your device.
Under GNU/Linux systems, if you use udev, you could use the provided udev rules.
  e.g. under Debian, Ubuntu, etc.
    sudo cp contrib/udev/42-pn53x.rules /lib/udev/rules.d/

Under FreeBSD, if you use devd, there is also a rules file: contrib/devd/pn53x.conf.

Configuration
=============

In order to change the default behavior of the library, the libnfc uses a
configuration file located in sysconfdir (as provided to ./configure).

A sample commented file is available in sources: libnfc.conf.sample

If you have compiled using:
  ./configure --prefix=/usr --sysconfdir=/etc
you can make configuration directory and copy the sample file:
  sudo mkdir /etc/nfc
  sudo cp libnfc.conf.sample /etc/nfc/libnfc.conf

To configure multiple devices, you can either modify libnfc.conf or create a
file per device in a nfc/devices.d directory:
  sudo mkdir -p /etc/nfc/devices.d
  printf 'name = "My first device"\nconnstring = "pn532_uart:/dev/ttyACM0"\n' | sudo tee /etc/nfc/devices.d/first.conf
  printf 'name = "My second device"\nconnstring = "pn532_uart:/dev/ttyACM1"\n' | sudo tee /etc/nfc/devices.d/second.conf

How to report bugs
==================

To report a bug, visit https://github.com/nfc-tools/libnfc/issues and fill
out a bug report form.

If you have questions, remarks, we encourage you to post this in the developers
community: 
http://www.libnfc.org/community

Please make sure to include:

* The version of libnfc

* Information about your system. For instance:

   - What operating system and version
   - For Linux, what version of the C library

  And anything else you think is relevant.

* A trace with debug activated.

  Reproduce the bug with debug, e.g. if it was:
  $ nfc-list -v
  run it as:
  $ LIBNFC_LOG_LEVEL=3 nfc-list -v

* How to reproduce the bug.

  Please include a short test program that exhibits the behavior. 
  As a last resort, you can also provide a pointer to a larger piece 
  of software that can be downloaded.

* If the bug was a crash, the exact text that was printed out
  when the crash occured.

* Further information such as stack traces may be useful, but
  is not necessary.

Patches
=======

Patches can be posted to https://github.com/nfc-tools/libnfc/issues

If the patch fixes a bug, it is usually a good idea to include
all the information described in "How to Report Bugs".

Building
========

It should be as simple as running these two commands:

./configure
make

Troubleshooting
===============

Touchatag/ACR122:
-----------------
If your Touchatag or ACR122 device fails being detected by libnfc, make sure
that PCSC-lite daemon (pcscd) is installed and is running.

If your Touchatag or ACR122 device fails being detected by PCSC-lite daemon
(pcsc_scan doesn't see anything) then try removing the bogus firmware detection
of libccid: edit libccid_Info.plist configuration file (usually
/etc/libccid_Info.plist) and locate "<key>ifdDriverOptions</key>", turn
"<string>0x0000</string>" value into 0x0004 to allow bogus devices and restart
pcscd daemon.

ACR122:
-------
Using an ACR122 device with libnfc and without tag (e.g. to use NFCIP modes or
card emulation) needs yet another PCSC-lite tweak: You need to allow usage of
CCID Exchange command.  To do this, edit libccid_Info.plist configuration file
(usually /etc/libccid_Info.plist) and locate "<key>ifdDriverOptions</key>",
turn "<string>0x0000</string>" value into 0x0001 to allow CCID exchange or
0x0005 to allow CCID exchange and bogus devices (cf previous remark) and
restart pcscd daemon.

Warning: if you use ACS CCID drivers (acsccid), configuration file is located
in something like: /usr/lib/pcsc/drivers/ifd-acsccid.bundle/Contents/Info.plist

SCL3711:
--------
Libnfc cannot be used concurrently with the PCSC proprietary driver of SCL3711.
Two possible solutions:
* Either you don't install SCL3711 driver at all
* Or you stop the PCSC daemon when you want to use libnfc-based tools

PN533 USB device on Linux >= 3.1:
---------------------------------
Since Linux kernel version 3.1, two kernel-modules must not be loaded in order
to use libnfc : "nfc" and "pn533".
To prevent kernel from loading automatically these modules, you can blacklist
them in a modprobe conf file. This file is provided within libnfc archive:
  sudo cp contrib/linux/blacklist-libnfc.conf /etc/modprobe.d/blacklist-libnfc.conf

Proprietary Notes
=================

FeliCa is s registered trademark of the Sony Corporation.
MIFARE is a trademark of NXP Semiconductors.
Jewel Topaz is a trademark of Innovision Research & Technology.
All other trademarks are the property of their respective owners.

libnfc's People

Contributors

adamlaurie avatar alexlian avatar arkusuma avatar c3be avatar cyberbobs avatar doegox avatar evgeny-boger avatar ikelos avatar iwamatsu avatar jiapengli avatar leg0 avatar ludovicrousseau avatar mativait avatar mincka avatar neffs avatar neomilium avatar openturns-appveyor avatar pmeerw avatar quantum-x avatar smortex avatar ste-m5s avatar xantares avatar xaqq avatar zuck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

libnfc's Issues

RC522 Config

hi...
how can i use libnfc and MFCUK with RC522 module?

Can't compile

Hello,
I can't compile your libnfc with make or cmake.
Moreover, I don't find the INSTALL file.
I would like some help please.
Thank you.

doesn't really work

Hi!
I reviewed both this fork and @socram8888 's pull request.
Fixed building with cmake, see my repo
Still attempring to run yields disappointing results:

 $ LIBNFC_LOG_LEVEL=3 ./nfc-anticol
info	libnfc.config	Unable to open file: /etc/nfc/libnfc.conf
debug	libnfc.config	key: [device.allow_autoscan], value: [false]
info	libnfc.config	Unknown key in config line: device.allow_autoscan = false
debug	libnfc.config	key: [device.log_level], value: [3]
info	libnfc.config	Unknown key in config line: device.log_level = 3
debug	libnfc.config	key: [device.name], value: [MFRC522]
debug	libnfc.config	key: [device.connstring], value: [rc522_uart:/dev/ttyUSB0]
debug	libnfc.general	log_level is set to 3
debug	libnfc.general	allow_autoscan is set to true
debug	libnfc.general	allow_intrusive_scan is set to false
debug	libnfc.general	1 device(s) defined by user
debug	libnfc.general	  #0 name: "MFRC522", connstring: "rc522_uart:/dev/ttyUSB0"
debug	libnfc.driver.rc522_uart	Attempt to open: /dev/ttyUSB0.
debug	libnfc.driver.rc522_uart	Attempting to establish a connection at 9600 bps.
debug	libnfc.bus.uart	Serial port speed requested to be set to 9600 baud.
debug	libnfc.bus.uart	TX: b7
debug	libnfc.bus.uart	RX: 12
debug	libnfc.chip.rc522	RD 37: 12
debug	libnfc.chip.rc522	Aborting self test for unknown version 12.
debug	libnfc.bus.uart	TX: 01
debug	libnfc.bus.uart	RX: 01
debug	libnfc.bus.uart	TX: 2f
debug	libnfc.chip.rc522	WR 01: 2f
debug	libnfc.driver.rc522_uart	Restoring baud rate to default of 9600 bps.
debug	libnfc.bus.uart	Serial port speed requested to be set to 9600 baud.
debug	libnfc.bus.uart	TX: 81
debug	libnfc.bus.uart	RX: 20
debug	libnfc.chip.rc522	RD 01: 20
debug	libnfc.driver.rc522_uart	Upgrading baud rate to user-specified 115200 bps.
debug	libnfc.bus.uart	Serial port speed requested to be set to 115200 baud.
debug	libnfc.bus.uart	TX: 1f
debug	libnfc.bus.uart	RX: 00
debug	libnfc.driver.rc522_uart	rc522_uart_write ack does not match (sent 1F, received 00)
error	libnfc.chip.rc522	Unable to write register 1F!
debug	libnfc.driver.rc522_uart	Attempting to establish a connection at 115200 bps.
debug	libnfc.bus.uart	Serial port speed requested to be set to 115200 baud.
debug	libnfc.bus.uart	TX: b7
debug	libnfc.bus.uart	RX: 00
debug	libnfc.chip.rc522	RD 37: 00
debug	libnfc.chip.rc522	Aborting self test for unknown version 00.
debug	libnfc.bus.uart	TX: 01
debug	libnfc.bus.uart	RX: 00
debug	libnfc.driver.rc522_uart	rc522_uart_write ack does not match (sent 01, received 00)
error	libnfc.chip.rc522	Unable to write register 01!
debug	libnfc.driver.rc522_uart	Could not connect with RC522 at 9600 or 115200 bps.
debug	libnfc.bus.uart	TX: 01
debug	libnfc.bus.uart	RX: 00
debug	libnfc.driver.rc522_uart	rc522_uart_write ack does not match (sent 01, received 00)
error	libnfc.chip.rc522	Unable to write register 01!
debug	libnfc.general	Unable to open "rc522_uart:/dev/ttyUSB0".
nfc-anticol: ERROR: Error opening NFC reader

This is the current state of the port, right?

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.