From e34cdfb856a4ffd57bc98de905a03943fa61986d Mon Sep 17 00:00:00 2001 From: HuangMason320 Date: Wed, 16 Jul 2025 21:53:31 +0800 Subject: [PATCH] Add TODO comment and device log --- cluster4npu_ui/core/functions/Multidongle.py | 25 ++++++++++---------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/cluster4npu_ui/core/functions/Multidongle.py b/cluster4npu_ui/core/functions/Multidongle.py index 5ccd303..e165806 100644 --- a/cluster4npu_ui/core/functions/Multidongle.py +++ b/cluster4npu_ui/core/functions/Multidongle.py @@ -90,6 +90,8 @@ class MultiDongle: print('[Scanning Devices]') device_descriptors = kp.core.scan_devices() + print(device_descriptors) + if not device_descriptors: print(' - No devices found') return [] @@ -175,14 +177,13 @@ class MultiDongle: str: Device series (e.g., 'KL520', 'KL720', etc.) """ try: - # Product ID to device series mapping + # TODO: Check Product ID to device series mapping product_id_mapping = { '0x100': 'KL520', '0x720': 'KL720', '0x630': 'KL630', '0x730': 'KL730', '0x540': 'KL540', - # Add more mappings as needed } # Handle dict format (from JSON) @@ -331,16 +332,16 @@ class MultiDongle: # kp.core.set_timeout(device_group=self.device_group, milliseconds=5000) # print(' - Success') - if self.upload_fw: - try: - print('[Upload Firmware]') - kp.core.load_firmware_from_file(device_group=self.device_group, - scpu_fw_path=self.scpu_fw_path, - ncpu_fw_path=self.ncpu_fw_path) - print(' - Success') - except kp.ApiKPException as exception: - print('Error: upload firmware failed, error = \'{}\''.format(str(exception))) - sys.exit(1) + # if self.upload_fw: + try: + print('[Upload Firmware]') + kp.core.load_firmware_from_file(device_group=self.device_group, + scpu_fw_path=self.scpu_fw_path, + ncpu_fw_path=self.ncpu_fw_path) + print(' - Success') + except kp.ApiKPException as exception: + print('Error: upload firmware failed, error = \'{}\''.format(str(exception))) + sys.exit(1) # upload model to device try: