@echo off
REM AutoSense Flash Tool - ESP8266 (NodeMCU v2 / 4MB flash)
REM Requires: Python + esptool (pip install esptool)

set /p COMPORT=Enter the COM port your ESP8266 is connected to (e.g. COM5):

echo.
echo Flashing AutoSense firmware to ESP8266 on %COMPORT% ...
echo.

python -m esptool --chip esp8266 --port %COMPORT% --baud 460800 write_flash -z ^
  --flash_mode dout --flash_freq 40m --flash_size 4MB ^
  0x0 bin\esp8266\firmware.bin ^
  0x300000 bin\esp8266\littlefs.bin

echo.
echo Done. Disconnect and power-cycle the device.
pause
