Skip to content
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

Allow Comment in OpcPublisher Configuration when Validation is used #1892

Merged
merged 2 commits into from
Nov 8, 2022

Conversation

bqstony
Copy link
Contributor

@bqstony bqstony commented Nov 4, 2022

Actualy when i use the the Validation on startup in the opc-publisher container then i get a error when my publishernodes.jsonc has commends inside.

this is a sample to start my container:

docker run -it --rm --name opcpubtest -v /mnt/c/source/publisherconfig:/mount/publisherconfig --env "EdgeHubConnectionString=secret" mcr.microsoft.com/iotedge/opc-publisher:2.8.3 --publishfile=/mount/publisherconfig/publishednodes.jsonc --publishfileschema=/mount/publisherconfig/strict-publishednodesschema.json --opcpublishinginterval=1000 --autoaccept --logfile=/mount/publisherconfig/publisher.log --messagingmode=PubSub --batchsize=100 --iothubsendinterval=1 --heartbeatinterval=3600

the configuration file publishednodes.jsonc looks like

// This file configures the XXX-OPC UA Server nodes
// It requires at least mcr.microsoft.com/iotedge/opc-publisher:2.8.3
/* some more header comment */
[
  {
    // Example for an EndpointUrl is: opc.tcp://192.168.178.26:62541/Quickstarts/ReferenceServer
    "EndpointUrl": "opc.tcp://10.10.1.152:48040",
    // Allows to access the endpoint with SecurityPolicy.None when set to false (no signing and encryption applied to the OPC UA communication), default is false.
    // Controls whether to use a secure OPC UA mode to establish a session to the OPC UA server endpoint.
    "UseSecurity": true,
    // Enum to specify the session authentication. Options: "Anonymous", "UsernamePassword"
    "OpcAuthenticationMode": "UsernamePassword",
    // The username for the session authentication. Mandatory if OpcAuthentication mode is "UsernamePassword".
    "OpcAuthenticationUsername": "xxx",
    // The password for the session authentication. Mandatory if OpcAuthentication mode is "UsernamePassword".
    "OpcAuthenticationPassword": "xxx",
    // The data set writer group collecting datasets defined for a certain endpoint.
    "DataSetWriterGroup": "Asset0",
    // The unique identifier for a data set writer used to collect OPC UA nodes to be semantically grouped and published with the same publishing interval.
    "DataSetWriterId": "DataFlow0",
    // The DataSet collection grouping the nodes to be published for the specific DataSetWriter defined above.
    "OpcNodes": [
      {
        "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=Events.Alarm.Class",
        "DisplayName": "Class"
      },
      {
        "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=Events.Alarm.Code"
      },
      {
        "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=Events.Alarm.IncomingUTC"
      },
      {
        "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=Events.Alarm.Message"
      },
      {
        "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=Events.Alarm.OutgoingUTC"
      },
      {
        "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=Events.Alarm.State"
      },
      {
        "Id": "nsu=http://microsoft.com/Opc/OpcPlc/;s=Events.Alarm.Unit"
      }
    ]
  }
]

This will result in an error to load the configuration.

This Pull requst allows the commends in the file 😎

@bqstony bqstony requested a review from a team as a code owner November 4, 2022 10:09
@bqstony
Copy link
Contributor Author

bqstony commented Nov 4, 2022

@microsoft-github-policy-service agree [company="{bqstony}"]

@bqstony
Copy link
Contributor Author

bqstony commented Nov 4, 2022

@microsoft-github-policy-service agree

@bqstony bqstony changed the title Allow Commend in OpcPublisher Configuration when Validation is used Allow Comment in OpcPublisher Configuration when Validation is used Nov 4, 2022
Copy link
Collaborator

@marcschier marcschier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please hold off on merging, I will merge once .net 6 update is in main.

@marcschier
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@marcschier marcschier merged commit 7f77a78 into Azure:main Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants