Connecting and Using Impinj R420 with Python (without Speedway Connect)

Impinj Speedway Connect is a software that provides an http API and works on Impinj Speedway RFID readers. The license costs about $250 per reader.

Without a license, you can use Speedway Connect in demo mode with a limit of 500 tag readings before rebooting the device. To fully use the software without restrictions, you must purchase a license.

If you need an API to work with an RFID reader via LLRP, consider using the Python module available at GitHub. This module allows you to connect and control the RFID reader with a single command, giving you all the functionality you need to work with tags.

Connecting the reader

  1. Connecting to a router
    Connect the reader to the router via Ethernet cable.

  2. Determining the IP address of the reader
    Log into the router's web interface on a computer connected to the same network. Find the reader's IP address using the MAC address, which is listed on the side of the device.

  3. Checking the connection
    Make sure you have correctly identified the reader's IP address by trying to connect to it via HTTP (NOT HTTPS) on that IP (default port 80). You should see the device's web interface.

    Login: root
    Password: impinj

  4. Assigning a static IP
    Assign a static IP to the reader via the router settings so that it does not change after a reboot. Instructions for assigning a permanent IP address. Reboot the reader (pull power) to update the IP address.

  5. Connecting antennas
    Connect the antennas to the reader and prepare the RFID tags for testing.

Installing and configuring the project

  1. Cloning a repository
    Clone the repository from GitHub:

    git clone https://github.com/Ruslanch0s/rfid_reader.git
  2. Setting up the reader host
    In file main.py Please enter your reader's IP address:

    READER_HOST = "192.168.88.249"
  3. Launching the program
    Make sure you have Python 3.9 or later installed. Run the program:

    python main.py

Processing tags

Function callback is used to process tags read by the reader. You can modify this function to suit your needs. Example:

def callback(_reader, tags):
    """
    Callback функция для обработки меток, прочитанных считывателем.

    Параметры:
        _reader (LLRPReaderClient): Объект считывателя, вызвавший callback.
        tags (list): Список прочитанных меток.
    """
    logger.info(f'TAGS:{tags}')

In my project, I used RabbitMQ for data transfer, which allowed me to avoid delays in working with the database (PostgreSQL) during periods of a large influx of labels.

Setting up the reader configuration

The configuration file reader_config.py in folder core contains settings for the reader. Configuration example:

reader_cfg_dict = {
    'duration': 1,  # для бесконечного считывания меток !!!
    'tx_power_dbm': 31.5,  # Мощность передачи dBm
    'frequencies': {
        'HopTableId': 1,
        'Channelist': [866.9],  # Частотный диапазон в МГц
        'Automatic': False
    },
    'mode_identifier': 1004,  # Режим работы считывателя
    'session': 2,  # Сессия
    'impinj_search_mode': 2,  # Установка режима Single Target (по документации вашего устройства)
    'tag_population': 1,  # Предполагаемое количество меток в зоне считывания
    'antennas': [0],  # Какие антенны использовать (0 - все антенны)
    # какие данные о метках будут включены в отчеты:
    'tag_content_selector': {
        'EnableROSpecID': False,
        'EnableSpecIndex': False,
        'EnableInventoryParameterSpecID': False,
        'EnableAntennaID': True,  # Включение идентификатора антенны
        'EnableChannelIndex': False,
        'EnablePeakRSSI': False,
        'EnableFirstSeenTimestamp': False,
        'EnableLastSeenTimestamp': False,
        'EnableTagSeenCount': False,
        'EnableAccessSpecID': False
    }
}

Conclusion

This code can easily replace Impinj Speedway Connect, which will save money, especially on small projects.

Sources

Code on github: https://github.com/Ruslanch0s/rfid_reader.git

Help with connection

If you have any questions or difficulties with connecting or setting up the reader, I will be happy to help you.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *