Skip to content

nedu96/python-websocket-counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tractor Telematics Backend

A FastAPI backend that relays live tractor telemetry from a remote WebSocket endpoint to frontend clients.

Overview

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.

Features

  • 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

Run

cd "c:\Software Development\python-websocket-counter"
python tractor_control_server.py

The backend listens on http://localhost:8765.

Main Endpoints

  • GET /health
  • GET /api/tractor/status
  • GET /api/tractor/telemetry
  • POST /api/tractor/start
  • POST /api/tractor/stop
  • WS /websocket/tractor

Telemetry Shape

{
  "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
}

Logging Prefixes

  • [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

Development Notes

  • 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

Quick Checks

curl http://localhost:8765/health
curl http://localhost:8765/api/tractor/telemetry

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages