libnfc | allows userspace application access to NFC devices
kandi X-RAY | libnfc Summary
kandi X-RAY | libnfc Summary
libnfc is a library which allows userspace application access to NFC devices. The official web site is: The official forum site is: The official development site is: Important note: this file covers POSIX systems, for Windows please read README-Windows.txt.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of libnfc
libnfc Key Features
libnfc Examples and Code Snippets
Community Discussions
Trending Discussions on libnfc
QUESTION
Trying to read various payment cards using PN532 NFC RFID Module. libnfc6 sucessfully polls most of the nfc cards and even mobile payment method is detected, but none of my Revolut cards are detected by nfc-poll app.
libnfc was compiled locally from libnfc-1.8.0 git tag.
My current polling setup:
...ANSWER
Answered 2021-Apr-08 at 08:03Buying new PN532 NFC RFID Module solved the issue.
QUESTION
I am trying to communicate with an NFC reader/writer on a raspberry pi 3 using dotnet core.
I have to say that the different libnfc command line tools I used are all working fine (aka I can read and poll my tags, no problem on this side).
The idea is to use dotnet core and C# to orchestrate the libnfc library and it seems to work fine except as soon as the function I call returns a string, I get the following error message:
...ANSWER
Answered 2021-Feb-23 at 09:39The comment from Matthew Watson and the link he shared had the correct answer!
So I modified the pinvoke line like this:
QUESTION
I have LibNFC working from the Linux terminal recognising my ACR122U Reader, and I wanted to know if there was a method for it to work through Chrome on a Linux Desktop as it is really similar to Android Support, with all the NFC device handling done by libnfc and the browser just has to know about this library instead of every type usb or other device than can do NFC.
I have tried using the WebNFC API to connect it :
...ANSWER
Answered 2021-Feb-10 at 06:54Web NFC is supported on Android only as of February 2021. See https://web.dev/nfc/
The WebUSB error suggests you're requesting an interface that implements a protected class (among those below):
QUESTION
I have been trying to detect an tag using the PN532 module that I bought from amazon here:
https://www.amazon.ca/ASHATA-Controller-Raspberry-Interface-Switching/dp/B07XFNDHNS
I followed the tutorial here:
http://wiki.sunfounder.cc/index.php?title=PN532_NFC_Module_for_Raspberry_Pi
I tried using both I2C or SPI, but both results just give me the following when I run nfc-poll:
...ANSWER
Answered 2020-Mar-30 at 01:55Answer
Update 2020mar29hkt2040
Part 1 - libnfc v1.17 I2C config tested OK
The OP has no luck in testing libnfc I2C mode and SPI mode. I tried I2C mode and found everything OK. I guess the OP has not set the config file, or has not set "auto scan = true". See my example libnfc171 config file in Appendix A. PS - (1) My NFC reader can detect a tag without any problem. (2) I am using Rpi4B buster 2020mar13.
Part 2 - Now testing SPI mode 2020mar29hkt2044
Sunfounder config instructions recommends lowering SPI speed 50kHz. So I have changed the /bbo/config.txt file as shown in Appendix F.
/ to continue, ...
References
(1) The OP's NFC RFID Controller Module
(2) SunFounder Rpi PN532 NFC Module Tutorial
(4) Libnfc Configuration Manual
(5) Libnfc Main Page
(7) Libnfc: nfc-list
(8) MIFARE Card
Appendices
Appendix A - Installing libnfc 1.7.1
Appendix B - Reading a tag
Appendix C - NFC Reader Tested
Appendix D - My NFC readers and tags
Appendix E - PN532 NFC reader V3 Wiring
Appendix F - SPI configuration for testing PN532 using libnfc 1.1.7
QUESTION
I try to use an ACR122 USB NFC-Reader on Mac OSX Mojave 10.14.6 with libnfc and I've got a "Unable to write to USB (Result too large)" error when I try to use the command LIBNFC_LOG_LEVEL=3 nfc-list
:
ANSWER
Answered 2020-Feb-06 at 21:49Your step 4, editing /usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist
worked for me and it is the only clean solution I could find.
Here a short description what you need to do:
- disable 'System Integrity Protection'
- removes 3 matching lines (with the same array index!) from the the 3 arrays ifdFriendlyName, ifdVendorID and ifdProductID of the plist
/usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist
- enable 'System Integrity Protection'
The three lines in my case were the entry number 370:
- ifdFriendlyName="ACS ACR122U PICC Interface"
- ifdVendorID=0x072F
- ifdProductID=0x2200
Detailed step by step description:
- unplug your NFC card reader
- shut down OSX
- hold down the keys
+
on the keyboard while starting your Mac to enter recovery mode - in the recovery mode open a Terminal Window using the 'Utility' menu
- execute the command
csrutil disable
- reboot your Mac normally
open a Terminal window and execute the following commands:
QUESTION
I have trouble with using my ACR122U RFID card reader form ACS. I need to connect it to my Mac using the PC/SC driver. I installed the driver from the ACS website and confirmed that it's running.
However, whenever I test using the nfc-list
command, I get the following error:
ANSWER
Answered 2017-Aug-11 at 10:19You seem to be mixing two different options for connecting the ACR122U to libnfc:
You can either use the direct USB driver for the ACR122U,
libnfc.driver.acr122_usb
(which is what you are currently using). In this case, you need to make sure that the PC/SC daemon does not take over control of the reader (since only one instance can access the USB interface of the reader at a time).- The quick-and-dirty fix is to disable the PC/SC daemon that takes control over the ACR122U. Though this is not straight forward on Mac OS X, a detailed explanation can be found in Ludovic's blog.
Alternatively, you could prevent the PC/SC daemon from taking control over that specific reader by editing
/usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist
. You would need search for the entry
QUESTION
I have a problem with libnfc on a Raspberry Pi 3B trying to read data from a PN532 card reader. I installed libnfc as the official site suggest to do and in fact it all worked this morning. I was able to detect my device using the nfc-list
and nfc-scan-device
commands.
Then I tried to run a C program (not done by me, but done by a person here in the company) and it worked. Did it again and it didn't work, but returned an error. Tried to run the nfc-list command and it returned the same error. Since then, it looks like the libnfc library stopped working properly.
These are the errors I get when I try to run some commands:
nfc-list
:
ANSWER
Answered 2019-Mar-25 at 04:54Have the same problem it was a problem on the circuit I believe. Taking it off and re putting it back solved the problem for me.
QUESTION
Testing with a DESFire, I picked up the following ATS: 0x75 0x77 0x81 0x02 0x80
.
From what I can tell, ISO/IEC 14443-4 says that the first byte should be the "length byte" and should indicate the total number of bytes sent as part of the ATS. Why, then, is the first byte 0x75
? If you ignore the first nibble, the value is correct, but is there any reason I should actually have to do that, or is there no relation between this byte and the length value?
Note: The ATS was obtained via libnfc through nfc_initiator_select_passive_target
.
ANSWER
Answered 2019-Feb-13 at 09:33The ATS is perfectly fine. libnfc does not include the length byte in the value stored in nt.nti.nai.abtAts
. Instead, the length of the ATS is stored in nt.nti.nai.szAtsLen
. Consequently, the first byte is not the length byte but the format byte. It indicates that TA(1), TB(1), and TC(1) are present (Y(1) = 7h), and that the FSC is 64 bytes (FSCI = 5h). The remaining bytes then decode as:
- TA(1) = 77h: all three divisors supported for both directions
- TB(1) = 81h: FWT = 256 * 16 / f_c * 2^8 = 77 ms, SFGT = 256 * 16 / f_c * 2^1 = 600 us
- TC(1) = 02h: CID supported, NAD not supported
- Historical bytes: 80h
QUESTION
What do they refer to with GKI here? What does it abbreviate?
...ANSWER
Answered 2018-Oct-28 at 18:21It seems to stand for General Kernel Interface, not that it is much useful as itself.
For example:
The libnfc-nci implementation uses a reliable mechanism of queues and message passing named General Kernel Interface (GKI) to easily communicate between layers and modules: Each task is isolated, owning a buffer (or inbox) where messages are queued and processed on arrival. This mechanism is used to send messages from the DH to the NFCC chip, and vice versa.
(Radio Frequency Identification: 11th International Workshop, RFIDsec 2015)
QUESTION
I am trying to implement python-to-c binding via ctypes
for libnfc
.
I have a structure, here is a wrong variant:
ANSWER
Answered 2018-Mar-27 at 22:44The issue here is that the C struct you're trying to map is packed, as (tersely) explained in the Structure/union alignment and byte order section of the docs:
By default, Structure and Union fields are aligned in the same way the C compiler does it. It is possible to override this behavior be specifying a
_pack_
class attribute in the subclass definition. This must be set to a positive integer and specifies the maximum alignment for the fields. This is what#pragma pack(n)
also does in MSVC.
That only makes sense if you already know about packing and alignment in C, but it's not that complicated.
By default, C structure elements are aligned to start on nice boundaries. For example, a 32-bit int following an 8-bit int doesn't run from bytes 1-4, it runs from bytes 4-7 (and bytes 1-3 are unused padding). So, ctypes
follows the same rules.
That means that, while szUidLen
runs from bytes 3-10 when it's defined as an array of 8-bit ints, it gets aligned to bytes 8-15 (or 4-11, depending on your compiler) when it's defined as a 64-bit int. You can see this by printing out nfc_iso14443a_info.szUidLen.offset
.
So, the first one gets the bytes 7, 0, 0, 0, 0, 0, 0, 0
, which is little-endian int64 for 7
, while the second one gets the bytes 0, 0, 0, a, b, c, d, e
, where abcde
are the first 5 bytes of the next field, which is little-endian int64 for some huge number (unless the next field happens to be 0).
Of course you don't want to just guess that this is the problem. If you based your Structure
on a struct
from a C header, this can only be true if the header or the compile flags specify some non-default packing, like the #pragma pack(1)
used by MSVC. If you based your Structure
on something like an RFC packet description, the alignment is not even according to C rules, but is defined somewhere in the documentation you're reading (although protocol RFCs almost always use 1-byte alignment).
Anyway, the docs don't explain the problem very well, but they explain the solution:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install libnfc
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page