Hi, I am using TRB140. I am trying to execute RPC call request from thingsboard but the commands do not work because RPC Call Requests from Thingsboard are sent with a specific JSON structure. For example (from the official documentation):
{
"method": "setGPIO",
"params": {
"pin": 4,
"value": 1
},
"timeout": 30000
}
You can find the documentation of thingsboard RPC here:
under the section “Server-side RPC structure“.
As you can see, the message, in this case, what I want the MQTT Modbus gateway to process, is inside the key “params“. Even if in thingsboard I move the content to the root of the JSON before executing the RPC Call Request, ThingsBoard does not send anything that is not expected, so it removes it.
Therefore I have the limitation that thingsboard speaks a language that MQTT modbus gateway cannot understand. What I would need is an option in MQTT modbus gateway where I can specify that the content of “params“ has to be used.
Just one more thing, I found a work around that is not the right thing to do with with thingsboard, but it proves that all the communication works well. From thingsboard, instead of executing an RPC Call Request I send an MQTT message to the MQTT broker from the TRB140, and I make the MQTT modbus gateway to listen to the local MQTT broker, where it has the modbus commad. This works well. But it is not the right apporach, because thingboard need a response in order to know that the RPC command works. By the way, the RPC call request makes a connection, because I see it is able to confirm the response from the TRB140, and that is great news. The problem is that the command sent, the MQTT Modbus Gateway is not able to interpret because of the JSON structure that cannot be changed in thingsboard when using RPC Call Request.
Thank you in advance