fledge-power / fledge-south-iec61850

A south plugin for collecting data via the IEC 61850 protocol
3 stars 5 forks source link

No visable assets in fledge when using report control block #37

Open JakobVogelsang opened 6 months ago

JakobVogelsang commented 6 months ago

I am currently working with the SCL file below and am I simulating using IEDScout 5.20. Below the configuration of the plugin. I do the communication in the sniffer also following the trigger options in the report. No of it is visible in the assets. When I take the same server and remove in the config anything related to the report and simply poll the data I so see assets being added.

Config

{
 "protocol_stack": {
  "name": "iec61850client",
  "version": "0.0.1",
  "transport_layer": {
   "ied_name": "IED1",
   "connections": [
    {
     "ip_addr": "192.168.0.67",
     "port": 49152,
     "tls": false
    }
   ]
  },
  "application_layer": {
   "polling_interval": 5000,
   "datasets": [
    {
     "dataset_ref": "IEDLDevice/LLN0.SwitchGear",
     "entries": [
      "IEDLDevice/XCBR1.Pos.stVal[ST]",
      "IEDLDevice/XCBR1.Pos.q[ST]"
     ]
    }
   ],
   "report_subscriptions": [
    {
     "rcb_ref": "IEDLDevice/LLN0.BR.SwitchGear",
     "dataset_ref": "IEDLDevice/LLN0.SwitchGear"
    }
   ]
  }
 }
}
{
 "exchanged_data": {
  "datapoints": [
   {
    "pivot_id": "TS1",
    "label": "TS1",
    "protocols": [
     {
      "name": "iec61850",
      "objref": "IEDLDevice/XCBR1.Pos",
      "cdc": "DpsTyp"
     }
    ]
   }
  ]
 }
}

PCAP:

WorkingReportControl.pcap.zip

Server definition TestIED (2).scd.zip

LOG:

grafik
mzillgith commented 6 months ago

I cannot reproduce it. Maybe it has been fixed in the meantime. Can you try again with the latest code in the "develop_mz" branch?

JakobVogelsang commented 6 months ago

I did test that with 1.0.0-rc1, sorry. Will retest and report back

JakobVogelsang commented 6 months ago

No, unfortunately, I still can reproduce this scenario. Report are visible in the bus, but there are no assets generated. To check the proper exchanged_data config, I just remove all datasets and report_subscriptions and assets are bing generated.

JakobVogelsang commented 6 months ago

Actually there seem to be a new error with SetBRCBValues such that the trigger options are not set correctly.

jude-adam commented 6 months ago

When testing with the provided SCD files and configurations, I also noticed that there was a SetRCBValues error. I think this was caused by the "rcb_ref" value being wrong, it works with IEDLDevice/LLN0.BR.SwitchGear01, not IEDLDevice/LLN0.BR.SwitchGear. Also, it was also noted that sending assets for the quality attribute reports was not yet implemented. This has now been fixed and will be pushed soon to the develop_mz branch.

JakobVogelsang commented 6 months ago

Once you have it going I would love it when you share with me a configuration that I can test, either with a new SCL file or any other SCL file that you are using for testing.

jude-adam commented 6 months ago

The fix has been pushed to the develop_mz branch.

Configuration : The SCL file I used was the one you provided. Here is the config I used:

{
 "protocol_stack": {
  "name": "iec61850client",
  "version": "0.0.1",
  "transport_layer": {
   "ied_name": "IED1",
   "connections": [
    {
     "ip_addr": "192.168.0.134",
     "port": 102,
     "tls": false
    }
   ]
  },
  "application_layer": {
   "polling_interval": 0,
   "datasets": [
    {
     "dataset_ref": "IEDLDevice/LLN0.SwitchGear",
     "entries": [
      "IEDLDevice/XCBR1.Pos.stVal[ST]",
      "IEDLDevice/XCBR1.Pos.q[ST]"
     ],
     "dynamic": false
    }
   ],
   "report_subscriptions": [
    {
     "rcb_ref": "IEDLDevice/LLN0.BR.SwitchGear01",
     "dataset_ref": "IEDLDevice/LLN0.SwitchGear"
    }
   ]
  }
 }
}
{
 "exchanged_data": {
  "datapoints": [
   {
    "pivot_id": "TS1",
    "label": "TS1",
    "protocols": [
     {
      "name": "iec61850",
      "objref": "IEDLDevice/XCBR1.Pos",
      "cdc": "DpcTyp"
     }
    ]
   }
  ]
 }
}

Here is the Logger Output (Sends readings for stVal and q reports):

image

jude-adam commented 6 months ago

@JakobVogelsang Any updates on testing so that the issue can be closed please.

JakobVogelsang commented 5 months ago

I am sorry but no I cannot confirm the report is being processed correctly. :( I see repots being activated and data is exchanged between the server and the client, but the information is not being processed correctly in the fledge instance. The assets are not showing any new incoming information.

Btw I am directly pulling from the branch develop_mz. Is there a way how I can see a new version being used?

JakobVogelsang commented 5 months ago

What do I need to do to see the log message you have shown above?

jude-adam commented 5 months ago

Did you set the plugin's logger level to debug?

JakobVogelsang commented 3 months ago

Hi @jude-adam,

@mzillgith has had the winning hint. The plugin at the moment assumes that report references on the wire are the not indexed. Which means that it is expecting the above report control block reference to be as such: IEDLDevice/LLN0$BR$SwitchGear

In my case however the simulation tool is indexing the report and the reference is changed to: IEDLDevice/LLN0$BR$SwitchGear01

As a result, the references do not match and therefore the plugin does not receive reports.

I personally think that the report control block reference indexing is correct. How else would you be able to differentiate between IEDLDevice/LLN0$BR$SwitchGear01 and IEDLDevice/LLN0$BR$SwitchGear02.

See my simple fix here https://github.com/JakobVogelsang/fledge-south-iec61850/commit/327410ab5e6e9ad090642b5f3424f66773e742a9

Sander3003 commented 1 month ago

Great investigation!