HealthCheckConfig.powerSupplyCheckDuration to spend more time validating power behavior before printing the final metrics.This example requires the DepthAI v3 API, see installation instructions.Source code
Python
PythonGitHub
1#!/usr/bin/env python3
2
3import sys
4import time
5from datetime import timedelta
6
7import depthai as dai
8
9
10def main() -> int:
11 config = dai.HealthCheckConfig(powerSupplyCheckDuration=timedelta(milliseconds=20000))
12
13 deviceInfos = dai.Device.getAllConnectedDevices()
14 if not deviceInfos:
15 print("No DepthAI device found.", file=sys.stderr)
16 return 1
17
18 deviceInfo = deviceInfos[0]
19
20 print(f"Device: {deviceInfo}")
21 print(f"Power supply check duration: {int(config.powerSupplyCheckDuration.total_seconds() * 1000)} ms")
22 print("Running health check...")
23
24 start = time.monotonic()
25 metrics = dai.Device.performHealthCheck(deviceInfo, config)
26 elapsedMs = int((time.monotonic() - start) * 1000)
27
28 print()
29 print(f"Health check completed in {elapsedMs} ms")
30 print(metrics)
31 return 0
32
33
34if __name__ == "__main__":
35 raise SystemExit(main())Need assistance?
Head over to Discussion Forum for technical support or any other questions you might have.