remote control problem
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user