Welcome to ntrx!
A modern, Python-powered NTRIP caster with a built-in API and WebSocket server for real-time GNSS correction data sharing.
ntrx is a next-generation NTRIP caster written in Python.
It streams GNSS correction data to clients and shares the latest state via a FastAPI-powered HTTP/WebSocket API.
Redis is used as a fast, in-memory message bus to synchronize state between the NTRIP caster and the API server.
- NTRIP Caster: Accepts connections from GNSS base stations (sources) and clients, relaying correction data.
- Redis: Used to store and publish the current state (sources, clients, stats) in real time.
- API Server: FastAPI app exposes
/state(HTTP) and/ws(WebSocket) endpoints for monitoring, integration and even support. - Clients: Can connect via NTRIP, HTTP, or WebSocket to receive data or monitor the system.
Note:
Redis is currently required for state sharing between the caster and API.
(TODO: Make Redis optional in a future release!)
- 🌍 Modern Python (asyncio, FastAPI, Typer CLI)
- 🔄 Real-time state sharing via Redis
- 🛰️ NTRIP Caster: Handles multiple sources and clients
- 📡 API & WebSocket: Live monitoring and integration
- 📝 Configurable via
.envand JSON config - 🪵 Rotating, gzipped logs
- 🧪 Test clients for HTTP and WebSocket endpoints
git clone https://github.com/ndjuric/ntrx.git
cd ntrxpython -m venv venv
source venv/bin/activate
pip install -r requirements.txtCopy and edit the .env file in the project root:
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=your_redis_password
FASTAPI_HOST=0.0.0.0
FASTAPI_PORT=8000Edit storage/ntripcaster.json to set up your sources, tokens, etc.
You can use Docker or your system package manager:
docker-compose uppython -m ntrx ntrip # Start the NTRIP caster server
python -m ntrx api # Start the FastAPI WebSocket API serverpython -m ntrxpython -m ntrx --helpAvailable ntrx subcommands:
ntrip– Run the NTRIP caster serverapi– Run the FastAPI WebSocket API server
GET /state– Get the current caster state (sources, clients, stats)WS /ws– Live state updates via WebSocket
src/ntrx/test_http_api_endpoint.py– Test the HTTP/stateendpointsrc/ntrx/test_ws_streaming.py– Test the WebSocket/wsendpoint
- Make Redis optional (allow direct API/caster communication)
- Add more authentication options - look at more ntrip clients
- Docker Compose setup for entire project (not just redis)
- More test coverage
PRs and issues are welcome!
Please open an issue or submit a pull request if you have suggestions or improvements.
MIT License
Happy streaming! 🛰️