Closed shaurabhsingh closed 2 months ago
This is related to the config file and the adapters. It’s saying there are two identical adapter entries in the file. Can you attach the agent.cfg file?
Devices = combined.xml
ServiceName = MTConnect Agent 1
Port = 5000
BufferSize = 17
IgnoreTimestamps = true
PreserveUUID = false
SchemaVersion = 2.0
Adapters {
robot1 {
FilterDuplicates = yes
AutoAvailable = no
Device = robot
Host = localhost
Port = 7996
}
cnc1 {
FilterDuplicates = yes
AutoAvailable = no
Device = cnc
Host = localhost
Port = 7896
}
conv1 {
FilterDuplicates = yes
AutoAvailable = no
Device = conv
Host = localhost
Port = 7796
}
b1 {
FilterDuplicates = yes
AutoAvailable = no
Device = buffer
Host = localhost
Port = 7696
}
cmm1 {
FilterDuplicates = yes
AutoAvailable = no
Device = cmm
Host = localhost
Port = 7596
}
conv2 {
FilterDuplicates = yes
AutoAvailable = no
Device = conv2
Host = localhost
Port = 7496
}
}
Files {
schemas {
Location = /schemas/
Path = ./schemas/
}
}
# Logger Configuration
logger_config
{
logging_level = debug
output = file agent.log
}
I'll test this locally and see what's happening.
I'm having trouble reproducing. Any other information about the environment?
Here's what I get:
[2024-08-08 10:29:06.715175] [0x00000001f9f5cc00] [debug] Cannot file path: "/etc/mtconnect", No such file or directory
[2024-08-08 10:29:06.715429] [0x00000001f9f5cc00] [debug] Cannot file path: "/usr/local/etc/mtconnect", No such file or directory
[2024-08-08 10:29:06.715444] [0x00000001f9f5cc00] [debug] Cannot file path: "/usr/local/share/mtconnect", No such file or directory
MTConnect Agent Version 2.4.0.1 - built on Fri Jul 5 10:14:00 2024
[2024-08-08 10:29:06.715558] [0x00000001f9f5cc00] [debug] Found file 'agent.cfg' in path "/Users/will/projects/MTConnect/agent/issues/482_duplicate_data_item"
[2024-08-08 10:29:06.715576] [0x00000001f9f5cc00] [debug] Loading configuration from: "/Users/will/projects/MTConnect/agent/issues/482_duplicate_data_item/agent.cfg"
Loading configuration from:"/Users/will/projects/MTConnect/agent/issues/482_duplicate_data_item/agent.cfg"
2024-08-08T14:29:06.717210Z (0x00000001f9f5cc00) [debug] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig: Searching config paths for combined.xml
2024-08-08T14:29:06.717242Z (0x00000001f9f5cc00) [debug] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig: "/Users/will/projects/MTConnect/agent/issues/482_duplicate_data_item"
2024-08-08T14:29:06.717259Z (0x00000001f9f5cc00) [debug] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig: "/Users/will/projects/MTConnect/agent/build/build/static-armv8/agent/Debug"
2024-08-08T14:29:06.717277Z (0x00000001f9f5cc00) [debug] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig: Found file 'combined.xml' in path "/Users/will/projects/MTConnect/agent/issues/482_duplicate_data_item"
2024-08-08T14:29:06.717342Z (0x00000001f9f5cc00) [info] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig: Starting agent on port 5001
2024-08-08T14:29:06.727173Z (0x00000001f9f5cc00) [debug] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig->AgentConfiguration::loadSinks: Cannot find file './schemas/' in path "/Users/will/projects/MTConnect/agent/issues/482_duplicate_data_item"
2024-08-08T14:29:06.727213Z (0x00000001f9f5cc00) [error] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig->AgentConfiguration::loadSinks: RestService loading Files: Cannot resolve path: ./schemas/ in data path
2024-08-08T14:29:06.728905Z (0x00000001f9f5cc00) [info] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig->Agent::initialize->Agent::loadXMLDeviceFile: MTConnect Schema Version of file: /Users/will/projects/MTConnect/agent/issues/482_duplicate_data_item/combined.xml = 1.5
2024-08-08T14:29:12.496859Z (0x00000001f9f5cc00) [info] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig->AgentConfiguration::loadAdapters: shdr: Adding adapter for robot: robot1
2024-08-08T14:29:12.500187Z (0x00000001f9f5cc00) [info] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig->AgentConfiguration::loadAdapters: shdr: Adding adapter for cnc: cnc1
2024-08-08T14:29:12.503679Z (0x00000001f9f5cc00) [info] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig->AgentConfiguration::loadAdapters: shdr: Adding adapter for conv: conv1
2024-08-08T14:29:12.507083Z (0x00000001f9f5cc00) [info] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig->AgentConfiguration::loadAdapters: shdr: Adding adapter for buffer: b1
2024-08-08T14:29:12.510279Z (0x00000001f9f5cc00) [info] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig->AgentConfiguration::loadAdapters: shdr: Adding adapter for cmm: cmm1
2024-08-08T14:29:12.512954Z (0x00000001f9f5cc00) [info] MAIN->AgentConfiguration::initialize->AgentConfiguration::loadConfig->AgentConfiguration::loadAdapters: shdr: Adding adapter for conv2: conv2
2024-08-08T14:29:12.519608Z (0x000000016ff13000) [debug] Connector::resolved->Connector::connect: Connecting to data source: localhost on port: 7996
2024-08-08T14:29:12.520022Z (0x000000016ff13000) [debug] Connector::resolved->Connector::connect: Connecting to data source: localhost on port: 7896
Could you try with v2.2.0.3 or v2.3.0.16 agent releases?
2.4.0.1
It is mostly the same as the 2.3 agents, just with a few new features. 2.3.0.16 should work as well.
Can't reproduce.
Found it. error in the agent.cfg previously that had two adapters with same port. My bad.
Getting the following error with the agent:
Have tried with v2.2.0.3 and v2.3.0.16 versions and both failed. But it did work with v2.1.0.1 agent.
My guess: Since the device xml has multiple devices and the agent is generating the same id for
ConnectionStatus
for all the devices, it is creating the duplicate dataitem id error.Device File: https://github.com/mtconnect/ros_mtconnect_2/blob/master/simulator/src/deviceFiles/combined.xml