Giter VIP home page Giter VIP logo

Comments (4)

wsobel avatar wsobel commented on July 4, 2024 1

This does appear to be an issue. It appears that the changes in the initialization and dynamic update of the device blew away the static UUID replacement. I have added a test and will fix the issue.

from cppagent.

wsobel avatar wsobel commented on July 4, 2024

Can you upload your device.xml and agent.xml so I can check. The only thing I can think of is the Adapter should be the device name or specify the Device in the adapter block. That way the agent knows which device to modify.

If there is only one device, the UUID may apply to the default device. I'll check if it is more explicit in the initialization phase.

Adapters {

    DeviceName  {
       UUID = NEW-UUID
       Host = ....
       Port = 7878
    }

}

from cppagent.

rwuthric avatar rwuthric commented on July 4, 2024

In case still required and helpful.

Here the content of device.xml:

<MTConnectDevices>
  <Devices>
    <Device uuid="DHT-GEN" id="dht" name="ESP8266-DHT">

      <!-- General information -->
      <Description>
         Humidity and Temperature Sensor (DHT)
      </Description>
      <DataItems>
        <DataItem category="EVENT" id="avail" type="AVAILABILITY"/>
      </DataItems>

      <!-- Components -->
      <Components>

        <!-- Sensor -->
        <Sensor id="sensor">

          <!-- Configuration -->
          <Configuration>
            <SensorConfiguration>
              <FirmwareVersion>0.1</FirmwareVersion>
              <Channels>
                 <Channel number="1" name="Temperature">
                   <Description>Temperature in celcius</Description>
                 </Channel>
                 <Channel number="2" name="Humidity">
                   <Description>Relative humidity</Description>
                 </Channel>
              </Channels>
            </SensorConfiguration>
          </Configuration>

          <!-- DataItems -->
          <DataItems>
            <DataItem category="SAMPLE" id="Temp" type="TEMPERATURE" units="CELCIUS"/>
            <DataItem category="SAMPLE" id="Humi" type="HUMIDITY_RELATIVE" units="PERCENT"/>
          </DataItems>

        </Sensor>

      </Components>
    </Device>
  </Devices>
</MTConnectDevices>

and the agent config file:

AgentDeviceUUID = $MTC_AGENT_UUID
Devices = device.xml
Port = 5000
SchemaVersion = 2.0

Adapters {

    Adapter {
       UUID   = DHT-001
       Host   = $ADAPTER_IP
       Port   = $ADAPTER_PORT
    }

}

Files {
    schemas {
        Path = /mtconnect/data/schemas
        Location = /schemas/
    }
    styles {
        Path = /mtconnect/data/styles
        Location = /styles/
    }
    Favicon {
        Path = /mtconnect/data/styles/favicon.ico
        Location = /favicon.ico
    }
}

DevicesStyle {
    Location = /styles/styles.xsl
}
StreamsStyle {
    Location = /styles/styles.xsl
}

logger_config
{
    logging_level = info
    output = file /home/agent/log/mtc_agent.log
}

The agent keeps reporting DHT-GEN instead of the expected DHT-001.

Our use case is that the device information model device.xml is a generic one (in a device model repository) for a DHT type sensor, and as the actual devices are deployed, the agents are configured with their unique UUIDs.

from cppagent.

wsobel avatar wsobel commented on July 4, 2024

Thanks, I'll fix the issue and verify with the files.

from cppagent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.