fix: Trying to fix Auto Restart. And Fixed MQTT admin auth
This commit is contained in:
@@ -534,8 +534,18 @@ function StepFlash({ device, onFlashed }) {
|
||||
setFwProgress(100);
|
||||
appendLog("Flash complete. Resetting device…");
|
||||
|
||||
// 5. Hard-reset via RTS — device boots into user code automatically
|
||||
await loaderRef.current.after("hard_reset");
|
||||
// 5. Manual hard-reset via RTS pulse (ESP32: RTS → EN pin)
|
||||
// esptool-js HardReset only calls setRTS(false) which is incomplete.
|
||||
// Full pulse: RTS high (EN=LOW → chip in reset) → wait → RTS low (EN=HIGH → boot)
|
||||
try {
|
||||
const transport = loaderRef.current.transport;
|
||||
await transport.setRTS(true); // pull EN low → enter reset
|
||||
await new Promise((r) => setTimeout(r, 100));
|
||||
await transport.setRTS(false); // release EN → boot into user code
|
||||
await new Promise((r) => setTimeout(r, 100));
|
||||
} catch (rstErr) {
|
||||
appendLog(`[Reset warning: ${rstErr.message}]`);
|
||||
}
|
||||
appendLog("Hard reset sent. Device is booting…");
|
||||
|
||||
// 6. Disconnect the esptool transport so it releases the port lock
|
||||
|
||||
Reference in New Issue
Block a user