Skip to content

Instantly share code, notes, and snippets.

@russss
Last active July 12, 2024 23:16
Show Gist options
  • Save russss/dcefd4ab3577d6064ef0120c41ee70eb to your computer and use it in GitHub Desktop.
Save russss/dcefd4ab3577d6064ef0120c41ee70eb to your computer and use it in GitHub Desktop.

NOTE: this is a work-in-progress draft, please don't implement anything based on this yet. It's also missing a name. Suggestions very much appreciated.

Introduction to UHF RFID

UHF RFID tags (also known as "Gen 2" or "RAIN") are the lesser-known third type of RFID. Operating in the unlicensed 868MHz (EU)/900MHz (US) bands, they have a read range of up to 10m with a relatively low-cost, passive tag.

These tags are used by large retailers, including Decathlon and Uniqlo, for inventory control, barcodeless checkout, and theft prevention. (If you buy anything from Decathlon, make sure you cut the sewn-in tag out or your products will be uniquely trackable.)

UHF RFID tags include a unique identifier which usually either follows the GS1 Electronic Product Code standard or ISO/IEC 15961-1. Unfortunately, for both of these, you have to pay a hefty annual fee to get a prefix. To GS1's credit, all their specifications are freely available.

About this project

This project provides a simple framework to produce globally-unique IDs for inventory tagging and similar uses. It has been designed with hackerspaces and hacker events in mind, but any other (non-creepy) uses are encouraged.

This project aims to provide:

  • A registry of ID prefixes outside of the official ID spaces which are globally unique and free to obtain
  • An optional, federated protocol to allow participants to exchange reports on the location of their tags

Identifier format

In the name of simplicity, a 64-bit identifier is used, split into two 32-bit fields. The first field is an organisation identifier [insert assignment info here] and the second field is a serial number which the user is free to use however they like.

Class 1 Gen2 RFID Representation

A tag following this specification will conform to the Class 1 Gen 2 UHF RFID standard, with the exception of the changes below.

Bit 0x17 (Numbering System Identifier/"T") of the Program Control field will be set to 1, indicating that this is an ISO/IEC 15961-formatted tag. The Application Family Identifier field (bits 0x18-0x1F of the Program Control field) will be set to 0x42, a value which is not assigned by the ISO/IEC 15961 specification.

(Note: the ISO/IEC 15961 mode is used here because it has a "not assigned" range which allows us to explicitly declare the tag does not comply with either GS1/EPC or ISO/IEC 15961. The ISO/IEC spec is of course expensive to buy, while the GS1 spec is freely available, but it appears they are mostly identical other than in the way they allocate identifiers. It should be fine to refer to the GS1 specs if you need any further technical details.)

The tag identifier (UII/EPC) field is three words long:

42 00 aa aa  aa aa 00 00  bb bb bb bb

Where aa is the the organisation identifier and bb is the user-allocated serial number. The representation is prefixed by 0x42 (a magic number for this spec), and 0x00 (a version number).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment