docs: перевод документации на русский язык

Полностью переведена вся документация в docs/:

- docs/architecture/overview.md — Архитектура Wyoming Satellite
- docs/settings-cheatsheet.md — Шпаргалка по настройкам (CLI флаги)
- docs/deployment/systemd-services.md — Настройка systemd сервисов
- docs/integration/mqtt-led.md — MQTT LED управление
- docs/integration/vad-wakeword.md — Уже был на русском
- docs/tutorials/2mic-hat.md — Tutorial для 2-MIC HAT
- docs/tutorials/installer.md — Интерактивный установщик
- docs/README.md — Индекс документации

Обновлены корневые файлы:
- README.md — Полностью на русском
- DEPLOY.md — Полностью на русском

Вся документация теперь на русском языке для удобства
русскоязычных пользователей.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
2026-05-19 23:25:34 +03:00
co-authored by Qwen-Coder
parent d38719ad53
commit 61b1532757
10 changed files with 609 additions and 522 deletions
+4
View File
@@ -0,0 +1,4 @@
# Инструкции по генерации файлов
- Всегда пиши файлы README.md, CHANGELOG.md и сопутствующую документацию на русском языке.
- Комментарии в коде также должны быть на русском языке.
- Используй технический, но понятный стиль.
+75 -31
View File
@@ -1,73 +1,117 @@
# Deployment Guide # Руководство по развёртыванию
Quick start guide for deploying Wyoming Satellite. Быстрый старт для развёртывания Wyoming Satellite.
## Quick Start ## Быстрый старт
### 1. Clone and Install ### 1. Клонирование и установка
```bash ```bash
git clone <repository-url> ~/projects/Satellite git clone <repository-url> ~/projects/Satellite
cd ~/projects/Satellite cd ~/projects/Satellite
# Create virtual environment # Создание виртуального окружения
python3 -m venv ~/.venv_satellite python3 -m venv ~/.venv_satellite
source ~/.venv_satellite/bin/activate source ~/.venv_satellite/bin/activate
# Install dependencies # Установка зависимостей
pip install -r requirements.txt pip install -r requirements.txt
``` ```
### 2. Install systemd Services ### 2. Установка systemd сервисов
```bash ```bash
sudo ./install_systemd_services.sh sudo ./install_systemd_services.sh
``` ```
### 3. Start Services ### 3. Запуск сервисов
```bash ```bash
# LED control (optional, requires ReSpeaker) # LED управление (опционально, требуется ReSpeaker)
sudo systemctl enable --now wyoming-event.service sudo systemctl enable --now wyoming-event.service
# Wyoming Satellite # Wyoming Satellite
sudo systemctl enable --now wyoming-satelite-vosk.service sudo systemctl enable --now wyoming-satelite-vosk.service
# Wake word detection (Vosk) # Детекция wake word (Vosk)
sudo systemctl enable --now wyoming-wakeword-vosk.service sudo systemctl enable --now wyoming-wakeword-vosk.service
``` ```
### 4. Verify ### 4. Проверка
```bash ```bash
sudo systemctl status wyoming-satelite-vosk.service sudo systemctl status wyoming-satelite-vosk.service
journalctl -u wyoming-satelite-vosk.service -f journalctl -u wyoming-satelite-vosk.service -f
``` ```
--- В Home Assistant: **Настройки → Устройства и сервисы → Найдено → Wyoming Satellite → Настроить**
## Full Documentation
- [**systemd Services**](deployment/systemd-services.md) — Detailed service configuration
- [**Tutorials**](tutorials/installer.md) — Step-by-step installation guides
--- ---
## Service Overview ## Полная документация
| Service | Port | Description | | Руководство | Описание |
|---------|------|-------------| |-------------|----------|
| `wyoming-satelite-vosk.service` | 10700 | Main Wyoming satellite | | [**systemd сервисы**](docs/deployment/systemd-services.md) | Детальная настройка сервисов |
| `wyoming-wakeword-vosk.service` | 10400 | Vosk wake word detection | | [**Tutorials**](docs/tutorials/) | Пошаговые руководства для разного оборудования |
| `wyoming-event.service` | 10500 | LED control + MQTT events | | [**Архитектура**](docs/architecture/overview.md) | Как работает Wyoming Satellite |
| [**MQTT LED**](docs/integration/mqtt-led.md) | LED управление с Home Assistant |
| [**Настройки**](docs/settings-cheatsheet.md) | Шпаргалка по всем CLI флагам |
## Configuration ### Tutorials
Service files use placeholders that are auto-replaced during installation: - [**2-MIC HAT**](docs/tutorials/2mic-hat.md) — Raspberry Pi + ReSpeaker 2-MIC HAT
- [**Установщик**](docs/tutorials/installer.md) — Руководство по интерактивному установщику
| Placeholder | Description | ---
|-------------|-------------|
| `__SAT_BASE_DIR__` | Path to Satellite repository | ## Требования
| `__SAT_VENV__` | Path to virtual environment |
| `__CURRENT_USER__` | Current username | - **Python 3.9+**
| `__HOME_DIR__` | User home directory | - **Linux** (протестировано на Raspberry Pi OS)
- **Микрофон** (USB или HAT)
- **Опционально:** ReSpeaker XVF3800 USB 4-MIC Array (для LED управления)
---
## Обзор сервисов
| Сервис | Порт | Описание |
|--------|------|----------|
| `wyoming-satelite-vosk.service` | 10700 | Основной Wyoming спутник |
| `wyoming-wakeword-vosk.service` | 10400 | Детекция wake word (Vosk) |
| `wyoming-event.service` | 10500 | LED управление + MQTT события |
---
## Конфигурация
Файлы сервисов используют плейсхолдеры, которые автоматически заменяются при установке:
| Плейсхолдер | Описание |
|-------------|----------|
| `__SAT_BASE_DIR__` | Путь к репозиторию Satellite |
| `__SAT_VENV__` | Путь к виртуальному окружению |
| `__CURRENT_USER__` | Имя текущего пользователя |
| `__HOME_DIR__` | Домашняя директория пользователя |
---
## Wake words (русские)
Отредактируйте `start_satellite.sh`:
```bash
--wake-word-name "привет дроид"
--wake-word-name "привет придурок"
--wake-word-name "привет жопа с ушами"
```
---
## Внешние ресурсы
- [Wyoming Protocol](https://github.com/rhasspy/wyoming)
- [Home Assistant Integration](https://www.home-assistant.io/integrations/wyoming)
- [Vosk](https://alphacephei.com/vosk/)
- [ReSpeaker 4-MIC Array](https://github.com/respeaker/usb_4mic_array)
+52 -51
View File
@@ -1,20 +1,20 @@
# README — VoskWyoming Satellite # README — VoskWyoming Satellite
Remote voice satellite using the [Wyoming protocol](https://github.com/rhasspy/wyoming) for Home Assistant. Удалённый голосовой спутник, использующий [Wyoming protocol](https://github.com/rhasspy/wyoming) для Home Assistant.
[![An open standard from the Open Home Foundation](https://www.openhomefoundation.org/badges/ohf-open-standard.png)](https://www.openhomefoundation.org/) [![An open standard from the Open Home Foundation](https://www.openhomefoundation.org/badges/ohf-open-standard.png)](https://www.openhomefoundation.org/)
## Features ## Возможности
- 🏠 **Home Assistant integration** — Native Wyoming protocol support - 🏠 **Интеграция с Home Assistant** — Нативная поддержка Wyoming протокола
- 🎤 **Local wake word detection** — Vosk-based Russian wake words ("привет дроид", etc.) - 🎤 **Локальная детекция wake word** — Vosk, русские фразы ("привет дроид" и др.)
- 🔇 **Audio enhancements** — WebRTC noise suppression and automatic gain control - 🔇 **Аудио улучшения** — Шумоподавление WebRTC и автоматическое усиление
- 💡 **MQTT LED control** — ReSpeaker XVF3800 4-MIC array support with HA discovery - 💡 **MQTT LED управление** — ReSpeaker XVF3800 4-MIC с авто-обнаружением HA
- 🎯 **Voice Activity Detection** — Silero or WebRTC VAD for privacy-focused operation - 🎯 **Voice Activity Detection** — Silero или WebRTC VAD для приватной работы
## Quick Start ## Быстрый старт
### 1. Install ### 1. Установка
```bash ```bash
git clone <repository-url> ~/projects/Satellite git clone <repository-url> ~/projects/Satellite
@@ -25,73 +25,74 @@ source ~/.venv_satellite/bin/activate
pip install -r requirements.txt pip install -r requirements.txt
``` ```
### 2. Install systemd Services ### 2. Установка systemd сервисов
```bash ```bash
sudo ./install_systemd_services.sh sudo ./install_systemd_services.sh
``` ```
### 3. Start ### 3. Запуск
```bash ```bash
sudo systemctl enable --now wyoming-satelite-vosk.service sudo systemctl enable --now wyoming-satelite-vosk.service
sudo systemctl status wyoming-satelite-vosk.service sudo systemctl status wyoming-satelite-vosk.service
``` ```
In Home Assistant: **Settings → Devices & Services → Discovered → Wyoming Satellite → Configure** В Home Assistant: **Настройки → Устройства и сервисы → Найдено → Wyoming Satellite → Настроить**
--- ---
## Documentation ## Документация
| Guide | Description | | Руководство | Описание |
|-------|-------------| |-------------|----------|
| [**Deployment**](DEPLOY.md) | Full deployment guide with systemd services | | [**Развёртывание**](DEPLOY.md) | Полное руководство по развёртыванию |
| [**Tutorials**](docs/tutorials/) | Step-by-step setup for different hardware | | [**Tutorials**](docs/tutorials/) | Пошаговые руководства для разного оборудования |
| [**Architecture**](docs/architecture/overview.md) | How Wyoming Satellite works | | [**Архитектура**](docs/architecture/overview.md) | Как работает Wyoming Satellite |
| [**MQTT LED**](docs/integration/mqtt-led.md) | LED control with Home Assistant | | [**MQTT LED**](docs/integration/mqtt-led.md) | LED управление с Home Assistant |
| [**VAD Integration**](docs/integration/vad-wakeword.md) | Technical integration guide | | [**VAD/Wake интеграция**](docs/integration/vad-wakeword.md) | Техническое руководство |
| [**Настройки**](docs/settings-cheatsheet.md) | Шпаргалка по CLI флагам |
### Tutorials ### Tutorials
- [**2-MIC HAT**](docs/tutorials/2mic-hat.md) — Raspberry Pi + ReSpeaker 2-MIC HAT - [**2-MIC HAT**](docs/tutorials/2mic-hat.md) — Raspberry Pi + ReSpeaker 2-MIC HAT
- [**Installer**](docs/tutorials/installer.md) — Interactive installer guide - [**Установщик**](docs/tutorials/installer.md) — Интерактивный установщик
--- ---
## Requirements ## Требования
- **Python 3.9+** - **Python 3.9+**
- **Linux** (tested on Raspberry Pi OS) - **Linux** (протестировано на Raspberry Pi OS)
- **Microphone** (USB or HAT) - **Микрофон** (USB или HAT)
- **Optional:** ReSpeaker XVF3800 USB 4-MIC Array (for LED control) - **Опционально:** ReSpeaker XVF3800 USB 4-MIC Array (для LED управления)
--- ---
## Project Structure ## Структура проекта
``` ```
Satellite/ Satellite/
├── wyoming_satellite/ # Main Python package ├── wyoming_satellite/ # Основной Python пакет
├── examples/ # Example scripts (LED, MQTT, configs) ├── examples/ # Примеры скриптов (LED, MQTT, конфиги)
├── services/ # systemd service files ├── services/ # systemd сервис файлы
├── docs/ # Documentation ├── docs/ # Документация
│ ├── tutorials/ # Hardware-specific guides │ ├── tutorials/ # Руководства по оборудованию
│ ├── integration/ # Technical integration guides │ ├── integration/ # Технические руководства
│ ├── deployment/ # Deployment guides │ ├── deployment/ # Руководства по развёртыванию
│ └── architecture/ # Architecture documentation │ └── architecture/ # Документация по архитектуре
├── sounds/ # Audio files (awake.wav, etc.) ├── sounds/ # Аудио файлы (awake.wav и др.)
├── scripts/ # Helper scripts ├── scripts/ # Вспомогательные скрипты
└── tests/ # Unit tests └── tests/ # Юнит тесты
``` ```
--- ---
## Configuration ## Конфигурация
### Wake Words (Russian) ### Wake words (русские)
Edit `start_satellite.sh`: Отредактируйте `start_satellite.sh`:
```bash ```bash
--wake-word-name "привет дроид" --wake-word-name "привет дроид"
@@ -99,14 +100,14 @@ Edit `start_satellite.sh`:
--wake-word-name "привет жопа с ушами" --wake-word-name "привет жопа с ушами"
``` ```
### Audio Settings ### Аудио настройки
```bash ```bash
--mic-noise-suppression 2 --mic-noise-suppression 2
--mic-auto-gain 5 --mic-auto-gain 5
``` ```
### VAD Settings ### VAD настройки
```bash ```bash
--vad --vad
@@ -116,31 +117,31 @@ Edit `start_satellite.sh`:
--- ---
## Development ## Разработка
```bash ```bash
# Linting # Линтинг
pylint wyoming_satellite/ pylint wyoming_satellite/
mypy wyoming_satellite/ mypy wyoming_satellite/
# Tests # Тесты
pytest tests/ pytest tests/
# Format # Форматирование
black wyoming_satellite/ black wyoming_satellite/
isort wyoming_satellite/ isort wyoming_satellite/
``` ```
--- ---
## Video Tutorials ## Видео уроки
- [Wyoming Voice Satellite with ChatGPT](https://www.youtube.com/watch?v=eTKgc0YDCwE) - [Wyoming Voice Satellite с ChatGPT](https://www.youtube.com/watch?v=eTKgc0YDCwE)
- [Local ChatGPT Voice Assistant](https://www.youtube.com/watch?v=pAKqKTkx5X4) - [Локальный голосовой ассистент с ChatGPT](https://www.youtube.com/watch?v=pAKqKTkx5X4)
--- ---
## External Resources ## Внешние ресурсы
- [Wyoming Protocol](https://github.com/rhasspy/wyoming) - [Wyoming Protocol](https://github.com/rhasspy/wyoming)
- [Home Assistant Integration](https://www.home-assistant.io/integrations/wyoming) - [Home Assistant Integration](https://www.home-assistant.io/integrations/wyoming)
@@ -151,6 +152,6 @@ isort wyoming_satellite/
## License ## License
This project is part of the Open Home Foundation ecosystem. Этот проект является частью экосистемы Open Home Foundation.
[![An open standard from the Open Home Foundation](https://www.openhomefoundation.org/badges/ohf-open-standard.png)](https://www.openhomefoundation.org/) [![An open standard from the Open Home Foundation](https://www.openhomefoundation.org/badges/ohf-open-standard.png)](https://www.openhomefoundation.org/)
+23 -22
View File
@@ -1,36 +1,37 @@
# Documentation Index # Документация Wyoming Satellite
## 📖 For Users ## 📖 Для пользователей
| Guide | Description | | Руководство | Описание |
|-------|-------------| |-------------|----------|
| [**Deployment**](../../DEPLOY.md) | Quick start and systemd services | | [**Развёртывание**](../../DEPLOY.md) | Быстрый старт и systemd сервисы |
| [**2-MIC HAT**](tutorials/2mic-hat.md) | Raspberry Pi + ReSpeaker 2-MIC HAT | | [**2-MIC HAT**](tutorials/2mic-hat.md) | Raspberry Pi + ReSpeaker 2-MIC HAT |
| [**Installer**](tutorials/installer.md) | Interactive installer guide | | [**Установщик**](tutorials/installer.md) | Интерактивный установщик |
## 🔧 For Developers ## 🔧 Для разработчиков
| Document | Description | | Документ | Описание |
|----------|-------------| |----------|----------|
| [**Settings Cheat Sheet**](settings-cheatsheet.md) | All CLI flags and options | | [**Шпаргалка по настройкам**](settings-cheatsheet.md) | Все CLI флаги и опции |
| [**Architecture**](architecture/overview.md) | How Wyoming Satellite works | | [**Архитектура**](architecture/overview.md) | Как работает Wyoming Satellite |
| [**VAD/Wake Integration**](integration/vad-wakeword.md) | Technical integration guide | | [**Интеграция VAD/Wake**](integration/vad-wakeword.md) | Техническое руководство по интеграции |
| [**MQTT LED Control**](integration/mqtt-led.md) | LED control with Home Assistant | | [**MQTT LED управление**](integration/mqtt-led.md) | LED управление с Home Assistant |
| [**systemd Services**](deployment/systemd-services.md) | Service configuration details | | [**systemd сервисы**](deployment/systemd-services.md) | Детали настройки сервисов |
## 📁 Structure ## 📁 Структура
``` ```
docs/ docs/
├── README.md # This file ├── README.md # Этот файл
├── settings-cheatsheet.md # Шпаргалка по настройкам
├── tutorials/ ├── tutorials/
│ ├── 2mic-hat.md # 2-MIC HAT setup │ ├── 2mic-hat.md # 2-MIC HAT настройка
│ └── installer.md # Interactive installer │ └── installer.md # Интерактивный установщик
├── integration/ ├── integration/
│ ├── vad-wakeword.md # VAD/Wake technical guide │ ├── vad-wakeword.md # Техническая интеграция VAD/Wake
│ └── mqtt-led.md # LED/MQTT integration │ └── mqtt-led.md # LED/MQTT интеграция
├── deployment/ ├── deployment/
│ └── systemd-services.md # systemd configuration │ └── systemd-services.md # systemd конфигурация
└── architecture/ └── architecture/
└── overview.md # High-level architecture └── overview.md # Обзор архитектуры
``` ```
+66 -58
View File
@@ -1,16 +1,16 @@
# Architecture Overview # Архитектура Wyoming Satellite
High-level architecture of Wyoming Satellite. Обзор архитектуры Wyoming Satellite.
## Core Components ## Основные компоненты
``` ```
┌─────────────────────────────────────────────────────────────┐ ┌─────────────────────────────────────────────────────────────┐
│ Home Assistant │ │ Home Assistant │
│ (Wyoming Integration) │ │ (Wyoming интеграция) │
└──────────────────────┬──────────────────────────────────────┘ └──────────────────────┬──────────────────────────────────────┘
│ Wyoming Protocol (TCP) │ Wyoming Protocol (TCP)
│ Port 10700 │ Порт 10700
┌──────────────────────▼──────────────────────────────────────┐ ┌──────────────────────▼──────────────────────────────────────┐
│ Wyoming Satellite │ │ Wyoming Satellite │
│ ┌─────────────────────────────────────────────────────┐ │ │ ┌─────────────────────────────────────────────────────┐ │
@@ -32,102 +32,102 @@ High-level architecture of Wyoming Satellite.
│ Audio In │ Audio Out │ Audio In │ Audio Out
│ (arecord) │ (aplay) │ (arecord) │ (aplay)
┌──────────▼──────┐ ┌────────▼──────────┐ ┌──────────▼──────┐ ┌────────▼──────────┐
│ Microphone │ │ Speaker │ │ Микрофон │ │ Динамик │
│ USB/HAT │ │ USB/HAT │ │ USB/HAT │ │ USB/HAT │
└─────────────────┘ └───────────────────┘ └─────────────────┘ └───────────────────┘
┌─────────────────────────────────────────────────────────────┐ ┌─────────────────────────────────────────────────────────────┐
│ Local Services (Optional) │ │ Локальные сервисы (опционально) │
├─────────────────────────────────────────────────────────────┤ ├─────────────────────────────────────────────────────────────┤
│ ┌─────────────────────┐ ┌─────────────────────┐ │ │ ┌─────────────────────┐ ┌─────────────────────┐ │
│ │ Wake Word Service │ │ Event Service │ │ │ │ Wake Word Service │ │ Event Service │ │
│ │ (Vosk, port 10400) │ │ (MQTT, port 10500) │ │ │ │ (Vosk, порт 10400) │ │ (MQTT, порт 10500) │ │
│ └─────────────────────┘ └─────────────────────┘ │ │ └─────────────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────────────────┘ └─────────────────────────────────────────────────────────────┘
``` ```
## Satellite Modes ## Режимы работы спутника
### AlwaysStreamingSatellite ### AlwaysStreamingSatellite
Continuously streams audio to Home Assistant. Постоянно передаёт аудио в Home Assistant.
- **Pros:** Lowest latency, simplest - **Преимущества:** Минимальная задержка, простота
- **Cons:** Highest bandwidth, no local processing - **Недостатки:** Высокий трафик, нет локальной обработки
- **Use case:** Fast LAN, no privacy concerns - **Применение:** Быстрая LAN, нет требований к приватности
### VadStreamingSatellite ### VadStreamingSatellite
Uses Voice Activity Detection to start streaming only when speech is detected. Использует Voice Activity Detection для начала стриминга только при обнаружении речи.
- **VAD Systems:** - **VAD системы:**
- **Silero:** Neural network-based, more accurate - **Silero:** Нейросетевой, более точный
- **WebRTC:** Lightweight, faster - **WebRTC:** Лёгкий, быстрый
- **Features:** - **Возможности:**
- Pre-roll buffer (sends audio before VAD trigger) - Пре-буфер (отправляет аудио до триггера VAD)
- Wake word timeout (wait for wake word after VAD) - Таймаут wake word (ожидание фразы после VAD)
- **Use case:** Privacy-focused, bandwidth-constrained - **Применение:** Приватность, ограничение трафика
### WakeStreamingSatellite ### WakeStreamingSatellite
Uses local wake word detection before streaming. Использует локальную детекцию wake word перед стримингом.
- **Wake Word Systems:** - **Системы wake word:**
- **Vosk:** Grammar-based (Russian phrases) - **Vosk:** Грамматика (русские фразы)
- **openWakeWord:** Neural network - **openWakeWord:** Нейросеть
- **Porcupine:** Commercial KWS - **Porcupine:** Коммерческий KWS
- **Flow:** - **Поток:**
1. Continuously listen for wake word 1. Постоянное прослушивание wake word
2. On detection → start streaming to HA 2. При обнаружении → стриминг в HA
3. Process command → stop streaming 3. Обработка команды → остановка стриминга
- **Use case:** Full local wake word, "Hey Google" style - **Применение:** Полная локальная активация, стиль "Hey Google"
## Audio Pipeline ## Аудио пайплайн
``` ```
Microphone Микрофон
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Audio Capture │ arecord -r 16000 -c 1 -f S16_LE │ Захват аудио │ arecord -r 16000 -c 1 -f S16_LE
└────────┬────────┘ └────────┬────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Pre-processing │ Volume, AGC, Noise Suppression │ Предобработка │ Громкость, AGC, шумоподавление
└────────┬────────┘ └────────┬────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ VAD / Wake │ Decision: stream or not? │ VAD / Wake │ Решение: стримить или нет?
└────────┬────────┘ └────────┬────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Wyoming Protocol│ Encode to Wyoming messages │ Wyoming Protocol│ Кодирование в Wyoming сообщения
└────────┬────────┘ └────────┬────────┘
│ │
▼ ▼
Home Assistant Home Assistant
``` ```
## Key Files ## Основные файлы
| File | Purpose | | Файл | Назначение |
|------|---------| |------|------------|
| `wyoming_satellite/__main__.py` | CLI entry point, argument parsing | | `wyoming_satellite/__main__.py` | CLI entry point, парсинг аргументов |
| `wyoming_satellite/satellite.py` | Satellite implementations | | `wyoming_satellite/satellite.py` | Реализации спутников |
| `wyoming_satellite/settings.py` | Settings dataclasses | | `wyoming_satellite/settings.py` | Dataclass настроек |
| `wyoming_satellite/event_handler.py` | Wyoming event handling | | `wyoming_satellite/event_handler.py` | Обработка Wyoming событий |
| `wyoming_satellite/vad.py` | VAD implementations (Silero, WebRTC) | | `wyoming_satellite/vad.py` | VAD реализации (Silero, WebRTC) |
| `wyoming_satellite/webrtc.py` | WebRTC audio processing | | `wyoming_satellite/webrtc.py` | WebRTC обработка аудио |
## Configuration ## Конфигурация
Main configuration via CLI arguments (see `__main__.py`): Основная конфигурация через CLI аргументы (см. `__main__.py`):
```bash ```bash
# Microphone # Микрофон
--mic-command 'arecord -r 16000 -c 1 -f S16_LE -t raw' --mic-command 'arecord -r 16000 -c 1 -f S16_LE -t raw'
--mic-noise-suppression 2 --mic-noise-suppression 2
--mic-auto-gain 5 --mic-auto-gain 5
@@ -141,28 +141,28 @@ Main configuration via CLI arguments (see `__main__.py`):
--vad-system webrtc --vad-system webrtc
--vad-threshold 0.5 --vad-threshold 0.5
# Events (LED, MQTT) # События (LED, MQTT)
--event-uri tcp://127.0.0.1:10500 --event-uri tcp://127.0.0.1:10500
``` ```
## State Machine ## Машина состояний
``` ```
┌──────────────┐ ┌──────────────┐
│ Stopped │ │ Остановка │
└──────┬───────┘ └──────┬───────┘
│ Start │ Старт
▼ ▼
┌──────────────┐ ┌──────────────┐
┌────────│ Listening │────────┐ ┌────────│ Прослушивание│────────┐
│ └──────┬───────┘ │ │ └──────┬───────┘ │
│ │ │ │ │ │
VAD trigger Wake detection Streaming VAD триггер Wake детекция Стриминг
│ │ │ │ │ │
▼ ▼ ▼ ▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ VAD │ │ Wake │ │Streaming │ │ VAD │ │ Wake │ │Стриминг │
│ Active │ │ Active │ │ Audio │ │ Активен │ │ Активен │ │ Аудио │
└────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘
│ │ │ │ │ │
└───────────────┴───────────────┘ └───────────────┴───────────────┘
@@ -170,6 +170,14 @@ Main configuration via CLI arguments (see `__main__.py`):
AudioStop AudioStop
▼ ▼
┌──────────────┐ ┌──────────────┐
│ Listening │ │ Прослушивание│
└──────────────┘ └──────────────┘
``` ```
---
## 🔗 Связанное
- [Настройки (cheat sheet)](settings-cheatsheet.md)
- [Руководство по развёртыванию](../../DEPLOY.md)
- [Интеграция VAD/Wake](integration/vad-wakeword.md)
+69 -62
View File
@@ -1,140 +1,147 @@
# systemd Services Configuration # Настройка systemd сервисов
Detailed guide for configuring and managing Wyoming Satellite systemd services. Подробное руководство по настройке и управлению systemd сервисами Wyoming Satellite.
## Service Files Location ## Расположение файлов сервисов
Service files are in the `services/` directory: Файлы сервисов находятся в директории `services/`:
``` ```
services/ services/
├── wyoming-event.service # LED control + MQTT ├── wyoming-event.service # LED управление + MQTT
├── wyoming-satelite-vosk.service # Main satellite ├── wyoming-satelite-vosk.service # Основной спутник
└── wyoming-wakeword-vosk.service # Wake word detection └── wyoming-wakeword-vosk.service # Детекция wake word
``` ```
## Installation Script ## Скрипт установки
The `install_systemd_services.sh` script automatically: Скрипт `install_systemd_services.sh` автоматически:
1. Detects your virtual environment path 1. Определяет путь к виртуальному окружению
2. Determines the current user 2. Определяет текущего пользователя
3. Substitutes placeholders in service files 3. Подставляет плейсхолдеры в файлы сервисов
4. Copies services to `/etc/systemd/system/` 4. Копирует сервисы в `/etc/systemd/system/`
5. Installs the `satellite-python` wrapper to `/usr/local/bin/` 5. Устанавливает wrapper `satellite-python` в `/usr/local/bin/`
### Manual Installation ### Ручная установка
If the script doesn't work, install manually: Если скрипт не работает, установите вручную:
```bash ```bash
# 1. Edit service files, replacing placeholders: # 1. Отредактируйте файлы сервисов, заменив плейсхолдеры:
# __SAT_BASE_DIR__ → /home/sirmrak/projects/Satellite # __SAT_BASE_DIR__ → /home/sirmrak/projects/Satellite
# __SAT_VENV__ → /home/sirmrak/.venv_satellite # __SAT_VENV__ → /home/sirmrak/.venv_satellite
# __CURRENT_USER__ → sirmrak # __CURRENT_USER__ → sirmrak
# 2. Copy to systemd directory # 2. Скопируйте в директорию systemd
sudo cp services/*.service /etc/systemd/system/ sudo cp services/*.service /etc/systemd/system/
# 3. Reload systemd # 3. Перезагрузите systemd
sudo systemctl daemon-reload sudo systemctl daemon-reload
# 4. Enable and start # 4. Включите и запустите
sudo systemctl enable --now wyoming-satelite-vosk.service sudo systemctl enable --now wyoming-satelite-vosk.service
``` ```
## Service Details ## Детали сервисов
### wyoming-satelite-vosk.service ### wyoming-satelite-vosk.service
Main Wyoming satellite service. Connects to: Основной сервис Wyoming Satellite. Подключается к:
- Microphone (arecord) - Микрофону (arecord)
- Speaker (aplay) - Динамику (aplay)
- Wake word service (optional, port 10400) - Сервису wake word (опционально, порт 10400)
- Event service (optional, port 10500) - Сервису событий (опционально, порт 10500)
**Ports:** 10700 (Wyoming protocol) **Порты:** 10700 (Wyoming protocol)
**Dependencies:** network.target **Зависимости:** network.target
### wyoming-wakeword-vosk.service ### wyoming-wakeword-vosk.service
Vosk-based wake word detection service. Listens for Russian wake words: Сервис детекции wake word на основе Vosk. Слушает русские фразы:
- "привет дроид" - "привет дроид"
- "привет придурок" - "привет придурок"
- "привет жопа с ушами" - "привет жопа с ушами"
**Ports:** 10400 (Wyoming protocol) **Порты:** 10400 (Wyoming protocol)
**Configuration:** `local/vosk-wake-dev/wyoming_vosk_wake/config.yaml` **Конфигурация:** `local/vosk-wake-dev/wyoming_vosk_wake/config.yaml`
### wyoming-event.service ### wyoming-event.service
LED control and MQTT integration for ReSpeaker XVF3800. LED управление и MQTT интеграция для ReSpeaker XVF3800.
**Ports:** 10500 (Wyoming event protocol) **Порты:** 10500 (Wyoming event protocol)
**MQTT Topics:** **MQTT топики:**
- `wyoming/led/command` — Commands from Home Assistant - `wyoming/led/command` — Команды от Home Assistant
- `wyoming/led/brightness/set` — Set brightness (0-255) - `wyoming/led/brightness/set` — Установка яркости (0-255)
- `wyoming/led/brightness/state` — Current brightness state - `wyoming/led/brightness/state` — Текущая яркость
- `wyoming/led/state` — LED state - `wyoming/led/state` — Состояние LED
- `wyoming/led/availability` — Online/offline status - `wyoming/led/availability` — Статус онлайн/офлайн
## Management Commands ## Команды управления
```bash ```bash
# Check status # Проверка статуса
sudo systemctl status wyoming-satelite-vosk.service sudo systemctl status wyoming-satelite-vosk.service
# View logs (real-time) # Просмотр логов (реальное время)
journalctl -u wyoming-satelite-vosk.service -f journalctl -u wyoming-satelite-vosk.service -f
# Restart service # Перезапуск сервиса
sudo systemctl restart wyoming-satelite-vosk.service sudo systemctl restart wyoming-satelite-vosk.service
# Disable service # Отключение сервиса
sudo systemctl disable --now wyoming-satelite-vosk.service sudo systemctl disable --now wyoming-satelite-vosk.service
# Reload systemd after changes # Перезагрузка systemd после изменений
sudo systemctl daemon-reload sudo systemctl daemon-reload
``` ```
## Troubleshooting ## Диагностика
### Service won't start ### Сервис не запускается
```bash ```bash
# Check status and recent errors # Проверка статуса и последних ошибок
sudo systemctl status wyoming-satelite-vosk.service sudo systemctl status wyoming-satelite-vosk.service
# View full logs # Просмотр полных логов
journalctl -u wyoming-satelite-vosk.service -n 100 journalctl -u wyoming-satelite-vosk.service -n 100
# Check Python path # Проверка пути к Python
which satellite-python which satellite-python
satellite-python --version satellite-python --version
``` ```
### Common Issues ### Частые проблемы
| Issue | Solution | | Проблема | Решение |
|-------|----------| |----------|---------|
| `ModuleNotFoundError` | Check venv path in service file | | `ModuleNotFoundError` | Проверьте путь к venv в файле сервиса |
| `arecord: command not found` | Install `alsa-utils` | | `arecord: command not found` | Установите `alsa-utils` |
| Permission denied | Check `User=` directive matches your username | | Permission denied | Проверьте директиву `User=` |
| Port already in use | Check if another instance is running | | Порт уже используется | Проверьте, не запущен ли другой экземпляр |
## Wrapper Script ## Wrapper скрипт
The `satellite-python` wrapper allows running Python from venv without full path: Wrapper `satellite-python` позволяет запускать Python из venv без указания полного пути:
```bash ```bash
# Installed to /usr/local/bin/satellite-python # Установлен в /usr/local/bin/satellite-python
satellite-python --version # Uses venv Python satellite-python --version # Использует Python из venv
``` ```
Used in service files: Используется в файлах сервисов:
```ini ```ini
ExecStart=satellite-python -m wyoming_satellite ... ExecStart=satellite-python -m wyoming_satellite ...
``` ```
---
## 🔗 Связанное
- [Руководство по развёртыванию](../../DEPLOY.md)
- [MQTT LED интеграция](integration/mqtt-led.md)
+77 -70
View File
@@ -1,35 +1,35 @@
# MQTT LED Control # MQTT LED Управление
Integration guide for ReSpeaker LED control via MQTT and Home Assistant. Руководство по интеграции LED управления ReSpeaker через MQTT и Home Assistant.
## Overview ## Обзор
The LED service (`examples/wyoming-led.py`) provides: LED сервис (`examples/wyoming-led.py`) предоставляет:
- **Light entity** — Control LED brightness and color - **Light сущность** — Управление яркостью и цветом LED
- **Sensor entity** — Satellite state (idle, listening, speaking) - **Sensor сущность** — Состояние спутника (ожидание, слушание, говорение)
- **Number entities** — 7 sliders for fine-grained control - **Number сущности** — 7 слайдеров для точной настройки
- **MQTT Discovery** — Auto-configuration in Home Assistant - **MQTT Discovery** — Авто-конфигурация в Home Assistant
## Architecture ## Архитектура
``` ```
┌──────────────────┐ MQTT ┌──────────────────┐ ┌──────────────────┐ MQTT ┌──────────────────┐
│ Home Assistant │◄─────────────►│ wyoming-led.py │ │ Home Assistant │◄─────────────►│ wyoming-led.py │
│ │ │ (port 10501) │ │ │ │ (порт 10501) │
└──────────────────┘ └────────┬─────────┘ └──────────────────┘ └────────┬─────────┘
│ │
│ Wyoming Events │ Wyoming Events
│ (port 10500) │ (порт 10500)
┌────────▼─────────┐ ┌────────▼─────────┐
│ Satellite │ │ Satellite │
│ (port 10700) │ │ (порт 10700) │
└──────────────────┘ └──────────────────┘
``` ```
## Installation ## Установка
### 1. Install Dependencies ### 1. Установка зависимостей
```bash ```bash
cd ~/projects/Satellite cd ~/projects/Satellite
@@ -37,18 +37,18 @@ source ~/.venv_satellite/bin/activate
pip install paho-mqtt pip install paho-mqtt
``` ```
### 2. Configure MQTT Settings ### 2. Настройка MQTT
Edit `examples/wyoming-led.py`: Отредактируйте `examples/wyoming-led.py`:
```python ```python
MQTT_BROKER = "192.168.200.100" # Your MQTT broker MQTT_BROKER = "192.168.200.100" # Ваш MQTT брокер
MQTT_PORT = 1883 MQTT_PORT = 1883
MQTT_USER = "mqtt" MQTT_USER = "mqtt"
MQTT_PASS = "mqtt" MQTT_PASS = "mqtt"
``` ```
### 3. Create systemd Service ### 3. Создание systemd сервиса
```bash ```bash
sudo nano /etc/systemd/system/wyoming-led.service sudo nano /etc/systemd/system/wyoming-led.service
@@ -56,7 +56,7 @@ sudo nano /etc/systemd/system/wyoming-led.service
```ini ```ini
[Unit] [Unit]
Description=Wyoming LED Service with MQTT Description=Wyoming LED Service с MQTT
After=network.target mosquitto.service After=network.target mosquitto.service
[Service] [Service]
@@ -71,46 +71,46 @@ Restart=always
WantedBy=multi-user.target WantedBy=multi-user.target
``` ```
### 4. Enable Service ### 4. Включение сервиса
```bash ```bash
sudo systemctl daemon-reload sudo systemctl daemon-reload
sudo systemctl enable --now wyoming-led.service sudo systemctl enable --now wyoming-led.service
``` ```
## MQTT Topics ## MQTT топики
| Topic | Direction | Description | | Топик | Направление | Описание |
|-------|-----------|-------------| |-------|-------------|----------|
| `wyoming/led/command` | HA → Script | Light commands (on/off, color, brightness) | | `wyoming/led/command` | HA → Скрипт | Команды света (вкл/выкл, цвет, яркость) |
| `wyoming/led/brightness/set` | HA → Script | Set brightness (0-255) | | `wyoming/led/brightness/set` | HA → Скрипт | Установка яркости (0-255) |
| `wyoming/led/brightness/state` | Script → HA | Current brightness | | `wyoming/led/brightness/state` | Скрипт → HA | Текущая яркость |
| `wyoming/led/state` | Script → HA | LED state (on/off) | | `wyoming/led/state` | Скрипт → HA | Состояние LED (вкл/выкл) |
| `wyoming/led/availability` | Script → HA | Online/offline | | `wyoming/led/availability` | Скрипт → HA | Онлайн/офлайн статус |
| `wyoming/satellite/state` | Script → HA | Satellite state | | `wyoming/satellite/state` | Скрипт → HA | Состояние спутника |
## Home Assistant Entities ## Сущности Home Assistant
After discovery, you'll see: После discovery вы увидите:
- **Light:** `light.wyoming_led` — RGB control - **Light:** `light.wyoming_led` — RGB управление
- **Sensor:** `sensor.wyoming_satellite_state` — Current state - **Sensor:** `sensor.wyoming_satellite_state` — Текущее состояние
- **Number:** `number.wyoming_led_brightness` — Brightness slider - **Number:** `number.wyoming_led_brightness` — Слайдер яркости
- **Number:** `number.wyoming_led_red/green/blue` — Color sliders - **Number:** `number.wyoming_led_red/green/blue` — Слайдеры цвета
- **Number:** `number.wyoming_led_idle/listening/speaking` — State colors - **Number:** `number.wyoming_led_idle/listening/speaking` — Цвета состояний
## LED States ## Состояния LED
| State | Color | Behavior | | Состояние | Цвет | Поведение |
|-------|-------|----------| |-----------|------|-----------|
| Idle | Blue (dim) | Breathing effect | | Ожидание (Idle) | Синий (тусклый) | Дыхательный эффект |
| Listening | Cyan | Solid | | Слушание (Listening) | Голубой | Постоянный |
| Speaking | Green | Solid | | Говорение (Speaking) | Зелёный | Постоянный |
| Error | Red | Blinking | | Ошибка (Error) | Красный | Мигание |
## Brightness Configuration ## Настройка яркости
LED brightness is stored in `examples/led_brightness_config.json`: Яркость LED хранится в `examples/led_brightness_config.json`:
```json ```json
{ {
@@ -121,55 +121,62 @@ LED brightness is stored in `examples/led_brightness_config.json`:
} }
``` ```
This file is auto-created and should be excluded from git tracking: Этот файл создаётся автоматически и должен быть исключён из git tracking:
```bash ```bash
git update-index --assume-unchanged examples/led_brightness_config.json git update-index --assume-unchanged examples/led_brightness_config.json
``` ```
## Troubleshooting ## Диагностика
### LEDs not responding ### LED не реагирует
```bash ```bash
# Check service status # Проверка статуса сервиса
sudo systemctl status wyoming-led.service sudo systemctl status wyoming-led.service
# View logs # Просмотр логов
journalctl -u wyoming-led.service -f journalctl -u wyoming-led.service -f
# Test manually # Тест вручную
python3 examples/wyoming-led.py --debug python3 examples/wyoming-led.py --debug
``` ```
### MQTT connection failed ### MQTT подключение не удалось
- Verify broker is running: `sudo systemctl status mosquitto` - Проверьте, что брокер запущен: `sudo systemctl status mosquitto`
- Check credentials in `wyoming-led.py` - Проверьте учётные данные в `wyoming-led.py`
- Test connection: `mosquitto_sub -t 'wyoming/led/#' -v` - Тест подключения: `mosquitto_sub -t 'wyoming/led/#' -v`
### ReSpeaker not detected ### ReSpeaker не обнаружен
```bash ```bash
# Check USB devices # Проверка USB устройств
lsusb | grep -i respeaker lsusb | grep -i respeaker
# Test xvf_host.py # Тест xvf_host.py
python3 examples/xvf_host.py --help python3 examples/xvf_host.py --help
``` ```
## Hardware Support ## Поддерживаемое оборудование
| Device | Support | Notes | | Устройство | Поддержка | Примечания |
|--------|---------|-------| |------------|-----------|------------|
| ReSpeaker XVF3800 (USB 4-MIC) | ✅ Full | Recommended | | ReSpeaker XVF3800 (USB 4-MIC) | ✅ Полная | Рекомендуется |
| ReSpeaker 2-MIC HAT | ✅ Full | Requires GPIO | | ReSpeaker 2-MIC HAT | ✅ Полная | Требуется GPIO |
| ReSpeaker 4-MIC HAT | ✅ Full | Requires GPIO | | ReSpeaker 4-MIC HAT | ✅ Полная | Требуется GPIO |
| Generic USB mic | ⚠️ Partial | No LED control | | Обычный USB микрофон | ⚠️ Частичная | Без LED управления |
## Related Files ## Связанные файлы
- `examples/wyoming-led.py` — Main LED control script - `examples/wyoming-led.py` — Основной скрипт LED управления
- `examples/xvf_host.py` — ReSpeaker XVF3800 driver - `examples/xvf_host.py` — Драйвер ReSpeaker XVF3800
- `examples/led_brightness_config.json` — Brightness settings - `examples/led_brightness_config.json` — Настройки яркости
- `services/wyoming-event.service` — Event service (alternative) - `services/wyoming-event.service` — Сервис событий (альтернатива)
---
## 🔗 Связанное
- [Руководство по развёртыванию](../../DEPLOY.md)
- [Настройка systemd сервисов](deployment/systemd-services.md)
+104 -104
View File
@@ -1,27 +1,27 @@
# Wyoming Satellite — Settings Cheat Sheet # Wyoming Satellite — Шпаргалка по настройкам
Quick reference for all CLI flags and settings. Быстрый справочник всех CLI флагов и настроек.
--- ---
## 🎤 Microphone (`--mic-*`) ## 🎤 Микрофон (`--mic-*`)
| Flag | Default | Description | | Флаг | По умолчанию | Описание |
|------|---------|-------------| |------|--------------|----------|
| `--mic-uri` | — | Wyoming microphone service URI (`tcp://ip:port`) | | `--mic-uri` | — | Wyoming microphone сервис URI (`tcp://ip:port`) |
| `--mic-command` | — | Command for microphone input (`arecord ...`) | | `--mic-command` | — | Команда для записи с микрофона (`arecord ...`) |
| `--mic-command-rate` | 16000 | Sample rate (Hz) | | `--mic-command-rate` | 16000 | Частота дискретизации (Гц) |
| `--mic-command-width` | 2 | Sample width (bytes) | | `--mic-command-width` | 2 | Разрядность (байт) |
| `--mic-command-channels` | 1 | Channels (1=mono) | | `--mic-command-channels` | 1 | Каналы (1=моно) |
| `--mic-command-samples-per-chunk` | 1024 | Samples per read | | `--mic-command-samples-per-chunk` | 1024 | Сэмплов за чтение |
| `--mic-volume-multiplier` | 1.0 | Volume multiplier | | `--mic-volume-multiplier` | 1.0 | Множитель громкости |
| `--mic-noise-suppression` | 0 | Noise suppression (0-4) | | `--mic-noise-suppression` | 0 | Шумоподавление (0-4) |
| `--mic-auto-gain` | 0 | Auto gain (0-31 dbFS) | | `--mic-auto-gain` | 0 | Автоусиление (0-31 dbFS) |
| `--mic-channel-index` | None | Channel index to use | | `--mic-channel-index` | None | Индекс канала |
| `--mic-seconds-to-mute-after-awake-wav` | 0.5 | Mute after awake WAV | | `--mic-seconds-to-mute-after-awake-wav` | 0.5 | Глушить после awake WAV |
| `--mic-no-mute-during-awake-wav` | false | Don't mute during awake WAV | | `--mic-no-mute-during-awake-wav` | false | Не глушить во время awake WAV |
**Example:** **Пример:**
```bash ```bash
--mic-command 'arecord -D plughw:CARD=Array,DEV=0 -r 16000 -c 1 -f S16_LE -t raw' \ --mic-command 'arecord -D plughw:CARD=Array,DEV=0 -r 16000 -c 1 -f S16_LE -t raw' \
--mic-noise-suppression 2 \ --mic-noise-suppression 2 \
@@ -30,20 +30,20 @@ Quick reference for all CLI flags and settings.
--- ---
## 🔊 Sound Output (`--snd-*`) ## 🔊 Звук (`--snd-*`)
| Flag | Default | Description | | Флаг | По умолчанию | Описание |
|------|---------|-------------| |------|--------------|----------|
| `--snd-uri` | — | Wyoming sound service URI | | `--snd-uri` | — | Wyoming sound сервис URI |
| `--snd-command` | — | Command for sound output (`aplay ...`) | | `--snd-command` | — | Команда для вывода звука (`aplay ...`) |
| `--snd-command-rate` | 22050 | Sample rate (Hz) | | `--snd-command-rate` | 22050 | Частота дискретизации (Гц) |
| `--snd-command-width` | 2 | Sample width (bytes) | | `--snd-command-width` | 2 | Разрядность (байт) |
| `--snd-command-channels` | 1 | Channels | | `--snd-command-channels` | 1 | Каналы |
| `--snd-volume-multiplier` | 1.0 | Volume multiplier | | `--snd-volume-multiplier` | 1.0 | Множитель громкости |
| `--awake-wav` | — | WAV played after wake word | | `--awake-wav` | — | WAV после wake word |
| `--done-wav` | — | WAV played after command | | `--done-wav` | — | WAV после команды |
**Example:** **Пример:**
```bash ```bash
--snd-command 'aplay -D plughw:CARD=Array,DEV=0 -r 22050 -c 1 -f S16_LE -t raw' \ --snd-command 'aplay -D plughw:CARD=Array,DEV=0 -r 22050 -c 1 -f S16_LE -t raw' \
--awake-wav /home/sirmrak/projects/Satellite/sounds/awake.wav --awake-wav /home/sirmrak/projects/Satellite/sounds/awake.wav
@@ -53,14 +53,14 @@ Quick reference for all CLI flags and settings.
## 🎯 Wake Word (`--wake-*`) ## 🎯 Wake Word (`--wake-*`)
| Flag | Default | Description | | Флаг | По умолчанию | Описание |
|------|---------|-------------| |------|--------------|----------|
| `--wake-uri` | — | Wyoming wake word service URI | | `--wake-uri` | — | Wyoming wake word сервис URI |
| `--wake-command` | — | Local wake word command | | `--wake-command` | — | Локальная команда wake word |
| `--wake-word-name` | — | Wake word phrase (can be repeated) | | `--wake-word-name` | — | Фраза wake word (можно повторять) |
| `--wake-refractory-seconds` | 5.0 | Delay between detections | | `--wake-refractory-seconds` | 5.0 | Задержка между детекциями |
**Example:** **Пример:**
```bash ```bash
--wake-uri tcp://127.0.0.1:10400 \ --wake-uri tcp://127.0.0.1:10400 \
--wake-word-name "привет дроид" \ --wake-word-name "привет дроид" \
@@ -71,17 +71,17 @@ Quick reference for all CLI flags and settings.
## 🎤 Voice Activity Detection (`--vad*`) ## 🎤 Voice Activity Detection (`--vad*`)
| Flag | Default | Description | | Флаг | По умолчанию | Описание |
|------|---------|-------------| |------|--------------|----------|
| `--vad` | false | Enable VAD | | `--vad` | false | Включить VAD |
| `--vad-system` | silero | `silero` or `webrtc` | | `--vad-system` | silero | `silero` или `webrtc` |
| `--vad-threshold` | 0.5 | Threshold (0-1) | | `--vad-threshold` | 0.5 | Порог (0-1) |
| `--vad-trigger-level` | 1 | Chunks to activate | | `--vad-trigger-level` | 1 | Чанков для активации |
| `--vad-energy-threshold` | None | Energy for webrtc (int16) | | `--vad-energy-threshold` | None | Энергия для webrtc (int16) |
| `--vad-buffer-seconds` | 2.0 | Pre-roll buffer (seconds) | | `--vad-buffer-seconds` | 2.0 | Пре-буфер (секунды) |
| `--vad-wake-word-timeout` | 5.0 | Wake word timeout | | `--vad-wake-word-timeout` | 5.0 | Таймаут wake word |
**Example:** **Пример:**
```bash ```bash
--vad \ --vad \
--vad-system webrtc \ --vad-system webrtc \
@@ -94,26 +94,26 @@ Quick reference for all CLI flags and settings.
## 📡 Event Service (`--event-uri`, `--*-command`) ## 📡 Event Service (`--event-uri`, `--*-command`)
| Flag | Event | | Флаг | Событие |
|------|-------| |------|---------|
| `--event-uri` | Wyoming event service URI | | `--event-uri` | Wyoming event сервис URI |
| `--startup-command` | Satellite started | | `--startup-command` | Спутник запущен |
| `--streaming-start-command` | Streaming started | | `--streaming-start-command` | Стриминг начался |
| `--streaming-stop-command` | Streaming stopped | | `--streaming-stop-command` | Стриминг остановлен |
| `--detect-command` | Wake detection started | | `--detect-command` | Начало детекции wake |
| `--detection-command` | Wake word detected | | `--detection-command` | Wake word обнаружен |
| `--tts-played-command` | Audio played | | `--tts-played-command` | Аудио воспроизведено |
| `--transcript-command` | STT transcript | | `--transcript-command` | STT текст |
| `--stt-start-command` | STT started | | `--stt-start-command` | STT начался |
| `--stt-stop-command` | STT stopped | | `--stt-stop-command` | STT завершён |
| `--synthesize-command` | TTS text received | | `--synthesize-command` | TTS текст получен |
| `--tts-start-command` | TTS started | | `--tts-start-command` | TTS начался |
| `--tts-stop-command` | TTS stopped | | `--tts-stop-command` | TTS завершён |
| `--error-command` | Error occurred | | `--error-command` | Ошибка |
| `--connected-command` | Connected to server | | `--connected-command` | Подключен к серверу |
| `--disconnected-command` | Disconnected from server | | `--disconnected-command` | Отключен от сервера |
**Example:** **Пример:**
```bash ```bash
--event-uri tcp://127.0.0.1:10500 \ --event-uri tcp://127.0.0.1:10500 \
--detection-command 'examples/commands/detection.sh' \ --detection-command 'examples/commands/detection.sh' \
@@ -123,18 +123,18 @@ Quick reference for all CLI flags and settings.
--- ---
## ⏱️ Timers (`--timer-*`) ## ⏱️ Таймеры (`--timer-*`)
| Flag | Default | Description | | Флаг | По умолчанию | Описание |
|------|---------|-------------| |------|--------------|----------|
| `--timer-started-command` | — | Timer started | | `--timer-started-command` | — | Таймер запущен |
| `--timer-updated-command` | — | Timer paused/resumed/changed | | `--timer-updated-command` | — | Таймер изменён/пауза/возобновление |
| `--timer-cancelled-command` | — | Timer cancelled | | `--timer-cancelled-command` | — | Таймер отменён |
| `--timer-finished-command` | — | Timer finished | | `--timer-finished-command` | — | Таймер завершён |
| `--timer-finished-wav` | — | WAV file to play | | `--timer-finished-wav` | — | WAV файл для воспроизведения |
| `--timer-finished-wav-repeat` | `1 0` | `<plays> <delay_seconds>` | | `--timer-finished-wav-repeat` | `1 0` | `<повторы> <задержка_сек>` |
**Example:** **Пример:**
```bash ```bash
--timer-finished-wav /path/to/timer.wav \ --timer-finished-wav /path/to/timer.wav \
--timer-finished-wav-repeat 3 1.0 --timer-finished-wav-repeat 3 1.0
@@ -142,32 +142,32 @@ Quick reference for all CLI flags and settings.
--- ---
## 🛰️ Satellite (`--uri`, `--name`, `--area`) ## 🛰️ Спутник (`--uri`, `--name`, `--area`)
| Flag | Default | Description | | Флаг | По умолчанию | Описание |
|------|---------|-------------| |------|--------------|----------|
| `--uri` | **required** | Satellite URI (`tcp://0.0.0.0:10700`) | | `--uri` | **требуется** | URI спутника (`tcp://0.0.0.0:10700`) |
| `--name` | Wyoming Satellite | Satellite name | | `--name` | Wyoming Satellite | Имя спутника |
| `--area` | — | Area name (for Home Assistant) | | `--area` | — | Имя зоны (для Home Assistant) |
--- ---
## 🔧 Debug & Discovery (`--debug*`, `--zeroconf*`) ## 🔧 Отладка и обнаружение (`--debug*`, `--zeroconf*`)
| Flag | Default | Description | | Флаг | По умолчанию | Описание |
|------|---------|-------------| |------|--------------|----------|
| `--debug` | false | Enable DEBUG logging | | `--debug` | false | DEBUG логирование |
| `--debug-recording-dir` | None | Directory for audio recording | | `--debug-recording-dir` | None | Папка для записи аудио |
| `--no-zeroconf` | false | Disable Zeroconf discovery | | `--no-zeroconf` | false | Отключить Zeroconf |
| `--zeroconf-name` | MAC address | Name for Zeroconf | | `--zeroconf-name` | MAC address | Имя для Zeroconf |
| `--zeroconf-host` | Auto | Host for Zeroconf | | `--zeroconf-host` | Авто | Хост для Zeroconf |
| `--log-format` | BASIC | Log format string | | `--log-format` | BASIC | Формат логов |
--- ---
## 📊 Operating Modes ## 📊 Режимы работы
### Mode 1: Always Streaming (no VAD, no wake) ### Режим 1: Always Streaming (без VAD, без wake)
```bash ```bash
python3 -m wyoming_satellite \ python3 -m wyoming_satellite \
@@ -177,11 +177,11 @@ python3 -m wyoming_satellite \
--snd-command 'aplay -r 22050 -c 1 -f S16_LE -t raw' --snd-command 'aplay -r 22050 -c 1 -f S16_LE -t raw'
``` ```
**Use case:** Lowest latency, always streaming to HA. **Применение:** Минимальная задержка, постоянный стриминг в HA.
--- ---
### Mode 2: VAD Streaming (stream after speech detected) ### Режим 2: VAD Streaming (стрим после обнаружения речи)
```bash ```bash
python3 -m wyoming_satellite \ python3 -m wyoming_satellite \
@@ -195,11 +195,11 @@ python3 -m wyoming_satellite \
--vad-energy-threshold 200 --vad-energy-threshold 200
``` ```
**Use case:** Privacy-focused, stream only when speaking. **Применение:** Приватность, стрим только при разговоре.
--- ---
### Mode 3: Wake Streaming (local wake word detection) ### Режим 3: Wake Streaming (локальная детекция wake word)
```bash ```bash
python3 -m wyoming_satellite \ python3 -m wyoming_satellite \
@@ -212,11 +212,11 @@ python3 -m wyoming_satellite \
--wake-word-name "привет придурок" --wake-word-name "привет придурок"
``` ```
**Use case:** "Hey Google" style, full local wake word. **Применение:** Стиль "Hey Google", полная локальная активация.
--- ---
### Mode 4: With Event Service (LED, MQTT, notifications) ### Режим 4: С Event Service (LED, MQTT, уведомления)
```bash ```bash
python3 -m wyoming_satellite \ python3 -m wyoming_satellite \
@@ -231,12 +231,12 @@ python3 -m wyoming_satellite \
--transcript-command 'examples/commands/transcript.sh' --transcript-command 'examples/commands/transcript.sh'
``` ```
**Use case:** Full integration with LED, MQTT, external scripts. **Применение:** Полная интеграция с LED, MQTT, внешними скриптами.
--- ---
## 🔗 Related ## 🔗 Связанное
- [Architecture Overview](architecture/overview.md) - [Архитектура](architecture/overview.md)
- [Deployment Guide](../../DEPLOY.md) - [Руководство по развёртыванию](../../DEPLOY.md)
- [MQTT LED Integration](integration/mqtt-led.md) - [MQTT LED интеграция](integration/mqtt-led.md)
+102 -94
View File
@@ -1,24 +1,24 @@
# 2-MIC HAT Tutorial # 2-MIC HAT Tutorial
Create a voice satellite using a [Raspberry Pi Zero 2 W](https://www.raspberrypi.com/products/raspberry-pi-zero-2-w/) and a [ReSpeaker 2Mic HAT](https://wiki.keyestudio.com/Ks0314_keyestudio_ReSpeaker_2-Mic_Pi_HAT_V1.0). Создание голосового спутника на [Raspberry Pi Zero 2 W](https://www.raspberrypi.com/products/raspberry-pi-zero-2-w/) и [ReSpeaker 2Mic HAT](https://wiki.keyestudio.com/Ks0314_keyestudio_ReSpeaker_2-Mic_Pi_HAT_V1.0).
**Prerequisites:** See [Deployment Guide](../../DEPLOY.md) for base installation. **Предварительные требования:** См. [Руководство по развёртыванию](../../DEPLOY.md) для базовой установки.
## Install OS ## Установка ОС
Follow instructions to [install Raspberry Pi OS](https://www.raspberrypi.com/software/). Under "Choose OS", pick "Raspberry Pi OS (other)" and "Raspberry Pi OS (**64-bit**) Lite". Следуйте инструкциям по [установке Raspberry Pi OS](https://www.raspberrypi.com/software/). В разделе "Choose OS" выберите "Raspberry Pi OS (other)" и "Raspberry Pi OS (**64-bit**) Lite".
When asking if you'd like to apply customization settings, choose "Edit Settings" and: Когда спросят о применении настроек кастомизации, выберите "Edit Settings" и:
* Set a username/password * Установите имя пользователя/пароль
* Configure the wireless LAN * Настройте беспроводную LAN
* Under the Services tab, enable SSH and use password authentication * На вкладке Services включите SSH и используйте аутентификацию по паролю
## Install Software ## Установка ПО
After flashing and booting the satellite, connect to it over SSH using the username/password you configured during flashing. После прошивки и загрузки спутника, подключитесь к нему по SSH, используя имя пользователя/пароль, настроенные при прошивке.
**On the satellite**, make sure system dependencies are installed: **На спутнике**, убедитесь, что системные зависимости установлены:
```sh ```sh
sudo apt-get update sudo apt-get update
@@ -27,26 +27,26 @@ sudo apt-get install --no-install-recommends \
python3-venv python3-venv
``` ```
Clone the `wyoming-satellite` repository: Склонируйте репозиторий `wyoming-satellite`:
```sh ```sh
git clone https://github.com/rhasspy/wyoming-satellite.git git clone https://github.com/rhasspy/wyoming-satellite.git
``` ```
If you have the ReSpeaker 2Mic or 4Mic HAT, recompile and install the drivers (this will take really long time): Если у вас ReSpeaker 2Mic или 4Mic HAT, перекомпилируйте и установите драйверы (это займёт много времени):
```sh ```sh
cd wyoming-satellite/ cd wyoming-satellite/
sudo bash etc/install-respeaker-drivers.sh sudo bash etc/install-respeaker-drivers.sh
``` ```
After install the drivers, you must reboot the satellite: После установки драйверов необходимо перезагрузить спутник:
```sh ```sh
sudo reboot sudo reboot
``` ```
Once the satellite has rebooted, reconnect over SSH and continue the installation: После перезагрузки подключитесь снова по SSH и продолжите установку:
```sh ```sh
cd wyoming-satellite/ cd wyoming-satellite/
@@ -58,23 +58,23 @@ python3 -m venv .venv
-e '.[all]' -e '.[all]'
``` ```
If the installation was successful, you should be able to run: Если установка прошла успешно, вы сможете запустить:
```sh ```sh
script/run --help script/run --help
``` ```
## Determine Audio Devices ## Определение аудиоустройств
Picking the correct microphone/speaker devices is critical for the satellite to work. We'll do a test recording and playback in this section. Правильный выбор устройств микрофона/динамика критически важен для работы спутника. В этом разделе мы сделаем тестовую запись и воспроизведение.
List your available microphones with: Список доступных микрофонов:
```sh ```sh
arecord -L arecord -L
``` ```
If you have the ReSpeaker 2Mic HAT, you should see: Если у вас ReSpeaker 2Mic HAT, вы увидите:
``` ```
plughw:CARD=seeed2micvoicec,DEV=0 plughw:CARD=seeed2micvoicec,DEV=0
@@ -82,23 +82,23 @@ plughw:CARD=seeed2micvoicec,DEV=0
Hardware device with all software conversions Hardware device with all software conversions
``` ```
For other microphones, prefer ones that start with `plughw:` or just use `default` if you don't know what to use. Для других микрофонов предпочитайте устройства, начинающиеся с `plughw:` или используйте `default`, если не знаете, что выбрать.
Record a 5 second sample from your chosen microphone: Запишите 5-секундный образец с выбранного микрофона:
```sh ```sh
arecord -D plughw:CARD=seeed2micvoicec,DEV=0 -r 16000 -c 1 -f S16_LE -t wav -d 5 test.wav arecord -D plughw:CARD=seeed2micvoicec,DEV=0 -r 16000 -c 1 -f S16_LE -t wav -d 5 test.wav
``` ```
Say something while `arecord` is running. If you get errors, try a different microphone device by changing `-D <device>`. Скажите что-нибудь во время работы `arecord`. Если получили ошибки, попробуйте другое устройство микрофона, изменив `-D <device>`.
List your available speakers with: Список доступных динамиков:
```sh ```sh
aplay -L aplay -L
``` ```
If you have the ReSpeaker 2Mic HAT, you should see: Если у вас ReSpeaker 2Mic HAT, вы увидите:
``` ```
plughw:CARD=seeed2micvoicec,DEV=0 plughw:CARD=seeed2micvoicec,DEV=0
@@ -106,21 +106,21 @@ plughw:CARD=seeed2micvoicec,DEV=0
Hardware device with all software conversions Hardware device with all software conversions
``` ```
For other speakers, prefer ones that start with `plughw:` or just use `default` if you don't know what to use. Для других динамиков предпочитайте устройства, начинающиеся с `plughw:` или используйте `default`, если не знаете, что выбрать.
Play back your recorded sample WAV: Воспроизведите записанный образец WAV:
```sh ```sh
aplay -D plughw:CARD=seeed2micvoicec,DEV=0 test.wav aplay -D plughw:CARD=seeed2micvoicec,DEV=0 test.wav
``` ```
You should hear your recorded sample. If there are problems, try a different speaker device by changing `-D <device>`. Вы должны услышать записанный образец. Если есть проблемы, попробуйте другое устройство динамика, изменив `-D <device>`.
Make note of your microphone and speaker devices for the next step. Запомните устройства микрофона и динамика для следующего шага.
## Running the Satellite ## Запуск спутника
In the `wyoming-satellite` directory, run: В директории `wyoming-satellite` выполните:
```sh ```sh
script/run \ script/run \
@@ -131,22 +131,23 @@ script/run \
--snd-command 'aplay -D plughw:CARD=seeed2micvoicec,DEV=0 -r 22050 -c 1 -f S16_LE -t raw' --snd-command 'aplay -D plughw:CARD=seeed2micvoicec,DEV=0 -r 22050 -c 1 -f S16_LE -t raw'
``` ```
Change the `-D <device>` for `arecord` and `aplay` to match the audio devices from the previous section. Измените `-D <device>` для `arecord` и `aplay` в соответствии с аудиоустройствами из предыдущего раздела.
You can set `--name <NAME>` to whatever you want, but it should stay the same every time you run the satellite.
In Home Assistant, check the "Devices & services" section in Settings. After some time, you should see your satellite show up as "Discovered" (Wyoming Protocol). Click the "Configure" button and "Submit". Choose the area that your satellite is located, and click "Finish". Вы можете установить `--name <NAME>` на любое значение, но оно должно оставаться одинаковым при каждом запуске спутника.
Your satellite should say "Streaming audio", and you can use the wake word of your preferred pipeline. В Home Assistant проверьте раздел "Devices & services" в настройках. Через некоторое время вы увидите ваш спутник как "Discovered" (Wyoming Protocol). Нажмите кнопку "Configure" и "Submit". Выберите зону, где расположен ваш спутник, и нажмите "Finish".
## Create Services Ваш спутник должен сказать "Streaming audio", и вы можете использовать wake word предпочитаемого пайплайна.
You can run wyoming-satellite as a systemd service by first creating a service file: ## Создание сервисов
``` sh Вы можете запустить wyoming-satellite как systemd сервис, создав файл сервиса:
```sh
sudo systemctl edit --force --full wyoming-satellite.service sudo systemctl edit --force --full wyoming-satellite.service
``` ```
Paste in the following template, and change both `/home/pi` and the `script/run` arguments to match your set up: Вставьте следующий шаблон и измените `/home/pi` и аргументы `script/run` в соответствии с вашей настройкой:
```text ```text
[Unit] [Unit]
@@ -165,45 +166,45 @@ RestartSec=1
WantedBy=default.target WantedBy=default.target
``` ```
Save the file and exit your editor. Next, enable the service to start at boot and run it: Сохраните файл и выйдите из редактора. Далее включите сервис для автозагрузки и запустите:
``` sh ```sh
sudo systemctl enable --now wyoming-satellite.service sudo systemctl enable --now wyoming-satellite.service
``` ```
(you may need to hit CTRL+C to get back to a shell prompt) (возможно, вам придётся нажать CTRL+C, чтобы вернуться к командной оболочке)
With the service running, you can view logs in real-time with: После запуска сервиса вы можете просматривать логи в реальном времени:
``` sh ```sh
journalctl -u wyoming-satellite.service -f journalctl -u wyoming-satellite.service -f
``` ```
If needed, disable and stop the service with: При необходимости отключите и остановите сервис:
``` sh ```sh
sudo systemctl disable --now wyoming-satellite.service sudo systemctl disable --now wyoming-satellite.service
``` ```
## Audio Enhancements ## Аудио улучшения
You can run the satellite with automatic gain control and noise suppression: Вы можете запустить спутник с автоматическим усилением и шумоподавлением:
``` sh ```sh
script/run \ script/run \
... \ ... \
--mic-auto-gain 5 \ --mic-auto-gain 5 \
--mic-noise-suppression 2 --mic-noise-suppression 2
``` ```
Automatic gain control is between 0-31 dbFS, which 31 being the loudest. Автоматическое усиление от 0 до 31 dbFS, где 31 — самое громкое.
Noise suppression is from 0-4, with 4 being maximum suppression (may cause audio distortion). Шумоподавление от 0 до 4, где 4 — максимальное подавление (может вызывать искажения аудио).
You can also use `--mic-volume-multiplier X` to multiply all audio samples by `X`. For example, using 2 for `X` will double the microphone volume (but may cause audio distortion). The corresponding `--snd-volume-multiplier` does the same for audio playback. Вы также можете использовать `--mic-volume-multiplier X` для умножения всех аудиосэмплов на `X`. Например, использование 2 для `X` удвоит громкость микрофона (но может вызвать искажения). Соответствующий `--snd-volume-multiplier` делает то же самое для воспроизведения аудио.
## Local Wake Word Detection ## Локальная детекция Wake Word
Install the necessary system dependencies: Установите необходимые системные зависимости:
```sh ```sh
sudo apt-get update sudo apt-get update
@@ -211,7 +212,7 @@ sudo apt-get install --no-install-recommends \
libopenblas-dev libopenblas-dev
``` ```
From your home directory, install the openWakeWord Wyoming service: Из домашней директории установите Wyoming сервис openWakeWord:
```sh ```sh
git clone https://github.com/rhasspy/wyoming-openwakeword.git git clone https://github.com/rhasspy/wyoming-openwakeword.git
@@ -219,13 +220,13 @@ cd wyoming-openwakeword
script/setup script/setup
``` ```
Create a systemd service for it: Создайте systemd сервис для него:
``` sh ```sh
sudo systemctl edit --force --full wyoming-openwakeword.service sudo systemctl edit --force --full wyoming-openwakeword.service
``` ```
Paste in the following template, and change both `/home/pi` and the `script/run` arguments to match your set up: Вставьте следующий шаблон и измените `/home/pi` и аргументы `script/run` в соответствии с вашей настройкой:
```text ```text
[Unit] [Unit]
@@ -242,15 +243,15 @@ RestartSec=1
WantedBy=default.target WantedBy=default.target
``` ```
Save the file and exit your editor. Сохраните файл и выйдите из редактора.
You can now update your satellite service: Теперь вы можете обновить сервис спутника:
``` sh ```sh
sudo systemctl edit --force --full wyoming-satellite.service sudo systemctl edit --force --full wyoming-satellite.service
``` ```
Update just the parts below: Обновите только следующие части:
```text ```text
[Unit] [Unit]
@@ -266,34 +267,34 @@ ExecStart=/home/pi/wyoming-satellite/script/run ... --wake-uri 'tcp://127.0.0.1:
... ...
``` ```
Reload and restart the satellite service: Перезагрузите и перезапустите сервис спутника:
``` sh ```sh
sudo systemctl daemon-reload sudo systemctl daemon-reload
sudo systemctl restart wyoming-satellite.service sudo systemctl restart wyoming-satellite.service
``` ```
You should see the wake service get automatically loaded: Вы должны увидеть, что сервис wake загрузился автоматически:
``` sh ```sh
sudo systemctl status wyoming-satellite.service wyoming-openwakeword.service sudo systemctl status wyoming-satellite.service wyoming-openwakeword.service
``` ```
They should all be "active (running)" and green. Все они должны быть "active (running)" и зелёные.
Test out your satellite by saying "ok, nabu" and a voice command. Use `journalctl` to check the logs of services for errors: Протестируйте спутник, сказав "ok, nabu" и голосовую команду. Используйте `journalctl` для проверки логов сервисов на наличие ошибок:
``` sh ```sh
journalctl -u wyoming-openwakeword.service -f journalctl -u wyoming-openwakeword.service -f
``` ```
Make sure to run `sudo systemctl daemon-reload` every time you make changes to the service. Убедитесь, что запускаете `sudo systemctl daemon-reload` каждый раз при внесении изменений в сервис.
## LED Service ## LED сервис
Example event services for the ReSpeaker 2Mic and 4Mic HATs are included in `wyoming-satellite/examples` that will change the LED color depending on the satellite state. The example below is for the 2Mic HAT, using `2mic_service.py`. If you're using the 4Mic HAT, use `4mic_service.py` instead as the LEDs and GPIO pins are slightly different. Примеры сервисов событий для ReSpeaker 2Mic и 4Mic HAT включены в `wyoming-satellite/examples`, они изменяют цвет LED в зависимости от состояния спутника. Пример ниже для 2Mic HAT с использованием `2mic_service.py`. Если вы используете 4Mic HAT, используйте `4mic_service.py`, так как светодиоды и GPIO пины немного отличаются.
Install it from your home directory: Установите его из домашней директории:
```sh ```sh
cd wyoming-satellite/examples cd wyoming-satellite/examples
@@ -303,32 +304,31 @@ python3 -m venv --system-site-packages .venv
.venv/bin/pip3 install 'wyoming==1.5.2' .venv/bin/pip3 install 'wyoming==1.5.2'
``` ```
In case you use a ReSpeaker USB 4mic array v2.0, additionally install pixel-ring: Если вы используете ReSpeaker USB 4mic array v2.0, дополнительно установите pixel-ring:
```sh ```sh
.venv/bin/pip3 install 'pixel-ring' .venv/bin/pip3 install 'pixel-ring'
``` ```
Аргумент `--system-site-packages` используется для доступа к предустановленным пакетам `gpiozero` и `spidev`. Если они **ещё не установлены** в вашей системе, выполните:
The `--system-site-packages` argument is used to access the pre-installed `gpiozero` and `spidev` Python packages. If these are **not already installed** in your system, run:
```sh ```sh
sudo apt-get install python3-spidev python3-gpiozero sudo apt-get install python3-spidev python3-gpiozero
``` ```
Test the service with: Протестируйте сервис:
```sh ```sh
.venv/bin/python3 2mic_service.py --help .venv/bin/python3 2mic_service.py --help
``` ```
Create a systemd service for it: Создайте systemd сервис:
``` sh ```sh
sudo systemctl edit --force --full 2mic_leds.service sudo systemctl edit --force --full 2mic_leds.service
``` ```
Paste in the following template, and change both `/home/pi` and the `script/run` arguments to match your set up: Вставьте следующий шаблон и измените `/home/pi` и аргументы `script/run` в соответствии с вашей настройкой:
```text ```text
[Unit] [Unit]
@@ -345,15 +345,15 @@ RestartSec=1
WantedBy=default.target WantedBy=default.target
``` ```
Save the file and exit your editor. Сохраните файл и выйдите из редактора.
You can now update your satellite service: Теперь вы можете обновить сервис спутника:
``` sh ```sh
sudo systemctl edit --force --full wyoming-satellite.service sudo systemctl edit --force --full wyoming-satellite.service
``` ```
Update just the parts below: Обновите только следующие части:
```text ```text
[Unit] [Unit]
@@ -369,28 +369,36 @@ ExecStart=/home/pi/wyoming-satellite/script/run ... --event-uri 'tcp://127.0.0.1
... ...
``` ```
Reload and restart the satellite service: Перезагрузите и перезапустите сервис спутника:
``` sh ```sh
sudo systemctl daemon-reload sudo systemctl daemon-reload
sudo systemctl restart wyoming-satellite.service sudo systemctl restart wyoming-satellite.service
``` ```
You should see the service get automatically loaded: Вы должны увидеть, что сервис загрузился автоматически:
``` sh ```sh
sudo systemctl status wyoming-satellite.service 2mic_leds.service sudo systemctl status wyoming-satellite.service 2mic_leds.service
``` ```
They should all be "active (running)" and green. Все они должны быть "active (running)" и зелёные.
Try a voice command and see if the LEDs change. Use `journalctl` to check the logs of services for errors: Попробуйте голосовую команду и посмотрите, реагируют ли светодиоды. Используйте `journalctl` для проверки логов сервисов на наличие ошибок:
``` sh ```sh
journalctl -u 2mic_leds.service -f journalctl -u 2mic_leds.service -f
``` ```
If you encounter any issues, you can add the `--debug` argument to the command line to increase the log level. Если возникли проблемы, добавьте аргумент `--debug` в командную строку для увеличения уровня логирования.
To control the brightness of the LEDS, use the `--led-brightness ` argument, which accepts integer numbers from 1 to 31.
Make sure to run `sudo systemctl daemon-reload` every time you make changes to the service. Для управления яркостью светодиодов используйте аргумент `--led-brightness`, который принимает целые числа от 1 до 31.
Убедитесь, что запускаете `sudo systemctl daemon-reload` каждый раз при внесении изменений в сервис.
---
## 🔗 Связанное
- [Руководство по развёртыванию](../../DEPLOY.md)
- [Интерактивный установщик](installer.md)
+36 -29
View File
@@ -1,24 +1,24 @@
# Interactive Installer Tutorial # Интерактивный установщик
Create a voice satellite using a Raspberry Pi 3+ and USB microphone and speakers. Создание голосового спутника на Raspberry Pi 3+ с USB микрофоном и динамиками.
**Prerequisites:** See [Deployment Guide](../../DEPLOY.md) for base installation. **Предварительные требования:** См. [Руководство по развёртыванию](../../DEPLOY.md) для базовой установки.
## Install OS ## Установка ОС
Follow instructions to [install Raspberry Pi OS](https://www.raspberrypi.com/software/). Under "Choose OS", pick "Raspberry Pi OS (other)" and "Raspberry Pi OS (**64-bit**) Lite". Следуйте инструкциям по [установке Raspberry Pi OS](https://www.raspberrypi.com/software/). В разделе "Choose OS" выберите "Raspberry Pi OS (other)" и "Raspberry Pi OS (**64-bit**) Lite".
When asking if you'd like to apply customization settings, choose "Edit Settings" and: Когда спросят о применении настроек кастомизации, выберите "Edit Settings" и:
* Set a username/password * Установите имя пользователя/пароль
* Configure the wireless LAN * Настройте беспроводную LAN
* Under the Services tab, enable SSH and use password authentication * На вкладке Services включите SSH и используйте аутентификацию по паролю
## Install Dependencies ## Установка зависимостей
After flashing and booting the satellite, connect to it over SSH using the username/password you configured during flashing. После прошивки и загрузки спутника, подключитесь к нему по SSH, используя имя пользователя/пароль, настроенные при прошивке.
**On the satellite**, make sure system dependencies are installed: **На спутнике**, убедитесь, что системные зависимости установлены:
```sh ```sh
sudo apt-get update sudo apt-get update
@@ -27,51 +27,58 @@ sudo apt-get install --no-install-recommends \
python3-venv python3-venv
``` ```
Clone the `wyoming-satellite` repository: Склонируйте репозиторий `wyoming-satellite`:
```sh ```sh
git clone https://github.com/rhasspy/wyoming-satellite.git git clone https://github.com/rhasspy/wyoming-satellite.git
``` ```
Now you can run the installer: Теперь вы можете запустить установщик:
```sh ```sh
cd wyoming-satellite/ cd wyoming-satellite/
python3 -m installer python3 -m installer
``` ```
## Satellite ## Спутник
Under the "Satellite" menu, select "Satellite Type" and choose "Local wake word detection" (with the space bar). В меню "Satellite" выберите "Satellite Type" и выберите "Local wake word detection" (пробелом).
## Microphone ## Микрофон
Make sure you USB microphone is plugged in. Убедитесь, что USB микрофон подключён.
Under the "Microphone" menu, select "Autodetect", and speak loudly into the microphone for a few seconds. В меню "Microphone" выберите "Autodetect" и громко поговорите в микрофон в течение нескольких секунд.
In "Audio Settings", set "Noise Suppression" to "Medium" and "Auto Gain" to 15. В "Audio Settings" установите "Noise Suppression" в "Medium" и "Auto Gain" в 15.
## Speakers ## Динамики
Make sure your USB speakers are plugged in. Убедитесь, что USB динамики подключены.
Under the "Speakers" menu, choose "Test All Speakers". For each device, choose "Play Sound" and listen. If you hear the sound, select "Choose This Device"; otherwise, select "Next Device". В меню "Speakers" выберите "Test All Speakers". Для каждого устройства выберите "Play Sound" и прослушайте. Если слышите звук, выберите "Choose This Device"; иначе выберите "Next Device".
In "Toggle Feedback Sounds", enable "On wake-up" and "After voice command" (with the space bar). В "Toggle Feedback Sounds" включите "On wake-up" и "After voice command" (пробелом).
## Wake Word ## Wake Word
Under the "Wake Word" menu, select "Wake Word System" and choose "openWakeWord" (with the space bar). When prompted, install openWakeWord. В меню "Wake Word" выберите "Wake Word System" и выберите "openWakeWord" (пробелом). Когда будет предложено, установите openWakeWord.
In the "openWakeWord" menu, choose "Download Community Wake Words". Back in the "Wake Word" menu, select "Choose Wake Word" and select one (with the space bar). В меню "openWakeWord" выберите "Download Community Wake Words". Вернитесь в меню "Wake Word", выберите "Choose Wake Word" и выберите одну фразу (пробелом).
## Apply Settings ## Применение настроек
From the main menu, select "Apply Settings" and enter your password. В главном меню выберите "Apply Settings" и введите пароль.
Check logs with: Проверьте логи:
```sh ```sh
sudo journalctl -f -u wyoming-satellite.service sudo journalctl -f -u wyoming-satellite.service
``` ```
---
## 🔗 Связанное
- [Руководство по развёртыванию](../../DEPLOY.md)
- [2-MIC HAT Tutorial](2mic-hat.md)