MQTT uses asynchronous pub/sub messaging, which does not support synchronous server-to-device communication. IoT Platform provides Revert-RPC (RRPC) over MQTT to let your server send a request to a device and wait for a synchronous response.
Glossary
|
Term |
Description |
|
RRPC |
Revert-RPC. RPC (Remote Procedure Call) uses a client/server model to request services remotely without understanding the underlying protocol. RRPC extends this model to enable synchronous request-response communication between a server and a device. |
|
RRPC subscription topic |
The topic a device subscribes to for RRPC messages. Contains a wildcard character. |
|
RRPC request message |
A message that IoT Platform sends to a device. |
|
RRPC response message |
A message that a device sends back to IoT Platform. |
|
RRPC message ID |
A unique ID that IoT Platform generates for each RRPC call to distinguish RRPC messages. |
How RRPC works

The process is as follows:
-
(Optional) The device subscribes to the relevant RRPC topic.
IoT Platform provides a custom RRPC request-response mechanism based on MQTT. To receive RRPC messages, a device must subscribe to the topic, and you must implement data processing logic on the device.
-
A device sends a SUB instruction to subscribe to a topic and receive IoT Platform messages. The Link SDK provides a subscription code example.
-
To implement RRPC message processing on the device, follow the RRPC feature development example.
-
-
Your server calls the IoT Platform RRpc API.
-
IoT Platform receives the request and sends an RRPC request message to the device. The message body contains the server request data and is sent to an IoT Platform-defined topic that includes the RRPC message ID.
-
After the device receives the mobile terminated message, it sends an RRPC response to IoT Platform. The response is sent to a topic in a specified format that includes the RRPC message ID from the request.
-
IoT Platform extracts the RRPC message ID and matches it with the original request.
-
IoT Platform returns the response to your server.
-
(Optional) The device processes the message from the subscribed topic.
When you call the RRpc API:
-
If the device is offline, IoT Platform returns a device-offline error.
-
If the device does not respond within 8 seconds, IoT Platform returns a timeout error.
Topic types
Two topic formats are available:
-
Call a custom topic (Recommended): Combines RRPC with custom topics to support diverse scenarios.
-
Call an RRPC communication topic: Uses the default communication topic. Limited applicability. Not recommended.
The Remotely control a Raspberry Pi server topic demonstrates a practical RRPC implementation.