flash works when not in EXE

This commit is contained in:
Brent Perteet
2025-10-25 11:29:53 -05:00
parent bca2f6ea9c
commit fe69dc6f19
5 changed files with 2942 additions and 57 deletions

View File

@@ -3,14 +3,27 @@
block_cipher = None
import os
import sys
# Hardcode the venv esptool path since PyInstaller might run from different env
esptool_dir = os.path.join(os.path.dirname(SPECPATH), 'venv', 'Lib', 'site-packages', 'esptool')
# Build datas list - include all esptool data files
datas_list = [
('templates', 'templates'),
('static', 'static'),
]
# Add esptool targets directory (includes stub_flasher JSON files)
if os.path.exists(os.path.join(esptool_dir, 'targets')):
datas_list.append((os.path.join(esptool_dir, 'targets'), 'esptool/targets'))
a = Analysis(
['web_flasher.py'],
pathex=[],
binaries=[],
datas=[
('templates', 'templates'),
('static', 'static'),
],
datas=datas_list,
hiddenimports=[
'serial.tools.list_ports',
'flask',
@@ -19,6 +32,10 @@ a = Analysis(
'flask_socketio',
'socketio',
'engineio.async_drivers.threading',
'esptool',
'esptool.cmds',
'esptool.loader',
'esptool.util',
],
hookspath=[],
hooksconfig={},

View File

@@ -298,7 +298,7 @@
<p class="subtitle">Firmware Flasher</p>
</div>
<form id="flashForm">
<form id="flashForm" onsubmit="return false;">
<div class="port-section">
<div class="form-group">
<label for="port">Serial Port</label>
@@ -444,6 +444,8 @@
document.getElementById('flashForm').addEventListener('submit', async (e) => {
e.preventDefault();
e.stopPropagation();
e.stopImmediatePropagation();
const flashBtn = document.getElementById('flashBtn');
const progressBar = document.getElementById('progressBar');