Errors while publishing attribute values

Hi,

I’m new to OpenRemote, and I manage to link and get MQTT events from it. :grinning:

The issue is, when I try to publish an attribute value I’m always getting this error:

manager_1     | 2023-02-10 09:16:54.359  ERROR   [Thread-1 (ActiveMQ-serve..595)] ache.activemq.artemis.core.protocol.mqtt : AMQ834002: Error processing control packet: MqttPublishMessage[fixedHeader=MqttFixedHeader[messageType=PUBLISH, isDup=false, qosLevel=AT_MOST_ONCE, isRetain=false, remainingLength=161], variableHeader=MqttPublishVariableHeader[topicName=master/test_mqtt/attribute/position/7A92oxiVkatOShs7pu7QUL, packetId=-1], payload=PooledSlicedByteBuf(ridx: 0, widx: 101, cap: 101/101, unwrapped: PooledUnsafeDirectByteBuf(ridx: 164, widx: 164, cap: 1024))]
manager_1     | ActiveMQSecurityException[errorType=SECURITY_EXCEPTION message=AMQ229032: User: master:dil1 does not have permission='SEND' on address master.test_mqtt.attribute.position.7A92oxiVkatOShs7pu7QUL]
manager_1     | 	at org.apache.activemq.artemis.core.security.impl.SecurityStoreImpl.check(SecurityStoreImpl.java:289)
manager_1     | 	at org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.securityCheck(ServerSessionImpl.java:502)
manager_1     | 	at org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.doSend(ServerSessionImpl.java:2212)
manager_1     | 	at org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.send(ServerSessionImpl.java:1840)
manager_1     | 	at org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.send(ServerSessionImpl.java:1781)
manager_1     | 	at org.apache.activemq.artemis.core.protocol.mqtt.MQTTPublishManager.sendToQueue(MQTTPublishManager.java:217)
manager_1     | 	at org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler.handlePublish(MQTTProtocolHandler.java:317)
manager_1     | 	at org.apache.activemq.artemis.core.protocol.mqtt.MQTTProtocolHandler.act(MQTTProtocolHandler.java:160)
manager_1     | 	at org.apache.activemq.artemis.utils.actors.Actor.doTask(Actor.java:33)
manager_1     | 	at org.apache.activemq.artemis.utils.actors.ProcessorBase.executePendingTasks(ProcessorBase.java:67)
manager_1     | 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
manager_1     | 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
manager_1     | 	at org.apache.activemq.artemis.utils.ActiveMQThreadFactory$1.run(ActiveMQThreadFactory.java:118)

This is my Agent and Asset configuration:

This is what I try to submit to the Asset:

Tpoic: master/test_mqtt/attribute/position/7A92oxiVkatOShs7pu7QUL

Value:

{
  "type": "boolean",
  "value": false,
  "name": "position",
  "meta": {
    "readOnly": true
  }
}

Any idea why I’m getting this error?

Hi,
No need to take mqttagentlink for publishing data .
first create an asset , add attribute then
Download MqttBox and
connect mqtt box , refer screenshot “connection”
for publish — Realm/mqttclientname/writeattributevalue/Attribute name/DeviceId
for subscribe – Realm/mqclientname/writeattributevalue/Attribute name/DeviceId

1 Like

Thanks! follow the steps and now it works!!!

Hi,

For subscribe it should be:
{realm}/{clientId}/attribute/{attributeName}/{assetId}

See this wiki page for more variations: User Guide: Manager APIs · openremote/openremote Wiki · GitHub

Also, you don’t need an MQTT Agent at all.
If you are using an MQTT client on your device, then you can use the MQTT Broker of OpenRemote by using the API.
If you were to use an external MQTT Broker service, you could connect to that broker using an MQTT Agent. However, I don’t think that is your situation.

Don