DepthAI Tutorials
DepthAI API References

ON THIS PAGE

  • Bootloader Version
  • Demo
  • Setup
  • Source code

Bootloader Version

This example shows basic bootloader interaction, retrieving the version of bootloader running on the device.Click on Bootloader for more information.

Demo

Example script output
Command Line
1~/depthai-python/examples$ python3 bootloader_version.py
2    Found device with name: 1.1
3    Version: 0.0.26
4    USB Bootloader - supports only Flash memory
5    Memory 'Memory.FLASH' size: 33554432, info: JEDEC ID: 01 02 19

Setup

Please run the install script to download all required dependencies. Please note that this script must be ran from git context, so you have to download the depthai-python repository first and then run the script
Command Line
1git clone https://github.com/luxonis/depthai-python.git
2cd depthai-python/examples
3python3 install_requirements.py
For additional information, please follow the installation guide.

Source code

Python
C++
Python
GitHub
1#!/usr/bin/env python3
2
3import depthai as dai
4
5(res, info) = dai.DeviceBootloader.getFirstAvailableDevice()
6
7if res == True:
8    print(f'Found device with name: {info.name}')
9    bl = dai.DeviceBootloader(info)
10    print(f'Version: {bl.getVersion()}')
11
12    supportedMemTypes = [dai.DeviceBootloader.Memory.FLASH, dai.DeviceBootloader.Memory.EMMC]
13    if bl.getType() == dai.DeviceBootloader.Type.USB:
14        print("USB Bootloader - supports only Flash memory")
15        supportedMemTypes = [dai.DeviceBootloader.Memory.FLASH];
16    else:
17        print(f"NETWORK Bootloader, is User Bootloader: {bl.isUserBootloader()}")
18
19    try:
20        for mem in supportedMemTypes:
21            memInfo = bl.getMemoryInfo(mem)
22            if memInfo.available:
23                print(f"Memory '{mem}' size: {memInfo.size}, info: {memInfo.info}")
24                appInfo = bl.readApplicationInfo(mem)
25                if appInfo.hasApplication:
26                    print(f"Application name: {appInfo.applicationName}, firmware version: {appInfo.firmwareVersion}")
27            else:
28                print(f"Memory '{mem.name}' not available...")
29    except Exception as ex:
30        print(f"Couldn't retrieve memory details: {ex}")
31else:
32    print('No devices found')

Need assistance?

Head over to Discussion Forum for technical support or any other questions you might have.