remote control problem

This commit is contained in:
Helva
2026-02-08 13:23:02 +01:00
parent cafae8a71d
commit f75c654a39
5 changed files with 33 additions and 6 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ import serial
from fastapi import FastAPI, WebSocket, WebSocketDisconnect
from fastapi.responses import HTMLResponse
SERIAL_PORT = "/dev/ttyACM0" # ggf. /dev/ttyUSB0
SERIAL_PORT = "/dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0" # ggf. /dev/ttyUSB0
BAUD = 115200
# Safety: if websocket stops sending, we also stop.
@@ -30,7 +30,7 @@ def send_lr(l: int, r: int):
def health():
return {"ok": True, "serial": SERIAL_PORT}
@app.websocket("/ws")
@app.websocket("/drive-ws")
async def ws(websocket: WebSocket):
global last_msg_ts
await websocket.accept()