description: DVB-S tuning, signal monitoring, LNB control, DiSEqC switching, and transport stream capture.
---
import { Tabs, TabItem, Steps, Aside, Badge } from '@astrojs/starlight/components';
`tune.py` is the primary user-facing tool for operating the SkyWalker-1 as a satellite receiver. It handles the complete signal chain: powering the demodulator, configuring LNB voltage and tone, sending DiSEqC switch commands, tuning to a transponder, monitoring signal quality, and capturing MPEG-2 transport stream data.
```bash
pip install pyusb
```
## Subcommands
| Subcommand | Purpose |
|------------|---------|
| `status` | Show device config, firmware version, and signal info |
| `tune` | Tune to a transponder frequency |
| `stream` | Capture MPEG-2 transport stream data |
| `diseqc` | Send DiSEqC switch commands |
| `lnb` | Control LNB voltage and 22 kHz tone |
Running with no subcommand defaults to `status`.
## Global Options
| Flag | Description |
|------|-------------|
| `-v, --verbose` | Show raw USB control transfer traffic |
Use `--json` for programmatic access to all fields.
---
## tune -- Transponder Tuning
The 8-step tuning sequence: check status, boot demodulator, enable LNB power, set voltage (polarization), set extra voltage, set 22 kHz tone (band), send TUNE_8PSK command, wait for signal lock.
### Required Arguments
| Argument | Description |
|----------|-------------|
| `FREQ` | Transponder downlink frequency in MHz (e.g., `12520`) |
| `SR` | Symbol rate in ksps (e.g., `27500`) |
### Options
| Flag | Description |
|------|-------------|
| `--pol H/V/L/R` | Polarization: H (horizontal/18V), V (vertical/13V), L (left circular/18V), R (right circular/13V) |
| `--band low/high` | LNB band: low (tone off, 9750 MHz LO) or high (tone on, 10600 MHz LO) |
| `--lnb-lo MHZ` | Override LNB local oscillator frequency (default: 9750 low, 10600 high) |
| `--mod TYPE` | Modulation type (default: `qpsk`) |
| `--fec RATE` | FEC rate (default: `auto`) |
| `--timeout SECONDS` | Signal lock timeout (default: `10`) |
| `--extra-volt` | Enable +1V LNB voltage boost for long cables |
The IF frequency is computed as `downlink - LNB_LO`. It must fall within 950--2150 MHz or the tool will warn. If you see negative IF values, your LNB LO is set higher than the downlink frequency -- check your LNB type.
</Aside>
---
## stream -- Transport Stream Capture
Captures MPEG-2 transport stream data from EP2 bulk endpoint after the device is tuned and locked. Requires a prior successful `tune` command (signal must be locked).
| `--stdout` | Write TS data to stdout (for piping) |
| `--duration SECONDS` | Capture duration (default: until Ctrl-C) |
The stream status is written to stderr when using `--stdout`, so it does not contaminate the TS data pipe.
<Aside type="tip">
Capture a short sample and analyze it with [ts_analyze.py](/tools/ts-analyzer/) to verify PIDs, check for continuity errors, and identify the programs in the transport stream.
</Aside>
---
## diseqc -- Switch Commands
Send DiSEqC 1.0 port selection, mini-DiSEqC tone bursts, or raw DiSEqC messages.
The LNB can supply up to 750 mA non-continuous, but sustained loads should stay below 450 mA to avoid overheating the on-board regulator. Use `--extra-volt` only when needed for long cable runs.
</Aside>
---
## Signal Quality Metrics
| Metric | Source | Description |
|--------|--------|-------------|
| **SNR** | `GET_SIGNAL_STRENGTH` (0x87) | Signal-to-noise ratio in dB, read as 16-bit value (dBu * 256 units) |
| **Lock** | `GET_SIGNAL_LOCK` (0x90) | BCM4500 register 0xA4, bit 5 indicates signal lock |
| **Quality %** | Computed | SNR scaled: `snr_raw * 17` maps to 0--100%, saturating at SNR >= `0x0F00` |
For details on the signal monitoring protocol, see [Signal Monitoring](/bcm4500/signal-monitoring/).
## See Also
- [Tuning Protocol](/bcm4500/tuning-protocol/) -- firmware-level TUNE_8PSK command format
- [LNB Control](/lnb-diseqc/lnb-control/) -- hardware-level voltage and tone control
- [TS Analyzer](/tools/ts-analyzer/) -- analyze captured transport streams
- [Vendor Commands](/usb/vendor-commands/) -- complete USB command reference