Chirpstack send data to command topic

Hey,
I have successfully subscribed to the ChirpStack MQTT topic and i can receive events.

I try now when clicking the send button on the UI like below to send the data to the command topic of Chirpstack:

Unfortunately without success. On the manager logs i see no logs only an inline send error as above in the picutre.

Below is my JSON configuration for the specific attribute

{
   "id":"5ZyK0ZJsLn6eB60Dw0z3gn",
   "writeValue":"{\"devEui\": \"0080e115052e77ea\", \"confirmed\": true, \"fPort\": 10, \"object\": {\"device_interval\": ${value}}}",
   "updateOnWrite":false,
   "publishTopic":"application/c618023c-5fbf-4d37-85fd-50df01fcbe28/device/0080e115052e77ea/command/down",
   "type":"MQTTAgentLink"
}

Here is also the documentation from Chirpstack regarding command events

Finally there was an open topic on this forum here but there is no clear solution.

Is there any working example like the subscription tutorial that i have followed to receive the events?
Thanks!

Maybe @rainerhitz can give you some assistance on this?

Hello guys,
Any update on this please?

In addition if the above does not work i have tried to use the HttpAgentLink with a POST method.
In order to send a custom JSON object that also gets the input value from an Integer Attribute field. Should i use the WriteValue or WriteValueConverter?
i want to post something like the below JSON and replace {$value} with the input value

{
  "queueItem": {
    "confirmed": false,
    "fPort": 10,
    "isEncrypted": false,
    "object": {
      "interval": {$value}
     }
  }
}

I have already tried to put the JSON as is in the WriteValue seciton but without luck! Also the {$value} seems that does not pass the data.
@Rich or @rainerhitz it would be grateful if you could help.

Thanks!

Your MQTT agent link configuration looks good that means WriteValue is Ok. You should replace {$value} with %VALUE% (see Dynamic Value Injection) so that your MQTT agent link configuration looks like the following:

{
   "id":"5ZyK0ZJsLn6eB60Dw0z3gn",
   "writeValue":"{\"devEui\": \"0080e115052e77ea\", \"confirmed\": true, \"fPort\": 10, \"object\": {\"device_interval\": %VALUE%}}",
   "updateOnWrite":false,
   "publishTopic":"application/c618023c-5fbf-4d37-85fd-50df01fcbe28/device/0080e115052e77ea/command/down",
   "type":"MQTTAgentLink"
}
1 Like

This is what we use and it has worked flawlessly. We still get the ‘send failed’ message but the command downlinks successfully. Data is base64.

{
“id”: “xxxxxxxxxxxxxxxxxxxxx”,
“writeValue”: “{"devEui":"24xxxxxxxxxxxx34","fPort":200,"data": "kAPABCAJiJ4="}”,
“publishTopic”: “application/d1aae7d9-3fe2-4e90-abc0-5e87839abc46/device/24e123456e300123/command/down”,
“type”: “MQTTAgentLink”
}

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.