From 60042f418e48a75a011587c5692a793c59955b2b Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Wed, 31 Jan 2024 00:45:51 +0100 Subject: [PATCH 01/24] add setup script for rfid reader. moved python script --- documentation/developers/coreapps.md | 2 +- installation/components/setup_rfid_reader.sh | 9 +++++++++ installation/routines/setup_rfid_reader.sh | 4 +++- .../rfid/hardware}/run_register_rfid_reader.py | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 installation/components/setup_rfid_reader.sh rename src/jukebox/{ => components/rfid/hardware}/run_register_rfid_reader.py (96%) mode change 100755 => 100644 diff --git a/documentation/developers/coreapps.md b/documentation/developers/coreapps.md index f1402683d..49b6a1dd5 100644 --- a/documentation/developers/coreapps.md +++ b/documentation/developers/coreapps.md @@ -33,7 +33,7 @@ Will also setup equalizer and mono down mixer in the pulseaudio config file. Run ### RFID Reader -**Scriptname:** [run_register_rfid_reader.py](../../src/jukebox/run_register_rfid_reader.py) +**Scriptname:** [setup_rfid_reader.sh](../../installation/components/setup_rfid_reader.sh) Setup tool to configure the RFID Readers. diff --git a/installation/components/setup_rfid_reader.sh b/installation/components/setup_rfid_reader.sh new file mode 100644 index 000000000..6467c217d --- /dev/null +++ b/installation/components/setup_rfid_reader.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +SOURCE=${BASH_SOURCE[0]} +SCRIPT_DIR="$(dirname "$SOURCE")" +PROJECT_ROOT="$SCRIPT_DIR"/../../ +cd "$SCRIPT_DIR" || (echo "Could not change to script directory" && exit 1) + +source "$PROJECT_ROOT"/.venv/bin/activate +python "$PROJECT_ROOT"/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py diff --git a/installation/routines/setup_rfid_reader.sh b/installation/routines/setup_rfid_reader.sh index 3003d79a4..1dfe32feb 100644 --- a/installation/routines/setup_rfid_reader.sh +++ b/installation/routines/setup_rfid_reader.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash _run_setup_rfid_reader() { - run_and_print_lc python "${INSTALLATION_PATH}/src/jukebox/run_register_rfid_reader.py" + local script="./../components/setup_rfid_reader.sh" + sudo chmod +x "$script" + run_and_print_lc $script" } setup_rfid_reader() { diff --git a/src/jukebox/run_register_rfid_reader.py b/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py old mode 100755 new mode 100644 similarity index 96% rename from src/jukebox/run_register_rfid_reader.py rename to src/jukebox/components/rfid/hardware/run_register_rfid_reader.py index 18a1614d8..2846104bc --- a/src/jukebox/run_register_rfid_reader.py +++ b/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py @@ -3,7 +3,7 @@ Setup tool to configure the RFID Readers. Run this once to register and configure the RFID readers with the Jukebox. Can be re-run at any time to change -the settings. For more information see [RFID Readers](../rfid/README.md). +the settings. For more information see [RFID Readers](./../../../../../../documentation/developers/rfid/README.md). > [!NOTE] > This tool will always write a new configurations file. Thus, overwrite the old one (after checking with the user). From 31bd3b6b055658ac81b18a5ba453a37872bb9ac3 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Wed, 31 Jan 2024 10:34:48 +0100 Subject: [PATCH 02/24] add check for venv activation --- installation/components/setup_rfid_reader.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installation/components/setup_rfid_reader.sh b/installation/components/setup_rfid_reader.sh index 6467c217d..e5bff7c45 100644 --- a/installation/components/setup_rfid_reader.sh +++ b/installation/components/setup_rfid_reader.sh @@ -5,5 +5,5 @@ SCRIPT_DIR="$(dirname "$SOURCE")" PROJECT_ROOT="$SCRIPT_DIR"/../../ cd "$SCRIPT_DIR" || (echo "Could not change to script directory" && exit 1) -source "$PROJECT_ROOT"/.venv/bin/activate -python "$PROJECT_ROOT"/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py +source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } +python "${PROJECT_ROOT}"/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py From 973175f493c27adbb4f68db3a2003a882c83e872 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Wed, 31 Jan 2024 10:49:15 +0100 Subject: [PATCH 03/24] fix --- installation/routines/setup_rfid_reader.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation/routines/setup_rfid_reader.sh b/installation/routines/setup_rfid_reader.sh index 1dfe32feb..808321bd6 100644 --- a/installation/routines/setup_rfid_reader.sh +++ b/installation/routines/setup_rfid_reader.sh @@ -3,7 +3,7 @@ _run_setup_rfid_reader() { local script="./../components/setup_rfid_reader.sh" sudo chmod +x "$script" - run_and_print_lc $script" + run_and_print_lc "$script" } setup_rfid_reader() { From 39f5378fcdbdac909a542ea072378f03d4fe2d2a Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Wed, 31 Jan 2024 11:14:30 +0100 Subject: [PATCH 04/24] fix cd fail behavior (dont start subprocess) --- installation/components/setup_rfid_reader.sh | 5 +++-- run_docgeneration.sh | 2 +- run_flake8.sh | 2 +- run_pytest.sh | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/installation/components/setup_rfid_reader.sh b/installation/components/setup_rfid_reader.sh index e5bff7c45..e95a3fe9a 100644 --- a/installation/components/setup_rfid_reader.sh +++ b/installation/components/setup_rfid_reader.sh @@ -2,8 +2,9 @@ SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -PROJECT_ROOT="$SCRIPT_DIR"/../../ -cd "$SCRIPT_DIR" || (echo "Could not change to script directory" && exit 1) +cd "$SCRIPT_DIR" || { echo "Could not change to script directory"; exit 1; } +PROJECT_ROOT="$SCRIPT_DIR"/../../ source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } + python "${PROJECT_ROOT}"/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py diff --git a/run_docgeneration.sh b/run_docgeneration.sh index 22ab8bc14..53b18ed57 100755 --- a/run_docgeneration.sh +++ b/run_docgeneration.sh @@ -6,7 +6,7 @@ # Change working directory to location of script SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -cd "$SCRIPT_DIR" || (echo "Could not change to top-level project directory" && exit 1) +cd "$SCRIPT_DIR" || { echo "Could not change to top-level project directory"; exit 1; } # Run pydoc-markdown # make sure, directory exists diff --git a/run_flake8.sh b/run_flake8.sh index a9ec73285..8fd6dcb53 100755 --- a/run_flake8.sh +++ b/run_flake8.sh @@ -7,7 +7,7 @@ # Change working directory to location of script SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -cd "$SCRIPT_DIR" || (echo "Could not change to top-level project directory" && exit 1) +cd "$SCRIPT_DIR" || { echo "Could not change to top-level project directory"; exit 1; } # Run flake8 flake8 --config .flake8 "$@" diff --git a/run_pytest.sh b/run_pytest.sh index 766f05182..91c56f46c 100755 --- a/run_pytest.sh +++ b/run_pytest.sh @@ -7,7 +7,7 @@ # Change working directory to location of script SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -cd "$SCRIPT_DIR" || (echo "Could not change to top-level project directory" && exit 1) +cd "$SCRIPT_DIR" || { echo "Could not change to top-level project directory"; exit 1; } # Run pytest pytest -c pytest.ini $@ From 7bd233907bba0f1497af70c6f1fbd113cc1891e4 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Wed, 31 Jan 2024 11:28:18 +0100 Subject: [PATCH 05/24] add script for run jukebox for venv. updated docs. --- documentation/builders/configuration.md | 6 ++---- documentation/builders/troubleshooting.md | 9 +++------ documentation/developers/coreapps.md | 2 +- resources/default-services/jukebox-daemon.service | 4 ++-- run_jukebox.sh | 15 +++++++++++++++ 5 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 run_jukebox.sh diff --git a/documentation/builders/configuration.md b/documentation/builders/configuration.md index 2e1c4ff23..78b348084 100644 --- a/documentation/builders/configuration.md +++ b/documentation/builders/configuration.md @@ -21,8 +21,7 @@ $ systemctl --user stop jukebox-daemon $ nano ./shared/settings/jukebox.yaml # Start Jukebox in console and check the log output (optional) -$ cd src/jukebox -$ ./run_jukebox.py +$ ./run_jukebox.sh # and if OK, press Ctrl-C and restart the service # Restart the service @@ -34,6 +33,5 @@ This could be useful if you want your Jukebox to only allow a lower volume when at night time when there is time to go to bed :-) ```bash -$ cd src/jukebox -$ ./run_jukebox.py --conf path/to/custom/config.yaml +$ ./run_jukebox.sh --conf path/to/custom/config.yaml ``` diff --git a/documentation/builders/troubleshooting.md b/documentation/builders/troubleshooting.md index ffc5189dc..5b4061aa8 100644 --- a/documentation/builders/troubleshooting.md +++ b/documentation/builders/troubleshooting.md @@ -64,12 +64,10 @@ on the console log. $ systemctl --user stop jukebox-daemon # Start the Jukebox in debug mode: -$ cd src/jukebox - # with default logger: -$ ./run_jukebox.py +$ ./run_jukebox.sh # or with custom logger configuration: -$ ./run_jukebox.py --logger path/to/custom/logger.yaml +$ ./run_jukebox.sh --logger path/to/custom/logger.yaml ``` ### Fallback configuration @@ -79,8 +77,7 @@ Attention: This only emits messages to the console and does not write to the log This is more a fallback features: ```bash -$ cd src/jukebox -$ ./run_jukebox.py -vv +$ ./run_jukebox.sh -vv ``` ### Extreme cases diff --git a/documentation/developers/coreapps.md b/documentation/developers/coreapps.md index 49b6a1dd5..b9a7eb9cf 100644 --- a/documentation/developers/coreapps.md +++ b/documentation/developers/coreapps.md @@ -10,7 +10,7 @@ $ ./ -h ## Jukebox Core -**Scriptname:** [run_jukebox.py](../../src/jukebox/run_jukebox.py) +**Scriptname:** [run_jukebox.sh](../../run_jukebox.sh) This is the main app and starts the Jukebox Core. diff --git a/resources/default-services/jukebox-daemon.service b/resources/default-services/jukebox-daemon.service index 050897e14..7898088e2 100644 --- a/resources/default-services/jukebox-daemon.service +++ b/resources/default-services/jukebox-daemon.service @@ -10,8 +10,8 @@ After=network.target sound.target mpd.service pulseaudio.service Requires=mpd.service pulseaudio.service [Service] -WorkingDirectory=%%INSTALLATION_PATH%%/src/jukebox -ExecStart=/bin/bash -c 'source %%INSTALLATION_PATH%%/.venv/bin/activate && python run_jukebox.py' +WorkingDirectory=%%INSTALLATION_PATH%% +ExecStart=/bin/bash -c '%%INSTALLATION_PATH%%/run_jukebox.sh' StandardOutput=inherit StandardError=inherit Restart=always diff --git a/run_jukebox.sh b/run_jukebox.sh new file mode 100644 index 000000000..c8ed9a373 --- /dev/null +++ b/run_jukebox.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# Runner script for jukebox to ensure +# - independent from working directory + +# Change working directory to location of script +SOURCE=${BASH_SOURCE[0]} +SCRIPT_DIR="$(dirname "$SOURCE")" +cd "$SCRIPT_DIR" || { echo "Could not change to script directory"; exit 1; } + +PROJECT_ROOT="$SCRIPT_DIR" +source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } + +cd "${PROJECT_ROOT}"/src/jukebox || { echo "Could not change directory"; exit 1; } +python run_jukebox.py $@ From f65d260f63af5f338775cb659bd829a89f1c41e4 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Wed, 31 Jan 2024 11:45:33 +0100 Subject: [PATCH 06/24] add setup script for audio sink. moved python script --- documentation/developers/coreapps.md | 2 +- installation/components/setup_audio_sink.sh | 10 ++++++++++ resources/default-settings/pulseaudio.default.pa | 2 +- src/jukebox/components/volume/__init__.py | 2 +- .../{ => components/volume}/run_configure_audio.py | 0 5 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 installation/components/setup_audio_sink.sh rename src/jukebox/{ => components/volume}/run_configure_audio.py (100%) mode change 100755 => 100644 diff --git a/documentation/developers/coreapps.md b/documentation/developers/coreapps.md index b9a7eb9cf..0eb8916d5 100644 --- a/documentation/developers/coreapps.md +++ b/documentation/developers/coreapps.md @@ -25,7 +25,7 @@ See [Best practice procedure](../builders/configuration.md#best-practice-procedu ### Audio -**Scriptname:** [run_configure_audio.py](../../src/jukebox/run_configure_audio.py) +**Scriptname:** [run_configure_audio.sh](../../installation/components/run_configure_audio.sh) Setup tool to register the PulseAudio sinks as primary and secondary audio outputs. diff --git a/installation/components/setup_audio_sink.sh b/installation/components/setup_audio_sink.sh new file mode 100644 index 000000000..f9597faf3 --- /dev/null +++ b/installation/components/setup_audio_sink.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +SOURCE=${BASH_SOURCE[0]} +SCRIPT_DIR="$(dirname "$SOURCE")" +cd "$SCRIPT_DIR" || { echo "Could not change to script directory"; exit 1; } + +PROJECT_ROOT="$SCRIPT_DIR"/../../ +source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } + +python "${PROJECT_ROOT}"/src/jukebox/components/volume/run_configure_audio.py diff --git a/resources/default-settings/pulseaudio.default.pa b/resources/default-settings/pulseaudio.default.pa index ee91ff9bf..0fe0376b7 100644 --- a/resources/default-settings/pulseaudio.default.pa +++ b/resources/default-settings/pulseaudio.default.pa @@ -147,5 +147,5 @@ load-module module-filter-apply #set-default-source input ### Configuration by Jukebox's Tool may come below -# Run ./run_configure_audio.py for configuration +# Run ./installation/components/run_configure_audio.sh for configuration diff --git a/src/jukebox/components/volume/__init__.py b/src/jukebox/components/volume/__init__.py index 4782581ca..62ae239b7 100644 --- a/src/jukebox/components/volume/__init__.py +++ b/src/jukebox/components/volume/__init__.py @@ -603,7 +603,7 @@ def parse_config() -> List[PulseAudioSinkClass]: logger.error(f"Configured sink '{pulse_sink_name}' not available sinks '{all_sinks}!\n" f"Using default sink '{default_sink_name}' as fallback\n" f"Things like audio sink toggle and volume limit will not work as expected!\n" - f"Please run audio config tool: ./run_configure_audio.py") + f"Please run audio config tool: ./installation/components/run_configure_audio.sh") sink_list.append(PulseAudioSinkClass(alias, pulse_sink_name, volume_limit)) key = 'secondary' diff --git a/src/jukebox/run_configure_audio.py b/src/jukebox/components/volume/run_configure_audio.py old mode 100755 new mode 100644 similarity index 100% rename from src/jukebox/run_configure_audio.py rename to src/jukebox/components/volume/run_configure_audio.py From 73d55839264c3595bf10dc12909305afda331ecf Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Wed, 31 Jan 2024 12:27:49 +0100 Subject: [PATCH 07/24] add script for rpc tool. moved python script --- src/jukebox/{ => jukebox/rpc}/run_rpc_tool.py | 0 tools/run_rpc_tool.sh | 14 ++++++++++++++ 2 files changed, 14 insertions(+) rename src/jukebox/{ => jukebox/rpc}/run_rpc_tool.py (100%) mode change 100755 => 100644 create mode 100644 tools/run_rpc_tool.sh diff --git a/src/jukebox/run_rpc_tool.py b/src/jukebox/jukebox/rpc/run_rpc_tool.py old mode 100755 new mode 100644 similarity index 100% rename from src/jukebox/run_rpc_tool.py rename to src/jukebox/jukebox/rpc/run_rpc_tool.py diff --git a/tools/run_rpc_tool.sh b/tools/run_rpc_tool.sh new file mode 100644 index 000000000..a10fcffdd --- /dev/null +++ b/tools/run_rpc_tool.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Runner script for jukebox to ensure +# - independent from working directory + +# Change working directory to location of script +SOURCE=${BASH_SOURCE[0]} +SCRIPT_DIR="$(dirname "$SOURCE")" +cd "$SCRIPT_DIR" || { echo "Could not change to script directory"; exit 1; } + +PROJECT_ROOT="$SCRIPT_DIR"/.. +source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } + +python "${PROJECT_ROOT}"/src/jukebox/jukebox/rpc/run_rpc_tool.py $@ From 0490ca365adbdd8bcac3b0d46847e526d2de74c9 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Wed, 31 Jan 2024 12:28:08 +0100 Subject: [PATCH 08/24] add script for sniffer tool. moved python script --- .../publishing}/run_publicity_sniffer.py | 0 tools/run_publicity_sniffer.sh | 14 ++++++++++++++ 2 files changed, 14 insertions(+) rename src/jukebox/{ => jukebox/publishing}/run_publicity_sniffer.py (100%) mode change 100755 => 100644 create mode 100644 tools/run_publicity_sniffer.sh diff --git a/src/jukebox/run_publicity_sniffer.py b/src/jukebox/jukebox/publishing/run_publicity_sniffer.py old mode 100755 new mode 100644 similarity index 100% rename from src/jukebox/run_publicity_sniffer.py rename to src/jukebox/jukebox/publishing/run_publicity_sniffer.py diff --git a/tools/run_publicity_sniffer.sh b/tools/run_publicity_sniffer.sh new file mode 100644 index 000000000..d157f1f79 --- /dev/null +++ b/tools/run_publicity_sniffer.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Runner script for jukebox to ensure +# - independent from working directory + +# Change working directory to location of script +SOURCE=${BASH_SOURCE[0]} +SCRIPT_DIR="$(dirname "$SOURCE")" +cd "$SCRIPT_DIR" || { echo "Could not change to script directory"; exit 1; } + +PROJECT_ROOT="$SCRIPT_DIR"/.. +source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } + +python "${PROJECT_ROOT}"/src/jukebox/jukebox/publishing/run_rpc_tool.sh.py $@ From dd2c7afeeca3ae9397daaa16a575231ed3d2bbbf Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Wed, 31 Jan 2024 12:28:32 +0100 Subject: [PATCH 09/24] fixed parameter passing --- installation/components/setup_audio_sink.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation/components/setup_audio_sink.sh b/installation/components/setup_audio_sink.sh index f9597faf3..cb18ae4a2 100644 --- a/installation/components/setup_audio_sink.sh +++ b/installation/components/setup_audio_sink.sh @@ -7,4 +7,4 @@ cd "$SCRIPT_DIR" || { echo "Could not change to script directory"; exit 1; } PROJECT_ROOT="$SCRIPT_DIR"/../../ source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } -python "${PROJECT_ROOT}"/src/jukebox/components/volume/run_configure_audio.py +python "${PROJECT_ROOT}"/src/jukebox/components/volume/run_configure_audio.py $@ From f18dad6c2cdb5ca97365ed5f563f88e093c82f20 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Wed, 31 Jan 2024 13:14:42 +0100 Subject: [PATCH 10/24] fix paths --- .../components/rfid/hardware/run_register_rfid_reader.py | 4 ++-- src/jukebox/components/volume/run_configure_audio.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py b/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py index 2846104bc..2f3a305ee 100644 --- a/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py +++ b/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py @@ -3,7 +3,7 @@ Setup tool to configure the RFID Readers. Run this once to register and configure the RFID readers with the Jukebox. Can be re-run at any time to change -the settings. For more information see [RFID Readers](./../../../../../../documentation/developers/rfid/README.md). +the settings. For more information see [RFID Readers](./../../../../../documentation/developers/rfid/README.md). > [!NOTE] > This tool will always write a new configurations file. Thus, overwrite the old one (after checking with the user). @@ -33,7 +33,7 @@ def main(): # The default config file relative to this files location and independent of working directory - cfg_file_default = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/../../shared/settings/rfid.yaml') + cfg_file_default = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/../../../../../shared/settings/rfid.yaml') parser = argparse.ArgumentParser() parser.add_argument("-f", "--force", diff --git a/src/jukebox/components/volume/run_configure_audio.py b/src/jukebox/components/volume/run_configure_audio.py index 93f0a4c6a..87389d61e 100644 --- a/src/jukebox/components/volume/run_configure_audio.py +++ b/src/jukebox/components/volume/run_configure_audio.py @@ -5,7 +5,7 @@ Will also setup equalizer and mono down mixer in the pulseaudio config file. Run this once after installation. Can be re-run at any time to change the settings. -For more information see [Audio Configuration](../../builders/audio.md#audio-configuration). +For more information see [Audio Configuration](../../../../builders/audio.md#audio-configuration). """ import os import argparse @@ -290,7 +290,7 @@ def configure_pa_switch_on_connect(pulse_cfg_file_content): def query_create_default_pa_config(script_path, config_file_path): default_config_path = os.path.normpath(os.path.join(script_path, - '../../resources/default-settings/pulseaudio.default.pa')) + '../../../../resources/default-settings/pulseaudio.default.pa')) print(f"\n*** PulseAudio configuration file does not exist: '{config_file_path}'.") print(f" RPI-Jukebox-RFID's default is: '{default_config_path}'.\n") query = pyil.input_yesno("Create new config file from RPi-Jukebox-RFID default?", @@ -401,7 +401,7 @@ def goodbye(pulse_config: PaConfigClass): def main(): # Get absolute path of this script script_path = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) - default_cfg_jukebox = os.path.abspath(os.path.join(script_path, '../../shared/settings/jukebox.yaml')) + default_cfg_jukebox = os.path.abspath(os.path.join(script_path, '../../../../shared/settings/jukebox.yaml')) default_cfg_pulse = os.path.abspath(os.path.expanduser('~/.config/pulse/default.pa')) argparser = argparse.ArgumentParser(description='The Jukebox audio configuration tool') From 7248ad2bd08458b2d2a4593acf0d9379ad453be7 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Wed, 31 Jan 2024 13:20:51 +0100 Subject: [PATCH 11/24] fix flake8 --- .../components/rfid/hardware/run_register_rfid_reader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py b/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py index 2f3a305ee..26fcb919e 100644 --- a/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py +++ b/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py @@ -33,7 +33,8 @@ def main(): # The default config file relative to this files location and independent of working directory - cfg_file_default = os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + '/../../../../../shared/settings/rfid.yaml') + script_path = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) + cfg_file_default = os.path.abspath(os.path.join(script_path, '/../../../../../shared/settings/rfid.yaml')) parser = argparse.ArgumentParser() parser.add_argument("-f", "--force", From d00a2033d6bb0b71cfaa1a5c240124d4df35c79b Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Wed, 31 Jan 2024 13:27:49 +0100 Subject: [PATCH 12/24] fix comments and docs --- documentation/developers/coreapps.md | 8 ++++---- installation/components/setup_audio_sink.sh | 4 ++++ installation/components/setup_rfid_reader.sh | 4 ++++ tools/run_publicity_sniffer.sh | 2 +- tools/run_rpc_tool.sh | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/documentation/developers/coreapps.md b/documentation/developers/coreapps.md index 0eb8916d5..123929226 100644 --- a/documentation/developers/coreapps.md +++ b/documentation/developers/coreapps.md @@ -46,20 +46,20 @@ Run this once to register and configure the RFID readers with the Jukebox. Can b ### RPC -**Scriptname:** [run_rpc_tool.py](../../src/jukebox/run_rpc_tool.py) +**Scriptname:** [run_rpc_tool.sh](../../tools/run_rpc_tool.sh) Command Line Interface to the Jukebox RPC Server. -A command line tool for sending RPC commands to the running jukebox app. This uses the same interface as the WebUI. Can be used for additional control or for debugging. Use `./run_rpc_tool.py` to start the tool in interactive mode. +A command line tool for sending RPC commands to the running jukebox app. This uses the same interface as the WebUI. Can be used for additional control or for debugging. Use `./run_rpc_tool.sh` to start the tool in interactive mode. The tool features auto-completion and command history. The list of available commands is fetched from the running Jukebox service. -The tool can also be used to send commands directly, when passing a `-c` argument, e.g. `./run_rpc_tool.py -c host.shutdown`. +The tool can also be used to send commands directly, when passing a `-c` argument, e.g. `./run_rpc_tool.sh -c host.shutdown`. ### Publicity Sniffer -**Scriptname:** [run_publicity_sniffer.py](../../src/jukebox/run_publicity_sniffer.py) +**Scriptname:** [run_publicity_sniffer.sh](../../tools/run_publicity_sniffer.sh) A command line tool that monitors all messages being sent out from the Jukebox via the publishing interface. Received messages are printed in the console. Mainly used for debugging. diff --git a/installation/components/setup_audio_sink.sh b/installation/components/setup_audio_sink.sh index cb18ae4a2..fcd53f048 100644 --- a/installation/components/setup_audio_sink.sh +++ b/installation/components/setup_audio_sink.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# Runner script for setup audio sink to ensure +# - independent from working directory + +# Change working directory to location of script SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" cd "$SCRIPT_DIR" || { echo "Could not change to script directory"; exit 1; } diff --git a/installation/components/setup_rfid_reader.sh b/installation/components/setup_rfid_reader.sh index e95a3fe9a..18a9e4956 100644 --- a/installation/components/setup_rfid_reader.sh +++ b/installation/components/setup_rfid_reader.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# Runner script for setup rfid reader to ensure +# - independent from working directory + +# Change working directory to location of script SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" cd "$SCRIPT_DIR" || { echo "Could not change to script directory"; exit 1; } diff --git a/tools/run_publicity_sniffer.sh b/tools/run_publicity_sniffer.sh index d157f1f79..a93d3e50a 100644 --- a/tools/run_publicity_sniffer.sh +++ b/tools/run_publicity_sniffer.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Runner script for jukebox to ensure +# Runner script for sniffer tool to ensure # - independent from working directory # Change working directory to location of script diff --git a/tools/run_rpc_tool.sh b/tools/run_rpc_tool.sh index a10fcffdd..885803a6e 100644 --- a/tools/run_rpc_tool.sh +++ b/tools/run_rpc_tool.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Runner script for jukebox to ensure +# Runner script for rpc tool to ensure # - independent from working directory # Change working directory to location of script From 7c87cea849652f544b431ad542887678936c9491 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Wed, 31 Jan 2024 13:48:17 +0100 Subject: [PATCH 13/24] fixed parameter passing --- installation/components/setup_rfid_reader.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installation/components/setup_rfid_reader.sh b/installation/components/setup_rfid_reader.sh index 18a9e4956..797b36db1 100644 --- a/installation/components/setup_rfid_reader.sh +++ b/installation/components/setup_rfid_reader.sh @@ -11,4 +11,4 @@ cd "$SCRIPT_DIR" || { echo "Could not change to script directory"; exit 1; } PROJECT_ROOT="$SCRIPT_DIR"/../../ source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } -python "${PROJECT_ROOT}"/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py +python "${PROJECT_ROOT}"/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py $@ From c97967248082cb3f43378c198130ebaadc1672e8 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Wed, 31 Jan 2024 19:43:29 +0100 Subject: [PATCH 14/24] some fixes --- documentation/developers/coreapps.md | 2 +- .../components/rfid/hardware/run_register_rfid_reader.py | 2 +- src/jukebox/components/volume/run_configure_audio.py | 2 +- tools/run_publicity_sniffer.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/documentation/developers/coreapps.md b/documentation/developers/coreapps.md index 123929226..1d6c79be3 100644 --- a/documentation/developers/coreapps.md +++ b/documentation/developers/coreapps.md @@ -25,7 +25,7 @@ See [Best practice procedure](../builders/configuration.md#best-practice-procedu ### Audio -**Scriptname:** [run_configure_audio.sh](../../installation/components/run_configure_audio.sh) +**Scriptname:** [setup_audio_sink.sh](../../installation/components/setup_audio_sink.sh) Setup tool to register the PulseAudio sinks as primary and secondary audio outputs. diff --git a/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py b/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py index 26fcb919e..cb02fa03b 100644 --- a/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py +++ b/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py @@ -3,7 +3,7 @@ Setup tool to configure the RFID Readers. Run this once to register and configure the RFID readers with the Jukebox. Can be re-run at any time to change -the settings. For more information see [RFID Readers](./../../../../../documentation/developers/rfid/README.md). +the settings. For more information see [RFID Readers](./../../documentation/developers/rfid/README.md). > [!NOTE] > This tool will always write a new configurations file. Thus, overwrite the old one (after checking with the user). diff --git a/src/jukebox/components/volume/run_configure_audio.py b/src/jukebox/components/volume/run_configure_audio.py index 87389d61e..27c08aa2a 100644 --- a/src/jukebox/components/volume/run_configure_audio.py +++ b/src/jukebox/components/volume/run_configure_audio.py @@ -5,7 +5,7 @@ Will also setup equalizer and mono down mixer in the pulseaudio config file. Run this once after installation. Can be re-run at any time to change the settings. -For more information see [Audio Configuration](../../../../builders/audio.md#audio-configuration). +For more information see [Audio Configuration](./../../builders/audio.md#audio-configuration). """ import os import argparse diff --git a/tools/run_publicity_sniffer.sh b/tools/run_publicity_sniffer.sh index a93d3e50a..51a5da3bd 100644 --- a/tools/run_publicity_sniffer.sh +++ b/tools/run_publicity_sniffer.sh @@ -11,4 +11,4 @@ cd "$SCRIPT_DIR" || { echo "Could not change to script directory"; exit 1; } PROJECT_ROOT="$SCRIPT_DIR"/.. source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } -python "${PROJECT_ROOT}"/src/jukebox/jukebox/publishing/run_rpc_tool.sh.py $@ +python "${PROJECT_ROOT}"/src/jukebox/jukebox/publishing/run_publicity_sniffer.sh.py $@ From e6f969ca6aeb68e4b1fcd6bbe380bb6dc4135859 Mon Sep 17 00:00:00 2001 From: Alvin <103769832+AlvinSchiller@users.noreply.github.com> Date: Wed, 31 Jan 2024 22:06:33 +0100 Subject: [PATCH 15/24] fixed execution rights --- installation/components/setup_audio_sink.sh | 0 installation/components/setup_rfid_reader.sh | 0 run_jukebox.sh | 0 tools/run_publicity_sniffer.sh | 0 tools/run_rpc_tool.sh | 0 5 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 installation/components/setup_audio_sink.sh mode change 100644 => 100755 installation/components/setup_rfid_reader.sh mode change 100644 => 100755 run_jukebox.sh mode change 100644 => 100755 tools/run_publicity_sniffer.sh mode change 100644 => 100755 tools/run_rpc_tool.sh diff --git a/installation/components/setup_audio_sink.sh b/installation/components/setup_audio_sink.sh old mode 100644 new mode 100755 diff --git a/installation/components/setup_rfid_reader.sh b/installation/components/setup_rfid_reader.sh old mode 100644 new mode 100755 diff --git a/run_jukebox.sh b/run_jukebox.sh old mode 100644 new mode 100755 diff --git a/tools/run_publicity_sniffer.sh b/tools/run_publicity_sniffer.sh old mode 100644 new mode 100755 diff --git a/tools/run_rpc_tool.sh b/tools/run_rpc_tool.sh old mode 100644 new mode 100755 From 48771613042948f04f89363d1f5a1824526f4c0e Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Wed, 31 Jan 2024 22:27:06 +0100 Subject: [PATCH 16/24] some fixes --- installation/routines/setup_rfid_reader.sh | 2 +- tools/run_publicity_sniffer.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/installation/routines/setup_rfid_reader.sh b/installation/routines/setup_rfid_reader.sh index 808321bd6..c7f3b7120 100644 --- a/installation/routines/setup_rfid_reader.sh +++ b/installation/routines/setup_rfid_reader.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash _run_setup_rfid_reader() { - local script="./../components/setup_rfid_reader.sh" + local script="${INSTALLATION_PATH}"/installation/components/setup_rfid_reader.sh sudo chmod +x "$script" run_and_print_lc "$script" } diff --git a/tools/run_publicity_sniffer.sh b/tools/run_publicity_sniffer.sh index 51a5da3bd..542d20119 100755 --- a/tools/run_publicity_sniffer.sh +++ b/tools/run_publicity_sniffer.sh @@ -11,4 +11,4 @@ cd "$SCRIPT_DIR" || { echo "Could not change to script directory"; exit 1; } PROJECT_ROOT="$SCRIPT_DIR"/.. source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } -python "${PROJECT_ROOT}"/src/jukebox/jukebox/publishing/run_publicity_sniffer.sh.py $@ +python "${PROJECT_ROOT}"/src/jukebox/jukebox/publishing/run_publicity_sniffer.py $@ From 654d031a104506d14f08f66a80c64b42342a00b1 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Thu, 1 Feb 2024 02:49:25 +0100 Subject: [PATCH 17/24] move scripts to python root again (failing import paths). fixed absolute path in caller scripts --- installation/components/setup_audio_sink.sh | 10 ++++++---- installation/components/setup_rfid_reader.sh | 10 ++++++---- run_jukebox.sh | 9 +++++---- .../{components/volume => }/run_configure_audio.py | 0 .../{jukebox/publishing => }/run_publicity_sniffer.py | 0 .../rfid/hardware => }/run_register_rfid_reader.py | 0 src/jukebox/{jukebox/rpc => }/run_rpc_tool.py | 0 tools/run_publicity_sniffer.sh | 8 +++++--- tools/run_rpc_tool.sh | 10 ++++++---- 9 files changed, 28 insertions(+), 19 deletions(-) rename src/jukebox/{components/volume => }/run_configure_audio.py (100%) rename src/jukebox/{jukebox/publishing => }/run_publicity_sniffer.py (100%) rename src/jukebox/{components/rfid/hardware => }/run_register_rfid_reader.py (100%) rename src/jukebox/{jukebox/rpc => }/run_rpc_tool.py (100%) diff --git a/installation/components/setup_audio_sink.sh b/installation/components/setup_audio_sink.sh index fcd53f048..3f332781a 100755 --- a/installation/components/setup_audio_sink.sh +++ b/installation/components/setup_audio_sink.sh @@ -1,14 +1,16 @@ #!/usr/bin/env bash -# Runner script for setup audio sink to ensure +# Runner script for sniffer tool to ensure +# - correct venv activation # - independent from working directory # Change working directory to location of script SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -cd "$SCRIPT_DIR" || { echo "Could not change to script directory"; exit 1; } +PROJECT_ROOT="$(realpath "$SCRIPT_DIR"/../..)" -PROJECT_ROOT="$SCRIPT_DIR"/../../ +cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } -python "${PROJECT_ROOT}"/src/jukebox/components/volume/run_configure_audio.py $@ +cd "${PROJECT_ROOT}"/src/jukebox || { echo "Could not change directory"; exit 1; } +python run_configure_audio.py $@ diff --git a/installation/components/setup_rfid_reader.sh b/installation/components/setup_rfid_reader.sh index 797b36db1..29fcf6b97 100755 --- a/installation/components/setup_rfid_reader.sh +++ b/installation/components/setup_rfid_reader.sh @@ -1,14 +1,16 @@ #!/usr/bin/env bash -# Runner script for setup rfid reader to ensure +# Runner script for sniffer tool to ensure +# - correct venv activation # - independent from working directory # Change working directory to location of script SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -cd "$SCRIPT_DIR" || { echo "Could not change to script directory"; exit 1; } +PROJECT_ROOT="$(realpath "$SCRIPT_DIR"/../..)" -PROJECT_ROOT="$SCRIPT_DIR"/../../ +cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } -python "${PROJECT_ROOT}"/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py $@ +cd "${PROJECT_ROOT}"/src/jukebox || { echo "Could not change directory"; exit 1; } +python run_register_rfid_reader.py $@ diff --git a/run_jukebox.sh b/run_jukebox.sh index c8ed9a373..cdda5dfa2 100755 --- a/run_jukebox.sh +++ b/run_jukebox.sh @@ -1,15 +1,16 @@ #!/usr/bin/env bash -# Runner script for jukebox to ensure +# Runner script for sniffer tool to ensure +# - correct venv activation # - independent from working directory # Change working directory to location of script SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -cd "$SCRIPT_DIR" || { echo "Could not change to script directory"; exit 1; } +PROJECT_ROOT="$(realpath "$SCRIPT_DIR")" -PROJECT_ROOT="$SCRIPT_DIR" +cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } -cd "${PROJECT_ROOT}"/src/jukebox || { echo "Could not change directory"; exit 1; } +cd "${PROJECT_ROOT}"/src/jukebox || { echo "Could not change directory"; exit 1; } python run_jukebox.py $@ diff --git a/src/jukebox/components/volume/run_configure_audio.py b/src/jukebox/run_configure_audio.py similarity index 100% rename from src/jukebox/components/volume/run_configure_audio.py rename to src/jukebox/run_configure_audio.py diff --git a/src/jukebox/jukebox/publishing/run_publicity_sniffer.py b/src/jukebox/run_publicity_sniffer.py similarity index 100% rename from src/jukebox/jukebox/publishing/run_publicity_sniffer.py rename to src/jukebox/run_publicity_sniffer.py diff --git a/src/jukebox/components/rfid/hardware/run_register_rfid_reader.py b/src/jukebox/run_register_rfid_reader.py similarity index 100% rename from src/jukebox/components/rfid/hardware/run_register_rfid_reader.py rename to src/jukebox/run_register_rfid_reader.py diff --git a/src/jukebox/jukebox/rpc/run_rpc_tool.py b/src/jukebox/run_rpc_tool.py similarity index 100% rename from src/jukebox/jukebox/rpc/run_rpc_tool.py rename to src/jukebox/run_rpc_tool.py diff --git a/tools/run_publicity_sniffer.sh b/tools/run_publicity_sniffer.sh index 542d20119..6d83c4ab0 100755 --- a/tools/run_publicity_sniffer.sh +++ b/tools/run_publicity_sniffer.sh @@ -1,14 +1,16 @@ #!/usr/bin/env bash # Runner script for sniffer tool to ensure +# - correct venv activation # - independent from working directory # Change working directory to location of script SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -cd "$SCRIPT_DIR" || { echo "Could not change to script directory"; exit 1; } +PROJECT_ROOT="$(realpath "$SCRIPT_DIR"/..)" -PROJECT_ROOT="$SCRIPT_DIR"/.. +cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } -python "${PROJECT_ROOT}"/src/jukebox/jukebox/publishing/run_publicity_sniffer.py $@ +cd "$PROJECT_ROOT"/src/jukebox || { echo "Could not change directory"; exit 1; } +python run_publicity_sniffer.py $@ diff --git a/tools/run_rpc_tool.sh b/tools/run_rpc_tool.sh index 885803a6e..86c775afa 100755 --- a/tools/run_rpc_tool.sh +++ b/tools/run_rpc_tool.sh @@ -1,14 +1,16 @@ #!/usr/bin/env bash -# Runner script for rpc tool to ensure +# Runner script for sniffer tool to ensure +# - correct venv activation # - independent from working directory # Change working directory to location of script SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -cd "$SCRIPT_DIR" || { echo "Could not change to script directory"; exit 1; } +PROJECT_ROOT="$(realpath "$SCRIPT_DIR"/..)" -PROJECT_ROOT="$SCRIPT_DIR"/.. +cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } -python "${PROJECT_ROOT}"/src/jukebox/jukebox/rpc/run_rpc_tool.py $@ +cd "$PROJECT_ROOT"/src/jukebox || { echo "Could not change directory"; exit 1; } +python run_rpc_tool.py $@ From 81fac269f12fdbb2d6d208168ca09426715215a5 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Thu, 1 Feb 2024 02:58:08 +0100 Subject: [PATCH 18/24] fix relative paths --- src/jukebox/run_configure_audio.py | 4 ++-- src/jukebox/run_register_rfid_reader.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/jukebox/run_configure_audio.py b/src/jukebox/run_configure_audio.py index 27c08aa2a..53ccb4212 100644 --- a/src/jukebox/run_configure_audio.py +++ b/src/jukebox/run_configure_audio.py @@ -290,7 +290,7 @@ def configure_pa_switch_on_connect(pulse_cfg_file_content): def query_create_default_pa_config(script_path, config_file_path): default_config_path = os.path.normpath(os.path.join(script_path, - '../../../../resources/default-settings/pulseaudio.default.pa')) + '../../resources/default-settings/pulseaudio.default.pa')) print(f"\n*** PulseAudio configuration file does not exist: '{config_file_path}'.") print(f" RPI-Jukebox-RFID's default is: '{default_config_path}'.\n") query = pyil.input_yesno("Create new config file from RPi-Jukebox-RFID default?", @@ -401,7 +401,7 @@ def goodbye(pulse_config: PaConfigClass): def main(): # Get absolute path of this script script_path = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) - default_cfg_jukebox = os.path.abspath(os.path.join(script_path, '../../../../shared/settings/jukebox.yaml')) + default_cfg_jukebox = os.path.abspath(os.path.join(script_path, '../../shared/settings/jukebox.yaml')) default_cfg_pulse = os.path.abspath(os.path.expanduser('~/.config/pulse/default.pa')) argparser = argparse.ArgumentParser(description='The Jukebox audio configuration tool') diff --git a/src/jukebox/run_register_rfid_reader.py b/src/jukebox/run_register_rfid_reader.py index cb02fa03b..13b0fd20c 100644 --- a/src/jukebox/run_register_rfid_reader.py +++ b/src/jukebox/run_register_rfid_reader.py @@ -34,7 +34,7 @@ def main(): # The default config file relative to this files location and independent of working directory script_path = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) - cfg_file_default = os.path.abspath(os.path.join(script_path, '/../../../../../shared/settings/rfid.yaml')) + cfg_file_default = os.path.abspath(os.path.join(script_path, '../../shared/settings/rfid.yaml')) parser = argparse.ArgumentParser() parser.add_argument("-f", "--force", From 1b86e1a43a0bbf9855dbc99025aa25f5c263d2cc Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Thu, 1 Feb 2024 03:27:25 +0100 Subject: [PATCH 19/24] update notes about config file paths --- documentation/builders/configuration.md | 3 ++- documentation/developers/known-issues.md | 2 +- resources/default-settings/jukebox.default.yaml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/documentation/builders/configuration.md b/documentation/builders/configuration.md index 78b348084..3e4bc87f5 100644 --- a/documentation/builders/configuration.md +++ b/documentation/builders/configuration.md @@ -31,7 +31,8 @@ $ systemctl --user start jukebox-daemon To try different configurations, you can start the Jukebox with a custom config file. This could be useful if you want your Jukebox to only allow a lower volume when started at night time when there is time to go to bed :-) +The path to the custom config file must be either absolute or relativ to the folder `src/jukebox/` ```bash -$ ./run_jukebox.sh --conf path/to/custom/config.yaml +$ ./run_jukebox.sh --conf /absolute/path/to/custom/config.yaml ``` diff --git a/documentation/developers/known-issues.md b/documentation/developers/known-issues.md index db3429bcc..74823a16a 100644 --- a/documentation/developers/known-issues.md +++ b/documentation/developers/known-issues.md @@ -21,6 +21,6 @@ RUN cd ${HOME} && mkdir ${ZMQ_TMP_DIR} && cd ${ZMQ_TMP_DIR}; \ ## Configuration In `jukebox.yaml` (and all other config files): -Always use relative path from settingsfile `../../`, but do not use relative paths with `~/`. +Always use relative path from folder `src/jukebox` (`../../`), but do not use relative paths with `~/`. **Sole** exception is in `playermpd.mpd_conf`. diff --git a/resources/default-settings/jukebox.default.yaml b/resources/default-settings/jukebox.default.yaml index 5c37f178a..c087cc024 100644 --- a/resources/default-settings/jukebox.default.yaml +++ b/resources/default-settings/jukebox.default.yaml @@ -1,5 +1,5 @@ # IMPORTANT: -# Always use relative path from settingsfile `../../`, but do not use relative paths with `~/`. +# Always use relative path from folder `src/jukebox` (`../../`), but do not use relative paths with `~/`. # Sole (!) exception is in playermpd.mpd_conf system: box_name: Jukebox From 7cda2cbea06c6dbe22ee67c2f8531dde9cd40d86 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Thu, 1 Feb 2024 03:42:14 +0100 Subject: [PATCH 20/24] update caller scripts path handling --- installation/components/setup_audio_sink.sh | 10 +++++----- installation/components/setup_rfid_reader.sh | 10 +++++----- run_jukebox.sh | 10 +++++----- tools/run_publicity_sniffer.sh | 10 +++++----- tools/run_rpc_tool.sh | 10 +++++----- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/installation/components/setup_audio_sink.sh b/installation/components/setup_audio_sink.sh index 3f332781a..e46b3abc0 100755 --- a/installation/components/setup_audio_sink.sh +++ b/installation/components/setup_audio_sink.sh @@ -4,13 +4,13 @@ # - correct venv activation # - independent from working directory -# Change working directory to location of script +# Change working directory to project root SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -PROJECT_ROOT="$(realpath "$SCRIPT_DIR"/../..)" +PROJECT_ROOT="$SCRIPT_DIR"/../.. +cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } -cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } -source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } +source .venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } -cd "${PROJECT_ROOT}"/src/jukebox || { echo "Could not change directory"; exit 1; } +cd src/jukebox || { echo "Could not change directory"; exit 1; } python run_configure_audio.py $@ diff --git a/installation/components/setup_rfid_reader.sh b/installation/components/setup_rfid_reader.sh index 29fcf6b97..582871f81 100755 --- a/installation/components/setup_rfid_reader.sh +++ b/installation/components/setup_rfid_reader.sh @@ -4,13 +4,13 @@ # - correct venv activation # - independent from working directory -# Change working directory to location of script +# Change working directory to project root SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -PROJECT_ROOT="$(realpath "$SCRIPT_DIR"/../..)" +PROJECT_ROOT="$SCRIPT_DIR"/../.. +cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } -cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } -source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } +source .venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } -cd "${PROJECT_ROOT}"/src/jukebox || { echo "Could not change directory"; exit 1; } +cd src/jukebox || { echo "Could not change directory"; exit 1; } python run_register_rfid_reader.py $@ diff --git a/run_jukebox.sh b/run_jukebox.sh index cdda5dfa2..68bf636f5 100755 --- a/run_jukebox.sh +++ b/run_jukebox.sh @@ -4,13 +4,13 @@ # - correct venv activation # - independent from working directory -# Change working directory to location of script +# Change working directory to project root SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -PROJECT_ROOT="$(realpath "$SCRIPT_DIR")" +PROJECT_ROOT="$SCRIPT_DIR" +cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } -cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } -source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } +source .venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } -cd "${PROJECT_ROOT}"/src/jukebox || { echo "Could not change directory"; exit 1; } +cd src/jukebox || { echo "Could not change directory"; exit 1; } python run_jukebox.py $@ diff --git a/tools/run_publicity_sniffer.sh b/tools/run_publicity_sniffer.sh index 6d83c4ab0..e82fdb80d 100755 --- a/tools/run_publicity_sniffer.sh +++ b/tools/run_publicity_sniffer.sh @@ -4,13 +4,13 @@ # - correct venv activation # - independent from working directory -# Change working directory to location of script +# Change working directory to project root SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -PROJECT_ROOT="$(realpath "$SCRIPT_DIR"/..)" +PROJECT_ROOT="$SCRIPT_DIR"/.. +cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } -cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } -source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } +source .venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } -cd "$PROJECT_ROOT"/src/jukebox || { echo "Could not change directory"; exit 1; } +cd src/jukebox || { echo "Could not change directory"; exit 1; } python run_publicity_sniffer.py $@ diff --git a/tools/run_rpc_tool.sh b/tools/run_rpc_tool.sh index 86c775afa..c6e88ab44 100755 --- a/tools/run_rpc_tool.sh +++ b/tools/run_rpc_tool.sh @@ -4,13 +4,13 @@ # - correct venv activation # - independent from working directory -# Change working directory to location of script +# Change working directory to project root SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -PROJECT_ROOT="$(realpath "$SCRIPT_DIR"/..)" +PROJECT_ROOT="$SCRIPT_DIR"/.. +cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } -cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } -source "${PROJECT_ROOT}"/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } +source .venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } -cd "$PROJECT_ROOT"/src/jukebox || { echo "Could not change directory"; exit 1; } +cd src/jukebox || { echo "Could not change directory"; exit 1; } python run_rpc_tool.py $@ From 6219f716a912cc2196b95d0aca1a9729f28fd837 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Thu, 1 Feb 2024 08:46:06 +0100 Subject: [PATCH 21/24] update comments --- installation/components/setup_audio_sink.sh | 2 +- installation/components/setup_rfid_reader.sh | 2 +- run_jukebox.sh | 2 +- tools/run_publicity_sniffer.sh | 2 +- tools/run_rpc_tool.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/installation/components/setup_audio_sink.sh b/installation/components/setup_audio_sink.sh index e46b3abc0..dc1313e1c 100755 --- a/installation/components/setup_audio_sink.sh +++ b/installation/components/setup_audio_sink.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Runner script for sniffer tool to ensure +# Runner script to ensure # - correct venv activation # - independent from working directory diff --git a/installation/components/setup_rfid_reader.sh b/installation/components/setup_rfid_reader.sh index 582871f81..ebabcf12b 100755 --- a/installation/components/setup_rfid_reader.sh +++ b/installation/components/setup_rfid_reader.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Runner script for sniffer tool to ensure +# Runner script to ensure # - correct venv activation # - independent from working directory diff --git a/run_jukebox.sh b/run_jukebox.sh index 68bf636f5..48e8aa7ba 100755 --- a/run_jukebox.sh +++ b/run_jukebox.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Runner script for sniffer tool to ensure +# Runner script to ensure # - correct venv activation # - independent from working directory diff --git a/tools/run_publicity_sniffer.sh b/tools/run_publicity_sniffer.sh index e82fdb80d..2ea47b48b 100755 --- a/tools/run_publicity_sniffer.sh +++ b/tools/run_publicity_sniffer.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Runner script for sniffer tool to ensure +# Runner script to ensure # - correct venv activation # - independent from working directory diff --git a/tools/run_rpc_tool.sh b/tools/run_rpc_tool.sh index c6e88ab44..dad895c56 100755 --- a/tools/run_rpc_tool.sh +++ b/tools/run_rpc_tool.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Runner script for sniffer tool to ensure +# Runner script to ensure # - correct venv activation # - independent from working directory From 86b210ed741c7de4cc9ca59f26839102619e0516 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:05:04 +0100 Subject: [PATCH 22/24] add venv activation to tests --- .githooks/post-merge | 1 + .github/workflows/codeql-analysis_v3.yml | 5 ++++- .github/workflows/pythonpackage_future3.yml | 6 ++++-- run_docgeneration.sh | 10 +++++++--- run_flake8.sh | 11 +++++++---- run_pytest.sh | 11 +++++++---- 6 files changed, 30 insertions(+), 14 deletions(-) diff --git a/.githooks/post-merge b/.githooks/post-merge index 6fc6e4f54..07b81db41 100755 --- a/.githooks/post-merge +++ b/.githooks/post-merge @@ -43,6 +43,7 @@ warn_python_requirements() { echo "ATTENTION: Python requirements have changed since last pull!" echo "" echo "To update python requirements on the RPi run" + echo "$ source .venv/bin/activate" echo "$ python -m pip install --upgrade -r requirements.txt" echo "************************************************************" echo -e "\n" diff --git a/.github/workflows/codeql-analysis_v3.yml b/.github/workflows/codeql-analysis_v3.yml index 1c1c68ba3..b63be3a80 100644 --- a/.github/workflows/codeql-analysis_v3.yml +++ b/.github/workflows/codeql-analysis_v3.yml @@ -44,7 +44,10 @@ jobs: - name: Install dependencies run: | # Install necessary packages - sudo apt-get install libasound2-dev pulseaudio + sudo apt-get install libasound2-dev pulseaudio python3-venv + python3 -m venv .venv + source ".venv/bin/activate" + python -m pip install --upgrade pip pip install -r requirements.txt # Set the `CODEQL-PYTHON` environment variable to the Python executable diff --git a/.github/workflows/pythonpackage_future3.yml b/.github/workflows/pythonpackage_future3.yml index f2174d0c0..dbaae25ee 100644 --- a/.github/workflows/pythonpackage_future3.yml +++ b/.github/workflows/pythonpackage_future3.yml @@ -30,7 +30,10 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y libasound2-dev pulseaudio + sudo apt-get install -y libasound2-dev pulseaudio python3-venv + python3 -m venv .venv + source ".venv/bin/activate" + python3 -m pip install --upgrade pip pip3 install -r requirements.txt # For operation of the Jukebox, ZMQ must be compiled from sources due to Websocket support @@ -51,7 +54,6 @@ jobs: parallel: true - name: Lint with flake8 run: | - pip3 install flake8 # Stop the build if linting fails ./run_flake8.sh diff --git a/run_docgeneration.sh b/run_docgeneration.sh index 53b18ed57..4fb5f1dc9 100755 --- a/run_docgeneration.sh +++ b/run_docgeneration.sh @@ -1,12 +1,16 @@ #!/usr/bin/env bash -# Runner script for pydoc-markdown to ensure +# Runner script to ensure +# - correct venv activation # - independent from working directory -# Change working directory to location of script +# Change working directory to project root SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -cd "$SCRIPT_DIR" || { echo "Could not change to top-level project directory"; exit 1; } +PROJECT_ROOT="$SCRIPT_DIR" +cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } + +source .venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } # Run pydoc-markdown # make sure, directory exists diff --git a/run_flake8.sh b/run_flake8.sh index 8fd6dcb53..f6603dc0a 100755 --- a/run_flake8.sh +++ b/run_flake8.sh @@ -1,13 +1,16 @@ #!/usr/bin/env bash -# Runner script for flak8 to ensure -# - correct config file +# Runner script to ensure +# - correct venv activation # - independent from working directory -# Change working directory to location of script +# Change working directory to project root SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -cd "$SCRIPT_DIR" || { echo "Could not change to top-level project directory"; exit 1; } +PROJECT_ROOT="$SCRIPT_DIR" +cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } + +source .venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } # Run flake8 flake8 --config .flake8 "$@" diff --git a/run_pytest.sh b/run_pytest.sh index 91c56f46c..c944419ae 100755 --- a/run_pytest.sh +++ b/run_pytest.sh @@ -1,13 +1,16 @@ #!/usr/bin/env bash -# Runner script for pytest to ensure -# - correct config file +# Runner script to ensure +# - correct venv activation # - independent from working directory -# Change working directory to location of script +# Change working directory to project root SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" -cd "$SCRIPT_DIR" || { echo "Could not change to top-level project directory"; exit 1; } +PROJECT_ROOT="$SCRIPT_DIR" +cd "$PROJECT_ROOT" || { echo "Could not change directory"; exit 1; } + +source .venv/bin/activate || { echo "ERROR: Failed to activate virtual environment for python"; exit 1; } # Run pytest pytest -c pytest.ini $@ From a33c25cb058f423fc7f546f602681110c667c514 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Thu, 1 Feb 2024 09:08:54 +0100 Subject: [PATCH 23/24] explicit installation of python3-venv not needed --- .github/workflows/codeql-analysis_v3.yml | 2 +- .github/workflows/pythonpackage_future3.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis_v3.yml b/.github/workflows/codeql-analysis_v3.yml index b63be3a80..89693df2a 100644 --- a/.github/workflows/codeql-analysis_v3.yml +++ b/.github/workflows/codeql-analysis_v3.yml @@ -44,7 +44,7 @@ jobs: - name: Install dependencies run: | # Install necessary packages - sudo apt-get install libasound2-dev pulseaudio python3-venv + sudo apt-get install libasound2-dev pulseaudio python3 -m venv .venv source ".venv/bin/activate" diff --git a/.github/workflows/pythonpackage_future3.yml b/.github/workflows/pythonpackage_future3.yml index dbaae25ee..2236a5a47 100644 --- a/.github/workflows/pythonpackage_future3.yml +++ b/.github/workflows/pythonpackage_future3.yml @@ -30,7 +30,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install -y libasound2-dev pulseaudio python3-venv + sudo apt-get install -y libasound2-dev pulseaudio python3 -m venv .venv source ".venv/bin/activate" From 0b5b5dadf27243f16342642b063f7586036178f6 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Thu, 1 Feb 2024 10:24:40 +0100 Subject: [PATCH 24/24] renamed audio setup file. updated docs path. --- documentation/developers/coreapps.md | 2 +- .../{setup_audio_sink.sh => setup_configure_audio.sh} | 0 resources/default-settings/pulseaudio.default.pa | 2 +- src/jukebox/components/volume/__init__.py | 2 +- src/jukebox/run_configure_audio.py | 2 +- src/jukebox/run_register_rfid_reader.py | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename installation/components/{setup_audio_sink.sh => setup_configure_audio.sh} (100%) mode change 100755 => 100644 diff --git a/documentation/developers/coreapps.md b/documentation/developers/coreapps.md index 1d6c79be3..47e92c2c7 100644 --- a/documentation/developers/coreapps.md +++ b/documentation/developers/coreapps.md @@ -25,7 +25,7 @@ See [Best practice procedure](../builders/configuration.md#best-practice-procedu ### Audio -**Scriptname:** [setup_audio_sink.sh](../../installation/components/setup_audio_sink.sh) +**Scriptname:** [setup_configure_audio.sh](../../installation/components/setup_configure_audio.sh) Setup tool to register the PulseAudio sinks as primary and secondary audio outputs. diff --git a/installation/components/setup_audio_sink.sh b/installation/components/setup_configure_audio.sh old mode 100755 new mode 100644 similarity index 100% rename from installation/components/setup_audio_sink.sh rename to installation/components/setup_configure_audio.sh diff --git a/resources/default-settings/pulseaudio.default.pa b/resources/default-settings/pulseaudio.default.pa index 0fe0376b7..e4d20ec53 100644 --- a/resources/default-settings/pulseaudio.default.pa +++ b/resources/default-settings/pulseaudio.default.pa @@ -147,5 +147,5 @@ load-module module-filter-apply #set-default-source input ### Configuration by Jukebox's Tool may come below -# Run ./installation/components/run_configure_audio.sh for configuration +# Run ./installation/components/setup_configure_audio.sh for configuration diff --git a/src/jukebox/components/volume/__init__.py b/src/jukebox/components/volume/__init__.py index 62ae239b7..9dd827e4a 100644 --- a/src/jukebox/components/volume/__init__.py +++ b/src/jukebox/components/volume/__init__.py @@ -603,7 +603,7 @@ def parse_config() -> List[PulseAudioSinkClass]: logger.error(f"Configured sink '{pulse_sink_name}' not available sinks '{all_sinks}!\n" f"Using default sink '{default_sink_name}' as fallback\n" f"Things like audio sink toggle and volume limit will not work as expected!\n" - f"Please run audio config tool: ./installation/components/run_configure_audio.sh") + f"Please run audio config tool: ./installation/components/setup_configure_audio.sh") sink_list.append(PulseAudioSinkClass(alias, pulse_sink_name, volume_limit)) key = 'secondary' diff --git a/src/jukebox/run_configure_audio.py b/src/jukebox/run_configure_audio.py index 53ccb4212..93f0a4c6a 100644 --- a/src/jukebox/run_configure_audio.py +++ b/src/jukebox/run_configure_audio.py @@ -5,7 +5,7 @@ Will also setup equalizer and mono down mixer in the pulseaudio config file. Run this once after installation. Can be re-run at any time to change the settings. -For more information see [Audio Configuration](./../../builders/audio.md#audio-configuration). +For more information see [Audio Configuration](../../builders/audio.md#audio-configuration). """ import os import argparse diff --git a/src/jukebox/run_register_rfid_reader.py b/src/jukebox/run_register_rfid_reader.py index 13b0fd20c..91d363157 100644 --- a/src/jukebox/run_register_rfid_reader.py +++ b/src/jukebox/run_register_rfid_reader.py @@ -3,7 +3,7 @@ Setup tool to configure the RFID Readers. Run this once to register and configure the RFID readers with the Jukebox. Can be re-run at any time to change -the settings. For more information see [RFID Readers](./../../documentation/developers/rfid/README.md). +the settings. For more information see [RFID Readers](../rfid/README.md). > [!NOTE] > This tool will always write a new configurations file. Thus, overwrite the old one (after checking with the user).