From 8e4480716a94134dee2f36ab413a10b98cc9d5e3 Mon Sep 17 00:00:00 2001 From: imonlinux <39863321+imonlinux@users.noreply.github.com> Date: Mon, 17 Nov 2025 18:38:01 -0800 Subject: [PATCH] Update linux-voice-assistant-2mic-install.md Updated the tutorial to reflect the change to config.json instead of command line arguements. --- docs/linux-voice-assistant-2mic-install.md | 128 +++++++++------------ 1 file changed, 53 insertions(+), 75 deletions(-) diff --git a/docs/linux-voice-assistant-2mic-install.md b/docs/linux-voice-assistant-2mic-install.md index fa6012d..a5ecef7 100644 --- a/docs/linux-voice-assistant-2mic-install.md +++ b/docs/linux-voice-assistant-2mic-install.md @@ -77,7 +77,7 @@ mkdir -p ~/.config/systemd/user ``` ```bash -cp ~/linux-voice-assistant/service/user-pw-linux-voice-assistant.service ~/.config/systemd/user/linux-voice-assistant.service +cp ~/linux-voice-assistant/service/linux-voice-assistant.service ~/.config/systemd/user/linux-voice-assistant.service ``` **Enable & start:** @@ -108,7 +108,7 @@ mkdir -p ~/.config/systemd/user ``` ```bash -cp ~/linux-voice-assistant/service/user-pa-linux-voice-assistant.service ~/.config/systemd/user/linux-voice-assistant.service +cp ~/linux-voice-assistant/service/linux-voice-assistant.service ~/.config/systemd/user/linux-voice-assistant.service ``` **Enable & start:** @@ -144,7 +144,7 @@ mkdir -p ~/.config/systemd/user ``` ```bash -cp ~/linux-voice-assistant/service/user-linux-voice-assistant.service ~/.config/systemd/user/linux-voice-assistant.service +cp ~/linux-voice-assistant/service/linux-voice-assistant.service ~/.config/systemd/user/linux-voice-assistant.service ``` **Enable & start:** @@ -239,57 +239,43 @@ The following effects can be selected via the `[State Name] Effect` (select) ent | **Fast Blink** | LEDs rapidly turn on and off. | | **Spin** | A single LED "spins" around the strip. | -**Edit LVA user-mode service:** +**Edit LVA config.json file:** ```bash -systemctl --user edit --force --full linux-voice-assistant +nano ~/linux-voice-assistant/linux_voice_assistant/config.json ``` -**Add MQTT configuration entries to LVA user-mode service:** +**Add MQTT configuration entries to LVA config.json file:** ```bash - --mqtt-host \ - --mqtt-port 1883 \ - --mqtt-username \ - --mqtt-password \ + "mqtt": { + "host": "192.168.1.2", + "port": 1883, + "username": "mqtt_username", + "password": "mqtt_password" + } ``` -**Example (Alsa LVA User Mode Service File)** +**Example of complete config.json file** ***Note: Change the MQTT values to match your system!*** ```bash -[Unit] -Description=Linux Voice Assistant - -[Service] -Type=simple -WorkingDirectory=/home/pi/linux-voice-assistant -Environment=PYTHONUNBUFFERED=1 - -ExecStart=/home/pi/linux-voice-assistant/script/run \ - --name 'Linux Voice Assistant' \ - --mqtt-host 192.168.1.2 \ - --mqtt-port 1883 \ - --mqtt-username mqtt \ - --mqtt-password Ch@ngeMe_1st \ - --wake-word-dir wakewords/openWakeWord \ - --wake-word-dir wakewords \ - --stop-model stop \ - --audio-input-device seeed-2mic-voicecard \ - --audio-output-device alsa/plughw:CARD=seeed2micvoicec \ - --debug - -Restart=always -RestartSec=2 - -[Install] -WantedBy=default.target +{ + "app": { + "name": "Linux Voice Assistant" + }, + "mqtt": { + "host": "192.168.1.2", + "port": 1883, + "username": "mqtt_username", + "password": "mqtt_password" + } +} ``` **Enable & start:** ```bash -systemctl --user daemon-reload systemctl --user restart linux-voice-assistant.service ``` @@ -311,59 +297,51 @@ This optional configuration support the use of the ReSpeaker 2Mic Grove Port wit | 🟡 **Yellow Wire** | GPIO12 (Signal 1) | **DI** (Data Input) | | ⚪ **White Wire** | GPIO13 (Signal 2) | **CI** (Clock Input) | -**Edit LVA user-mode service:** +**Edit LVA config.json file:** ```bash -systemctl --user edit --force --full linux-voice-assistant +nano ~/linux-voice-assistant/linux_voice_assistant/config.json ``` -**Add Grove (GPIO) configuration entries to LVA user-mode service:** +**Add Grove (GPIO) configuration entries to LVA config.json file:** ```bash - --led-interface gpio \ - --led-data-pin 12 \ - --led-clock-pin 13 \ + "led": { + "led_type": "dotstar", + "interface": "gpio", + "clock_pin": 13, + "data_pin": 12, + "num_leds": 10 + } ``` -**Example (Alsa LVA User Mode Service File with MQTT Enabled)** +**Example (LVA config.json file with MQTT and Grove Port enabled)** ***Note: Change the GPIO values to match your system!*** ```bash -[Unit] -Description=Linux Voice Assistant - -[Service] -Type=simple -WorkingDirectory=/home/pi/linux-voice-assistant -Environment=PYTHONUNBUFFERED=1 - -ExecStart=/home/pi/linux-voice-assistant/script/run \ - --name 'Linux Voice Assistant' \ - --mqtt-host 192.168.1.2 \ - --mqtt-port 1883 \ - --mqtt-username mqtt \ - --mqtt-password Ch@ngeMe_1st \ - --led-interface gpio \ - --led-data-pin 12 \ - --led-clock-pin 13 \ - --wake-word-dir wakewords/openWakeWord \ - --wake-word-dir wakewords \ - --stop-model stop \ - --audio-input-device seeed-2mic-voicecard \ - --audio-output-device alsa/plughw:CARD=seeed2micvoicec \ - --debug - -Restart=always -RestartSec=2 - -[Install] -WantedBy=default.target +{ + "app": { + "name": "Linux Voice Assistant" + }, + "mqtt": { + "host": "192.168.1.2", + "port": 1883, + "username": "mqtt_username", + "password": "mqtt_password" + }, + "led": { + "led_type": "dotstar", + "interface": "gpio", + "clock_pin": 13, + "data_pin": 12, + "num_leds": 10 + } +} ``` **Enable & start:** ```bash -systemctl --user daemon-reload systemctl --user restart linux-voice-assistant.service ```