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

[Core Metadata] Handle plugged devices moving from one node to another node #4694

Closed
lenny-goodell opened this issue Sep 26, 2023 · 4 comments · Fixed by #4929
Closed

[Core Metadata] Handle plugged devices moving from one node to another node #4694

lenny-goodell opened this issue Sep 26, 2023 · 4 comments · Fixed by #4929
Assignees
Labels
enhancement New feature or request

Comments

@lenny-goodell
Copy link
Member

🚀 Feature Request

Relevant Package [REQUIRED]

This feature request is for Core Metadata

Description [REQUIRED]

Unable to successfully add device for USB camera when the camera is unplugged from Node A and plugged into Node B. Device USB Camera on Node B will get an error attempting to add the device for the camera when it discovers it. This is because a device with that name already exists in Core Metadata and is owned by Device USB Camera on Node A. i.e. the device doesn't get deleted when the camera is unplugged from Node A.

This issue is applicable to any devices that are plugged in and can be removed and plugged into a different node.

Describe the solution you'd like

One possible solution would be to add the `force` option on the Add Device Request and for the Device SDK to set this to `true` when adding devices that are auto provisioned.

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?
@lenny-goodell lenny-goodell added the enhancement New feature or request label Sep 26, 2023
@github-project-automation github-project-automation bot moved this to New Issues in Technical WG Sep 26, 2023
@cloudxxx8
Copy link
Member

I think this feasture should be handled by the individual Device Service. If it detects any device is un-plugged, it can send a delete device request to core-metadata.

Also, we have implemented the update callback support to switch device service
#2716

@lenny-goodell
Copy link
Member Author

@cloudxxx8 , I agree that would be the best approach, but not all protocols notify when the device has been disconnected, The only way would be for the service to periodically (often) check if the device is still connected. Could be done as part of the discovery, but then discovery would have to be run often to detect removed device. I think this one is a good topic for Odessa planning.

@lenny-goodell lenny-goodell moved this from New Issues to Icebox in Technical WG Oct 17, 2023
@cloudxxx8
Copy link
Member

Since the old device service should also be notified, there are two approaches:

  1. In Device Service or SDK auto discovery logic, add device first, if it got conflict error code, execute update. The update API in core-metadata will send a callback to the old device service.
  2. In Core Metadata, implement a force add flag in Add Device API, and Core Metadata should call the Update function internally.

@jumpingliu jumpingliu moved this from Icebox to Release Backlog in Technical WG Dec 13, 2023
@lindseysimple lindseysimple moved this from Release Backlog to In Progress in Technical WG Sep 27, 2024
@cloudxxx8
Copy link
Member

The force option is the easier way to do.
If the device exists, delete and recreate it.
In this case, device service and device profile can also be changed.

lindseysimple added a commit to lindseysimple/edgex-go that referenced this issue Oct 1, 2024
Resolves edgexfoundry#4694. Add the force query param to add device metadata API.

Signed-off-by: Lindsey Cheng <[email protected]>
cloudxxx8 pushed a commit that referenced this issue Oct 2, 2024
* feat: Add the force query param to add device metadata API

Resolves #4694. Add the force query param to add device metadata API.

Signed-off-by: Lindsey Cheng <[email protected]>

* fix: Rename forceAddDevice func to update Device

- Rename forceAddDevice func to update Device
- Publish update device system event for force add

Signed-off-by: Lindsey Cheng <[email protected]>

---------

Signed-off-by: Lindsey Cheng <[email protected]>
@github-project-automation github-project-automation bot moved this from In Progress to Odessa Done in Technical WG Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Odessa Done
Development

Successfully merging a pull request may close this issue.

3 participants