MQTT Commands

The Smartreader Embedded app supports command processing over MQTT. In order to avoid command loops when the app or the reader is restarted, the command_id received is always compared to the last command received and ignored in case they are the same.

Supported Commands

The Smartreader currently supports the following MQTT commands:

  • start – begin the inventory operation.

  • stop – halt the inventory operation.

  • reboot – reboot the reader.

  • mode – configure reader settings.

  • get-gpo – read the current state of the reader's GPO pins.

  • set-gpo – set the state of one or more GPO pins.

  • status – request compact reader status information.

  • status-detailed – request a more exhaustive status report.

  • impinj_iot_device_interface – proxy a request to the Impinj IoT Device Interface API.

  • retrieve-settings – fetch current Smartreader application settings.

  • apply-settings – apply new configuration settings.

  • upgrade – trigger firmware upgrade from a specified URL.

  • rshell – execute an RShell command on the reader.

  • Task commands for stored tasks:

    • create

    • update

    • get

    • delete

Start Command

Description: This command starts the inventory operation (preset)

Topic: Topic for Control Command

Payload:

Stop Command

Description: This command stops the inventory operation (preset)

Topic: Topic for Control Command

Payload:

Reboot Command

Description: This command reboots the reader

Topic: Topic for Control Command

Payload:

Mode Command

Description: This command configures the reader settings

Topic: Topic for Control Command

Payload:

GPO GET Command

Description: This command gets the current status of the reader´s GPOs

Topic: Topic for Control Command

Result topic: Topic for Control Command Response Publishing

GPO SET Command

Description: This command sets reader´s GPOs. Note that it is not needed to include all 3 GPOs on the payload.

Topic: Topic for Control Command

Result topic: Topic for Control Command Response Publishing

Status Command

Description: This command gets the status of the reader. There are two variations of this command. The default one, "status", returns a reduced and fast payload. A detailed one, "status-detailed" that returns a longer and detailed payload (but slower).

Topic: Topic for Management Command

Payload:

Status Event

Description: This event contains compact status information from the reader

Topic: Topic for Management Events

Payload:

Status Detailed Event

Description: This event contains detailed status information from the reader

Topic: Topic for Management Events

Payload:

Impinj IoT Device Interface Command

Description: This command interfaces with the Impinj IoT Device Interface over MQTT

See Impinj IoT Device Interface payload examples for additional request formats.

Topic: Topic for Management Command

Payload:

Retrieve Settings Command

Description: This command queries the current app settings

Topic: Topic for Management Command

Payload:

Apply Settings Command

Description: This command applies a new configuration to the app

Topic: Topic for Management Command

Payload:

Upgrade Command

Description: This command trigger the firmware upgrade process

Topic: Topic for Management Command

Payload:

RShell Command

Description: Executes an RShell command on the reader. The command string is provided in payload.data and the response returns the command output split into lines.

Topic: Topic for Management Command

Payload:

Example response:

Task Commands

Task management operations can also be performed via MQTT.

Topic format: smartreader/{deviceId}/api/v1/tasks/{action}

Where {action} is one of:

  • create – create a new task or add a document to an existing task

  • update – update an existing task or document

  • get – retrieve task information, progress, or documents

  • delete – delete a task or document

Response Topic: Responses are published to the Management Command Response topic configured in MQTT settings.

The logicalPointId, taskId and documentId values are provided in the JSON payload as needed by each action. The logicalPointId can be omitted to query tasks for all logical points.

Create Task

Creates a new task with one or more documents containing expected EPCs for verification.

Topic: smartreader/{deviceId}/api/v1/tasks/create

Request Payload:

Response: The created task is published to the Management Command Response topic:

Create Task with Multiple Documents

You can create a task with multiple documents, each containing different sets of expected EPCs:

Request Payload:

Add Document to Existing Task

To add a document to an existing task, include documentId in the payload:

Request Payload:

Response: The added document is published:

Update Task

Updates an existing task's state or progress:

Topic: smartreader/{deviceId}/api/v1/tasks/update

Request Payload:

Response: The updated task is published:

Update Document

Updates an existing document within a task:

Request Payload:

Response: The updated document is published:

Get Tasks

Retrieves task information. The response varies based on the payload:

Topic: smartreader/{deviceId}/api/v1/tasks/get

Get All Tasks (omit logicalPointId):

Request Payload:

Response: Array of all tasks:

Get Tasks for Logical Point:

Request Payload:

Response: Array of tasks for the specified logical point.

Get Specific Task:

Request Payload:

Response: The task definition:

Get Task Progress:

Request Payload:

Response: Task progress information:

Get All Documents for Task:

Request Payload:

Response: Array of documents:

Get Specific Document:

Request Payload:

Response: The document:

Delete Task

Deletes a task and all its documents:

Topic: smartreader/{deviceId}/api/v1/tasks/delete

Request Payload:

Response: "OK" published to the Management Command Response topic.

Delete Document

Deletes a specific document from a task:

Request Payload:

Response: "OK" published to the Management Command Response topic.

EPC Document Item Properties

When using mode: "epc", each item in epcItems can include:

Property
Type
Required
Description

epc

string

Yes

The EPC code to verify

expectedQuantity

integer

No

Expected number of times this EPC should be read (default: 1)

verified

boolean

No

Verification status (set by system, default: false)

gs1Code

string

No

Optional GS1 code associated with the EPC

matchedEpcs

array of strings

No

List of EPCs that matched this item (populated by system)

Notes:

  • When mode is "epc", only epcItems should be provided (not gs1Items)

  • The matchedEpcs field is automatically populated by the system as tags are read

  • The verified field indicates whether the expected quantity has been met

  • EPC matching is case-insensitive

Last updated