Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hi there,

i just started to play around the MTConnect but stuck at the moment with connection to a HAAS VF-4 with NGC Firmware.
I can view alle MTConnect Data through Web Port 8082, but not able to correctly setup MTConnect MQTT Broker to read all the data.

Is there an example available or how i can debug the connection?

Best Regards

You must be logged in to vote

Replies: 5 comments · 20 replies

Comment options

@nobrainer-de The regular MTConnect MQTT Broker Agent is designed to read from an MTConnect Adapter's SHDR port (usually 7878). It looks like the 8082 port for the NGC MTConnect Agent is the actual MTConnect Agent.

I just uploaded the v5.1.0 release that includes the new MQTT Gateway Agents. Gateway Agents are designed to read from an existing MTConnect Agent and forward it to an MQTT broker. It looks like the MTConnect MQTT Broker Gateway Agent may be what you are looking for.

The configuration file for your scenario should be similar to:

# - HTTP Client Adapter Configuration -
# The Agent is able to receive data by reading from other MTConnect HTTP Agents
clients:
- address: [IP Address that you used to view in a browser]
  port: 8282
  deviceKey: [The Device Name that is shown in a Probe request in a browser]


# - 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

Please let me know if you have any questions or need any assistance with getting this setup.

Thanks,
-Patrick

You must be logged in to vote
1 reply
@nobrainer-de
Comment options

Hey good to hear!

I don't know what am I doing wrong, but it seems that the connection is not correctly building up:

Topic: MTConnect/Devices/364a87e1-7814-47b5-b1ec-8cf0a77bacff/Observations/Adapter/adapter_http_037e74ac8a/Events/ConnectionStatus/adapter_http_037e74ac8a_connStatus/adapter_http_037e74ac8a_connStatusQoS: 0

{"dataItemId":"adapter_http_037e74ac8a_connStatus",
"name":"connStatus",
"type":"CONNECTION_STATUS",
"timestamp":"2023-03-03T10:43:00.72546Z",
"result":"ESTABLISHED"}

Topic: MTConnect/Devices/364a87e1-7814-47b5-b1ec-8cf0a77bacff/Observations/Adapter/adapter_http_037e74ac8a/Events/ConnectionStatus/adapter_http_037e74ac8a_connStatus/adapter_http_037e74ac8a_connStatusQoS: 0

{"dataItemId":"adapter_http_037e74ac8a_connStatus",
"name":"connStatus",
"type":"CONNECTION_STATUS",
"timestamp":"2023-03-03T10:43:00.8389373Z",
"result":"CLOSED"}

Topic: MTConnect/Devices/364a87e1-7814-47b5-b1ec-8cf0a77bacff/Observations/Adapter/adapter_http_037e74ac8a/Events/ConnectionStatus/adapter_http_037e74ac8a_connStatus/adapter_http_037e74ac8a_connStatusQoS: 0

{"dataItemId":"adapter_http_037e74ac8a_connStatus",
"name":"connStatus","type":
"CONNECTION_STATUS","timestamp":
"2023-03-03T10:43:00.8390545Z",
"result":"LISTEN"}

I just attached you the probe from the machine.
probe_haas_vf4.txt

My settings as you told:

clients:
- address: http://192.168.22.153/
  port: 8082
  deviceKey: VF-4
  useSSL: false
  heartbeat: 0

Log File from the MQTT Broker Gateway

2023-03-03 11:41:43.8709|0|INFO|agent-logger|Configuration File Read Successfully from: C:\Program Files\TrakHound\MTConnect-MQTT-Broker-Gateway-Agent\agent.config.yaml 
2023-03-03 11:41:43.9441|0|WARN|agent-logger|No Devices Found : Reading from :  
2023-03-03 11:45:34.0559|0|WARN|agent-logger|No Devices Found : Reading from :  
Comment options

It looks like it is connecting and then disconnecting from the Haas Agent. Seems like I have heard that the Haas Agent doesn't support streaming, (can anyone confirm this?). I'll look at adding a configuration option to toggle "streaming" vs "polling" in case this is the issue.

Are you able to connect to any other MTConnect Agents? Have you tried a public Agent such as the public Mazak Agent?

# - HTTP Client Adapter Configuration -
# The Agent is able to receive data by reading from other MTConnect HTTP Agents
clients:
- address: mtconnect.mazakcorp.com
  port: 5719
  deviceKey: HCN001

If the public Agent works and the Haas Agent doesn't, then we can at least narrow the issue down.

Let me know what you find and I will go ahead and add the configuration option just in case that is the issue.

Thanks,
-Patrick

You must be logged in to vote
10 replies
@PatrickRitchie
Comment options

Thanks for information. I will have a new Release published either today or tomorrow that should fix this issue.

Thanks,
-Patrick

@nobrainer-de
Comment options

Hey nice to hear! i am looking forward to this. How can i send you a little gift for your work? :-)

@PatrickRitchie
Comment options

I published the v5.3.0 Release earlier today that should solve this issue.

Thanks for the support! I do have a donations page if you are interested: PayPal Donations

