Kowsi KWS-X1 USB-C PD QC Tester Firmware V1.0.5V
- sdefrwggerg
-
Autor témy
- Offline
- Big Poster
-

Enregistré
- Príspevky: 45
- Thanks: 24
Re: Kowsi KWS-X1 USB-C PD QC Tester Firmware V1.0.5V
pred 22 hodinami 29 minútami - pred 22 hodinami 16 minútami
Batch Script for Safe Firmware Flashing (Unofficial)
This batch script automates the firmware flashing process for the KWS-X1 meter while adding manual verification steps to protect against corrupted or tampered firmware files.
What It Does
This is unofficial firmware. Flashing carries risks including permanent device damage. Use at your own risk the author is not responsible for any damage to the meter, chargers, cables, or connected devices. Sink mode can expose the meter's output to the charger's maximum voltage.
Requirements
This batch script automates the firmware flashing process for the KWS-X1 meter while adding manual verification steps to protect against corrupted or tampered firmware files.
What It Does
- Computes SHA-256 hash – Calculates the checksum of your local
file using PowerShell.Code:firmware.X1C
- Manual hash confirmation – Displays the computed hash and asks you to confirm it matches the official release hash. This prevents accidental flashing of corrupted or modified files.
- Dry-run validation – Runs the flasher in offline mode to verify the firmware and flasher setup work before touching the device.
- Bootloader instructions – Provides step-by-step guidance to enter the meter's bootloader mode (BACK + OK while connecting USB).
- Final write operation – Only proceeds to flash the firmware after all previous checks pass and you explicitly confirm.
- Checks that both
andCode:flasherexist before proceeding.Code:firmware
- Validates hash length (64 characters for SHA-256).
- Requires explicit user confirmation at multiple checkpoints.
- Does not write to the device until dry-run validation succeeds.
- Leaves the device in bootloader mode on error for troubleshooting.
This is unofficial firmware. Flashing carries risks including permanent device damage. Use at your own risk the author is not responsible for any damage to the meter, chargers, cables, or connected devices. Sink mode can expose the meter's output to the charger's maximum voltage.
Requirements
- Windows (uses
andCode:cmd)Code:powershell
-
in the same folderCode:flasher
-
in the same folderCode:firmware
- Compare the displayed hash against the official release hash manually
Upozornenie: Informácia, ktorú nemusíte chcieť zobraziť!
@echo off
setlocal enabledelayedexpansion
cd /d "%~dp0"
set "IMAGE=firmware.X1C"
set "FLASHER=flasher.exe"
echo ============================================================
echo Rust Firmware-Flasher - %IMAGE%
echo ============================================================
echo Disclaimer. This is unofficial firmware, provided as is, without warranty of any kind.
echo Flashing it, and using the meter with it, is entirely at your own risk. The author
echo is not responsible for any damage to the meter, to chargers, cables or connected
echo devices, or for any other loss. Sink mode can put up to the charger's highest
echo voltage on the meter's output.
echo.
if not exist "%FLASHER%" (
echo ERROR: %FLASHER% not found.
echo Folder: %CD%
goto :abort
)
if not exist "%IMAGE%" (
echo ERROR: %IMAGE% not found.
echo Folder: %CD%
goto :abort
)
echo [1/4] Computing SHA-256 of the firmware and confirming it
set "HASH="
for /f "usebackq delims=" %%a in (`powershell -NoProfile -Command "(Get-FileHash -LiteralPath '%IMAGE%' -Algorithm SHA256).Hash.ToLower()"`) do set "HASH=%%a"
if not defined HASH (
echo ERROR: Could not compute the hash.
goto :abort
)
set "TAIL=!HASH:~63,1!"
if "!TAIL!"=="" echo WARNING: Value does not have the expected length of 64 characters.
echo Local firmware hash : !HASH!
echo Now compare this value yourself against the independently confirmed hash
echo - release page, signature, or a second machine.
echo.
set /p "CONFIRM=Does the hash match? (y/n): "
if /i not "!CONFIRM!"=="y" (
echo.
echo ERROR: Hash not confirmed - no flashing.
echo Get the firmware again from github.com/kralonur/kws-x1-standalone-rs/releases
goto :abort
)
echo OK - hash confirmed as correct.
echo.
echo [2/4] Offline validation - dry run, no device access
"%FLASHER%" --dry-run --image "%IMAGE%" --confirm-sha256 "!HASH!"
if errorlevel 1 (
echo.
echo ERROR: Validation failed. Aborting.
goto :abort
)
echo Validation successful.
echo.
echo [3/4] Put the device into bootloader mode
echo - Unplug the meter from USB
echo - Hold BACK and OK pressed at the same time
echo - Plug the meter in while holding them
echo - Do NOT connect an output load
echo.
pause
echo Optional mode check - mode 0 means bootloader:
"%FLASHER%" --info
echo.
echo [4/4] Writing the firmware
echo CAUTION: This writes to the device.
set /p "GO=Flash now? (y/n): "
if /i not "!GO!"=="y" (
echo Cancelled. Nothing was written.
goto :end
)
echo.
"%FLASHER%" --image "%IMAGE%" --confirm-sha256 "!HASH!"
if errorlevel 1 (
echo.
echo ERROR while writing or verifying.
echo Leave the device in bootloader mode and investigate the cause.
goto :abort
)
echo.
echo Leave the device connected. The backlight flashes briefly with a blank display,
echo then the meter restarts and the process is complete.
goto :end
:abort
echo.
echo Process aborted.
:end
echo.
pause
endlocal
setlocal enabledelayedexpansion
cd /d "%~dp0"
set "IMAGE=firmware.X1C"
set "FLASHER=flasher.exe"
echo ============================================================
echo Rust Firmware-Flasher - %IMAGE%
echo ============================================================
echo Disclaimer. This is unofficial firmware, provided as is, without warranty of any kind.
echo Flashing it, and using the meter with it, is entirely at your own risk. The author
echo is not responsible for any damage to the meter, to chargers, cables or connected
echo devices, or for any other loss. Sink mode can put up to the charger's highest
echo voltage on the meter's output.
echo.
if not exist "%FLASHER%" (
echo ERROR: %FLASHER% not found.
echo Folder: %CD%
goto :abort
)
if not exist "%IMAGE%" (
echo ERROR: %IMAGE% not found.
echo Folder: %CD%
goto :abort
)
echo [1/4] Computing SHA-256 of the firmware and confirming it
set "HASH="
for /f "usebackq delims=" %%a in (`powershell -NoProfile -Command "(Get-FileHash -LiteralPath '%IMAGE%' -Algorithm SHA256).Hash.ToLower()"`) do set "HASH=%%a"
if not defined HASH (
echo ERROR: Could not compute the hash.
goto :abort
)
set "TAIL=!HASH:~63,1!"
if "!TAIL!"=="" echo WARNING: Value does not have the expected length of 64 characters.
echo Local firmware hash : !HASH!
echo Now compare this value yourself against the independently confirmed hash
echo - release page, signature, or a second machine.
echo.
set /p "CONFIRM=Does the hash match? (y/n): "
if /i not "!CONFIRM!"=="y" (
echo.
echo ERROR: Hash not confirmed - no flashing.
echo Get the firmware again from github.com/kralonur/kws-x1-standalone-rs/releases
goto :abort
)
echo OK - hash confirmed as correct.
echo.
echo [2/4] Offline validation - dry run, no device access
"%FLASHER%" --dry-run --image "%IMAGE%" --confirm-sha256 "!HASH!"
if errorlevel 1 (
echo.
echo ERROR: Validation failed. Aborting.
goto :abort
)
echo Validation successful.
echo.
echo [3/4] Put the device into bootloader mode
echo - Unplug the meter from USB
echo - Hold BACK and OK pressed at the same time
echo - Plug the meter in while holding them
echo - Do NOT connect an output load
echo.
pause
echo Optional mode check - mode 0 means bootloader:
"%FLASHER%" --info
echo.
echo [4/4] Writing the firmware
echo CAUTION: This writes to the device.
set /p "GO=Flash now? (y/n): "
if /i not "!GO!"=="y" (
echo Cancelled. Nothing was written.
goto :end
)
echo.
"%FLASHER%" --image "%IMAGE%" --confirm-sha256 "!HASH!"
if errorlevel 1 (
echo.
echo ERROR while writing or verifying.
echo Leave the device in bootloader mode and investigate the cause.
goto :abort
)
echo.
echo Leave the device connected. The backlight flashes briefly with a blank display,
echo then the meter restarts and the process is complete.
goto :end
:abort
echo.
echo Process aborted.
:end
echo.
pause
endlocal
Posledný krát upravené:pred 22 hodinami 16 minútami sdefrwggerg
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Čas vytvorenia stránky: 0.073 sekúnd

