Open Vishnu-Karthikeyan opened 2 weeks ago
Hi @Vishnu-Karthikeyan , Does it also not turn on when not in standalone mode (so just standard/peripheral mode)?
I tried using the following standard preview example. The IR led turns on as soon as feed windows shows up and then gets turned off automatically within 3-4 seconds, the window feed however continues.
import cv2 import depthai as dai
pipeline = dai.Pipeline()
monoLeft = pipeline.create(dai.node.MonoCamera) monoRight = pipeline.create(dai.node.MonoCamera) xoutLeft = pipeline.create(dai.node.XLinkOut) xoutRight = pipeline.create(dai.node.XLinkOut)
xoutLeft.setStreamName('left') xoutRight.setStreamName('right')
monoLeft.setCamera("left") monoLeft.setResolution(dai.MonoCameraProperties.SensorResolution.THE_720_P) monoRight.setCamera("right") monoRight.setResolution(dai.MonoCameraProperties.SensorResolution.THE_720_P)
monoRight.out.link(xoutRight.input) monoLeft.out.link(xoutLeft.input)
with dai.Device(pipeline) as device: device.setIrFloodLightIntensity(0.9) # in %, from 0 to 1
qLeft = device.getOutputQueue(name="left", maxSize=4, blocking=False)
qRight = device.getOutputQueue(name="right", maxSize=4, blocking=False)
while True:
device.setIrFloodLightIntensity(0.9) # in %, from 0 to 1
# Instead of get (blocking), we use tryGet (non-blocking) which will return the available data or None otherwise
inLeft = qLeft.tryGet()
inRight = qRight.tryGet()
if inLeft is not None:
cv2.imshow("left", inLeft.getCvFrame())
if inRight is not None:
cv2.imshow("right", inRight.getCvFrame())
if cv2.waitKey(1) == ord('q'):
break
@Vishnu-Karthikeyan I mean setting it once inside the Scirpt node (not inside a while True loop). Does that work?
Yes i tried that first itself. It glowed for first 3 seconds then got turned off by itself, I thought it was executing only once in program so kept it in while loop later (the one that i posted here). Anyways both the methods gave same result.
Following is the code i used for inside script led intensity setting
#!/usr/bin/env python3
import cv2
import depthai as dai
# Create pipeline
pipeline = dai.Pipeline()
# Define sources and outputs
monoLeft = pipeline.create(dai.node.MonoCamera)
monoRight = pipeline.create(dai.node.MonoCamera)
xoutLeft = pipeline.create(dai.node.XLinkOut)
xoutRight = pipeline.create(dai.node.XLinkOut)
xoutLeft.setStreamName('left')
xoutRight.setStreamName('right')
# Properties
monoLeft.setCamera("left")
monoLeft.setResolution(dai.MonoCameraProperties.SensorResolution.THE_720_P)
monoRight.setCamera("right")
monoRight.setResolution(dai.MonoCameraProperties.SensorResolution.THE_720_P)
# Create a Script node
script = pipeline.create(dai.node.Script)
script.setProcessor(dai.ProcessorType.LEON_CSS)
script.setScript("""
Device.setIrFloodLightIntensity(0.9)
""")
# Linking
monoRight.out.link(xoutRight.input)
monoLeft.out.link(xoutLeft.input)
# Connect to device and start pipeline
with dai.Device(pipeline) as device:
# Output queues will be used to get the grayscale frames from the outputs defined above
qLeft = device.getOutputQueue(name="left", maxSize=4, blocking=False)
qRight = device.getOutputQueue(name="right", maxSize=4, blocking=False)
while True:
# Instead of get (blocking), we use tryGet (non-blocking) which will return the available data or None otherwise
inLeft = qLeft.tryGet()
inRight = qRight.tryGet()
if inLeft is not None:
cv2.imshow("left", inLeft.getCvFrame())
if inRight is not None:
cv2.imshow("right", inRight.getCvFrame())
if cv2.waitKey(1) == ord('q'):
break
@Vishnu-Karthikeyan I mean setting it once inside the Scirpt node (not inside a while True loop). Does that work?
@jakaskerl , could you try to repro this?
@Vishnu-Karthikeyan Does it work in normal operation (setting it on host using device.setIrFloodLightBrightness(0.9)
). I tested on Pro W POE and it does not work in any mode. Tested the same code on it's USB variant and had no issue both inside Script as well as on host.
Yes i tried the following methods 1) with dai.Device(pipeline) as device: ____device.setIrFloodLightBrightness(0.9) in host mode 2) Device.setIrFloodLightIntensity(0.9) within script in host mode 3) Device.setIrFloodLightIntensity(0.9) within script in standalone mode
RESULT: The ir led light switches on for first 2-3 seconds and turns off automatically. No problems with video stream however.
Do we have any solution for this ?
I apologize for the delay @Vishnu-Karthikeyan. The code above works as expected for me. So very likely there's a hardware issue (which I haven't seen yet for LED). Please send an email to support@luxonis.com together with this ticket URL and we'll replace the device asap.
Thanks @Erol444, I have 2 unit of same hardware. But same problem for both which are installed at two different sites. Do you think this would still be a hardware problem. I think @jakaskerl also has the same problem as mentioned in his comment.
@Vishnu-Karthikeyan that's interesting.. Are you using the latest depthai? Are you powering the device with sufficient POE injector/switch?
Am creating a dap package and installing it to OAK-D Pro W PoE using device manager. Am getting the video feed on link, but the IR led does not switch on. Tested it on dark room environment. Checked IR led on phone cam nut no glow.
Following is the code.