• Assistance Needed for Standalone Streaming Setup on Multiple OAK PoE Cameras

Hello Luxonis Community,

I am working with three OAK cameras (OAK-1-PoE, OAK-D-PoE, and OAK-D Pro PoE) and aim to set them up as standalone devices. Each camera has been assigned a static IP address. My objective is to stream from these cameras over the network using specific URLs tied to their IP addresses. For instance, I wish to access the OAK-1-PoE stream via "0.0.0.0:1010/view1". Additionally, for the OAK-D-PoE, which supports multiple views, I'd like to use URLs like "0.0.0.1:1010/view1" and "0.0.0.1:1010/view2". or change in the port 0.0.0.1:1010/view and 0.0.0.1:1011/view.

I attempted to flash the devices with a .dap file for MJPEG streaming, but faced challenges, likely due to gaps in my understanding. I am seeking guidance on crafting a script that can generate a suitable .dap file for this purpose, enabling me to flash the devices and access different camera views as described. Any assistance or pointers towards relevant scripts and resources would be greatly appreciated.

    nikul I attempted to flash the devices with a .dap file for MJPEG streaming, but faced challenges, likely due to gaps in my understanding.

    What challenges? Any errors showing up?
    luxonis/depthai-experimentsblob/master/gen2-mjpeg-streaming/main.py this example is similar to what you are trying to achieve, but for a single device. You can remove the part with context manager and replace it with code used for flashing: https://docs.luxonis.com/projects/api/en/latest/tutorials/standalone_mode/#converting-a-demo-to-standalone-mode

    Thanks,
    Jaka

    Snap from my current code.
    Simply trying to stream using MJPEG(OAK-1-PoE)

    import socketserver

    import threading

    import time

    from http.server import BaseHTTPRequestHandler, HTTPServer

    from io import BytesIO

    from socketserver import ThreadingMixIn

    from time import sleep

    import depthai as dai

    import numpy as np

    import cv2

    from PIL import Image

    import blobconverter

    HTTP_SERVER_PORT = 8090

    class TCPServerRequest(socketserver.BaseRequestHandler):

    def handle(self):

    # Handle is called each time a client is connected

    # When OpenDataCam connects, do not return - instead keep the connection open and keep streaming data

    # First send HTTP header

    header = 'HTTP/1.0 200 OK\r\nServer: Mozarella/2.2\r\nAccept-Range: bytes\r\nConnection: close\r\nMax-Age: 0\r\nExpires: 0\r\nCache-Control: no-cache, private\r\nPragma: no-cache\r\nContent-Type: application/json\r\n\r\n'

    self.request.send(header.encode())

    while True:

    sleep(0.1)

    if hasattr(self.server, 'datatosend'):

    self.request.send(self.server.datatosend.encode() + "\r\n".encode())

    # HTTPServer MJPEG

    class VideoStreamHandler(BaseHTTPRequestHandler):

    def do_GET(self):

    self.send_response(200)

    self.send_header('Content-type', 'multipart/x-mixed-replace; boundary=--jpgboundary')

    self.end_headers()

    while True:

    sleep(0.1)

    if hasattr(self.server, 'frametosend'):

    ok, encoded = cv2.imencode('.jpg', self.server.frametosend)

    self.wfile.write("--jpgboundary".encode())

    self.send_header('Content-type', 'image/jpeg')

    self.send_header('Content-length', str(len(encoded)))

    self.end_headers()

    self.wfile.write(encoded)

    self.end_headers()

    class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):

    """Handle requests in a separate thread."""

    pass

    # start TCP data server

    server_TCP = socketserver.TCPServer(('localhost', 8070), TCPServerRequest)

    th = threading.Thread(target=server_TCP.serve_forever)

    th.daemon = True

    th.start()

    # start MJPEG HTTP Server

    server_HTTP = ThreadedHTTPServer(('localhost', HTTP_SERVER_PORT), VideoStreamHandler)

    th2 = threading.Thread(target=server_HTTP.serve_forever)

    th2.daemon = True

    th2.start()

    syncNN = True

    def create_pipeline():

    # Start defining a pipeline

    pipeline = dai.Pipeline()

    # Define a source - color camera

    colorCam = pipeline.create(dai.node.ColorCamera)

    colorCam.setPreviewSize(300, 300)

    colorCam.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1080_P)

    colorCam.setInterleaved(False)

    colorCam.setColorOrder(dai.ColorCameraProperties.ColorOrder.BGR)

    return pipeline

    # Save the pipeline as a .dap file

    pipeline = create_pipeline() # Change 'depth' based on your requirements

    dai.DeviceBootloader.saveDepthaiApplicationPackage(

    './OAK1_MJPEG_Streaming.dap', # Where to save the .dap file

    pipeline, # The pipeline you just created

    compress=True, # Compress the file

    applicationName='OAK1Streaming' # Optional application name

    )

    I have Couple of question.
    First I am receiving the following error when i try to flash the .dap file

    Secondly, do I need to change localhost with anything else.
    # start TCP data server

    server_TCP = socketserver.TCPServer(('localhost', 8070), TCPServerRequest)

    th = threading.Thread(target=server_TCP.serve_forever)

    th.daemon = True

    th.start()

    # start MJPEG HTTP Server

    server_HTTP = ThreadedHTTPServer(('localhost', HTTP_SERVER_PORT), VideoStreamHandler)

    th2 = threading.Thread(target=server_HTTP.serve_forever)

    th2.daemon = True

    th2.start()

      Hi @nikul
      You can try flashing this way if you are having issues:

      import depthai as dai
      
      pipeline = dai.Pipeline()
      
      # Define standalone pipeline; add nodes and link them
      # cam = pipeline.create(dai.node.ColorCamera)
      # script = pipeline.create(dai.node.Script)
      # ...
      
      # Flash the pipeline
      (f, bl) = dai.DeviceBootloader.getFirstAvailableDevice()
      bootloader = dai.DeviceBootloader(bl)
      progress = lambda p : print(f'Flashing progress: {p*100:.1f}%')
      bootloader.flash(progress, pipeline)

      nikul Secondly, do I need to change localhost with anything else.

      No, I don't think you need to change it. Socketserver should know to point localhost to loopback.

      Thanks,
      Jaka

      Thank you for your prompt response.

      Here I am trying to understand do we only flash pipeline on to the device. from the code its seems like it just flashing the pipeline we created from "depthai" package. so what happens to the code outside of the object which basically responsible from streaming.

      Further how would i target specific device using IP address.
      (f, bl) = dai.DeviceBootloader.getFirstAvailableDevice()
      I do not need first available device. I currently have 5 OAK devices connected to my network at the moment.

      Let me know if you need more detail to understand my use case thoroughly.

        H @nikul

        nikul so what happens to the code outside of the object which basically responsible from streaming.

        The code goes inside the script node. Here is an example of how to port: luxonis/depthai-experimentstree/master/gen2-cumulative-object-counting. Standalone mode version should have all components inside the script node. Keep in mind that some libraries are not accessible so you will need workarounds.
        https://docs.luxonis.com/projects/api/en/latest/components/nodes/script/#available-modules-and-libraries


        getAllAvailableDevices() should give you a list. Then select the correct one based on IP or MXID.

        Thanks,
        Jaka

        Thank you,
        I need assistance with couple of things.
        desired_ip = "x.x.x.x"

        # Get the list of all available devices

        available_devices = dai.DeviceBootloader.getAllAvailableDevices()

        # Find the bootloader corresponding to the device with the desired IP

        selected_bootloader = None

        for device_info in available_devices:

        if device_info.name == desired_ip:

        selected_bootloader = dai.DeviceBootloader(device_info)

        break

        # Check if the device was found and flash the pipeline

        if selected_bootloader:

        # Check if the device is already in the FLASH state

        print(selected_bootloader)

        if ("Want to check the state"):

        print("Device already in FLASH state, removing existing flash...")

        selected_bootloader.("Want function to clear it before i flash it again (flashEepromClear)?") ""

        progress = lambda p: print(f'Flashing progress: {p*100:.1f}%')

        selected_bootloader.flash(progress, pipeline)

        print("Flashing completed.")

        else:

        print("Device with the specified IP not found.")

        1. How can check if the device is in BOOTABLE state. (using object of DepthAi in this case it selected_bootloader)
        2. What happens if I Flash device even though it not in the Bootloader State. If it won't allow, how do tI clear it., or if it will allow does it overwrites the script.

        HI @nikul
        1:

        # Check every second for new devices
        while True:
        device_infos = dai.Device.getAllAvailableDevices()
        for device_info in device_infos:
        if device_info.state != dai.XLinkDeviceState.X_LINK_BOOTLOADER:
        continue
        # Start thread here
        sleep(1)
        1. If you try to flash the device when it is already booted, you will get an error that device is already used. If you flash an unbooted device, it will try to boot it to bootloader first, then flash it.

        Thanks,
        Jaka

        Thank you for your response @jakaskerl , Really Appreciate.I
        I need assistance with the following code.

        1. I am trying to get the object of desired IP (desired_ip) and trying to perform flash() and flasClear() on the object. However i am getting error depthai.DeviceInfo object has no attribute 'flashClear'. I am assuming flash() also won't work. Here is snap of my code.


          desired_ip = "0.0.0.0"

          device_infos = dai.Device.getAllAvailableDevices()

          device_infos = [device_info for device_info in device_infos if device_info.name == desired_ip]

          if device_infos:

              device_info = device_infos[0]

              print(device_info)

              if device_info.state != dai.XLinkDeviceState.X_LINK_BOOTLOADER:

                  print("Device already in FLASH state, removing existing flash...")

                  device_info.flashClear()

                  print('Successfully cleared bootloader flash')

              progress = lambda p: print(f'Flashing progress: {p*100:.1f}%')

              # device_info.flash(progress, pipeline)

              print("Flashing completed.")

          else:

              print(f"No device with IP address {desired_ip} found.")

        1. I am trying to make the device stand alone. it will stream the camera on IP address using MJPEG. Now I am in situation where I might have to change the camera configuration. Right now what planning is I will clearing flash. and reassign it to the device was wondering if there's any optimal way.

        Thanks,
        Nikul

        Hi @nikul

        1. dai.DeviceBootloader(devInfo=device_info).flashClear()
        2. Flashing a different app will override the already flashed app, so you don't have to manually clear the flash.

        Thanks,
        Jaka

        Hi @jakaskerl Thank you for your response.
        I have been successfully able to Flash the script on to the desired device using IP address.
        I was wondering If i can show both the views since I have OAK-D Pro PoE camera which can produce Active/Passive Stereo view. I want to produce two URL. For example given script make steaming run on 0.0.0.0:0000/img. I want to make two different URL for two different views for example 0.0.0.0:0000/normal and 0.0.0.0:0000/stereo.
        Since it is complex for me to marge the functionality your assistance will be really appreciated.
        Code
        import depthai as dai

        import time

        # Start defining a pipeline

        pipeline = dai.Pipeline()

        # Define a source - color camera

        cam = pipeline.create(dai.node.ColorCamera)

        cam.setFps(30)

        cam.setResolution(dai.ColorCameraProperties.SensorResolution.THE_12_MP)

        # VideoEncoder

        jpeg = pipeline.create(dai.node.VideoEncoder)

        jpeg.setDefaultProfilePreset(cam.getFps(), dai.VideoEncoderProperties.Profile.MJPEG)

        # Script node

        script = pipeline.create(dai.node.Script)

        script.setProcessor(dai.ProcessorType.LEON_CSS)

        script.setScript("""

        import time

        import socket

        import fcntl

        import struct

        from socketserver import ThreadingMixIn

        from http.server import BaseHTTPRequestHandler, HTTPServer

        PORT = 0000

        def get_ip_address(ifname):

        s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

        return socket.inet_ntoa(fcntl.ioctl(

        s.fileno(),

        -1071617759, # SIOCGIFADDR

        struct.pack('256s', ifname[:15].encode())

        )[20:24])

        class ThreadingSimpleServer(ThreadingMixIn, HTTPServer):

        pass

        class HTTPHandler(BaseHTTPRequestHandler):

        def do_GET(self):

        if self.path == '/':

        self.send_response(200)

        self.end_headers()

        self.wfile.write(b'<h1>[DepthAI] Hello, world!</h1><p>Click <a href="img">here</a> for an image</p>')

        elif self.path == '/img':

        try:

        self.send_response(200)

        self.send_header('Content-type', 'multipart/x-mixed-replace; boundary=--jpgboundary')

        self.end_headers()

        fpsCounter = 0

        timeCounter = time.time()

        while True:

        jpegImage = node.io['jpeg'].get()

        self.wfile.write("--jpgboundary".encode())

        self.wfile.write(bytes([13, 10]))

        self.send_header('Content-type', 'image/jpeg')

        self.send_header('Content-length', str(len(jpegImage.getData())))

        self.end_headers()

        self.wfile.write(jpegImage.getData())

        self.end_headers()

        fpsCounter = fpsCounter + 1

        if time.time() - timeCounter > 1:

        node.warn(f'FPS: {fpsCounter}')

        fpsCounter = 0

        timeCounter = time.time()

        except Exception as ex:

        node.warn(str(ex))

        with ThreadingSimpleServer(("", PORT), HTTPHandler) as httpd:

        node.warn(f"Serving at {get_ip_address('re0')}:{PORT}")

        httpd.serve_forever()

        """)

        # Connections

        cam.video.link(jpeg.input)

        jpeg.bitstream.link(script.inputs['jpeg'])

        desired_ip = "0.0.0.0"

        device_infos = dai.Device.getAllAvailableDevices()

        device_infos = [device_info for device_info in device_infos if device_info.name == desired_ip]

        if device_infos:

        device_info = device_infos[0]

        print(device_info)

        if device_info.state != dai.XLinkDeviceState.X_LINK_BOOTLOADER:

        print("Device already in FLASH state, removing existing flash...")

        dai.DeviceBootloader(devInfo=device_info).flashClear()

        print('Successfully cleared bootloader flash')

        progress = lambda p: print(f'Flashing progress: {p*100:.1f}%')

        dai.DeviceBootloader(devInfo=device_info).flash(progress, pipeline)

        print("Flashing completed.")

        else:

        print(f"No device with IP address {desired_ip} found.")

        Thank you.
        Nikul

        Hi @nikul
        I'm going to attach a script which did a similar thing, but with different stages of NN. Couldn't find the discussion in which this was posted, so I'm only positing code. Hope it helps in understanding.

        import depthai as dai
        import time
        import blobconverter
        from pathlib import Path
        
        # modelOL = blobconverter.from_zoo(name="mobile_object_localizer_192x192", zoo_type="depthai", shaves=6)
        modelSSD = blobconverter.from_zoo(name="mobilenet-ssd", shaves=6)
        fire_model_path = "/Users/jaka/Desktop/tests/multimodel_scripts/models/fire-detection_openvino_2021.2_5shave.blob"
        
        SW_VERSION = "SSD_FireDet"
        
        # Start defining a pipeline
        pipeline = dai.Pipeline()
        
        pipeline.setOpenVINOVersion(version = dai.OpenVINO.VERSION_2021_4)
        
        # Color camera
        cam = pipeline.create(dai.node.ColorCamera)
        cam.setInterleaved(False)
        cam.setResolution(dai.ColorCameraProperties.SensorResolution.THE_1080_P)
        cam.setIspScale(1,3)
        # cam.setPreviewSize(640, 640)
        # cam.setVideoSize(640, 640)
        cam.setFps(5)
        
        # Define a neural network Mobilenet-ssd
        nn_mssd = pipeline.create(dai.node.MobileNetDetectionNetwork)
        nn_mssd.setConfidenceThreshold(0.5)
        nn_mssd.setBlobPath(modelSSD)
        nn_mssd.setNumInferenceThreads(2)
        nn_mssd.input.setBlocking(False)
        
        # Define input image to nn_MobilenetSSD
        manip_mssd = pipeline.createImageManip()
        manip_mssd.setResize(300,300)
        manip_mssd.setMaxOutputFrameSize(270000) # 300x300x3
        manip_mssd.initialConfig.setFrameType(dai.RawImgFrame.Type.RGB888p)
        
        # Define a neural network Fire Detection
        nn_fire = pipeline.create(dai.node.NeuralNetwork)
        # nn_fire.setConfidenceThreshold(0.5)
        nn_fire.setBlobPath(fire_model_path)
        nn_fire.input.setBlocking(False)
        
        # Define input image to nn_FireDetection
        manip_fire = pipeline.createImageManip()
        manip_fire.setResize(224,224)
        manip_fire.setMaxOutputFrameSize(150528) # 224x224x2
        manip_fire.initialConfig.setFrameType(dai.RawImgFrame.Type.RGB888p)
        
        #define a script node
        script = pipeline.create(dai.node.Script)
        script.setProcessor(dai.ProcessorType.LEON_CSS)
        
        #Define a video encoder
        videoEnc = pipeline.create(dai.node.VideoEncoder)
        videoEnc.setDefaultProfilePreset(30, dai.VideoEncoderProperties.Profile.MJPEG)
        
        # Links
        cam.preview.link(manip_mssd.inputImage)
        manip_mssd.out.link(nn_mssd.input)
        
        cam.preview.link(manip_fire.inputImage)
        manip_fire.out.link(nn_fire.input)
        
        script.inputs['detSSD'].setBlocking(False)
        script.inputs['detSSD'].setQueueSize(1)
        nn_mssd.out.link(script.inputs["detSSD"])
        
        script.inputs['detFire'].setBlocking(False)
        script.inputs['detFire'].setQueueSize(1)
        nn_fire.out.link(script.inputs["detFire"])
        
        script.inputs['frame'].setBlocking(False)
        script.inputs['frame'].setQueueSize(1)
        videoEnc.bitstream.link(script.inputs['frame'])
        
        cam.video.link(videoEnc.input)
        
        script.setScript("""
        import socket
        import time
        import threading
        
        serverFrame = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        serverFrame.bind(("0.0.0.0", 5010))
        serverFrame.listen()
        
        serverSSD = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        serverSSD.bind(("0.0.0.0", 5011))
        serverSSD.listen()
        
        serverFire = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        serverFire.bind(("0.0.0.0", 5012))
        serverFire.listen()
        
        node.warn("Server up")
        
        labelMap_SSD = ["background", "aeroplane", "bicycle", "bird", "boat", "bottle", "bus", "car", "cat", "chair", "cow",
                        "diningtable", "dog", "horse", "motorbike", "person", "pottedplant", "sheep", "sofa", "train", "tvmonitor"]
        
        label_fire = ["fire", "normal", "smoke"]
        
        client_connections = {
            "frame": [],
            "ssd": [],
            "fire": []
        }
        
        def send_frame_thread():
            try:
                while True:
                    pck = node.io["frame"].tryGet()
                    # log shape
                    if not pck:
                        continue
                    node.warn(f"Frame shape: {pck.getData().shape}")
                    data = pck.getData()
                    ts = pck.getTimestamp()
                    
                    header = f"ABCDE " + str(ts.total_seconds()).ljust(18) + str(len(data)).ljust(8)
        
                    for conn in client_connections["frame"]:
                        try:
                            conn.send(bytes(header, encoding='ascii'))
                            conn.send(data)
                        except Exception as e:
                            node.warn(f"Frame client disconnected: {e}")
                            client_connections["frame"].remove(conn)
                            conn.close()
            except Exception as e:
                node.warn(f"Error oak: {e}")
        
        def send_result_nn(type):
            try:
                while True:
                    pck = node.io["frame"].tryGet()
                    if not pck:
                        continue
                    data = pck.getData()
                    node.warn(f"Frame shape: {pck.getData().shape}")
                    ts = pck.getTimestamp()
                    data_to_send = []
        
                    if type == 1:  # SSD
                        detections_ssd = node.io["detSSD"].tryGet()
                        if detections_ssd:
                            dets = detections_ssd.detections
                            for det in dets:
                                label = labelMap_SSD[det.label]
                                if label == "person":
                                    det_bb = [det.label, det.xmin, det.ymin, det.xmax, det.ymax]
                                    data_to_send.append(det_bb)
        
                        for conn in client_connections["ssd"]:
                            try:
                                header = f"ABCDE " + str(ts.total_seconds()).ljust(18) + str(len(data)).ljust(8) + str(data_to_send).ljust(224)
                                conn.send(bytes(header, encoding='ascii'))
                                conn.send(data)
                            except Exception as e:
                                node.warn(f"SSD client disconnected: {e}")
                                client_connections["ssd"].remove(conn)
                                conn.close()
        
                    elif type == 2:  # Fire Detection
                        data_fire = node.io["detFire"].tryGet()
                        if data_fire:
                            data_to_send = data_fire.getLayerFp16("final_result")
        
                        for conn in client_connections["fire"]:
                            try:
                                header = f"ABCDE " + str(ts.total_seconds()).ljust(18) + str(len(data)).ljust(8) + str(data_to_send).ljust(224)
                                conn.send(bytes(header, encoding='ascii'))
                                conn.send(data)
                            except Exception as e:
                                node.warn(f"Fire Detection client disconnected: {e}")
                                client_connections["fire"].remove(conn)
                                conn.close()
        
            except Exception as e:
                node.warn(f"Error oak: {e}")
            
        def get_thread(server, type):
            try:
                while True:
                    conn, client = server.accept()
                    node.warn(f"Connected to client IP: {client}, type: {type}")
                    if type == 0:
                        client_connections["frame"].append(conn)
                        threading.Thread(target=send_frame_thread).start()
                    elif type == 1:
                        client_connections["ssd"].append(conn)
                        threading.Thread(target=send_result_nn, args=(type, )).start()
                    elif type == 2:
                        client_connections["fire"].append(conn)
                        threading.Thread(target=send_result_nn, args=(type, )).start()
            except Exception as e:
                node.warn("Server error:", e)
        
        threading.Thread(target=get_thread, args=(serverFrame, 0)).start()
        threading.Thread(target=get_thread, args=(serverSSD, 1)).start()
        threading.Thread(target=get_thread, args=(serverFire, 2)).start()
        
        """)

        Thanks,
        Jaka

        Hi @jakaskerl Thank you for your response I will look into it and will try to figure the way out.
        however I am stuck in on other problem. I really appreciate your help in this.

        Here is snap of my code where I am working.

        device_info = dai.DeviceInfo("0.0.0.0")

        if device_info:

        with dai.Device(pipeline, device_info) as device:

                while not device.isClosed():

                    time.sleep(1)

        else:

            print(f"No device with IP address {device_info.name} found.")


        if device_info:

            progress = lambda p: print(f'Flashing progress: {p*100:.1f}%')

            dai.DeviceBootloader(devInfo=device_info).flash(progress, pipeline)

            print("Flashing completed.")

        else:

            print(f"No device with IP address {device_info.name} found.")

        Above code does flash the script to the specific device. but the part where don't really flash and I just want to stream on my machine is not really working. throwing the following error

        Or

        Use constructor taking 'UsbSpeed' instead

        with dai.Device(pipeline, device_info) as device:

        however device is available I do have checked.

        2. I am making a camera stand alone device. I will be trying different focus and different resolution based on my requirement. for now what I am planning is I will stream it in my system first once I am done, with all the setting I will flash it at single shot. That's what first question is about. However i am still looking for optimum solution of this if you can suggest something different that be great.

        1. Sometime camera view fluctuates,.

          Hi @nikul
          A single device cannot be used by both the deviceBootloader and the dai.Device(). After exiting the context of these two functions, the device will reboot which will cause the error you are experiencing.

          nikul 2. I am making a camera stand alone device. I will be trying different focus and different resolution based on my requirement. for now what I am planning is I will stream it in my system first once I am done, with all the setting I will flash it at single shot. That's what first question is about. However i am still looking for optimum solution of this if you can suggest something different that be great.

          Optimum solution for what exactly? Streaming or setting the resolution, etc..?

          nikul Sometime camera view fluctuates,.

          What do you mean by fluctuates?

          Thanks,
          Jaka

            jakaskerl
            Hi @jakaskerl

            1. I am looking for way to view the camera(stream using mjpeg) on localhost before I flash the setting(Res,Focus,etc) into the device. The way I am flashing specific device using IP address. I want to view specific IP address instead of available device.
              this not really working getting the error I shared with you earlier in this discussion.
              # Specify MXID, IP Address or USB path

              device_info = depthai.DeviceInfo("14442C108144F1D000") # MXID

              #device_info = depthai.DeviceInfo("192.168.1.44") # IP Address

              #device_info = depthai.DeviceInfo("3.3.3") # USB port name

              with depthai.Device(pipeline, device_info) as device:

              # ...

            2. Apologies, I meant streaming is flickering .My observation says it happens when I use camera as standalone device not when I use my system as host.

              nikul

              nikul The way I am flashing specific device using IP address. I want to view specific IP address instead of available device.

              Coudly elaborate more, I'm still quite unsure of what you goal is. IP address is accessed through name property of the deviceInfo object.

              nikul Apologies, I meant streaming is flickering .My observation says it happens when I use camera as standalone device not when I use my system as host.

              Can you send a screenshot/video of this happening?

              Thanks,
              Jaka

                jakaskerl Thank you for getting back.

                1. here is the recorded video of camera behavior on stand alone mode.
                video.mp4
                8MB
                1. Here is the script which basically sets MJPEG server with both views (normal and stereo). I am not sure weather or not it will work, but currently it is taking random device from the network since have both OAK-1 and OAK-D-Pro it select OAK 1 from the network and trying to run the given script causing error like this one.

                  Note: Even though if I disconnect all the device and just keep OAK-D-Pro PoE it still say failed to find the device even though its connected when i check the status.

                  Script : GitHub (GPT generated)

                  You did mention something like this. Apologies if still repeating the same mistake unconsciously

                A single device cannot be used by both the deviceBootloader and the dai.Device(). After exiting the context of these two functions, the device will reboot which will cause the error you are experiencing.

                1. This simple example of depth preview is not working for me.
                  https://github.com/luxonis/depthai-python/blob/main/examples/StereoDepth/depth_preview.py

                Getting this error even after getting sure that its connected.

                HI @nikul
                I tested you script and it works great on Oak-D-Pro Poe. It does not flicker at all. Are you experiencing the flickering in host mode or just in standalone? Does it help removing the color_cam.initialControl.setManualFocus(100) # 0..255?

                "0.0.0.0" IP won't work, you have to specify the IP of the device directly. Camera not detected error stems from the fact that OAK-1 poe only has 1 camera (on socket 0). Stereo needs cameras on socket 1 and 2.

                Thanks,
                Jaka

                  jakaskerl
                  I tested you script and it works great on Oak-D-Pro Poe. It does not flicker at all. Are you experiencing the flickering in host mode or just in standalone? Does it help removing the color_cam.initialControl.setManualFocus(100) # 0..255?

                  It flickers only on Standalone. I have applied the same code to the all my four OAK PoE cameras however effect of this code color_cam.initialControl.setManualFocus(100) # 0..255is only appearing on OAK-D-Pro. and none other.

                  "0.0.0.0" IP won't work, you have to specify the IP of the device directly. Camera not detected error stems from the fact that OAK-1 poe only has 1 camera (on socket 0). Stereo needs cameras on socket 1 and 2.

                  0.0.0.0 is just for security purpose I am using device IP while running in into my system. I aware of the fact that I need OAK-D or OAK-D-Pro to stream depth view. i do have both of them connected to my network.

                  Hi @nikul
                  Which Oak-D-pro Poe is this? This is what /examples/ColorCamera/rgb_preview.py prints out for a camera I tested and which had no issues with flickering:

                  Connected cameras: [{socket: CAM_A, sensorName: IMX378, width: 4056, height: 3040, orientation: AUTO, supportedTypes: [COLOR], hasAutofocus: 1, hasAutofocusIC: 1, name: color}, {socket: CAM_B, sensorName: OV9282, width: 1280, height: 800, orientation: AUTO, supportedTypes: [MONO], hasAutofocus: 0, hasAutofocusIC: 0, name: left}, {socket: CAM_C, sensorName: OV9282, width: 1280, height: 800, orientation: AUTO, supportedTypes: [MONO], hasAutofocus: 0, hasAutofocusIC: 0, name: right}]
                  Usb speed: UNKNOWN
                  Bootloader version: 0.0.26
                  Device name: OAK-D-PRO-POE  Product name: OAK-D-PRO-POE-AF

                  I flashed the application you have sent to the device and experienced no issues.

                  Thanks,
                  Jaka