Please let me know if you run into any other issues.

Thanks,
-Patrick

@nobrainer-de
Comment options

Thanks for the work! Now it works perfect, I'll collect the data now few days and weeks and will see how i can use them the best :-)

@PatrickRitchie
Comment options

Thank you so much for the support! I'm glad to hear everything is working now and please let me know if you run into anything else.

Thanks,
-Patrick

Comment options

I am trying to use the mqtt gateway with two of our Haas VMC's (vf-5 and vf-10) unfortunalty Haas assinged both of them with the same uuid "000", this is causing the mqtt topics to overlap. I have had non stop issues with the Haas implementationof MTConnect, they originaly set the device name to "VF-5/50" and "VF-10/50", it took me 6 month to convince them that they are not following the MTConnect standard.

any sudgestions on how i can get arround this non unique uuid issue with out having to deal with Haas directly? I was thinking about using the device name or creating my own uuid's in the config file?
thanks

You must be logged in to vote
0 replies
Comment options

I just pushed a new commit with a change that should allow you to add a DeviceConfiguration file (same way you would if you were using a regular non-gateway Agent) that you can set a different Device UUID. The only thing you will need to keep the same is the Device Name between the client configuration and the overriding device configuration. See below:

Gateway Agent Configuration (agent.config.yaml)

# Override what the Probe gets with this Device file
devices: haas-override.xml

clients:
- address: localhost
  port: 5000
  deviceKey: Haas-Device

haas-override.xml File to override the Http Client Probe. Change the "uuid" to whatever you need but make sure the "name" matches what is in the "deviceKey" for the clients configuration in the Gateway Agent Configuration file.

<Device uuid="new-haas-uuid" name="Haas-Device" id="HaasDevice">
...
</Device>

Note that the new "haas-override.xml" file will override the entire Device so you may want to copy a typical XML Probe response from the Haas Agent and paste in to the override file and then just change the Device UUID.

I only pushed the changes to the repo as of right now but if you are using the installers then let me know and I will create a new Release with these changes in it.

Thanks
-Patrick

You must be logged in to vote
6 replies
@PatrickRitchie
Comment options

The main change I made in commit cec7741 was that when I read from the HTTP client adapter and add the Observations to the agent, I'm adding it with the DeviceKey (which can be either the UUID or Name) instead of only by the UUID. The MTConnectAgent class resolves that DeviceKey to the matching device.

The other two commits were to get the MQTT Gateway agents to allow a device file to override the Probe.

Let me know how it works for you as I'm sure you aren't the only one to run into this issue.

@DouglasRudd
Comment options

yes this worked great.
thank you again.

@smtpl-iiotian
Comment options

@PatrickRitchie is the same applicable to embedded mtconnect agent.

@PatrickRitchie
Comment options

@smtpl-iiotian Yes I believe this should work using an embedded agent as well. Let me know if you run into any issues with it though and I will be glad to help.

@smtpl-iiotian
Comment options

@PatrickRitchie please share link of sample haas-override.xml

Comment options

@PatrickRitchie I installed latest MTConnect.Net Agent from .exe
My updated agent.config.yaml is below

modules:
- http-adapter: 
    address: http://192.168.1.81/
    port: 8082
    deviceKey: Machine

I am facing issue where I am not able to update custom uuid in haas-override.xml. I had to keep it same as below in the image.
1

If it is kept different from Haas MTConnect Agent it is just creates h_01 devicestream displaying UNAVAILABLE for all the dataitems while the haas mtconnect data is routed under default "000" uuid devicestream as per below image
2

Kindly guide.

You must be logged in to vote
3 replies
@smtpl-iiotian
Comment options

@PatrickRitchie, I have 3 Haas NGC machines which has same id, name and uuid in the Haas MTConnect Agent on port 8082. What makes difference is the serialNumber in the Description. Please see 3 images attached.

1 (1)

2

3

Can I add serialNumber in the Gateway Agent Configuration (agent.config.yaml) ?
Kindly guide.

@PatrickRitchie
Comment options

You may be able to use the DeviceMapping configuration in the HTTP Adapter Module as shown below:

- http-adapter:
    address: http://192.168.1.81
    port: 8082
    deviceKey: Machine
    devices:
      Machine:
        name: Machine-01-Name
        uuid: Machine-01-UUID
        id: Machine-01-ID

- http-adapter:
    address: http://192.168.1.82
    port: 8082
    deviceKey: Machine
    devices:
      Machine:
        name: Machine-02-Name
        uuid: Machine-02-UUID
        id: Machine-02-ID

- http-adapter:
    address: http://192.168.1.83
    port: 8082
    deviceKey: Machine
    devices:
      Machine:
        name: Machine-03-Name
        uuid: Machine-03-UUID
        id: Machine-03-ID

This was a configuration option that I added a while ago but did not document yet and should allow you to change the Name, UUID, and ID of each device from the remote agent.

Let me know if this is what you were looking for.

@smtpl-iiotian
Comment options

@PatrickRitchie lot of thanks, above configuration worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.