Hi erik , Running fix_softbrick.py in the linked announcement worked! Now I can connect to my device.
I will wait for an example on how to use the bootloader API for (.setStaticIPv4(ipv4, mask, gateway), .setDynamicIPv4(ipv4, mask, gateway)).
I wrote a script to use the bootloader API which shows that the .getIPv4(), .getIPv4Mask(), .getIPv4Gateway(), .isStaticIPV4() are set, but when I rerun the same script I do not see the changes to the bootloader just made.
# usr/bin/env/python3
import depthai as dai
current_ip = input("Enter IP of POE OAK Device: ").strip() # example: 172.16.15.17
found_poe, poe = dai.DeviceBase.getDeviceByMxId(current_ip)
if not found_poe:
print(f"Did not find {current_ip}, exiting.")
exit(1)
print(f"Found {current_ip}")
poebl = dai.DeviceBootloader(poe)
device_config = poebl.Config()
def see_config():
print("\nCurrent IPv4 Configurations: ")
print(f"IPv4: {device_config.getIPv4()}")
print(f"IPv4 Mask: {device_config.getIPv4Mask()}")
print(f"IPv4 Gateway: {device_config.getIPv4Gateway()}")
print(f"Is IPv4 static: {device_config.isStaticIPV4()}")
def enter_new_config():
print("\nNew IPv4 Configurations: ")
ipv4 = input("Enter IPv4: ").strip()
mask = input("Enter IPv4 Mask: ").strip()
gateway = input("Enter IPv4 Gateway: ").strip()
is_static = True if input("Is this a static IPv4 (sets dynamic IPv4 if no)? (y/n): ").strip() == "y" else False
return ipv4, mask, gateway, is_static
def confirm_new_config(ipv4, mask, gateway, is_static):
print("\nEntered IPv4 Configurations: ")
print(f"New IPv4: {ipv4}")
print(f"New IPv4 Mask: {mask}")
print(f"New IPv4 Gateway: {gateway}")
print(f"Is New IPv4 static: {is_static}")
if is_static:
print("Note: Static IPv4 will not start DHCP client")
else:
print("Note: Dynamic IPv4 will be used (sets IP and starts DHCP client)")
is_confirmed = True if input("\nPlease confirm this Configuration to Set (y/n): ").strip() == "y" else False
if not is_confirmed:
print("New Config is not Confirmed, exiting.")
exit(1)
def perform_config(ipv4, mask, gateway, is_static):
print("Setting New Configurations...")
if is_static:
device_config.setStaticIPv4(ipv4, mask, gateway)
else:
device_config.setDynamicIPv4(ipv4, mask, gateway)
print("Configuration Complete")
def run_config():
see_config()
ipv4, mask, gateway, is_static = enter_new_config()
confirm_new_config(ipv4, mask, gateway, is_static)
perform_config(ipv4, mask, gateway, is_static)
see_config()
if __name__ == "__main__":
run_config()