Online Store

USB-connected µFR Nano Online NFC RFID Reader Writer on the Raspberry Pi

USB-connected µFR Nano Online NFC RFID Reader Writer on the Raspberry Pi #

To connect and run the µFR Nano Online reader plugged into the Raspberry Pi USB port, follow the instructions below:

1) USB-CONNECTED µFR NANO ONLINE NFC READER INSTALLATION #

All µFR series devices require the FTDI drivers for USB communication. This also applies to the µFR Nano Online NFC reader if it is used as a standard USB device. 

If you have no FTDI drivers installed on your installed Raspberry Pi, please follow the manual for the FTDI drivers installed on the Linux-based platforms. This article is also available in our Knowledge Base.

Important notice: Before you proceed with the µFR Nano Online implementation, make sure you grant the USB PORT access permission to the local user (the script is available in our GitLab projects repository).

Once you have the FTDI drivers installed with your USB-connected NFC reader, you will be able to open the port and establish communication with the device by the ReaderOpen function provided by the ufr library

uf nfc reader libraries sdk project for linux - nfc reader raspberry pi software

Important notice: The recommended library for the Raspberry Pi is the 64-bit aarch64. However, there are some known problems with aarch64 on a Raspberry Pi 4 with 8 GB related to the USB-A 2.0 and 3.0 ports functionality. Those ports might not work with the generic aarch64 kernel that is included with the distribution. This can be fixed by not using the generic mainstream kernel, but a Pi 4-specific kernel based on the kernel provided by the Raspberry Pi Foundation, available at https://github.com/raspberrypi/linux. Arch Linux ARM has this kernel available, but it is not installed by default.
Alternatively, you can use the 32-bit arm-hf (ARMv7) instead of the aarch64 (ARMv8). The ARMv8 architecture allows an AArch32->AArch64 transition as the result of an exception/interrupt, as well as the AArch64->AArch32 on return from an exception.

2) SDK SOFTWARE TESTING #

Each of our SDK projects includes the ufr-lib folder with the libraries for all the support platforms. In case this folder is missing for some reason, the libraries can be downloaded separately and added to the project.

As for the compiled software examples, here are some of the SDK projects with the compiled executable software that you can use for your project starting point.

Python example #

SDK project: https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-mf-examples-python

 

ufr nfc reader mifare software python sdk

Make sure you change the uFCoderSimple.py file mode (permission) to the executive (chmod +x).

C Console example #

SDK project: https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-mf-examples-c

 

ufr nfc reader mifare software c console sdk

Make sure you change the ufr file mode (permission) to the executive (chmod +x).

Java example #

SDK project: https://www.d-logic.com/code/nfc-rfid-reader-sdk/ufr-mf-examples-java #

ufr nfc reader mifare software java sdk

Make sure you change the uFCoderSimple.jar file mode (permission) to the executive (chmod +x).

3) NETWORK COMMUNICATION PARAMETERS #

If you’ve purchased the NFC reader with the wireless connectivity enabled, your final intention is probably to use the device that is not directly plugged into the RPi’s USB port.
If so, to establish communication with the WiFI, Bluetooth, or Ethernet-connected reader by the software running on the Raspberry Pi you need to use the ReaderOpenEx function with the required port parameters instead of the simple ReaderOpen function that automatically searches for the reader just on the physically available ports.  Both these functions, including the required ReaderOpenEx function parameters, are explained in the uFR API document (page 25).
You can also find its implementation example under the reader opening “advanced options” of our SDK projects.

IMPORTANT: The known problem of the ReaderOpen and ReaderOpenEx function with Argument: 0 on the Raspberry Pi is the occasional communication break due to the session expiry.  The reader’s port is automatically closed in a short time. To overcome this problem, please make sure you use the parameter UNIT_OPEN_RESET_DISABLE for the Argument.

Parameters example:

ReaderOpenEx(0, "device-IP-or-PORT-name" , 0, UNIT_OPEN_RESET_DISABLE);

 

Related search: