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

device->addLogCallback() doesn't work for bootloader warnings #1064

Open
diablodale opened this issue Jul 11, 2024 · 0 comments
Open

device->addLogCallback() doesn't work for bootloader warnings #1064

diablodale opened this issue Jul 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@diablodale
Copy link
Contributor

diablodale commented Jul 11, 2024

bootloader warnings are not sent to callbacks. Its because bl init() directly writes to the logger during Device construct. And the logger is processing the message before the Device is constructed to even go to the next line of code to add the log callback.

Setup

Windows, MSVC, and depthai-core v2.27.0

pseudocode

device = std::make_unique<dai::Device>(config.getOpenVINOVersion(), myDeviceInfo);
device->addLogCallback([](const dai::LogMessage& logMessage) {
   if (logMessage.level == dai::LogLevel::CRITICAL)
      do_critical_things();
   else if (logMessage.level >= dai::LogLevel::WARN)
      do_warn_things();

Then run the compiled code against a OAK-D-Pro-POE that has bootloader 0.0.26 flashed.

The debug console will have

[2024-07-11 23:52:12.389] [depthai] [warning] [18443010318EF50800] [192.168.2.23] Flashed bootloader version 0.0.26, less than 0.0.28 is susceptible to bootup/restart failure. Upgrading is advised, flashing main/factory (not user) bootloader. Available: 0.0.28

Result

Yet, do_warn_things() is not called.

Expected

do_warn_things() called

@diablodale diablodale added the bug Something isn't working label Jul 11, 2024
@diablodale diablodale changed the title device-addLogCallback() doesn't work for bootloader warnings device->addLogCallback() doesn't work for bootloader warnings Jul 11, 2024
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

1 participant