Files
rpi-tulivision/CHANNEL_CONTROL.md
2025-09-25 18:43:27 +02:00

1.6 KiB

Channel Control Commands

This document describes the command-line tools for controlling the video player service.

Quick Usage

Simple Channel Change

# Change to random channel
./channel

# Change to specific channel
./channel 5

Advanced Control

# Change to random channel
python3 change_channel.py

# Change to specific channel
python3 change_channel.py 5

# Show current channel
python3 change_channel.py --current

# List all available channels
python3 change_channel.py --list

# Stop video player service
python3 change_channel.py --stop

Features

  • Random Channel Selection: If no channel is specified, automatically selects a random channel
  • Service Communication: Communicates with the running video player service via Unix socket
  • Real-time Control: Changes channels instantly without restarting the service
  • Channel Information: Shows current channel and available channels

Requirements

  • Video player service must be running
  • Control socket must be available at /tmp/video_player_control.sock
  • Python virtual environment activated (on server)

Examples

# On the server (tulivision@192.168.1.160)
cd rpi-tulivision
source venv/bin/activate

# Quick random channel change
./channel

# Change to channel 7
./channel 7

# Check what's currently playing
python3 change_channel.py --current

Technical Details

The channel control system uses:

  • Unix domain sockets for inter-process communication
  • JSON-based command protocol
  • Thread-safe command processing
  • Automatic error handling and timeouts