Thanks a lot, it’s clear now, I will use the Metric object to set the action name, and in properties associated at this metric object, all data that the action need
Regards
Xavier Millieret
Software Engineer
Engineering Software & Connectivity
Power Quality and Electronics Division (PQED)
Immeuble Viseo - Bâtiment A
110, rue Blaise Pascal
38330 Montbonnot St Martin
FRANCE
tel: +33 (0) 4 76 00 66 02
xaviermillieret@xxxxxxxxx
www.eaton.com
From: sparkplug-dev <sparkplug-dev-bounces@xxxxxxxxxxx>
On Behalf Of Bryce Nakatani via sparkplug-dev
Sent: jeudi 21 décembre 2023 19:17
To: sparkplug developer discussions <sparkplug-dev@xxxxxxxxxxx>
Cc: Bryce Nakatani <bnakatani@xxxxxxxxxx>
Subject: Re: [sparkplug-dev] [EXTERNAL] Re: Device creation
The Sparkplug payloads are created through the use of an
implementation that relies on the Google Protobuf. There are examples of the Protobuf and a Java library that handles a good deal of the payload management.
There is nothing special about the metric. In the example I mentioned earlier, you could create a Metric (a tag) that has a String data type. The edge node receives the Metric
value and then processes the data accordingly. In turn, the response of this process updates the value of the same metric and then publishes the change as a node data (NDATA) or device data (DDATA) metric.
Thanks a lot for your answers, I appreciate, so thank you.
Let me write some precision
The idea is:
my edge node can accept some commands, like create a device and so on (this one is not known by my edge node, so I have not already this device id)
So my question is, how pass the command and payload relating to the command in SparkPlug format?
-
I can do this:
Send a SP message with this topic
spBv1.0/group_id/DCMD/edge_node_id/create and in the Metric Object pass all information to create my device. -
And or publish this special cmd (create) in the NBIRTH message in Metric Object, after that the edge node can accept this command on the following topic spBv1.0/group_id/DCMD/edge_node_id
And inside the Metric object the special cmd and in body the payload to launch the special command, and or add some properties associated to the metric?
Thank you by advance
Regards
I'm not completely clear about your implementation.
The specification specifies the
MQTT topic for the device command (DCMD). The topic has the form of
spBv1.0/group_id/DCMD/edge_node_id/device_id
The node and device birth certificates contain all the metrics that the edge node will publish. If you wanted a "special"
function, this would have to be referenced through the data of a metric that is published in the birth certificate. The host does not arbitrarily create new metrics for the node or device.
If you need a special function metric, it could be of type string. The string written from host to edge could contain
the information required. The result of the operation could be the metric's state reported to the host.
I am new on SparkPlug, and after reading the specification, I have some questions to implement my feature.
I must have some CRUD function for a device in my system, the main question is how pass the verb in the SP payload
-
Either in the topic name for example spBv1.0/<groupe/DCMD/<edge_node_id>/<verbe-like-create-read-etc>,
and in metric all information to create the device?
-
Either in the metric payload, and put in the body all information to create the device?
-
Either in the metric payload, and put all information to create the device inside properties attached at this metric?
-
How to return the result of the CRUD command
All of them scenario works, but I don't know the right way to do this feature, so any help on this part will be appreciate
Thanks a lot
Eaton Industries (France) S.A.S ~ Siège social: 110 Rue Blaise Pascal, Immeuble Le Viséo - Bâtiment A Innovallée, 38330, Montbonnot-St.-Martin, France ~ Lieu d'enregistrement au registre du commerce: Grenoble ~ Numéro d'enregistrement: 509 653 176 ~ Capital social souscrit et liberé:€ 16215441 ~ Numéro de TVA: FR47509653176
|