

MQTT Protocol Configuration Guide for URF Devices
- URF Device Configuration
- Open NSET, access to Interfaces Settings (Figure 1). Edit Data output Channel to ETH TCP client on the right side, make sure the Remote IP Address and Remote Port are same as the IP and port number on MQTT server.
- Enable MQTT, set up MQTT User name and Password (eg:test user name: rfid, password: 87654321), also MQTT Qos set as QosQ
- Click Save to Device, the device will automatically reboot to activate MQTT functionality and initiate connection to the configured server.
Figure 1
- MQTT Connect Client
- Example Setup: EMQX (MQTT Broker)
Note: This is for demonstration purposes only. The customer is responsible for deploying and managing their own MQTT platform in production. - Install MQTT server MQTTX-Setup-1.9.8-x64.exe。
- Open MQTTX new connection(Figure 2),you can customize name and Client ID,Server address is XXX.XXX.XXX.XXX,port: XXXX,username rfid,password: 87654321,other settings keep as default
Figure 2
- Add New Subscription(Figure 3),set up the Topic only. Normally, 2 Topics are required to make it work. (1.Tag Data(RFID/+/TAG)2.Command Responce(RFID/+/ACK)).
Figure 3
- Command Interface (Figure 4)
Red Box 1: Subscribed topic (receives incoming commands).
Red Box 2 & 3: JSON format selected for command sending and receiving.
Red Box 4: Send topic and command input field.
Figure 4
- MQTT Command
1 Command format
The message subject format of the communication between the client and the server is “RFID/device Serial Number/Command type” and the message content will be JSON format:
- RFID/ device Serial Number /CMD:client side publish, URF device subscribe use for client side send command to device
- RFID/ device Serial Number /ACK:URF device publish, client side subscribe use for device send command to answer the client
- RFID/ device Serial Number /TAG:URF device publish, client side subscribe use for device send TAG’s data to client
2 command expands
2.1 CMD Info
Name |
Format |
Description |
|
1 |
Async inventory |
{ "command": "async_inventory", "payload": number } |
After receiving the async inventory start command, the URF device continues to take inventory and upload tag data in real time until receiving the asynchronous inventory stop command. "payload" value type needs to be number 0:stop async inventory 1:start async inventory eg:send command to start async inventory { "command": "async_inventory", "payload": 1 } |
2 |
Sync inventory |
{ "command": "sync_inventory", "payload": number } |
The URF device receives the sync inventory command, inventories and caches the tag data within the specified time, and uploads the stored tag data after the inventory time ends.。 "payload" value type needs to be number。 Value between 100-60000,it represent inventory time(ms). eg:send sync inventory 1000ms command { "command": "sync_inventory", "payload": 1000 } |
2.2 ACK Info
Name |
Format |
Description |
|
1 |
Async inventory respond |
{ "command": "async_inventory", "response": string } |
"response" value type needs to be string. "success":command respond successfully "fail":command respond failed Eg: send async inventory respond successfully { "command": "async_inventory", "response": "success" } |
2 |
Sync inventory respond |
{ "command": "sync_inventory" "response": string } |
"response" value type needs to be string. "success":command respond successfully "fail":command respond failed Eg: send sync inventory respond failed { "command": "sync_inventory", "response": "fail" } |
2.3 TAG info
Name |
Formate |
Description |
|
1 |
Tag’s data |
{ "EPC": string, "TID": string, "antenna": number, "reads": number, "RSSI": number } |
Tag’s “EPC” is required, "TID","antenna","reads" and "RSSI" are optional for device setup upload. "EPC" value type needs to be string "TID" value type needs to be string "antenna" value type needs to be number "reads" value type needs to be number "RSSI" value type needs to be number eg: { "EPC": "055421000000000000003A71", "TID": "E280382120006026022903D7", "antenna": 1, "reads": 6, "RSSI": -41 } The above command means EPC is 055421000000000000003A71 TID is E280382120006026022903D7 antenna 1 read times 6 RSSI is -41 |
- Note
Due to the limited resources of the URF device and the MQTT test server, it is recommended that the number of tags stored per second should not exceed 10, otherwise the tag data reporting will be blocked or lost.