Skip to main content

A complete implementation of LLRP (Low Level Reader Protocol) in pure Python.

Project description

pyllrp

A 100% complete, pure Python implementation of LLRP (Low Level Reader Protocol) also with 100% support for Impinj extensions.

Communicate with LLRP-compliant RFID readers including Impinj, Alien and ThingMagic. See the LLRP spec for full details.

pyllrp supports quick-and-easy scripting in portable Python to create LLRP applications.

It is used extensively in CrossMgr (CrossMgrImpinj and TagReadWrite) and RaceDB for race timing.

All LLRP features and the full Impinj extension is supported:

  • Message and Parameters are Python classes.
  • 100% runtime validation of all LLRP Messages and Parameters including data types, data ranges, parameter sequence and count.
  • 100% support for constant values - no hardcoded values necessary.
  • Impossible to pass incorrect or malformed LLRP messages to the reader.

See TinyExample.py for how to use.

A reader connection manager is also included that can connect to a reader, transact commands, and/or start/stop a thread to listen for tag reads. A message handler callback can be configured to respond to reader messages in your code.

See wxExample.py for a simple method to show reader messages in a wxPython application with a Queue (requires wxPython).

The module also supports reading and writing messages in XML format, however, I find it just as easy to create the messages in Python code.

pyllrp is picky about LLRP Messages, Parameters and data types. For example, pyllrp passing ints as bools won't work; if the value must be True/False, 1/0 won't work. The names of all non-default fields must be specified, with the exception of Parameters which have only one field. In this case, the single parameter can be passed in the constructor.

How to use it:

import pyllrp and follow the example. TinyExample.py shows how to formulate LLRP specs, messages and parameters. To run TinyExample, from the top pyllrp directory, enter "python3 -m pyllrp.TinyExample".

How it works:

ParseDef.py reads the LLRP XML spec file and compiles it into a dict which it pretty-prints to a file called llrpdef.py. ParseDef must be run every time the XML files change.

pyllrp.py imports llrpdef.py and converts the Messages, Parameters and Enums into runtime classes. It adds the binary pack/unpack methods, data validation and human-readable formating functions to each class. Startup time is minimal due to the llrpdef.py pre-processing, and this augementation is only done once.

Unlike other LLRP interfaces which sometimes combine messages and parameters into one call, pyllrp requires that you follow the LLRP spec accurately. If in doubt, check the LLRP spec and follow it exactly.

Future work:

Because the classes are created dynamically, python linters (eg. flake8) create lots of warnings for pyllrp calls. This could be migitated by code generating the full classes in llrpdef.py. But, this is likely slower and less memory efficient than the current approach.

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

pyllrp-3.1.1.tar.gz (38.4 kB view details)

Uploaded Source

Built Distribution

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

pyllrp-3.1.1-py3-none-any.whl (39.8 kB view details)

Uploaded Python 3

File details

Details for the file pyllrp-3.1.1.tar.gz.

File metadata

  • Download URL: pyllrp-3.1.1.tar.gz
  • Upload date:
  • Size: 38.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for pyllrp-3.1.1.tar.gz
Algorithm Hash digest
SHA256 4cf9e4203a16242615d257a79b604267ca12cf778d450e684b392d5aeeec6966
MD5 c046e396717a763509bd1a3692517d9c
BLAKE2b-256 953645330d9d798d2e9f7bcb621cfc2a2b0332fcc665c151c7a95fbad4c3ad6f

See more details on using hashes here.

File details

Details for the file pyllrp-3.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyllrp-3.1.1-py3-none-any.whl
  • Upload date:
  • Size: 39.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for pyllrp-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c27f71d461e5e14eb4230f221f49e92ebdbd8c7a2121824c74d479335565ddcd
MD5 ced4be496a33a36737240e4802384978
BLAKE2b-256 a4a83886585ea39cab3a209b86427bb8914d3134e8f9c4b48dc49f47120c602f

See more details on using hashes here.

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