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

MT-Connect-MQTT-Relay Example #55

Open
ravirajpspl2023 opened this issue Feb 9, 2024 · 2 comments
Open

MT-Connect-MQTT-Relay Example #55

ravirajpspl2023 opened this issue Feb 9, 2024 · 2 comments

Comments

@ravirajpspl2023
Copy link

installing MT-Connect-Mqtt-Relay Example in source code. this MT_Connect agent publish data on external Mqtt-broker
so i not know the SHDR adaper is embedded with this agent , if yes then how to configure this or not then how or which is used for this agent

@PatrickRitchie
Copy link
Contributor

Yes the MTConnect-Mqtt-Relay Agent supports SHDR and can be configured in the agent.config.yaml file below:

# - Device Configuration -
devices: devices

# - SHDR Adapter Configuration -
# The Agent is able to receive data through a TCP port using the SHDR protocol
adapters:
- hostname: localhost
  port: 7878
  reconnectInterval: 1000

# - MQTT Configuration -

# The hostname of the MQTT broker to publish messages to
server: localhost

# The port number of the MQTT broker to publish messages to
port: 1883

Version 6

I will note that there is a new version (Version 6) that combines HTTP, MQTT, and SHDR in a single Agent. I recommend using this as the version 5.x applications will be deprecated. The version 6 agent also uses the new MQTT format.

Version 6 ReadMe:
https://github.com/TrakHound/MTConnect.NET/tree/version-6.0/agent/MTConnect.NET-Agent

Version 6 Download:
https://github.com/TrakHound/MTConnect.NET/releases/tag/untagged-1926fb8a6fc4ed4c6b60

Version 6 Configuratoin:

# - Device Configuration -
devices: devices

# - Processors -
processors:
- python: # - Add Python Processor
    directory: processors

# - Modules -
modules:
  
- http-server: # - Add HTTP Server module
    hostname: localhost
    port: 5000
    allowPut: true
    indentOutput: true
    documentFormat: xml
    responseCompression:
    - gzip
    - br
    files:
    - path: schemas
    location: schemas
    - path: styles
    location: styles
    - path: styles/favicon.ico
    location: favicon.ico

- mqtt-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
observationBufferSize: 150000

# The maximum number of assets the agent can hold in its buffer
assetBufferSize: 1000

# Sets whether the Agent buffers are durable and retain state after restart
durable: false

# Sets the default MTConnect version to output response documents for.
defaultVersion: 2.2

@ravirajpspl2023
Copy link
Author

Hi Patrick,

Thank you for your message! I really appreciate your quick response.
i am use your adapter to connect with my fanuc cnc controller through a focas but not getting data how to configar adapter to connect my fanuc cnc and get basic data from cnc controller and display external MQTT broker

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

No branches or pull requests

2 participants