flash works when not in EXE
This commit is contained in:
@@ -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={},
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user