Skip to content

Integrating RFID into your software

This page is for teams who already build ERP, WMS, or retail software and are working with an RFID reader for the first time. The approach here: tie each RFID concept back to something you already use every day, and draw the boundary clearly between what the SDK handles and what your software handles.

The reader is an event source, not an API

The model most familiar to a software developer is request and response: call an API, get a result, done. An RFID reader does not work that way. You send one start-inventory command, and the reader then pushes data to you continuously until you tell it to stop.

If you want a familiar picture:

  • A barcode scanner is like a keyboard: the user acts, your software receives exactly one event.
  • An RFID reader is like a message queue whose producer is hardware: messages arrive continuously, the same identifier repeats hundreds of times, and the consumer, your software, has to fold them into meaningful events.

If you have ever written a Kafka or RabbitMQ consumer, every technique you know transfers directly: handling duplicate messages, idempotency keys, windowed aggregation.

Where the SDK sits

The SDK plays the same role as a database driver: you never deal with the wire protocol, you call methods and receive parsed data.

Division of responsibility:

JobOwner
Open the serial port, talk to the reader, parse tag dataSDK
Configure power, antennas, frequency regionSDK, you choose the values
Fold many reads into one event (deduplication)Your software
Give the event business meaning based on the read pointYour software
Write to the ERP idempotentlyYour software

The common architecture: a small service next to the reader

The most common shape is an edge service: a small program running on a computer at the warehouse or store, connected to the reader over USB.

  1. The service (usually Python with nrn-sdk) receives tags through the SDK callback.
  2. It deduplicates locally, so hundreds of repeat reads never cross the network.
  3. It pushes clean events to your backend over HTTP or a message queue, with the read point and timestamp attached.
  4. The backend maps EPC to SKU and creates ERP documents the same way it does for any other transaction.

For a sales screen or kiosk running in the browser there is a shorter path: the Web Serial package (@nextwaves/nrn-sdk) lets the web page talk to the reader directly, with nothing to install.

One note for distributed-systems people: the reader is a serial device, so exactly one process may hold the connection. Never let two services open the same reader; if several consumers need the data, have the edge service republish it through a queue.

The data you add to your system

Usually three tables, and all three resemble things you have built before:

TableRoleResembles
EPC mappingWhich EPC belongs to which SKU and batch, since whenA serial-number or IMEI table
Read pointsWhich reader and antenna stand at which business locationA register/dock/warehouse catalog
Read eventsDeduplicated events with an idempotency keyA transaction log table

An EPC identifies an individual item, so the EPC mapping table is simply a serial-number table at larger scale. The rules for generating EPCs are in EPC encoding.

Preventing duplicate writes: the double-submit playbook

Every web developer has stopped a user from clicking Save twice. RFID needs exactly that technique, because the same tag is guaranteed to be reported many times, and your service may restart mid-stream:

  1. Give each event a natural key: (EPC, read point, business window).
  2. Write to the ERP with a conditional operation on that key, in the spirit of INSERT ... ON CONFLICT DO NOTHING.
  3. A second write of the same event becomes a no-op instead of a second stock movement.

The full three-layer deduplication approach, from the reader down to the database, is in reading tags and deduplication.

A one-week trial plan

  1. Day one: plug a desktop reader into a laptop, pip install nrn-sdk, run the quickstart. The goal is EPCs printing to the console.
  2. During the week: wire the callback into your existing event pipeline in a test environment, build the EPC mapping table, and exercise the idempotency key by passing one tag through repeatedly.
  3. Before going on site: survey the real read zone with the RFID deployment guide, because read performance depends on the physical environment, not on your code.

Easy Inventory operations and RFID integration documentation