README
¶
ntrip-client: NTRIP Client Tool
ntrip-client is a command-line tool for connecting to NTRIP (Networked Transport of RTCM via Internet Protocol) casters and streaming GNSS correction data.
Features
- NTRIP 1.0/2.0 Support: Compatible with both NTRIP protocol versions
- TLS/SSL Encryption: Secure connections with TLS support
- Authentication: Username/password authentication
- Automatic Reconnection: Handles connection drops gracefully
- Real-time Streaming: Streams correction data to stdout
- Source Table Support: Can retrieve and display source tables
- Configurable Coordinates: Specify receiver position for better corrections
Installation
From Source
# Clone the repository
git clone https://gitlab.com/earthscope/gnsstools.git
cd gnsstools
# Build the tool
go build -o ntrip-client ./cmd/ntrip-client
# Install globally (optional)
go install ./cmd/ntrip-client
Prerequisites
- Go 1.19 or later
- Git
Usage
Basic Syntax
ntrip-client <command> [options]
Available Commands
connect: Connect to NTRIP caster and stream correction datasrctab: Retrieve and display NTRIP source tableversion: Show version information
Connect Command
ntrip-client connect --host <host:port> --user <username> --pass <password> [options]
Required Options:
--host: NTRIP caster host and port (e.g.,caster.example.com:2101)--user: Username for authentication--pass: Password for authentication
Optional Options:
--mountpoint: Mountpoint name (default:ALIC00AUS0)--tls: Use TLS/SSL encryption--lat: Receiver latitude (default:40.0)--lon: Receiver longitude (default:-105.0)--debug: Enable debug logging
Source Table Command
ntrip-client srctab --host <host:port> --user <username> --pass <password> [options]
Required Options:
--host: NTRIP caster host and port--user: Username for authentication--pass: Password for authentication
Optional Options:
--tls: Use TLS/SSL encryption--debug: Enable debug logging
Examples
Connect to NTRIP Caster
# Basic connection
ntrip-client connect \
--host caster.example.com:2101 \
--user myusername \
--pass mypassword \
--mountpoint MOUNT1
# With TLS encryption
ntrip-client connect \
--host caster.example.com:443 \
--user myusername \
--pass mypassword \
--mountpoint MOUNT1 \
--tls
# With specific coordinates
ntrip-client connect \
--host caster.example.com:2101 \
--user myusername \
--pass mypassword \
--mountpoint MOUNT1 \
--lat 40.123456 \
--lon -105.123456
Get Source Table
# Retrieve source table
ntrip-client srctab \
--host caster.example.com:2101 \
--user myusername \
--pass mypassword
Save Data to File
# Stream data to file
ntrip-client connect \
--host caster.example.com:2101 \
--user myusername \
--pass mypassword \
--mountpoint MOUNT1 > corrections.rtcm3
Debug Mode
# Enable debug logging
ntrip-client connect \
--host caster.example.com:2101 \
--user myusername \
--pass mypassword \
--mountpoint MOUNT1 \
--debug
Output
- Correction Data: RTCM3 messages are streamed to stdout (connect command)
- Source Table: Source table is displayed to stdout (srctab command)
- Logs: Structured JSON logs are written to stderr
Error Handling
The client includes robust error handling:
- Connection Failures: Automatic reconnection with exponential backoff
- Authentication Errors: Clear error messages for invalid credentials
- Network Issues: Graceful handling of network interruptions
- Invalid Mountpoints: Proper error reporting for non-existent mountpoints
Common Use Cases
Real-time GNSS Corrections
# Stream corrections to a GNSS receiver
ntrip-client \
--host caster.example.com:2101 \
--user myusername \
--pass mypassword \
--mountpoint MOUNT1 | \
socat - TCP:gnss-receiver:2101
Data Logging
# Log corrections with timestamp
ntrip-client \
--host caster.example.com:2101 \
--user myusername \
--pass mypassword \
--mountpoint MOUNT1 | \
tee "corrections_$(date +%Y%m%d_%H%M%S).rtcm3"
Testing Connectivity
# Test connection and get source table
ntrip-client srctab \
--host caster.example.com:2101 \
--user myusername \
--pass mypassword
Troubleshooting
Common Issues
"Authentication failed"
- Verify username and password are correct
- Check if the account has access to the specified mountpoint
"Connection refused"
- Verify host and port are correct
- Check if the caster is running and accessible
- Ensure firewall allows the connection
"Mountpoint not found"
- Use
ntrip-client srctabto see available mountpoints - Verify the mountpoint name is correct
"TLS handshake failed"
- Ensure the caster supports TLS on the specified port
- Check if certificates are valid
Debug Mode
Enable debug logging to see detailed connection information:
ntrip-client connect --debug --host ... --user ... --pass ...
Related Tools
- gnss-inspect: Inspect and analyze GNSS data formats
- gnss-convert: Convert GNSS data between formats
- Other NTRIP tools: See the main project README for a complete list
Support
This tool is part of the GNSS Tools project and is licensed under the Apache License, Version 2.0.
For issues and feature requests, please visit the project repository.
Documentation
¶
There is no documentation for this package.
Click to show internal directories.
Click to hide internal directories.