mtconnect / cppagent

C++ Agent toolkit - Pre-built binaries, visit: https://github.com/mtconnect/cppagent/releases Docker images available at https://hub.docker.com/repositories/mtconnect
http://mtcup.org/
Apache License 2.0
143 stars 91 forks source link

Probe not received on device UUID change. #467

Closed emvarunp closed 4 months ago

emvarunp commented 5 months ago

When UUID of a device is changed by * uuid command from adapter. probe data will not be sent for the updated device in mqtt sink.

The mqtt client connected to the agent will only receive probe information of agent device and the device with old uuid. when the uuid changes the agent will not send a new probe data with the changed uuid.

I expected a new probe will be published by agent under the topic with new uuid.

Thank you. V

wsobel commented 5 months ago

Which MQTT sink are you using? The one with one DataItem per topic or the second that has probe, current, and sample?

Can you also attach your agent.cfg file so I can repeat what you're reporting.

There may be some issue regarding what behavior we should have since changing the UUID may also change the topic paths which would be confusing. I'm open to suggestions.

Best

emvarunp commented 5 months ago

Hi @wsobel.

We are using the mqtt2service which has probe ,current, sample.

Attaching the agent configuration below. agent_config.txt

When the UUID of the device changes the agent shall send a new probe under the topic path with new UUID as it would make it easier for us.

If there is any other way for the mqtt client to know if the UUID has been changed then we would like your suggestion.

Thank you. V

wsobel commented 5 months ago

That helps a lot, thanks! - W

emvarunp commented 5 months ago

Hi @wsobel. Is there any update for approaching this bug.? Would help us to know.

Thanks, V

wsobel commented 5 months ago

I'm working on the fix. The fix is nearly complete but it required more change than I originally thought.

The old code took some shortcuts to change the machine uuid. This worked for some simple use cases, but did not execute the full device change workflow which is much more complex.

I need to fix some tests they made assumptions on the smaller workflow. This will take a couple of days to sort out.

emvarunp commented 5 months ago

Thank you for the quick update @wsobel.