sllurp


Namesllurp JSON
Version 0.6.0 PyPI version JSON
download
home_pagehttps://github.com/ransford/sllurp
SummaryRFID reader control library
upload_time2023-12-18 18:06:44
maintainer
docs_urlNone
authorBen Ransford
requires_python
licenseGPLv3
keywords llrp rfid reader
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: http://img.shields.io/pypi/v/sllurp.svg
    :target: https://pypi.python.org/pypi/sllurp

.. image:: https://img.shields.io/pypi/pyversions/sllurp.svg
    :target: https://pypi.python.org/pypi/sllurp

.. image:: https://circleci.com/gh/ransford/sllurp.svg?style=svg
    :target: https://circleci.com/gh/ransford/sllurp

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 GitHub_ 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.

.. _GitHub: https://github.com/ransford/sllurp/

Quick Start
-----------

Install from PyPI_::

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

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

Or install from GitHub_::

    $ git clone https://github.com/ransford/sllurp.git
    $ cd sllurp
    $ virtualenv .venv
    $ source .venv/bin/activate
    $ pip install .
    $ sllurp inventory ip.add.re.ss

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``.

.. _PyPI: https://pypi.python.org/pypi/sllurp
.. _GitHub: https://github.com/ransford/sllurp/

Reader API
----------

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

.. code:: python

    # 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()

.. _Twisted: http://twistedmatrix.com/

Getting More Information From Tag Reports
-----------------------------------------

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

