LLRP Tag Encoding
From RifidiWiki
Contents
LLRP Tag Encoding Options
LLRP Encode Command
LLRP Encode Command is used to encode a new Tag with the following operations:
Order: operationCode 1 - LLRPAccessPasswordWrite 2 - LLRPEPCWrite 3 - LLRPKillPasswordWrite 4 - LLRPEPCLock 5 - LLRPKillPasswordLock 6 - LLRPAccessPasswordLock
What are EPC, Kill Password, Access Password:
- EPC is the GEN2 EPC ID for a Tag
- Kill Password is used to set the password necessary to kill/destroy a tag for future use (by default there is no password (value(0))
- Access Password is used to perform tag writes such as EPC, Kill Password, Access Password (by default there is no password (value(0))
- C1G2Write and C1G2Lock are the LLRP Access Spec operations used
- Command
llrpencode/{readerID}/{sessionID}/{tag}- Performs all LLRP Encoding operations for a New RFID Tag
- Example
http://localhost:8111/llrpencode/LLRP_1/1/111122223333444455556666
- Prerequisites
- Only one tag can be present(This is Not a Bulk encoding operation)
- Must be a LLRP reader
- Must be a valid readerID and sessionID
- tag must be evenly divide by 4 (word in hex) and tag must be able to support length
- access password and kill password must be evenly divide by 4 (4 or 8 characters/1 or 2 words) or 0
- Only one encoding session per reader can be active at one time
Global Settings via Edge_Server_Configuration
Global Properties below need to be set for LLRP encode based on ones requirements
- Note: All MQTT (if set), timeout tagmask and epctarget always come form Global Variables
- Note: These are set globally using the Rifidi Edge Configuration Edge_Server_Configuration
-Dorg.rifidi.llrp.encode.targetepc=000000000000000000000000 - (Hex Value) Sets the EPC Tag Data to perform operation on (Must be even block of 4 charaters and size depends on Tag - typical is 24 characters) - default if not set is 000000000000000000000000 -Dorg.rifidi.llrp.encode.tagmask=000000000000000000000000 - (Hex Value) Sets the Tag Mask to perform operation on (0 is wildcard match, F is Exact Match) (Must be even block of 4 characters and size depends on Tag - typical is 24 characters) - default if not set is 000000000000000000000000 -Dorg.rifidi.llrp.encode.timeout=5000 - Sets the duration of time to attempt operation (O is infinite until operation occurs, set in milliseconds) -Dorg.rifidi.llrp.encode.accesspwd=0 - Access Password (Hex Value) (8 Characters or value of 0) - default if not set is 0 -Dorg.rifidi.llrp.encode.oldaccesspwd=0 - Old Access Password (Hex Value) (8 Characters or value of 0) - default if not set is 0 Note: used when setting new access password -Dorg.rifidi.llrp.encode.killpwd=0 - Kill Password (Hex Value) (8 Characters or value of 0) - default if not set is 0 -Dorg.rifidi.llrp.encode.killpwdlockprivilege=Read_Write - If Set Performs a Kill Password Lock Operation (values can be Read_Write (which Locks), Perma_Lock, Unlock) - default if not set is Read_Write -Dorg.rifidi.llrp.encode.accesspwdlockprivilege=Read_Write - If Set Performs a Access Password Lock Operation (values can be Read_Write (which Locks), Perma_Lock, Unlock) default if not set is Read_Write -Dorg.rifidi.llrp.encode.epclockprivilege=Read_Write - If Set Performs a EPC Lock Operation (values can be Read_Write (which Locks), Perma_Lock, Unlock) - default if not set is Read_Write -Dorg.rifidi.llrp.encode.mqttbroker -- mqtt broker url - optional (if set, received response of encode operation is posted to this queue in asynchronous mode). Mqttqos and mqttclientid must be set too in order to post to queue -Dorg.rifidi.llrp.encode.mqttqos -- optional - Quality of service level for mqtt, example: 2 -Dorg.rifidi.llrp.encode.mqttclientid -- optional - Client id to publish messages on queue
Note: These are optional Global variables for MQTT. If these are set then llrpencode command operations response to sent asynchronously to a topic
- topic naming convention {readerId}/encode with result of encoding operations
-Dorg.rifidi.llrp.encode.mqttqos=2 -Dorg.rifidi.llrp.encode.mqttbroker=tcp://localhost:1883 -Dorg.rifidi.llrp.encode.mqttclientid=llrpEncodeId
Encode Response
Response: Success
<?xml version="1.0" encoding="UTF-8"?> <response> <message>Success</message> </response>
Response: Fail
<?xml version="1.0" encoding="UTF-8"?> <response> <message>Fail</message> <Description> LLRP Message Returned goes here such as Tag mask and Tag data not matching - such</Description> </response> Note: Some types of Fail responses could be # Reader does not exist: <response> <message>Fail</message> <description>Reader with id LLRP_13 does not exist</description> </response> # Not a LLRP reader <response> <message>Fail</message> <description>Reader with id Front_Door_1 of type Alien is not an LLRP reader type</description> </response> # Not a valid session <response> <message>Fail</message> <description>Session with id 2 does not exist for reader with id LLRP_1</description> </response> # More than one tag <response> <message>Fail</message> <description>There are 2 tags in the scope of the reader with id LLRP_1</description> </response> # Invalid access spec request <response> <message>Fail</message> <description><?xml version="1.0" encoding="UTF-8"?> <llrp:ADD_ACCESSSPEC_RESPONSE xmlns:llrp="http://www.llrp.org/ltk/schema/core/encoding/xml/1.0" Version="1" MessageID="0"> <llrp:LLRPStatus> <llrp:StatusCode>M_FieldError</llrp:StatusCode> <llrp:ErrorDescription>An unkown C1G2 Opsec was added</llrp:ErrorDescription> </llrp:LLRPStatus> </llrp:ADD_ACCESSSPEC_RESPONSE></description> </response> # Encoding session already active
Encode Operations Response
If MQTT Variables defined Globally (above) then operations result response will be sent to MQTT topic
- Topic naming convention: {readerID}/encode
Success Message
<encodeMessage> <status>Success</Status> </encodeMessage>
Fail Message
<encodeMessage> <status>Fail</status> <operationList> <operation>LLRPAccessPasswordWrite:Sucess</operation> <operation>LLRPEPCWrite:Sucess</operation> <operation>LLRPKillPasswordWrite:Sucess</operation> <operation>LLRPEPCLock:No_Response_From_Tag</operation> <operation>LLRPKillPaswordLock: Success</operation> <operation>LLRPAccessPaswordLock: Success</operation> </operationList> </encodeMessage>
Full List of Return Failure Codes:
Insufficient_Power No_Response_From_Tag Nonspecific_Reader_Error Nonspecific_Tag_Error Tag_Memory_Locked_Error Tag_Memory_Overrun_Error
LLRP Encode Single Shot Commands
These are used to perform single operations and override Global properties therefore all values must be supplied in request Note: All MQTT (if set), timeout tagmask and epctarget always come form Global Variables
- Command
/llrpencode/{readerID}/{sessionID}/{operationCode}/{properties}
- Special characters: See how to send special characters in properties' values http://wiki.rifidi.net/index.php?title=Rifidi_App_API#Properties_with_special_characters
List of operationCodes
LLRPEPCWrite LLRPKillPasswordWrite LLRPAccessPasswordWrite LLRPEPCLock LLRPKillPasswordLock LLRPAccessPasswordLock
- Example LLRPECWrite - Used to Write a EPC ID
- Example LLRPKillPasswordWrite - Used to Write a Kill Password
http://localhost:8111/llrpencode/LLRP_1/1/LLRPKillPasswordWrite/accesspwd=12345678;killpwd=87654321
- Example LLRPAccessPasswordWrite - Used to Write a Access Password
- Example LLRPEPCLock - Set EPC Lock Priveledge
http://localhost:8111/llrpencode/LLRP_1/1/LLRPEPCLock/accesspwd=98765432;privilege=Read_Write
- Example LLRPKillPasswordLock - Set Kill Password Lock Privilege
- Example LLRPAccessPasswordLock - Set Access Password Lock Privilege
Single Shot Encode Operations Response
If MQTT Variables defined Globally (above) then operations result response will be sent to MQTT topic otherwise response is synchronous
- Topic naming convention: {readerID}/encode
Encode Single Shot Response
Response: Success
<?xml version="1.0" encoding="UTF-8"?> <response> <message>Success</message> </response>
Response: Fail
<?xml version="1.0" encoding="UTF-8"?> <response> <message>Fail</message> <Description> LLRP Message Returned goes here such as Tag mask and Tag data not matching - such</Description> </response> Note: Some types of Fail responses could be # More than one tag # Not a LLLRP reader # Not a valid session # Invalid access spec request # Encoding session already active
Success Message
<encodeMessage> <status>Success</Status> </encodeMessage>
Fail Message
<encodeMessage> <status>Fail</status> <operationList> <operation>LLRPEPCLock:No_Response_From_Tag</operation> </operationList> </encodeMessage>
Full List of Return Failure Codes:
Insufficient_Power No_Response_From_Tag Nonspecific_Reader_Error Nonspecific_Tag_Error Tag_Memory_Locked_Error Tag_Memory_Overrun_Error