Skip to main content

.. image:: http://img.shields.io/pypi/v/sllurp.svg :target: https://pypi-hypernode.com/pypi/sllurp

Project description

https://travis-ci.org/ransford/sllurp.svg?branch=master

sllurp is a Python library to interface with RFID readers. It is a pure-Python implementation of the Low Level Reader Protocol (LLRP).

These readers are known to work well with sllurp, but it should be adaptable with not much effort to other LLRP-compatible readers:

  • Impinj Speedway (R1000)

  • Impinj Speedway Revolution (R220, R420)

  • Impinj Speedway xPortal

  • Motorola MC9190-Z (handheld)

File an issue on this GitHub project if you would like help getting another kind of reader to work.

sllurp is distributed under version 3 of the GNU General Public License. See LICENSE.txt for details.

Quick Start

$ virtualenv .venv
$ source .venv/bin/activate
$ pip install .
$ sllurp inventory ip.add.re.ss

Run sllurp --help and sllurp inventory --help to see options.

If the reader gets into a funny state because you’re debugging against it (e.g., if your program or sllurp has crashed), you can set it back to an idle state by running sllurp reset ip.add.re.ss.

Reader API

sllurp relies on Twisted for network interaction with the reader. To make a connection, create an LLRPClientFactory and hand it to Twisted:

# Minimal example; see inventory.py for more.
from sllurp import llrp
from twisted.internet import reactor
import logging
logging.getLogger().setLevel(logging.INFO)

def cb (tagReport):
    tags = tagReport.msgdict['RO_ACCESS_REPORT']['TagReportData']
    print 'tags:', tags

factory = llrp.LLRPClientFactory()
factory.addTagReportCallback(cb)
reactor.connectTCP('myreader', llrp.LLRP_PORT, factory)
reactor.run()

Getting More Information From Tag Reports

When initializing LLRPClientFactory, set flags in the tag_content_selector dictionary argument:

llrp.LLRPClientFactory(tag_content_selector={
    'EnableROSpecID': False,
    'EnableSpecIndex': False,
    'EnableInventoryParameterSpecID': False,
    'EnableAntennaID': True,
    'EnableChannelIndex': False,
    'EnablePeakRRSI': True,
    'EnableFirstSeenTimestamp': False,
    'EnableLastSeenTimestamp': True,
    'EnableTagSeenCount': True,
    'EnableAccessSpecID': False,
}, ...)

Logging

sllurp logs under the name sllurp, so if you wish to log its output, you can do this the application that imports sllurp:

sllurp_logger = logging.getLogger('sllurp')
sllurp_logger.setLevel(logging.DEBUG)
sllurp_logger.setHandler(logging.FileHandler('sllurp.log'))
# or .setHandler(logging.StreamHandler()) to log to stderr...

Handy Reader Commands

To see what inventory settings an Impinj reader is currently using (i.e., to fetch the current ROSpec), ssh to the reader and

> show rfid llrp rospec 0

The “nuclear option” for resetting a reader is:

> reboot

If You Find a Bug

Start an issue on this GitHub project!

Bug reports are most useful when they’re accompanied by verbose error messages. Turn sllurp’s log level up to DEBUG, which you can do by specifying the -d command-line option to sllurp. You can log to a logfile with the -l [filename] option. Or simply put this at the beginning of your own code:

import logger
sllurp_logger = logging.getLogger('sllurp')
sllurp_logger.setLevel(logging.DEBUG)

Contributing

Want to contribute? Here are some areas that need improvement:

  • Reduce redundancy in the encode_* and decode_* functions in llrp_proto.py.

  • Support the AccessSpec primitive (basis for tag read and write).

  • Write tests for common encoding and decoding tasks.

  • Make get_reader_config use the fabric library to connect to readers via SSH.

  • Generalize LLRP support beyond Impinj readers. Remove Impinj-specific assumptions.

Authors

Much of the code in sllurp is by Ben Ransford, although it began its life in August 2013 as a fork of LLRPyC. Many fine citizens of GitHub have contributed code to sllurp since the fork.

Home-page: https://github.com/ransford/sllurp Author: Ben Ransford Author-email: ben@ransford.org License: GPLv3 Description: UNKNOWN Keywords: llrp rfid reader Platform: UNKNOWN Classifier: Development Status :: 4 - Beta Classifier: Environment :: Console Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3) Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7

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

sllurp-0.2.1.tar.gz (38.3 kB view details)

Uploaded Source

Built Distribution

sllurp-0.2.1-py2.py3-none-any.whl (46.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file sllurp-0.2.1.tar.gz.

File metadata

  • Download URL: sllurp-0.2.1.tar.gz
  • Upload date:
  • Size: 38.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sllurp-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a2ddaa150ae9babbbd8ec66512b3fdf93c84a6a5f68907b04c79b07ba2b5567b
MD5 1d972609c5fc6422143a0f2e48696389
BLAKE2b-256 a99ad43114f9ba711d56e2889b402c15e73dbeedcb773f2a2d5efc1f0205300f

See more details on using hashes here.

File details

Details for the file sllurp-0.2.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for sllurp-0.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a0733b4ebc741e35048c7886feeb53bdf3b34dd72a9271badfc131e1336819eb
MD5 906a23d83e6f73e1000de500750dad10
BLAKE2b-256 6ba8e2afef2ef0b375b5a0ca06433a1a4b3a81aae1c9d47845fe036b97373441

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