before cleanup

This commit is contained in:
2026-09-08 16:32:02 +02:00
parent 7c70221723
commit 5642424697
4 changed files with 185 additions and 50 deletions

View File

@@ -10,6 +10,7 @@ import json
from datetime import datetime
import os
import time
import subprocess
# ------------------- Config ----------------------------------------------------------------
@@ -78,6 +79,12 @@ async def ble_scan():
await stop_event.wait()
except Exception as e:
print("Error", e)
try:
subprocess.run(["hciconfig", "hci0", "reset"], check=True)
except Exception as reset_err:
print(f"Reset failed: {reset_err}")
await asyncio.sleep(3)
print("Starting again")
@@ -94,4 +101,4 @@ if __name__ == "__main__":
os.system(f"hciconfig {restart_interface} up")
time.sleep(3)
print("Done")
asyncio.run(main())
asyncio.run(main())