Metadata-Version: 2.4
Name: impinj-iot
Version: 0.4.0
Summary: Python driver for Impinj R700 RAIN RFID readers using IoT Device Interface (REST API)
Project-URL: Documentation, https://github.com/kliskatek/driver-rain-py-impinj-iot#readme
Project-URL: Issues, https://github.com/kliskatek/driver-rain-py-impinj-iot/issues
Project-URL: Source, https://github.com/kliskatek/driver-rain-py-impinj-iot
Author-email: Ibon Zalbide <ibon.zalbide@kliskatek.com>
License-Expression: MIT
License-File: LICENSE.txt
Keywords: epc,impinj,iot,r700,rain,reader,rfid,uhf
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.8
Requires-Dist: requests
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Description-Content-Type: text/markdown

# impinj-iot

[![PyPI - Version](https://img.shields.io/pypi/v/impinj-iot.svg)](https://pypi.org/project/impinj-iot)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/impinj-iot.svg)](https://pypi.org/project/impinj-iot)

Python driver for Impinj R700 RAIN RFID readers using the IoT Device Interface (REST API).

## Features

- Connect to Impinj R700 readers over HTTPS
- Start/stop inventory with configurable antenna ports, TX power, and RF modes
- Real-time tag streaming via NDJSON with callback-based notifications
- Query reader info (model, firmware, region, antenna count, power limits)
- Full RF mode enumeration with modulation details
- Authentication support (default: `root` / `impinj`)

## Installation

```console
pip install impinj-iot
```

## Quick Start

```python
from impinj_iot import ImpinjIot, ImpinjIotTagReport

reader = ImpinjIot()

def on_tag(report: ImpinjIotTagReport):
    print(f"EPC: {report.epc}  RSSI: {report.peak_rssi_cdbm / 100:.1f} dBm")

reader.set_notification_callback(on_tag)
reader.connect("192.168.1.100")
reader.set_tx_power(30.0)  # dBm
reader.start()

# ... tags arrive via callback ...

reader.stop()
reader.disconnect()
```

## API Reference

### `ImpinjIot`

| Method | Description |
|--------|-------------|
| `connect(ip, user, password)` | Connect to reader via HTTPS |
| `disconnect()` | Stop inventory and disconnect |
| `is_connected()` | Check connection status |
| `set_notification_callback(fn)` | Register tag report callback |
| `get_reader_info()` | Get reader model, firmware, region, antenna count, power limits |
| `start()` | Start inventory and tag stream |
| `stop()` | Stop inventory |
| `get_tx_power()` / `set_tx_power(dbm)` | Get/set TX power in dBm |
| `get_antenna_config()` / `set_antenna_config(list[bool])` | Get/set active antennas |
| `get_rf_mode()` / `set_rf_mode(mode)` | Get/set RF mode |
| `get_supported_rf_modes()` | Query reader for available RF modes |

### `ImpinjIotTagReport`

| Field | Type | Description |
|-------|------|-------------|
| `epc` | `str` | Tag EPC (hex string) |
| `antenna_port` | `int` | Antenna port number |
| `peak_rssi_cdbm` | `int` | Peak RSSI in centi-dBm |
| `frequency` | `int` | Frequency in kHz |
| `transmit_power_cdbm` | `int` | TX power in centi-dBm |

### `RfMode`

Enum with all supported Impinj R700 RF modes: `MAX_THROUGHPUT`, `HYBRID`, `DENSE_READER_M4`, `DENSE_READER_M8`, `AUTOSET`, and more. See source for full list.

## License

`impinj-iot` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
