skyview/README.md

112 lines
3.3 KiB
Markdown
Raw Normal View History

# SkyView - ADS-B Aircraft Tracker
A modern web frontend for dump1090 ADS-B data with real-time aircraft tracking, statistics, and mobile-responsive design.
## Features
- **Real-time Aircraft Tracking**: Live map with aircraft positions and flight paths
- **Interactive Map**: Leaflet-based map with aircraft markers and optional trails
- **Aircraft Table**: Sortable and filterable table view with detailed aircraft information
- **Statistics Dashboard**: Real-time statistics and charts for signal strength, aircraft counts
- **WebSocket Updates**: Real-time data updates without polling
- **Mobile Responsive**: Optimized for desktop, tablet, and mobile devices
- **Single Binary**: Embedded static files for easy deployment
## Configuration
### Environment Variables
- `SKYVIEW_ADDRESS`: Server listen address (default: ":8080")
- `SKYVIEW_PORT`: Server port (default: 8080)
- `DUMP1090_HOST`: dump1090 host address (default: "localhost")
- `DUMP1090_DATA_PORT`: dump1090 SBS-1 data port (default: 30003)
- `ORIGIN_LATITUDE`: Receiver latitude for distance calculations (default: 37.7749)
- `ORIGIN_LONGITUDE`: Receiver longitude for distance calculations (default: -122.4194)
- `ORIGIN_NAME`: Name/description of receiver location (default: "Default Location")
- `SKYVIEW_CONFIG`: Path to JSON configuration file
### Configuration File
SkyView automatically loads `config.json` from the current directory, or you can specify a path with `SKYVIEW_CONFIG`.
Create a `config.json` file (see `config.json.example`):
```json
{
"server": {
"address": ":8080",
"port": 8080
},
"dump1090": {
"host": "192.168.1.100",
"data_port": 30003
}
}
```
### Data Source
SkyView uses **SBS-1/BaseStation format** (Port 30003) which provides decoded aircraft information including:
- Aircraft position (latitude/longitude)
- Altitude, ground speed, vertical rate
- Flight number/callsign
- Squawk code and emergency status
## Building and Running
### Build
```bash
go build -o skyview .
```
### Run
```bash
# Foreground (default) - Press Ctrl+C to stop
DUMP1090_HOST=192.168.1.100 ./skyview
# Daemon mode (background process)
DUMP1090_HOST=192.168.1.100 ./skyview -daemon
# With custom origin location
DUMP1090_HOST=192.168.1.100 ORIGIN_LATITUDE=59.3293 ORIGIN_LONGITUDE=18.0686 ORIGIN_NAME="Stockholm" ./skyview
# Using config file
SKYVIEW_CONFIG=config.json ./skyview
# Default (localhost:30003)
./skyview
```
### Development
```bash
go run main.go
```
## Usage
1. Start your dump1090 instance
2. Configure SkyView to point to your dump1090 host
3. Run SkyView
4. Open your browser to `http://localhost:8080`
## API Endpoints
- `GET /`: Main web interface
- `GET /api/aircraft`: Aircraft data (parsed from dump1090 TCP stream)
- `GET /api/stats`: Statistics data (calculated from aircraft data)
- `GET /ws`: WebSocket endpoint for real-time updates
## Data Sources
SkyView connects to dump1090's **SBS-1/BaseStation format** via TCP port 30003 to receive decoded aircraft data in real-time.
The application maintains an in-memory aircraft database with automatic cleanup of stale aircraft (older than 2 minutes).
## Views
- **Map View**: Interactive map with aircraft positions and trails
- **Table View**: Sortable table with aircraft details and search
- **Stats View**: Dashboard with real-time statistics and charts