Skip to main content

USB based RFID reader with Python interface

Project description

PN5180-tagomatic

USB based RFID reader with Python interface

Python CI REUSE status PyPI version

Overview

PN5180-tagomatic is a USB-based RFID reader that provides a Python interface for reading NFC/RFID tags using the PN5180 NFC Frontend module and a Raspberry Pi Pico (Zero).

Features

  • Python library for easy integration.
  • Uses USB serial communication to the reader.
  • Cross-platform support (Linux, Windows, macOS).
  • Finds and selects single ISO/IEC 14443 cards.
  • Uses NFC FORUM commands to read/write 14443-A cards' memories.
  • Can authenticate against Mifare classic cards to read their memories.
  • Finds ISO/IEC 15693 cards, uses 15693-3 commands to read/write their memories.

Multiple cards in the RFID field is currently not really supported, the hardware and arduino sketch supports all commands for it.

Installation

Python Package

Install from PyPI:

pip install pn5180-tagomatic

Install from source:

git clone https://github.com/bofh69/PN5180-tagomatic.git
cd PN5180-tagomatic
pip install -e .

Firmware

See sketch/README.md for instructions on building and uploading the Raspberry Pi Pico firmware.

Usage

from pn5180_tagomatic import PN5180


# Create reader instance and use it
with PN5180("/dev/ttyACM0") as reader:
    versions = reader.ll.read_eeprom(0x10, 6)
    with reader.start_session(0x00, 0x80) as session:
        card = session.connect_one_iso14443a()
        print(f"Reading from card {card.uid.hex(':')}")
        if len(card.uid) == 4:
            memory = card.read_mifare_memory()
        else:
            memory = card.read_memory()

Example Program

A few simple example programs are in the examples/ directory.

Development

Setting up development environment

# Clone the repository
git clone https://github.com/bofh69/PN5180-tagomatic.git
cd PN5180-tagomatic

# Install development dependencies
pip install -e .[dev]
# or:
make install-dev

Running tests

pytest or make test

Code quality checks

# Linting
make check

# Formatting
make format

# Type checking
make type-check

License

This project is licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later).

See LICENSE for the full license text.

Contributing

Contributions are welcome! Please ensure that:

  1. All code passes linting and type checking
  2. Tests are added for new functionality
  3. All files include proper REUSE-compliant license headers
  4. Code follows the project's style guidelines

Acknowledgments

This project uses FastLED by Daniel Garcia et al.

SimpleRPC by Jeroen F.J. Laros, Chris Flesher et al is also used.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pn5180_tagomatic-0.0.3.tar.gz (52.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pn5180_tagomatic-0.0.3-py3-none-any.whl (31.9 kB view details)

Uploaded Python 3

File details

Details for the file pn5180_tagomatic-0.0.3.tar.gz.

File metadata

  • Download URL: pn5180_tagomatic-0.0.3.tar.gz
  • Upload date:
  • Size: 52.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pn5180_tagomatic-0.0.3.tar.gz
Algorithm Hash digest
SHA256 a745642bdf739aaec10e739f1d22389fc46377a91eeeb6a7f0518af657d42315
MD5 121c4e167b16e1af083472a65fa83091
BLAKE2b-256 d78b7f4d252f1d02b4ac2cc89d4d345c859584d68813dfc2454c0ea95b934dd2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pn5180_tagomatic-0.0.3.tar.gz:

Publisher: publish.yml on bofh69/PN5180-tagomatic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pn5180_tagomatic-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for pn5180_tagomatic-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 513d295ccf6725b06ce166a32600227ece0335e72bccc8112070c9d20d7fb759
MD5 84b36ae78a5129cc8bf4d88425a8fe14
BLAKE2b-256 da99ed3b336ccf3f53353233494727b069a86e390bbfc743981230cacd900cc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pn5180_tagomatic-0.0.3-py3-none-any.whl:

Publisher: publish.yml on bofh69/PN5180-tagomatic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page