A FastAPI backend that relays live tractor telemetry from a remote WebSocket endpoint to frontend clients.
This service connects to the remote tractor feed, stores the latest telemetry snapshot, exposes HTTP endpoints for status and polling, and accepts frontend WebSocket clients for live updates and command forwarding.
- Real-time tractor connection to
wss://machinely-nonsciatic-hanh.ngrok-free.dev - WebSocket relay endpoint for frontend clients
- HTTP telemetry and status endpoints
- Automatic reconnection logic
- Plain-text server logging
- CORS enabled for local frontend development
cd "c:\Software Development\python-websocket-counter"
python tractor_control_server.pyThe backend listens on http://localhost:8765.
GET /healthGET /api/tractor/statusGET /api/tractor/telemetryPOST /api/tractor/startPOST /api/tractor/stopWS /websocket/tractor
{
"timestamp": "2026-03-25T15:30:45.123456Z",
"gps_position": {
"latitude": -36.5978453,
"longitude": 144.0213898
},
"speed": 18.3,
"heading": 269.4,
"flags": ["MOVING", "ENGAGED"],
"driving": true
}[SERVER]server startup[STARTUP]boot lifecycle[TRACTOR]remote tractor connection events[CLIENT]frontend WebSocket events[BROADCAST]telemetry relay events[HTTP]REST requests[WARNING]warnings[ERROR]failures
- Main backend file:
tractor_control_server.py - Legacy helper files still present:
main.py,application.py,tactor.py - Simulator and demo endpoints have been removed from the active backend
- Default local port:
8765
curl http://localhost:8765/health
curl http://localhost:8765/api/tractor/telemetry