• Standalone mode oak ffc 4p does not work

erik oh sorry i missed it in my hurry 🙂

Here's a new version:


from pathlib import Path

import cv2

import depthai as dai

import numpy as np

\# Get argument first

yolo_v5_path = str((Path(__file__).parent / Path('ai_v2/result/best_openvino_2022.1_6shave.blob')).resolve().absolute())

GPIO = dai.BoardConfig.GPIO

\# Define outputs for serial communication

uartNum = 0

uarts = {

    0: {  # Suitable for the custom TG board

        'txPin' : 15,

        'rxPin' : 16,

        'txPinMode' : GPIO.ALT_MODE_2,

        'rxPinMode' : GPIO.ALT_MODE_2,

    }

}

\# Start defining a pipeline

pipeline = dai.Pipeline()

pipeline.setOpenVINOVersion(version=dai.OpenVINO.Version.VERSION_2022_1)

pyserial = """

    import serial

    ser = serial.Serial("/dev/ttyS0", baudrate=115200)

    bboxes = []

    
while True: in_nn = node.io['detections'].get() if in_nn is not None: bboxes = in_nn.detections
if bboxes is not None: yellowValues = [-1,-1,-1,-1] blueValues = [-1,-1,-1,-1] ballValues = [-1,-1,-1,-1]
for bbox in bboxes:
# denormalize bounding box x1 = int(bbox.xmin \* size) x2 = int(bbox.xmax \* size) y1 = int(bbox.ymin \* size) y2 = int(bbox.ymax \* size)
if check:
coordinates = list() coordinates.append(x1) coordinates.append(x2) coordinates.append(y1)

serString = 'str(ballValues[0])'
ser.write(serString.encode()) """ \# Define script for output script = pipeline.create(dai.node.Script) script.setProcessor(dai.ProcessorType.LEON_CSS) script.setScript(pyserial) \# Create output detectionNetwork.out.link(script.inputs["detections"]) config = dai.Device.Config() config.board.gpio[uarts[uartNum]['txPin']] = GPIO(GPIO.OUTPUT, uarts[uartNum]['txPinMode']) config.board.gpio[uarts[uartNum]['rxPin']] = GPIO(GPIO.INPUT, uarts[uartNum]['rxPinMode']) config.board.uart[uartNum] = dai.BoardConfig.UART() config.version = config.version.VERSION_2021_4 \# 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) DetectionNetwork is my network with the blobpath.
  • erik replied to this.

    Maimilian are you using latest depthai (2.21.2)? There were some fixes recently (from changelog: FW: fix for UART0 / '/dev/ttyS0' init failure in Script node).

      erik maybe I have to flash the config part? Because it is not part of the pipeline is it?

      • erik replied to this.

        erik I have done this via the device manager. It is installed version 0.0.24. I think that's the newest version (this says the device manager too). Then I tried to flash it. The output in the terminal then says: progress 0.0% (something like that) and then it finishes.

        erik Maybe there's also a problem with the current and latest bootloader version. I think so because when I flashed with the version 0.0.18 instead of the latest version 0.0.24 it flashed normally (about 2 minutes with a progress). However, even there standalone mode has not worked yet. Nevertheless, is there a way to downgrade bootloader version?

        Furthermore I read about the parameter compress in bootloader.flash(). Should this be true?

        • erik replied to this.

          Maimilian I can confirm it does work in normal mode, but not in flashed mode with latest bootlaoder. Our firmware team will be looking into this shortly. You can downgrade bootloader by installing older depthai version (eg. 2.19.1).

          Maimilian very likely you have only 16MB of memory, and if you don't compress the firmware (bootlaoder.flash(progress, pipeline, compress=True)) it will fail. Try the following:

          (ok, err) = bootloader.flash(progress, pipeline)
          print(f"Flashing success: {ok}, error: {err}")

          And then change to:

          (ok, err) = bootloader.flash(progress, pipeline, compress=True)

          Also note that with 16MB memory, I don't think you'll be able to flash any kind of neural network to the device. The depthai itself takes like 10MB-15MB (when compressed), so you will have a small margin. It might also be that only the USB Bootlaoder doesn't find eMMC flash (usually present on SOMs). I opened Feature Request here.

            erik Thanks for answering. The flash progress was succesful. However, I need to flash my ai model on the board. It is 14.1MB large.

            • erik replied to this.

              Maimilian For that, I believe it would be best to open feature request on depthai-core, that even USB bootloader can access eMMC memory (currently, only NETWORK bootlaoder can). I also don't think flashing BoardConfig (needed for UART) is available, perhaps creating separate feature request for that would be useful as well.

                erik Is there any chance that flashing config for uart will be available in the next two weeks?

                erik And another question: is it possible to use network bootloader with the oak ffc 4p?

                erik Or is there any other way to work without a Computer?

                • erik replied to this.

                  Maimilian It's always suggested to write concise and thought-over messages 🙂

                  1. It depends on the opportunity. If you could share the volume opportunity here (or email support@luxonis.com) we can expedite this. Commitment (to buy) may be required. If this is a bachelors thesis then I don't see this being implemented even in 1 year, but if there are 1000s pcs/year opportunity then we would fix this over the weekend. I hope you understand.
                  2. depthai-core github repository.
                  3. No, I don't think so.
                  4. No, standalone mode is the only way.

                    erik Thanks for all your help! We decided to use a raspberry pi to have a non standalone mode on the board.