neuron icon indicating copy to clipboard operation
neuron copied to clipboard

Mqtt plugin message payload error 3017 for multiple tags publish

Open nick0tine opened this issue 1 year ago • 3 comments

I have created a northbound app and it has a group having 9 tags in it.

All the subscription to southbound apps is there. Issue: When trying to publish message to mqtt broker address of north app, it throws mqtt payload error 3017.

The above case is only when I publish message where multiple tags are passed inside an array to tags attribute of message dict.

Although if i try to publish a message with single tag without any array, it works perfectly fine.

PS: I am using neuronEX. Code snippet example:


def on_message(client, userdata, message):

    payload = json.loads(message.payload.decode())

    if not 'error' in payload.keys() or payload['error'] != 0:

        print(f"Received message on {message.topic}: {payload}")







client = mqtt.Client(client_id=client_id)



client.on_message = on_message





client.connect(broker_ip, broker_port, 60)





client.loop_start()



client.subscribe("northappwriteresphost", qos=1)





msg = {

        "group": "example-grp",

        "node": "server-DC",

        "tags": [

            {

                "tag": "gate",

                "value": 11.0

            },

            {

                "tag": "brush",

                "value": 101.0

            },

            {

                "tag": "solids",

                "value": 16.0

            },

            {

                "tag": "width",

                "value": 25.0

            },

            {

                "tag": "length",

                "value": 150.0

            },

            {

                "tag": "line",

                "value": 500.0

            },

            {

                "tag": "weight",

                "value": 0.3732195710002935

            },

            {

                "tag": "load",

                "value": 29.32012949778306

            },

            {

                "tag": "coeff",

                "value": 8.728136979594593e-06

            }

        ],

        "uuid": "cd32be1b-c8b1-3257-94af-77f847b1ed3e"

    }



topic = 'xxxxx'



client.publish(topic, json.dumps(msg), qos=1)

client.loop_stop()

client.disconnect()

nick0tine avatar Aug 27 '24 21:08 nick0tine

3017 meas that the driver used for writing multiple tags does not yet support writing multiple tags in a single message

fengzeroz avatar Aug 28 '24 05:08 fengzeroz

3017 meas that the driver used for writing multiple tags does not yet support writing multiple tags in a single message

By driver you mean the plugin we're using in southbound devices ? Or is the protocol version?

I'm using Allen-Bradley-ControlLogix 5500 plugin.

I'm new to this, so pardon for my silly doubts.

nick0tine avatar Aug 29 '24 15:08 nick0tine

3017 meas that the driver used for writing multiple tags does not yet support writing multiple tags in a single message

By driver you mean the plugin we're using in southbound devices ? Or is the protocol version?

I'm using Allen-Bradley-ControlLogix 5500 plugin.

I'm new to this, so pardon for my silly doubts.

Yes, Allen-Bradley 5500 plugin does not currently support writing multiple tags in a single message, future version will support.

fengzeroz avatar Aug 30 '24 03:08 fengzeroz

Thanks for the comments and help

nick0tine avatar Sep 06 '24 12:09 nick0tine