OpenAstroTech / OATFWGUI

OpenAstroTech FirmWare Graphical User Interface
http://openastrotech.com/
8 stars 0 forks source link

Python exception downloading firmware on Windows #29

Closed julianneswinoga closed 11 months ago

julianneswinoga commented 11 months ago

Seems to happen sometimes when the 'Download' button is hit too fast on startup? The extracted zip goes into OATFW rather than replacing it.

2023-07-23 16:16:20,784:DEBUG:C:\Users\USER\Downloads\OATFWGUI_1.0.1-dev+3e9642_Windows\.python_local\python.exe:State changed: Not running
2023-07-23 16:16:20,784:INFO:platformio refresh ports finished
2023-07-23 16:16:20,785:INFO:Normal exit
2023-07-23 16:16:20,786:DEBUG:LogicState updated: serial_ports [] -> ['COM7']
2023-07-23 16:16:20,786:DEBUG:Cleaning up external process: C:\Users\USER\Downloads\OATFWGUI_1.0.1-dev+3e9642_Windows\.python_local\python.exe. Exited with 0
2023-07-23 16:16:20,788:DEBUG:LogicState updated: upload_port None -> COM7
2023-07-23 16:16:21,059:DEBUG:Creating worker <bound method BusinessLogic.download_and_extract_fw of <gui_logic.BusinessLogic object at 0x0000027D8B7FFC40>>
2023-07-23 16:16:21,061:DEBUG:LogicState updated: release_idx None -> 0
2023-07-23 16:16:21,063:INFO:Downloading OAT FW from: https://github.com/OpenAstroTech/OpenAstroTracker-Firmware/archive/refs/heads/develop.zip
2023-07-23 16:16:21,066:DEBUG:Starting new HTTPS connection (1): github.com:443
2023-07-23 16:16:21,283:DEBUG:https://github.com:443 "GET /OpenAstroTech/OpenAstroTracker-Firmware/archive/refs/heads/develop.zip HTTP/1.1" 302 0
2023-07-23 16:16:21,286:DEBUG:Starting new HTTPS connection (1): codeload.github.com:443
2023-07-23 16:16:21,486:DEBUG:https://codeload.github.com:443 "GET /OpenAstroTech/OpenAstroTracker-Firmware/zip/refs/heads/develop HTTP/1.1" 200 None
2023-07-23 16:16:21,623:INFO:Extracting FW from C:\Users\USER\Downloads\OATFWGUI_1.0.1-dev+3e9642_Windows\OATFW.zip
2023-07-23 16:16:21,721:INFO:Rename C:\Users\USER\Downloads\OATFWGUI_1.0.1-dev+3e9642_Windows\OpenAstroTracker-Firmware-develop to C:\Users\USER\Downloads\OATFWGUI_1.0.1-dev+3e9642_Windows\OATFW
2023-07-23 16:16:21,722:INFO:Removing previously downloaded FW from C:\Users\USER\Downloads\OATFWGUI_1.0.1-dev+3e9642_Windows\OATFW
2023-07-23 16:16:22,048:INFO:Extracted FW to C:\Users\USER\Downloads\OATFWGUI_1.0.1-dev+3e9642_Windows\OATFW
2023-07-23 16:16:22,049:DEBUG:LogicState updated: fw_dir None -> C:\Users\USER\Downloads\OATFWGUI_1.0.1-dev+3e9642_Windows\OATFW
Traceback (most recent call last):
  File "C:\Users\USER\Downloads\OATFWGUI_1.0.1-dev+3e9642_Windows\OATFWGUI\qt_extensions.py", line 39, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\USER\Downloads\OATFWGUI_1.0.1-dev+3e9642_Windows\OATFWGUI\gui_logic.py", line 187, in download_and_extract_fw
    self.logic_state.pio_envs = get_pio_environments(self.logic_state.fw_dir)
  File "C:\Users\USER\Downloads\OATFWGUI_1.0.1-dev+3e9642_Windows\OATFWGUI\gui_logic.py", line 27, in get_pio_environments
    with open(ini_path.resolve(), 'r') as fp:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\USER\\Downloads\\OATFWGUI_1.0.1-dev+3e9642_Windows\\OATFW\\platformio.ini'

Also the traceback isn't logged, which is annoying.