We are using MIPSDK 2023 R2 on XProtect Corporate 2024 R1.
The manual replacement of an Axis Camera (AXIS M4327-P Panoramic Camera) with 12 channels and an Axis Camera (AXIS P3344 Fixed Dome Network Camera) with one channel succeeds without error from the Management Client. However, the same camera gives an error when replaced using the code below.
Code:
HardwareDriver hwDriver = primRecServer.recServer.HardwareDriverFolder.HardwareDrivers.FirstOrDefault(x => x.Path == primHW.HardwareDriverPath);
ReplaceHardwareServerTask reptas1 = secHW.ReplaceHardware();
reptas1.SetProperty(“Address”, uriCamAddress.Host);
reptas1.SetProperty(“Port”, uriCamAddress.Port.ToString());
reptas1.SetProperty(“UseHttps”, bHTTPSEnabled.ToString());
reptas1.SetProperty(“HttpsPort”, iHTTPSPort.ToString());
reptas1.SetProperty(“UserName”, primHW.UserName);
reptas1.SetProperty(“Driver”, hwDriver.Number.ToString());
reptas1.SetProperty(“CustomDriverData”, “”);
reptas1.SetProperty(“AllowDeletingDisabledDevices”, “true”);
reptas1.SecurePassword = secureStringPassword;
ServerTask task = reptas1.ExecuteMethod(“ReplaceHardware”);
if (task.Path != null)
task.UpdateState();
while (task.State != StateEnum.Error && task.State != StateEnum.Success)
{
System.Threading.Thread.Sleep(1000);
task.UpdateState();
}
if (task.State == StateEnum.Success)
{
pushLogs("ReplaceHardware: Success - " + secHW.DisplayName, bEnhancedLogging);
}
else
{
pushLogs("ReplaceHardware: Error - " + secHW.DisplayName + " " + task.ErrorText, true);
}
Error:
ReplaceHardware: Error - AXIS M4327-P Panoramic Camera (192.168.0.202) Could not replace the hardware.
The existing hardware contains more devices than the new hardware.
The hardware replacement process will delete disabled redundant devices.
You must disable all devices that may be deleted.