.. code:: python

    llrp.LLRPClientFactory(tag_content_selector={
        'EnableROSpecID': False,
        'EnableSpecIndex': False,
        'EnableInventoryParameterSpecID': False,
        'EnableAntennaID': True,
        'EnableChannelIndex': False,
        'EnablePeakRSSI': 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:

.. code:: python

    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...


Vendor Extensions
-----------------

sllurp has limited support for vendor extensions through LLRP's custom message
facilities.  For example, `sllurp inventory --impinj-search-mode N` allows you
to set the Impinj_ search mode to single target (1) or dual target (2).

.. _Impinj: https://support.impinj.com/hc/en-us/articles/202756158-Understanding-EPC-Gen2-Search-Modes-and-Sessions

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 GitHub_!  Please follow Simon Tatham's guide_ on writing good
bug reports.

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:

.. code:: python

  import logging
  logging.getLogger('sllurp').setLevel(logging.DEBUG)

.. _GitHub: https://github.com/ransford/sllurp/
.. _guide: https://www.chiark.greenend.org.uk/~sgtatham/bugs.html

Known Issues
------------

Reader mode selection is confusing_, not least because most readers seem to
conflate ``ModeIndex`` and ``ModeIdentifier``.  If you're using ``sllurp
inventory``, use ``--mode-identifier N``.  Check your reader's manual to see
what mode identifiers it supports via the ``C1G2RFControl`` parameter, or run
``sllurp --debug inventory`` against a reader to see a dump of the supported
modes in the capabilities description.

.. _confusing: https://github.com/ransford/sllurp/issues/63#issuecomment-309233937

Contributing
------------

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

- Encode more protocol messages in the ``construct`` branch.
- Write tests for common encoding and decoding tasks.

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.

.. _Ben Ransford: https://ben.ransford.org/
.. _LLRPyC: https://sourceforge.net/projects/llrpyc/



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ransford/sllurp",
    "name": "sllurp",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "llrp rfid reader",
    "author": "Ben Ransford",
    "author_email": "ben@ransford.org",
    "download_url": "https://files.pythonhosted.org/packages/e3/cd/62c23a649e519e5b25b871e68479ba9f13f8b6b6ac885ea4620726d540e9/sllurp-0.6.0.tar.gz",
    "platform": null,
    "description": ".. image:: http://img.shields.io/pypi/v/sllurp.svg\n    :target: https://pypi.python.org/pypi/sllurp\n\n.. image:: https://img.shields.io/pypi/pyversions/sllurp.svg\n    :target: https://pypi.python.org/pypi/sllurp\n\n.. image:: https://circleci.com/gh/ransford/sllurp.svg?style=svg\n    :target: https://circleci.com/gh/ransford/sllurp\n\nsllurp is a Python library to interface with RFID readers.  It is a pure-Python\nimplementation of the Low Level Reader Protocol (LLRP).\n\nThese readers are known to work well with sllurp, but it should be adaptable\nwith not much effort to other LLRP-compatible readers:\n\n- Impinj Speedway (R1000)\n- Impinj Speedway Revolution (R220, R420)\n- Impinj Speedway xPortal\n- Motorola MC9190-Z (handheld)\n\nFile an issue on GitHub_ if you would like help getting another kind of reader\nto work.\n\nsllurp is distributed under version 3 of the GNU General Public License.  See\n``LICENSE.txt`` for details.\n\n.. _GitHub: https://github.com/ransford/sllurp/\n\nQuick Start\n-----------\n\nInstall from PyPI_::\n\n    $ virtualenv .venv\n    $ source .venv/bin/activate\n    $ pip install sllurp\n    $ sllurp inventory ip.add.re.ss\n\nRun ``sllurp --help`` and ``sllurp inventory --help`` to see options.\n\nOr install from GitHub_::\n\n    $ git clone https://github.com/ransford/sllurp.git\n    $ cd sllurp\n    $ virtualenv .venv\n    $ source .venv/bin/activate\n    $ pip install .\n    $ sllurp inventory ip.add.re.ss\n\nIf the reader gets into a funny state because you're debugging against it\n(e.g., if your program or sllurp has crashed), you can set it back to an idle\nstate by running ``sllurp reset ip.add.re.ss``.\n\n.. _PyPI: https://pypi.python.org/pypi/sllurp\n.. _GitHub: https://github.com/ransford/sllurp/\n\nReader API\n----------\n\nsllurp relies on Twisted_ for network interaction with the reader.  To make a\nconnection, create an `LLRPClientFactory` and hand it to Twisted:\n\n.. code:: python\n\n    # Minimal example; see inventory.py for more.\n    from sllurp import llrp\n    from twisted.internet import reactor\n    import logging\n    logging.getLogger().setLevel(logging.INFO)\n\n    def cb (tagReport):\n        tags = tagReport.msgdict['RO_ACCESS_REPORT']['TagReportData']\n        print 'tags:', tags\n\n    factory = llrp.LLRPClientFactory()\n    factory.addTagReportCallback(cb)\n    reactor.connectTCP('myreader', llrp.LLRP_PORT, factory)\n    reactor.run()\n\n.. _Twisted: http://twistedmatrix.com/\n\nGetting More Information From Tag Reports\n-----------------------------------------\n\nWhen initializing ``LLRPClientFactory``, set flags in the\n``tag_content_selector`` dictionary argument:\n\n.. code:: python\n\n    llrp.LLRPClientFactory(tag_content_selector={\n        'EnableROSpecID': False,\n        'EnableSpecIndex': False,\n        'EnableInventoryParameterSpecID': False,\n        'EnableAntennaID': True,\n        'EnableChannelIndex': False,\n        'EnablePeakRSSI': True,\n        'EnableFirstSeenTimestamp': False,\n        'EnableLastSeenTimestamp': True,\n        'EnableTagSeenCount': True,\n        'EnableAccessSpecID': False,\n    }, ...)\n\n\nLogging\n-------\n\nsllurp logs under the name ``sllurp``, so if you wish to log its output, you\ncan do this the application that imports sllurp:\n\n.. code:: python\n\n    sllurp_logger = logging.getLogger('sllurp')\n    sllurp_logger.setLevel(logging.DEBUG)\n    sllurp_logger.setHandler(logging.FileHandler('sllurp.log'))\n    # or .setHandler(logging.StreamHandler()) to log to stderr...\n\n\nVendor Extensions\n-----------------\n\nsllurp has limited support for vendor extensions through LLRP's custom message\nfacilities.  For example, `sllurp inventory --impinj-search-mode N` allows you\nto set the Impinj_ search mode to single target (1) or dual target (2).\n\n.. _Impinj: https://support.impinj.com/hc/en-us/articles/202756158-Understanding-EPC-Gen2-Search-Modes-and-Sessions\n\nHandy Reader Commands\n---------------------\n\nTo see what inventory settings an Impinj reader is currently using (i.e., to\nfetch the current ROSpec), ssh to the reader and\n\n::\n\n    > show rfid llrp rospec 0\n\nThe \"nuclear option\" for resetting a reader is:\n\n::\n\n    > reboot\n\nIf You Find a Bug\n-----------------\n\nStart an issue on GitHub_!  Please follow Simon Tatham's guide_ on writing good\nbug reports.\n\nBug reports are most useful when they're accompanied by verbose error messages.\nTurn sllurp's log level up to DEBUG, which you can do by specifying the `-d`\ncommand-line option to ``sllurp``.  You can log to a logfile with the ``-l\n[filename]`` option.  Or simply put this at the beginning of your own code:\n\n.. code:: python\n\n  import logging\n  logging.getLogger('sllurp').setLevel(logging.DEBUG)\n\n.. _GitHub: https://github.com/ransford/sllurp/\n.. _guide: https://www.chiark.greenend.org.uk/~sgtatham/bugs.html\n\nKnown Issues\n------------\n\nReader mode selection is confusing_, not least because most readers seem to\nconflate ``ModeIndex`` and ``ModeIdentifier``.  If you're using ``sllurp\ninventory``, use ``--mode-identifier N``.  Check your reader's manual to see\nwhat mode identifiers it supports via the ``C1G2RFControl`` parameter, or run\n``sllurp --debug inventory`` against a reader to see a dump of the supported\nmodes in the capabilities description.\n\n.. _confusing: https://github.com/ransford/sllurp/issues/63#issuecomment-309233937\n\nContributing\n------------\n\nWant to contribute?  Here are some areas that need improvement:\n\n- Encode more protocol messages in the ``construct`` branch.\n- Write tests for common encoding and decoding tasks.\n\nAuthors\n-------\n\nMuch of the code in sllurp is by `Ben Ransford`_, although it began its life in\nAugust 2013 as a fork of LLRPyC_.  Many fine citizens of GitHub have\ncontributed code to sllurp since the fork.\n\n.. _Ben Ransford: https://ben.ransford.org/\n.. _LLRPyC: https://sourceforge.net/projects/llrpyc/\n\n\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "RFID reader control library",
    "version": "0.6.0",
    "project_urls": {
        "Homepage": "https://github.com/ransford/sllurp"
    },
    "split_keywords": [
        "llrp",
        "rfid",
        "reader"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "907dbe7b5af7579f5e002628f0b35ab5d5c6c36355b7bc8953801d7a2716f993",
                "md5": "d274d8bf3e45b088798cd1a150d7b16e",
                "sha256": "162eca6ac29ec12e8294688067006dedfc8ccf18e3a3ad4f1140be489187fdf2"
            },
            "downloads": -1,
            "filename": "sllurp-0.6.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d274d8bf3e45b088798cd1a150d7b16e",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 48905,
            "upload_time": "2023-12-18T18:06:42",
            "upload_time_iso_8601": "2023-12-18T18:06:42.095731Z",
            "url": "https://files.pythonhosted.org/packages/90/7d/be7b5af7579f5e002628f0b35ab5d5c6c36355b7bc8953801d7a2716f993/sllurp-0.6.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e3cd62c23a649e519e5b25b871e68479ba9f13f8b6b6ac885ea4620726d540e9",
                "md5": "691da09922c620f43cd6f041782f037b",
                "sha256": "e51e0c522aaa8ff003fe04fe5bf36c84ed3bd6845393946da577cf3574f09f1e"
            },
            "downloads": -1,
            "filename": "sllurp-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "691da09922c620f43cd6f041782f037b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 41968,
            "upload_time": "2023-12-18T18:06:44",
            "upload_time_iso_8601": "2023-12-18T18:06:44.006093Z",
            "url": "https://files.pythonhosted.org/packages/e3/cd/62c23a649e519e5b25b871e68479ba9f13f8b6b6ac885ea4620726d540e9/sllurp-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-18 18:06:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ransford",
    "github_project": "sllurp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "circle": true,
    "lcname": "sllurp"
}
        
Elapsed time: 0.15126s