-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ua-deltaframe Messages don't contain ExtensionFields #2091
Comments
Can you post the message content of the FullNetworkMessage when using extension fields? The extension fields look like regular fields of the data set message object, as if they came from the OPC UA server. There is no particular extension fields "object" then, like we had in Samples encoding. You uncovered a bug though for samples, the string is incorrect. |
Edit: I have collected DataSetMessages, FullNetworkMessages, FullSamples and PubSub messages with JSON and JSONReversible profile. All with ExtensionFields configured. I can upload all the messages if needed. Cfg: "Cmd": [
"--PkiRootPath=/mount/pki",
"--PublishedNodesFile=/appdata/pn.json",
"--CreatePublishFileIfNotExistKey=false",
"--AutoAcceptUntrustedCertificates",
"--AddAppCertToTrustedStore=true",
"--LogLevel=Debug",
"--strict",
"--fm=true",
"--mm=FullNetworkMessages",
"--me=JsonReversible",
"--bs=2"
] Msg: {
"MessageId": "f54c075e-a455-45c3-82c5-f49b79860a23",
"MessageType": "ua-data",
"PublisherId": "iothub-xxxxx_device_publisher29poc_module_opc-publisher",
"DataSetWriterGroup": "Asset1",
"Messages": [
{
"DataSetWriterId": 1,
"SequenceNumber": 2512,
"MetaDataVersion": {
"MajorVersion": 1222365517,
"MinorVersion": 997070557
},
"Timestamp": "2023-10-20T12:45:43.7435731Z",
"MessageType": "ua-deltaframe",
"DataSetWriterName": "DataFlow1",
"Payload": {
"nsu=http://microsoft.com/Opc/OpcPlc/;s=LongString10kB": {
"Value": {
"Type": 12,
"Body": "NNNNN"
},
"SourceTimestamp": "2023-10-20T12:45:43.2682162Z",
"ServerTimestamp": "2023-10-20T12:45:43.2682305Z"
},
"nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1": {
"Value": {
"Type": 7,
"Body": 135234
},
"SourceTimestamp": "2023-10-20T12:45:43.6645184Z",
"ServerTimestamp": "2023-10-20T12:45:43.6645279Z"
}
}
},
{
"DataSetWriterId": 1,
"SequenceNumber": 2513,
"MetaDataVersion": {
"MajorVersion": 1222365517,
"MinorVersion": 997070557
},
"Timestamp": "2023-10-20T12:45:48.7526074Z",
"MessageType": "ua-deltaframe",
"DataSetWriterName": "DataFlow1",
"Payload": {
"nsu=http://microsoft.com/Opc/OpcPlc/;s=LongString10kB": {
"Value": {
"Type": 12,
"Body": "NNNNN"
},
"SourceTimestamp": "2023-10-20T12:45:48.2679673Z",
"ServerTimestamp": "2023-10-20T12:45:48.2679787Z"
},
"nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1": {
"Value": {
"Type": 7,
"Body": 135284
},
"SourceTimestamp": "2023-10-20T12:45:48.6666901Z",
"ServerTimestamp": "2023-10-20T12:45:48.6667005Z"
}
}
}
]
} |
Thanks for the details. I will take a look at this so it gets addressed before the 2.9.3 release. We have tests for extension fields,, but maybe a case not covered. |
Update: I added another test that uses the same command line arguments, and it verifies that extension fields working but only as part of the key frame messages: Line 338 in 5dfae19
If there are no key frame messages configured/sent then you will not see extension fields in delta frame messages. This logically makes sense as you won't expect changes in extension fields, yet works against it's usefulness for contextualization. We can change this by adding a cli switch to pack extension fields always into all messages that are sent. In the meantime, would key frames work for you? Then you can set "DataSetKeyFrameCount": x where x is the number of delta messages until a key frame is sent. |
I am ill at the moment, that's why my answer is delayed. We need the Extensionfields in every message for more context. A new config for sending the Extensionfields in every msg will be a perfect solution. I will try it with the DataSetKeyFrameCount cfg you mentioned next week. Thanks for your support :) |
The DataSetKeyFrameCount cfg works, thanks for you help. |
Updated documentation in #2103. Closing for now. |
@marcschier We need a way to get the ExtensionFields with every DeltaMessage, which only sends the nodes which have been changed. Maybe there is also another MessageFormat which fits our needs? |
Describe the bug
I have tested several messaging profiles from the opc publisher module to find how how the ExtensionFields look in the different profiles.
I now have the issue, that the ExtensionFields doesn't appear for example the "FullNetworkMessages" profile.
Only message profile where I can see the ExtensionFields is "FullSamples".
Here it is documented that several profiles should support ExtensionFields: https://github.com/Azure/Industrial-IoT/blob/release/2.9.0/docs/opc-publisher/messageformats.md#messaging-profiles-supported-by-opc-publisher
But I can only get it working for "FullSamples"
To Reproduce
I have an Iot Edge device with these modules:
$edgeAgent, $edgeHub, opcplc, opc-publisher
The publisher is configured with this container create options:
Endpoints configuration returned from "GetConfiguredEndpoints_V1" direct method:
Expected behavior
I expected that the FullNetworkMessages would also contain the ExtensionFields.
I have tested the FullSamples profile and received the ExtensionFields.
But for FullNetworkMessages it is not working.
FullSamples-JSONReversible Sample:
opc-publisher image: mcr.microsoft.com/iotedge/opc-publisher:2.9.2
The text was updated successfully, but these errors were encountered: