diff --git a/agent/MTConnect.NET-Agent/README.md b/agent/MTConnect.NET-Agent/README.md index 93689a76..d4635813 100644 --- a/agent/MTConnect.NET-Agent/README.md +++ b/agent/MTConnect.NET-Agent/README.md @@ -130,11 +130,15 @@ More information about [Configurations](https://github.com/TrakHound/MTConnect.N # - Device Configuration - devices: devices +# - Processors - +processors: +- python: # - Add Python Processor + directory: processors + # - Modules - -- modules: +modules: - # - Add HTTP Server module - - http-server: +- http-server: # - Add HTTP Server module hostname: localhost port: 7878 allowPut: true @@ -145,37 +149,33 @@ devices: devices - br files: - path: schemas - location: schemas + location: schemas - path: styles - location: styles + location: styles - path: styles/favicon.ico - location: favicon.ico - - # - Add MQTT Relay module - - mqtt2-relay: - server: localhost - port: 1883 - currentInterval: 5000 - sampleInterval: 500 - - # - Add SHDR Adapter module for Device = M12346 and Port = 7878 - - shdr-adapter: - deviceKey: M12346 - hostname: localhost - port: 7878 - - # - Add SHDR Adapter module for Device = OKUMA-Lathe and Port = 7879 - - shdr-adapter: - deviceKey: OKUMA-Lathe - hostname: localhost - port: 7879 - - # - Add MQTT Adapter module for Device = M12346 and Topic = cnc-01 - - mqtt-adapter: - deviceKey: M12346 - server: localhost - port: 1883 - topic: cnc-01 + location: favicon.ico + +- mqtt2-relay: # - Add MQTT Relay module + server: localhost + port: 1883 + currentInterval: 5000 + sampleInterval: 500 + +- shdr-adapter: # - Add SHDR Adapter module for Device = M12346 and Port = 7878 + deviceKey: M12346 + hostname: localhost + port: 7878 + +- shdr-adapter: # - Add SHDR Adapter module for Device = OKUMA-Lathe and Port = 7879 + deviceKey: OKUMA-Lathe + hostname: localhost + port: 7879 + +- mqtt-adapter: # - Add MQTT Adapter module for Device = M12346 and Topic = cnc-01 + deviceKey: M12346 + server: localhost + port: 1883 + topic: cnc-01 # The maximum number of Observations the agent can hold in its buffer diff --git a/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/README.md b/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/README.md index 2d9328fa..50972cb4 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/README.md +++ b/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/README.md @@ -9,7 +9,7 @@ This Agent Module implements an adapter to read from other MTConnect Agents usin ```yaml - http-adapter: address: localhost - port: 5001 + port: 5000 deviceKey: M12346 interval: 100 ``` diff --git a/agent/Modules/MTConnect.NET-AgentModule-HttpServer/README.md b/agent/Modules/MTConnect.NET-AgentModule-HttpServer/README.md index 0e0e1ac6..0a8826b4 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-HttpServer/README.md +++ b/agent/Modules/MTConnect.NET-AgentModule-HttpServer/README.md @@ -9,7 +9,7 @@ This Agent Module implements the MTConnect REST Protocol ```yaml - http-server: hostname: localhost - port: 7878 + port: 5000 allowPut: true indentOutput: true documentFormat: xml diff --git a/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/Module.cs b/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/Module.cs index 314c368d..67f530ad 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/Module.cs +++ b/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/Module.cs @@ -134,8 +134,6 @@ private async Task Worker() Log(Logging.MTConnectLogLevel.Information, $"MQTT Relay Connected to External Broker ({_configuration.Server}:{_configuration.Port})"); - //if (Connected != null) Connected.Invoke(this, new EventArgs()); - _server.Start(); while (!_stop.Token.IsCancellationRequested && _mqttClient.IsConnected) @@ -146,11 +144,9 @@ private async Task Worker() catch (Exception ex) { Log(Logging.MTConnectLogLevel.Warning, $"MQTT Relay Connection Error : {ex.Message}"); - //if (ConnectionError != null) ConnectionError.Invoke(this, ex); } Log(Logging.MTConnectLogLevel.Information, $"MQTT Relay Disconnected from External Broker ({_configuration.Server}:{_configuration.Port})"); - //if (Disconnected != null) Disconnected.Invoke(this, new EventArgs()); await Task.Delay(_configuration.ReconnectInterval, _stop.Token); } @@ -220,7 +216,7 @@ private async void SampleReceived(IDevice device, IStreamsResponseOutputDocument var topic = $"{_configuration.TopicPrefix}/{device.Uuid}/{_configuration.SampleTopic}"; var message = new MqttApplicationMessage(); - message.Retain = true; + //message.Retain = true; message.Topic = topic; message.QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtLeastOnce; message.Payload = formatResult.Content; diff --git a/libraries/MTConnect.NET-SHDR/Shdr/ShdrClient.cs b/libraries/MTConnect.NET-SHDR/Shdr/ShdrClient.cs index 07117c4d..c5cb8951 100644 --- a/libraries/MTConnect.NET-SHDR/Shdr/ShdrClient.cs +++ b/libraries/MTConnect.NET-SHDR/Shdr/ShdrClient.cs @@ -636,7 +636,7 @@ private static string GetDataItemKey(string line) var x = ShdrLine.GetNextSegment(line); var y = ShdrLine.GetNextValue(x); - if (y.Contains(":")) + if (y != null && y.Contains(":")) { var i = y.IndexOf(':'); y = y.Substring(i + 1);