Skip to main content

Interface for RDM6300 rfid reader

Project description

Using the RDM6300 RFID reader from python

The project is primarly geared towards using the RDM6300 with a Raspberry PI and Python 3.

The unit tests are passing with Python 2, so it should work (tm), but I am using python3 for developing the module.

In theory the module should be working with anything that is compatible with the EM4100 wire protocol.

Please note that wiring the RDM6300 to an RPI is not entierly trivial (either it will not work, or you are risking frying your PI), so before tring this out please make sure you had read my blog post on this: https://the.mad-tinkerer.me/rdm-6300-raspberry-pi/

The reader code has almost 100% unit test coverage, so the code should be quite stable.

Please see the API documentation here

Usage (Easy mode)

Assuming that you had wired the RDM6300 correctly you can execute the following to create a working environment:

$ virtualenv -p python3 virtualenv
$ . virtualenv/bin/activate
$ pip install rdm6300

Afterwards you can use this code to start reading with the RFID reader (examples/simple.py):

import rdm6300

reader = rdm6300.Reader('/dev/ttyS0')
print("Please insert an RFID card")
while True:
    card = reader.read()
    if card:
        print(f"[{card.value}] read card {card}")

Usage (Real life scenario)

see examples/complex.py

import rdm6300

class Reader(rdm6300.BaseReader):
    def card_inserted(self, card):
        print(f"card inserted {card}")

    def card_removed(self, card):
        print(f"card removed {card}")

    def invalid_card(self, card):
        print(f"invalid card {card}")

r = Reader('/dev/ttyS0')
r.start()

Credits

The code is a rewrite of the library pyrfid: https://www.pm-codeworks.de/pyrfid.html

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

rdm6300-0.1.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

rdm6300-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file rdm6300-0.1.0.tar.gz.

File metadata

  • Download URL: rdm6300-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.3

File hashes

Hashes for rdm6300-0.1.0.tar.gz
Algorithm Hash digest
SHA256 34286beb94b3fe58ba58097deb5c9a74101361cc6166871bc2bc405921099375
MD5 80e463e7ec209939315adf31b3037bd7
BLAKE2b-256 52f666bb453b2965b220507ee03560c17528469697e339ee413045a422a51064

See more details on using hashes here.

File details

Details for the file rdm6300-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rdm6300-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.3

File hashes

Hashes for rdm6300-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 baa3c17bb7ada357a0d925aee6e1b6ecb59a44bbf1f64dd0c2db6301588bdec4
MD5 a6f5b2622927f5c8c87bea2885fd6971
BLAKE2b-256 a748f6cbb75535dfd34ecbd1080e68300e8c5f5facd08dedbae860c289585566

See more details on using hashes here.

Supported by

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