Package: 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 xPortalMotorola MC9190-Z (handheld)File an issue onGitHubif you would like help getting another kind of reader
to work.sllurp is distributed under version 3 of the GNU General Public License.  SeeLICENSE.txtfor details.Quick StartInstall fromPyPI:$ virtualenv .venv
$ source .venv/bin/activate
$ pip install sllurp
$ sllurp inventory ip.add.re.ssRunsllurp--helpandsllurp inventory--helpto see options.Or install fromGitHub:$ git clone https://github.com/ransford/sllurp.git
$ cd sllurp
$ virtualenv .venv
$ source .venv/bin/activate
$ pip install .
$ sllurp inventory ip.add.re.ssIf 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 runningsllurp reset ip.add.re.ss.Reader APIsllurp relies onTwistedfor network interaction with the reader.  To make a
connection, create anLLRPClientFactoryand hand it to Twisted:# Minimal example; see inventory.py for more.fromsllurpimportllrpfromtwisted.internetimportreactorimportlogginglogging.getLogger().setLevel(logging.INFO)defcb(tagReport):tags=tagReport.msgdict['RO_ACCESS_REPORT']['TagReportData']print'tags:',tagsfactory=llrp.LLRPClientFactory()factory.addTagReportCallback(cb)reactor.connectTCP('myreader',llrp.LLRP_PORT,factory)reactor.run()Getting More Information From Tag ReportsWhen initializingLLRPClientFactory, set flags in thetag_content_selectordictionary argument: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,},...)Loggingsllurp logs under the namesllurp, 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...Vendor Extensionssllurp has limited support for vendor extensions through LLRP’s custom message
facilities.  For example,sllurp inventory –impinj-search-mode Nallows you
to set theImpinjsearch mode to single target (1) or dual target (2).Handy Reader CommandsTo 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 0The “nuclear option” for resetting a reader is:> rebootIf You Find a BugStart an issue onGitHub!  Please follow Simon Tatham’sguideon 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-dcommand-line option tosllurp.  You can log to a logfile with the-l[filename]option.  Or simply put this at the beginning of your own code:importlogginglogging.getLogger('sllurp').setLevel(logging.DEBUG)Known IssuesReader mode selection isconfusing, not least because most readers seem to
conflateModeIndexandModeIdentifier.  If you’re usingsllurp inventory, use--mode-identifierN.  Check your reader’s manual to see
what mode identifiers it supports via theC1G2RFControlparameter, or runsllurp--debuginventoryagainst a reader to see a dump of the supported
modes in the capabilities description.ContributingWant to contribute?  Here are some areas that need improvement:Encode more protocol messages in theconstructbranch.Write tests for common encoding and decoding tasks.AuthorsMuch of the code in sllurp is byBen Ransford, although it began its life in
August 2013 as a fork ofLLRPyC.  Many fine citizens of GitHub have
contributed code to sllurp since the fork.