START_HERE.cmd 899 B

12345678910111213141516171819202122232425262728293031
  1. @echo off
  2. setlocal EnableExtensions
  3. chcp 65001 >nul
  4. set PYTHONIOENCODING=utf-8
  5. set PYTHONUTF8=1
  6. cd /d "%~dp0"
  7. if not exist "logs" mkdir "logs"
  8. echo START_HERE %DATE% %TIME%> "logs\install.log"
  9. set "PY="
  10. if exist "%~dp0runtime\python.exe" set "PY=%~dp0runtime\python.exe"
  11. if not defined PY if exist "%~dp0.venv\Scripts\python.exe" set "PY=%~dp0.venv\Scripts\python.exe"
  12. if not defined PY (
  13. echo Missing runtime. Run INSTALL.cmd or use the Windows portable zip.
  14. echo missing runtime>> "logs\install.log"
  15. exit /b 1
  16. )
  17. echo using %PY%>> "logs\install.log"
  18. "%PY%" -m hth_sdk doctor > "logs\self-test.log" 2>&1
  19. if errorlevel 1 (
  20. echo Self-test failed. Open logs\self-test.log
  21. type "logs\self-test.log"
  22. exit /b 1
  23. )
  24. echo Self-test passed.
  25. "%PY%" -m hth_sdk demo
  26. if errorlevel 1 (
  27. echo Demo failed.
  28. exit /b 1
  29. )
  30. echo Done. You read a simulated temperature and sent the first control.
  31. exit /b 0