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

[BUG] Reconnection logic doesn't work when registering callbacks #1162

Open
guilhermedemouraa opened this issue Oct 31, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@guilhermedemouraa
Copy link

Creating a new issue here since I haven't heard back on #1042.

Hello DepthAI team,

In our application, we register a callback for new frames using DepthAI's API. This callback is triggered whenever a new packet/frame is received. However, this design leaves me uncertain about how to catch exceptions or handle a dropped device event.

Specifically, I'm looking for recommendations on how to implement reconnection logic in a situation where the device is dropped, but no new frames are being received (i.e., the callback is not triggered). Since I rely heavily on the callback to process data, I am unsure where or how to catch any exceptions that might arise due to a device being dropped or encountering other issues. I found this resource online, but I don't think this could work for the callback approach.

Could you provide any examples or guidance on how to detect and handle these cases within the callback system or elsewhere in the data flow? Additionally, if there are best practices for managing reconnections, I would greatly appreciate your insights.

Thank you for your continued support.

@guilhermedemouraa guilhermedemouraa added the bug Something isn't working label Oct 31, 2024
@guilhermedemouraa
Copy link
Author

Could anyone please help me?

@Erol444
Copy link
Member

Erol444 commented Nov 25, 2024

Hi @guilhermedemouraa , perhaps rather use our Forum (discuss.luxonis.com) which is primary support location:)
I'd say you can use device.isPipelineRunning(), and if it isn't, create a new Device object and setup callbacks once again (one the new Device object). Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants