A Python port of the SparkFun Simultaneous RFID Tag Reader Library for controlling ThingMagic M6E Nano and M7E Hecto UHF RFID modules.
Claude Code did most of the work here.
This library enables you to read and write UHF Gen2 RFID tags using Python, with support for multiple simultaneous tag reading.
This project uses uv for dependency management.
- Python 3.8 or higher
- uv package manager
curl -LsSf https://astral.sh/uv/install.sh | sh# Clone the repository
git clone <repository-url>
cd sparkfun-rfid-reader
# Install dependencies
uv syncIf you prefer using pip:
pip install pyserialfrom sparkfun_rfid import RFID, ModuleType
from sparkfun_rfid.constants import REGION_NORTHAMERICA, RESPONSE_SUCCESS
# Create RFID reader instance
rfid = RFID()
# Connect to the module
rfid.begin('/dev/ttyUSB0', 115200, ModuleType.M6E_NANO)
# Configure
rfid.set_region(REGION_NORTHAMERICA)
rfid.set_read_power(500) # 5.00 dBm
rfid.set_tag_protocol()
rfid.set_antenna_port()
# Read a tag's EPC
response, epc = rfid.read_tag_epc(timeout=1000)
if response == RESPONSE_SUCCESS:
print(f"EPC: {epc.hex(' ').upper()}")
# Close connection
rfid.close()The examples/ directory contains several example scripts:
Add your user to the dialout group:
sudo usermod -a -G dialout $USERThen log out and log back in.
This library is a Python port of the original SparkFun Arduino library and maintains the same open source MIT License.
Original Arduino library by Nathan Seidle @ SparkFun Electronics
If you find this code helpful, consider buying a board from SparkFun!