I have an OAK-1-POE connected directly to my PC and want to connect using the device's static IP. I have followed the instructions for doing this from here:
It all works fine using Python via PyCharm - I can connect to the camera and the examples all work.
What I want to do is integrate this into our software which is built with VisualStudio and is written in C++. I have downloaded the libraries etc. for version 2.12.1 from here:
I have got it to build successfully and it runs up until I create the
dai::Device passing it device_info containing the IP address and other state, platform and protocol info. However, it then throws a runtime exception with the message "Cannot find any device with given deviceInfo".
As far as I can see from the source code for DepthAI, this message is only sent from one place, inside
DeviceBase::init2. However, it's inside an if then else group which it should not reach if deviceInfo.state is equal to X_LINK_BOOTLOADER. Unless I'm missing something, I have this set in my code so I can't see why it is reaching this point.
Here's my source:
device_info.state = X_LINK_BOOTLOADER;
device_info.desc.platform = X_LINK_ANY_PLATFORM;
device_info.desc.protocol = X_LINK_TCP_IP;
// Create pipeline
auto ppipeline = new dai::Pipeline;
auto& pipeline = *ppipeline;
// Define sources and outputs
auto camRgb = pipeline.create<dai::node::ColorCamera>();
auto nn = pipeline.create<dai::node::MobileNetDetectionNetwork>();
auto xoutRgb = pipeline.create<dai::node::XLinkOut>();
auto nnOut = pipeline.create<dai::node::XLinkOut>();
camRgb->setPreviewSize(300, 300); // NN input
// Define a neural network that will make predictions based on the source frames
// Connect to device and start pipeline
dai::Device* pDevice = nullptr;
pDevice = new dai::Device(pipeline, device_info);
catch (const std::runtime_error & err)
auto msg = err.what();
I can't help thinking there's something simple that I've missed or got wrong. Any assistance would be much appreciated!