• DepthAI
  • Problems using multiple PoE cameras

We have 3 OAK-1 PoE cameras attached to one PC. Each camera is connected to a separate ethernet port. We can connect to each camera individually (without the others plugged in). We can also update the IP address for each camera so that each one is unique. The problems come when we try to use more than one at the same time.

We use getAllAvailableDevices to give us a std::vector of connected cameras. This works as far as giving us 3 sets of dai::DeviceInfo but the .desc.name for each of them is the same. It seems to give each entry the IP address for the first one. So if we have 169.254.1.221, 169.254.1.222 and 169.254.1.223 we get 3 entries with 169.254.1.221. Also we can connect to the first one but it fails to connect to the other two. This suggests it's not just the same camera listed multiple times.

The three ethernet ports have their own IPs of 169.254.1.10, 169.254.1.11 and 169.254.1.12 and when we flashed the new IP addresses we obviously had to use these as the gateway addresses for each camera. This wouldn't be an issue would it? You would expect the ports to have different addresses.

Any idea why we're getting the same three IP addresses back?

Also, there seem to be different versions of getAllAvailableDevices. There's:

dai::DeviceBootloader::getAllAvailableDevices
dai::Device::getAllAvailableDevices

And there's also:

dai::XLinkConnection::getAllConnectedDevices

Does it matter which you use? Do they all do the same thing?

  • erik replied to this.

    Hello Malcs ,
    We have experienced something similar at another user, and I believe the solution was to set unique Mac address for each of the cameras. You could use device manager app to easily set these. Please let us know how it goes.
    Thanks, Erik

      Thanks erik. I have worked out how to change the MAC address from C++ but I can't work out how to find out what the current one is. Same goes for IP address, gateway and mask. I can set these but can't work out how to query them.

      To set the MAC address I do the following:

      bool success;
      std::string error;
      dai::DeviceBootloader bl(info, true);
      auto conf = dai::DeviceBootloader::Config();
      conf.setMacAddres(newAddress);
      std::tie(success, error) = bl.flashConfig(conf);

      How do I get the MAC address though?

      • erik replied to this.

        Hi Malcs , I would suggest using the device manager app (linked above) to both see the current IP/gateway/mask/MAC and to also set these.
        Thanks, Erik

          Thanks for the quick reply erik. We could do that but should it not work using the C++ API too? We want to build it into our software.

          I tried:

          dai::DeviceBootloader bl(device_info);
          auto conf = bl.readConfig();

          but it returns an empty record. By that I mean the IP, mask and gateway are all "0:0:0:0" and the MAC address is "00:00:00:00:00".

          Is the C++ API for this known not to work?

          • erik replied to this.

            Hi Malcs ,
            It will work the exact same way in C++ as well. That's expected, as nothing is flashed on the device, so after you flash it you should get changed values when reading the config.
            Thanks, Erik

              Ah I see! Ok, that makes sense now. Thanks erik. I have it working now, changing and reading the MAC address.

              Next I need to test if the unique MAC addresses now allow us to access multiple cameras. Will let you know!

              • erik replied to this.

                That would be perfect, thanks Malcs ! And from out experience that should solve this issue, hopefully that will be the case for you as well.

                We have tried it but we're still getting the same IP address for all 3 devices when we use dai::Device::getAllAvailableDevices

                All the .desc.name entries are the same despite having changed the IP and MAC addresses. Could there be a bug in that somewhere?

                We're about to try overwriting the .desc.name with the required IP address as currently we get the address by picking an item from the returned vector of DeviceInfo.

                We're about to try overwriting the .desc.name with the required IP address as currently we get the address by picking an item from the returned vector of DeviceInfo.

                Unfortunately this didn't work. Only worked for the one IP address that was listed with all the DeviceInfo entries.