From 569be42055016c8dab2e993ab366a3629d4396a3 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Sat, 9 Dec 2023 23:41:02 +0100 Subject: [PATCH 1/8] add proxy script to activate python venv. updated docs --- .githooks/post-merge | 4 ++-- documentation/builders/audio.md | 8 ++------ documentation/builders/concepts.md | 4 ++-- documentation/builders/configuration.md | 6 +++--- documentation/builders/rpc-commands.md | 2 +- documentation/builders/troubleshooting.md | 6 +++--- documentation/developers/coreapps.md | 5 ++++- documentation/developers/development-environment.md | 2 +- documentation/developers/rfid/basics.md | 5 ++--- documentation/developers/rfid/genericusb.md | 2 +- documentation/developers/rfid/mfrc522_spi.md | 2 +- documentation/developers/rfid/template_reader.md | 2 +- requirements.txt | 2 +- resources/default-settings/jukebox.default.yaml | 2 +- resources/default-settings/pulseaudio.default.pa | 2 +- run_flake8.sh | 2 +- run_pytest.sh | 2 +- run_python.sh | 9 +++++++++ .../components/rfid/hardware/generic_usb/generic_usb.py | 2 +- .../rfid/hardware/pn532_i2c_py532/requirements.txt | 2 +- .../components/rfid/hardware/rc522_spi/requirements.txt | 2 +- 21 files changed, 40 insertions(+), 33 deletions(-) create mode 100644 run_python.sh diff --git a/.githooks/post-merge b/.githooks/post-merge index 3b838c87c..319291f6b 100755 --- a/.githooks/post-merge +++ b/.githooks/post-merge @@ -43,7 +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 "$ python -m pip install --upgrade -r requirements.txt" + echo "$ ./run_python.sh pip install --upgrade -r requirements.txt" echo "************************************************************" echo -e "\n" } @@ -81,4 +81,4 @@ if [[ -n $githooks_changed ]]; then fi echo -e "\nTo see a summary of what happened since your last pull, do:" -echo -e "git show --oneline -s ORIG_HEAD..HEAD\n" \ No newline at end of file +echo -e "git show --oneline -s ORIG_HEAD..HEAD\n" diff --git a/documentation/builders/audio.md b/documentation/builders/audio.md index 07d24e40f..bc8f2bf62 100644 --- a/documentation/builders/audio.md +++ b/documentation/builders/audio.md @@ -17,7 +17,7 @@ To set up the audio 1. Follow the setup steps according to your sound card 2. Check that the sound output works [as described below](audio.md#checking-system-sound-output) -3. Run the the tool [run_configure_audio](../developers/coreapps.md#run_configure_audio.py) +3. Run the [audio configuration tool](../developers/coreapps.md#run_configure_audio.py) 4. [Fine-tune audio parameters](audio.md#additional-options) ## Checking system sound output @@ -134,8 +134,4 @@ You are, of course, free to modify the PulseAudio configuration to your needs. R 1. [PulseAudio Documentation](https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User) 2. [PulseAudio Examples](https://wiki.archlinux.org/title/PulseAudio/Examples) -In this case, run the configuration tool with below parameter to avoid touching the PulseAudio configuration file. - -```bash -$ ./run_configure_audio.py --ro_pulse -``` +In this case, run the [audio configuration tool](../developers/coreapps.md#run_configure_audio.py) with the parameter `--ro_pulse` to avoid touching the PulseAudio configuration file. diff --git a/documentation/builders/concepts.md b/documentation/builders/concepts.md index c08a33caa..a14592d75 100644 --- a/documentation/builders/concepts.md +++ b/documentation/builders/concepts.md @@ -16,10 +16,10 @@ The Remote Procedure Call (RPC) server allows remotely triggering actions (e.g., Why should you care? Because we use the same protocol when triggering actions from other inputs like a card swipe, a GPIO button press, etc. How that works is described in [RPC Commands](rpc-commands.md). -We also have a tool to send RPC commands to the running Jukebox application: [run_rpc_tool.py](../developers/coreapps.md#run_rpc_toolpy) +We also have a [tool to send RPC commands](../developers/coreapps.md#run_rpc_tool.py) to the running Jukebox application. ## Publishing Message Queue The Publishing Message Queue is the complementary part to the RPC where the core application publishes its status and status updates. As a user, you need not worry about it. -If you want to interact with the Jukebox from your own application, this is where you get the current state from. Details about the protocol can be found here (TBD). A sniffer tool exists which listens and prints the incoming status messages: [run_publicity_sniffer.py](../developers/coreapps.md#run_publicity_snifferpy). +If you want to interact with the Jukebox from your own application, this is where you get the current state from. Details about the protocol can be found here (TBD). A [sniffer tool](../developers/coreapps.md#run_publicity_sniffer.py) exists which listens and prints the incoming status messages. diff --git a/documentation/builders/configuration.md b/documentation/builders/configuration.md index e0240ddbe..ea3a5ab91 100644 --- a/documentation/builders/configuration.md +++ b/documentation/builders/configuration.md @@ -7,7 +7,7 @@ The majority of configuration options is only available by editing the config fi *when the service is not running!* Don't fear (overly), they contain commentaries. -For several aspects we have :ref:`developer/coreapps:Configuration Tools` and detailed guides: +For several aspects we have [configuration tools](../developers/coreapps.md#configuration-tools) and detailed guides: * [Audio Configuration](./audio.md#audio-configuration) * [RFID Reader Configuration](../developers/rfid/basics.md#reader-configuration) @@ -24,7 +24,7 @@ $ systemctl --user stop jukebox-daemon $ nano ./shared/settings/jukebox.yaml # Start Jukebox in console and check the log output (optional) -$ ./src/jukebox/run_jukebox.py +$ ./run_python.sh ./src/jukebox/run_jukebox.py # and if OK, press Ctrl-C and restart the service # Restart the service @@ -36,5 +36,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 -$./run_jukebox.py --conf ../path/to/custom/config.yaml +$ ./run_python.sh ./src/jukebox/run_jukebox.py --conf path/to/custom/config.yaml ``` diff --git a/documentation/builders/rpc-commands.md b/documentation/builders/rpc-commands.md index f578ccd99..fa367f588 100644 --- a/documentation/builders/rpc-commands.md +++ b/documentation/builders/rpc-commands.md @@ -107,6 +107,6 @@ You will find some more examples the configuration of the [Card Database](card-d ## For developers -To send RPC commands for testing and debugging purpose you can use the CLI Tool [`run_rpc_tool.py`](../developers/coreapps.md#run_rpc_toolpy) +To send RPC commands for testing and debugging purpose you can use the [CLI Tool](../developers/coreapps.md#run_rpc_tool.py). Also here is a ready-to-use decoding functions which decodes an RPC command (with or without alias) from a YAML entry:func:`jukebox.utils.decode_rpc_command`. diff --git a/documentation/builders/troubleshooting.md b/documentation/builders/troubleshooting.md index a0618ab5d..1b92666a1 100644 --- a/documentation/builders/troubleshooting.md +++ b/documentation/builders/troubleshooting.md @@ -64,10 +64,10 @@ $ systemctl --user stop jukebox-daemon # Start the Jukebox in debug mode: # with default logger: -$ ./run_jukebox.py +$ ./run_python.sh ./src/jukebox/run_jukebox.py # or with custom logger configuration: -$ ./run_jukebox.py --logger ../path/to/logger.yaml +$ ./run_python.sh ./src/jukebox/run_jukebox.py --logger path/to/custom/logger.yaml ``` ### Fallback configuration @@ -77,7 +77,7 @@ Attention: This only emits messages to the console and does not write to the log This is more a fallback features: ``` bash -$ ./run_jukebox.py -vv +$ ./run_python.sh ./src/jukebox/run_jukebox.py -vv ``` ### Extreme cases diff --git a/documentation/developers/coreapps.md b/documentation/developers/coreapps.md index 2fa8b84e9..9023a5e6f 100644 --- a/documentation/developers/coreapps.md +++ b/documentation/developers/coreapps.md @@ -4,9 +4,10 @@ The Jukebox\'s core apps are located in `src/jukebox`. Run the following command to learn more about each app and its parameters: ``` bash -$ ./run_app_name.py -h +$ ./run_python.sh ./src/jukebox/ -h ``` + ## Jukebox Core ### `run_jukebox.py` @@ -19,6 +20,7 @@ Usually this runs as a service, which is started automatically after boot-up. At For debugging, it is usually desirable to run the Jukebox directly from the console rather than as service. This gives direct logging info in the console and allows changing command line parameters. See [Troubleshooting](../builders/troubleshooting.md). + ## Configuration Tools Before running the configuration tools, stop the Jukebox Core service. @@ -45,6 +47,7 @@ Run this once to register and configure the RFID readers with the Jukebox. Can b > [!NOTE] > This tool will always write a new configurations file. Thus, overwrite the old one (after checking with the user). Any manual modifications to the settings will have to be re-applied + ## Developer Tools ### `run_rpc_tool.py` diff --git a/documentation/developers/development-environment.md b/documentation/developers/development-environment.md index d79a6101e..aee130284 100644 --- a/documentation/developers/development-environment.md +++ b/documentation/developers/development-environment.md @@ -61,7 +61,7 @@ Github, which is taken care of by the installation script. For regular machines, the normal package can be installed: ``` bash -pip install pyzmq +./run_python.sh pip install pyzmq ``` You will have to start Jukebox core application and the WebUI diff --git a/documentation/developers/rfid/basics.md b/documentation/developers/rfid/basics.md index 7a5aa37d9..078340236 100644 --- a/documentation/developers/rfid/basics.md +++ b/documentation/developers/rfid/basics.md @@ -35,8 +35,7 @@ Readers operate on one of two different frequencies: 125kHz or 13.56 MHz. Make s ## Reader Configuration During the installation process, you can already configure a RFID -reader. To manually configure RFID reader(s), -[please run the tool](../coreapps.md#run_register_rfid_reader.py), (`src/jukebox/run_register_rfid_reader.py`). +reader. To manually configure RFID reader(s) run the [RFID reader configuration tool](../coreapps.md#run_register_rfid_reader.py). It will generate a reader configuration file at `shared/settings/rfid.yaml`. You can re-run the tool to change the @@ -67,7 +66,7 @@ Indicates the Python package used for this reader. Filled by the RFID configurat #### config: -Filled by the [RFID configuration tool](../coreapps.md#run_register_rfid_reader.py) (`src/jukebox/run_register_rfid_reader.py`) based on default values and user input. After running the tool, you may manually change some settings here, as not everything can be configured through the tool. Note that re-running the tool will completely rewrite the configuration file. +Filled by the [RFID reader configuration tool](../coreapps.md#run_register_rfid_reader.py) based on default values and user input. After running the tool, you may manually change some settings here, as not everything can be configured through the tool. Note that re-running the tool will completely rewrite the configuration file. #### same_id_delay: float \| integer diff --git a/documentation/developers/rfid/genericusb.md b/documentation/developers/rfid/genericusb.md index 23975cf14..924550f8f 100644 --- a/documentation/developers/rfid/genericusb.md +++ b/documentation/developers/rfid/genericusb.md @@ -4,7 +4,7 @@ This module covers all types of USB-based RFID input readers. If you plan to connect multiple USB-based RFID readers to the Jukebox, make -sure to connect all of them before running the registration tool [run_register_rfid_reader.py](../coreapps.md#run_register_rfid_readerpy). +sure to connect all of them before running the [RFID reader configuration tool](../coreapps.md#run_register_rfid_reader.py). > [!NOTE] > The user needs to be part of the group \'input\' for evdev to work. This should usually be the case. However, a user can be added with: diff --git a/documentation/developers/rfid/mfrc522_spi.md b/documentation/developers/rfid/mfrc522_spi.md index f7710b2b1..d8cb4fd26 100644 --- a/documentation/developers/rfid/mfrc522_spi.md +++ b/documentation/developers/rfid/mfrc522_spi.md @@ -6,7 +6,7 @@ RC522 RFID reader via SPI connection. ## Installation -Run the [run_register_rfid_reader.py](../coreapps.md#run_register_rfid_reader.py) tool for guided +Run the [RFID reader configuration tool](../coreapps.md#run_register_rfid_reader.py) for guided installation. ## Options diff --git a/documentation/developers/rfid/template_reader.md b/documentation/developers/rfid/template_reader.md index 0f4c3e939..5c729cbf3 100644 --- a/documentation/developers/rfid/template_reader.md +++ b/documentation/developers/rfid/template_reader.md @@ -9,7 +9,7 @@ This template provides the skeleton API for a new Reader. If you follow the conventions outlined below, your new reader will be picked up automatically There is no extra need to register the reader module with -the Phoniebox. Just re-run `the reader config tool `. +the Phoniebox. Just re-run [RFID reader configuration tool](../coreapps.md#run_register_rfid_reader.py). Follow the instructions in [template_new_reader.py] diff --git a/requirements.txt b/requirements.txt index 0f8c8c86d..f4b28c820 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # Common python packages -# You need to install these with `python -m pip install --no-cache-dir -r requirements.txt` +# You need to install these with `./run_python.sh pip install --upgrade --force-reinstall -q -r path/to/requirements.txt` setuptools wheel diff --git a/resources/default-settings/jukebox.default.yaml b/resources/default-settings/jukebox.default.yaml index 91ada74c6..36661c992 100644 --- a/resources/default-settings/jukebox.default.yaml +++ b/resources/default-settings/jukebox.default.yaml @@ -30,7 +30,7 @@ pulse: toggle_on_connect: true # Limit maximum volume range to XX % - can be changed through the UI (for temporary use) soft_max_volume: 70 - # Run the tool run_configure_audio.py to configure the pulseaudio sinks + # Run the audio configuration tool to configure the pulseaudio sinks # # After startup, the audio output defaults to primary # Any Bluetooth device should be the secondary (as it may not always be available directly after boot) diff --git a/resources/default-settings/pulseaudio.default.pa b/resources/default-settings/pulseaudio.default.pa index ee91ff9bf..8f90a940d 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 `./run_python.sh ./src/jukebox/run_configure_audio.py` for configuration diff --git a/run_flake8.sh b/run_flake8.sh index a9ec73285..e1b671200 100755 --- a/run_flake8.sh +++ b/run_flake8.sh @@ -10,4 +10,4 @@ SCRIPT_DIR="$(dirname "$SOURCE")" cd "$SCRIPT_DIR" || (echo "Could not change to top-level project directory" && exit 1) # Run flake8 -flake8 --config .flake8 "$@" +./run_python.sh flake8 --config .flake8 "$@" diff --git a/run_pytest.sh b/run_pytest.sh index a3cbd8df6..32c4a9914 100755 --- a/run_pytest.sh +++ b/run_pytest.sh @@ -10,4 +10,4 @@ SCRIPT_DIR="$(dirname "$SOURCE")" cd "$SCRIPT_DIR" || (echo "Could not change to top-level project directory" && exit 1) # Run pytest -pytest -c pytest.ini +./run_python.sh pytest -c pytest.ini diff --git a/run_python.sh b/run_python.sh new file mode 100644 index 000000000..530851039 --- /dev/null +++ b/run_python.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# Runner script for python scripts with activated venv + +SOURCE=${BASH_SOURCE[0]} +SCRIPT_DIR="$(dirname "$SOURCE")" +source ${SCRIPT_DIR}/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment"; exit 1; } + +$@ diff --git a/src/jukebox/components/rfid/hardware/generic_usb/generic_usb.py b/src/jukebox/components/rfid/hardware/generic_usb/generic_usb.py index 287bd6b9e..0bf84012b 100755 --- a/src/jukebox/components/rfid/hardware/generic_usb/generic_usb.py +++ b/src/jukebox/components/rfid/hardware/generic_usb/generic_usb.py @@ -82,7 +82,7 @@ def query_customization() -> dict: print(f" {Colors.lightgreen}ID{Colors.reset}: " f"{Colors.lightgreen}isKey{Colors.reset}: {Colors.lightcyan}Name{Colors.reset}") if len(devices) == 0: - logger.error("USB device list is empty. Make sure USB RFID reader is connected. Then re-run register_reader.py") + logger.error("USB device list is empty. Make sure USB RFID reader is connected. Then re-run RFID reader configuration tool") return {'device_name': '__error_empty_device_list__'} for idx, (dev, key) in enumerate(zip(devices, devices_is_key)): print(f" {Colors.lightgreen}{idx:2d}{Colors.reset}:" diff --git a/src/jukebox/components/rfid/hardware/pn532_i2c_py532/requirements.txt b/src/jukebox/components/rfid/hardware/pn532_i2c_py532/requirements.txt index 9b156854b..b7f34ce09 100644 --- a/src/jukebox/components/rfid/hardware/pn532_i2c_py532/requirements.txt +++ b/src/jukebox/components/rfid/hardware/pn532_i2c_py532/requirements.txt @@ -1,3 +1,3 @@ # PN532 related requirements -# You need to install these with `python -m pip install --upgrade --force-reinstall -q -r requirements.txt` +# You need to install these with `./run_python.sh pip install --upgrade --force-reinstall -q -r path/to/requirements.txt` py532lib diff --git a/src/jukebox/components/rfid/hardware/rc522_spi/requirements.txt b/src/jukebox/components/rfid/hardware/rc522_spi/requirements.txt index 56b9ca4dc..2b4c497c0 100644 --- a/src/jukebox/components/rfid/hardware/rc522_spi/requirements.txt +++ b/src/jukebox/components/rfid/hardware/rc522_spi/requirements.txt @@ -1,5 +1,5 @@ # RC522 related requirements -# You need to install these with `python -m pip install --upgrade --force-reinstall -q -r requirements.txt` +# You need to install these with `./run_python.sh pip install --upgrade --force-reinstall -q -r path/to/requirements.txt` pi-rc522==2.3.0 From 71889644bade15e3f3faf1d6c60be42115577051 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Sun, 10 Dec 2023 00:49:34 +0100 Subject: [PATCH 2/8] harmonize paths in docs --- documentation/builders/configuration.md | 2 +- documentation/builders/system.md | 2 +- documentation/builders/troubleshooting.md | 12 ++++++------ documentation/developers/developer-issues.md | 1 + documentation/developers/docker.md | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/documentation/builders/configuration.md b/documentation/builders/configuration.md index ea3a5ab91..d7b7206c8 100644 --- a/documentation/builders/configuration.md +++ b/documentation/builders/configuration.md @@ -1,6 +1,6 @@ # Jukebox Configuration -The Jukebox configuration is managed by set of files located in `../shared/settings`. +The Jukebox configuration is managed by a set of files located in `shared/settings`. Some configuration changes can be made through the WebUI and take immediate effect. The majority of configuration options is only available by editing the config files - diff --git a/documentation/builders/system.md b/documentation/builders/system.md index 873d489f6..766b57e68 100644 --- a/documentation/builders/system.md +++ b/documentation/builders/system.md @@ -101,7 +101,7 @@ Starting and stopping the service can be useful for debugging or configuration c The Web UI is served using nginx. Nginx runs as a system service. The home directory is localed at ``` -~/RPi-Jukebox-RFID/src/webapp/build +./src/webapp/build ``` The Nginx configuration is located at diff --git a/documentation/builders/troubleshooting.md b/documentation/builders/troubleshooting.md index 1b92666a1..59bb028f7 100644 --- a/documentation/builders/troubleshooting.md +++ b/documentation/builders/troubleshooting.md @@ -15,8 +15,8 @@ Debugging your setup runs in several steps ## The short answer ```bash -../shared/logs/app.log : Complete Debug Messages -../shared/logs/errors.log: Only Errors and Warnings +shared/logs/app.log : Complete Debug Messages +shared/logs/errors.log: Only Errors and Warnings ``` These files always contain the messages of the current run only. @@ -33,9 +33,9 @@ http://ip.of.your.box/logs ## The long answer: A few more details -If started without parameters, the Jukebox checks for the existence of `../shared/settings/logger.yaml` +If started without parameters, the Jukebox checks for the existence of `shared/settings/logger.yaml` and if present, uses that configuration for logging. This file is created by the installation process. -The default configuration file is also provided in `../resources/default-settings/logger.default.yaml`. +The default configuration file is also provided in `resources/default-settings/logger.default.yaml`. We use Python's logging module to provide the debug messages which is configured through this file. **We are still in the Pre-Release phase which means full debug logging is enabled by default.** @@ -47,8 +47,8 @@ The default logging config does 2 things: 1. It writes 2 log files: ```bash -../shared/logs/app.log : Complete Debug Messages -../shared/logs/errors.log : Only Errors and Warnings +shared/logs/app.log : Complete Debug Messages +shared/logs/errors.log : Only Errors and Warnings ``` 2. Prints logging messages to the console. If run as a service, only error messages are emitted to console to avoid spamming the system log files. diff --git a/documentation/developers/developer-issues.md b/documentation/developers/developer-issues.md index 1ed531738..c8dd3b6c3 100644 --- a/documentation/developers/developer-issues.md +++ b/documentation/developers/developer-issues.md @@ -46,6 +46,7 @@ Alternatively, use the provided script, which sets the variable for you (provided your swap size is large enough): ``` bash +$ cd src/webapp $ ./run_rebuild.sh ``` diff --git a/documentation/developers/docker.md b/documentation/developers/docker.md index 96b5a64b6..39518e248 100644 --- a/documentation/developers/docker.md +++ b/documentation/developers/docker.md @@ -33,7 +33,7 @@ need to adapt some of those commands to your needs. * Override/Merge the values from the following [Override file](https://github.com/MiczFlor/RPi-Jukebox-RFID/blob/future3/develop/docker/config/jukebox.overrides.yaml) in your `jukebox.yaml`. * **\[Currently required\]** Update all relative paths (`../..`) in to `/home/pi/RPi-Jukebox-RFID`. -4. Change directory into the `./RPi-Jukebox-RFID/shared/audiofolders` +4. Change directory into the `./shared/audiofolders` and copy a set of MP3 files into this folder (for more fun when testing). From 8ff4d76df0e2579e868683346aad3dfe2ae6af07 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Sun, 10 Dec 2023 01:15:24 +0100 Subject: [PATCH 3/8] some fixes for doc --- documentation/builders/audio.md | 4 ++-- documentation/builders/system.md | 2 +- documentation/builders/update.md | 6 ++++++ documentation/developers/rfid/template_reader.md | 2 +- .../controls/bluetooth_audio_buttons/README.rst | 2 +- src/jukebox/components/gpio/gpioz/README.rst | 8 ++++---- src/jukebox/components/gpio/gpioz/core/input_devices.py | 2 +- .../rfid/hardware/fake_reader_gui/requirements.txt | 1 + .../rfid/hardware/rdm6300_serial/requirements.txt | 3 +++ src/jukebox/components/rpc_command_alias.py | 2 +- src/jukebox/components/volume/__init__.py | 2 +- src/jukebox/run_configure_audio.py | 2 +- src/jukebox/run_jukebox.py | 4 ++-- src/jukebox/run_register_rfid_reader.py | 2 +- 14 files changed, 26 insertions(+), 16 deletions(-) diff --git a/documentation/builders/audio.md b/documentation/builders/audio.md index bc8f2bf62..2cf36dad9 100644 --- a/documentation/builders/audio.md +++ b/documentation/builders/audio.md @@ -31,7 +31,7 @@ $ pactl list sinks short 1 bluez_sink.C4_FB_20_63_CO_FE.a2dp_sink module-bluez5-device.c s16le 2ch 44100Hz # Set the default sink (this will be reset at reboot) -$ pactl set-default-sink sink_name +$ pactl set-default-sink # Check default sink is correctly set $ pactl info @@ -50,7 +50,7 @@ You can also try different PulseAudio sinks without setting the default sink. In volume level for this sink: ```bash -$ paplay -d sink_name /usr/share/sounds/alsa/Front_Center.wav +$ paplay -d /usr/share/sounds/alsa/Front_Center.wav ``` # Bluetooth diff --git a/documentation/builders/system.md b/documentation/builders/system.md index 766b57e68..0e2c19485 100644 --- a/documentation/builders/system.md +++ b/documentation/builders/system.md @@ -70,7 +70,7 @@ Service control and service configuration file location is identical to MPD. ## Jukebox Core Service -The :ref:`developer/coreapps:Jukebox Core` runs as a *user-local* service with the name `jukebox-daemon`. +The [Jukebox Core Service](../developers/coreapps.md#Jukebox-Core) runs as a *user-local* service with the name `jukebox-daemon`. Similar to MPD, it's important that it does run as system-wide service to be able to interact with PulseAudio. The service can be controlled with the `systemctl`-command by adding the parameter `--user` diff --git a/documentation/builders/update.md b/documentation/builders/update.md index e09137ca3..f6dab2c91 100644 --- a/documentation/builders/update.md +++ b/documentation/builders/update.md @@ -2,6 +2,12 @@ ## Updating your Jukebox Version 3 +### Update from v3.2.1 and prior + +As there are some significant changes in the installation, a new setup on a fresh image is required. + +### General + Things on Version 3 are moving fast and you may want to keep up with recent changes. Since we are in Alpha Release stage, a fair number of fixes are expected to be committed in the near future. diff --git a/documentation/developers/rfid/template_reader.md b/documentation/developers/rfid/template_reader.md index 5c729cbf3..541b20a00 100644 --- a/documentation/developers/rfid/template_reader.md +++ b/documentation/developers/rfid/template_reader.md @@ -11,7 +11,7 @@ the conventions outlined below, your new reader will be picked up automatically There is no extra need to register the reader module with the Phoniebox. Just re-run [RFID reader configuration tool](../coreapps.md#run_register_rfid_reader.py). -Follow the instructions in [template_new_reader.py] +Follow the instructions in [template_new_reader.py](../../../src/jukebox/components/rfid/hardware/template_new_reader/template_new_reader.py) Also have a look at the other reader subpackages to see how stuff works with an example diff --git a/src/jukebox/components/controls/bluetooth_audio_buttons/README.rst b/src/jukebox/components/controls/bluetooth_audio_buttons/README.rst index 87a7eab2b..0d602e39f 100644 --- a/src/jukebox/components/controls/bluetooth_audio_buttons/README.rst +++ b/src/jukebox/components/controls/bluetooth_audio_buttons/README.rst @@ -28,7 +28,7 @@ Custom key bindings You may change or extend the actions assigned to a button in the configuration. If the configuration contains a block 'mapping', the default button-action mapping is *completely* replaced with the new mapping. The definitions for each key looks like ``key-code: {rpc_command_definition}``. -The RPC command follows the regular RPC command rules as defined in :ref:`userguide/rpc_commands:RPC Commands`. +The RPC command follows the regular RPC command rules as defined in :ref:`documentation/builders/rpc-commands.md:RPC Commands`. .. code-block:: yaml diff --git a/src/jukebox/components/gpio/gpioz/README.rst b/src/jukebox/components/gpio/gpioz/README.rst index 46ab0250a..6f3c4d4ec 100644 --- a/src/jukebox/components/gpio/gpioz/README.rst +++ b/src/jukebox/components/gpio/gpioz/README.rst @@ -16,7 +16,7 @@ this entry and modify it accordingly: enable: true config_file: ../../shared/settings/gpio.yaml -The GPIO configuration itself is stored in a separate file, in this case ``../../shared/settings/gpio.yaml``. +The GPIO configuration itself is stored in a separate file, in this case ``shared/settings/gpio.yaml``. The GPIO module uses `GPIOZero `_ as a backend to access the RPi's GPIO pins. It's a wrapper to integrate GPIOZero into the Jukebox's API, allowing a YAML based configuration and providing @@ -56,7 +56,7 @@ Configuring input devices consists of 2 aspects: #. Define an input device and configure it's parameters. All available input devices can be found in :class:`components.gpio.gpioz.core.input_devices`. #. Assign an action to execute on input state change. - Actions are defined as :ref:`userguide/rpc_commands:RPC Commands`, + Actions are defined as :ref:`documentation/builders/rpc-commands.md:RPC Commands`, just the same as for assigning card actions. @@ -87,7 +87,7 @@ parameters, which relate directly to the class' initialization parameters. from inside ``kwargs``. The name is automatically assigned from the unique name of configuration entry. Usually, only the pin(s) are mandatory parameters. In the section ``actions``, the RPC commands are linked, -either as alias (i.e. shortcut) or full :ref:`userguide/rpc_commands:RPC Commands` specification. +either as alias (i.e. shortcut) or full :ref:`documentation/builders/rpc-commands.md:RPC Commands` specification. The default configuration of the Button uses the internal pull-up resistor. So, the physical connection to the RPi looks: @@ -435,7 +435,7 @@ Use Mock Pins Using GPIOZero `Mock pins `_, allows to do function development on an arbitrary machine. If you have -configured the :ref:`Mock RFID Reader `, +configured the :ref:`Mock RFID Reader `, the GPIO input and output devices are added to the GUI. Simply change the header in the configuration file to: .. code-block:: yaml diff --git a/src/jukebox/components/gpio/gpioz/core/input_devices.py b/src/jukebox/components/gpio/gpioz/core/input_devices.py index 5090762f4..c6a32c2a4 100644 --- a/src/jukebox/components/gpio/gpioz/core/input_devices.py +++ b/src/jukebox/components/gpio/gpioz/core/input_devices.py @@ -75,7 +75,7 @@ def set_rpc_actions(self, action_config) -> None: Set all input device callbacks from :attr:`action_config` :param action_config: Dictionary with one - :ref:`RPC Command ` definition entry for every device callback + `documentation/builders/rpc-commands.md` definition entry for every device callback """ pass diff --git a/src/jukebox/components/rfid/hardware/fake_reader_gui/requirements.txt b/src/jukebox/components/rfid/hardware/fake_reader_gui/requirements.txt index 931c9db0f..775a1b13d 100644 --- a/src/jukebox/components/rfid/hardware/fake_reader_gui/requirements.txt +++ b/src/jukebox/components/rfid/hardware/fake_reader_gui/requirements.txt @@ -1,5 +1,6 @@ # This GUI-based mock reader also requires: tkinter # tkinter is a standard Python package and needs not be installed separately # It is available on most Unix systems (but not on headless Raspbian RPi where running a GUI is difficult anyway) +# You need to install these with `./run_python.sh pip install --upgrade --force-reinstall -q -r path/to/requirements.txt` ttkthemes diff --git a/src/jukebox/components/rfid/hardware/rdm6300_serial/requirements.txt b/src/jukebox/components/rfid/hardware/rdm6300_serial/requirements.txt index f6c1a1f57..3dc94de8b 100644 --- a/src/jukebox/components/rfid/hardware/rdm6300_serial/requirements.txt +++ b/src/jukebox/components/rfid/hardware/rdm6300_serial/requirements.txt @@ -1 +1,4 @@ +# RDM6300 related requirements +# You need to install these with `./run_python.sh pip install --upgrade --force-reinstall -q -r path/to/requirements.txt` + pyserial diff --git a/src/jukebox/components/rpc_command_alias.py b/src/jukebox/components/rpc_command_alias.py index bb484891a..e40f8e1ea 100644 --- a/src/jukebox/components/rpc_command_alias.py +++ b/src/jukebox/components/rpc_command_alias.py @@ -1,7 +1,7 @@ """ This file provides definitions for RPC command aliases -See :ref:`userguide/rpc_commands` +See `documentation/builders/rpc-commands.md` """ # -------------------------------------------------------------- diff --git a/src/jukebox/components/volume/__init__.py b/src/jukebox/components/volume/__init__.py index 6653baa77..6add98a33 100644 --- a/src/jukebox/components/volume/__init__.py +++ b/src/jukebox/components/volume/__init__.py @@ -26,7 +26,7 @@ Pulse Audio runs as a user process. Processes who want to communicate / stream to it must also run as a user process. -This means must also run as user process, as described in :ref:`userguide/system:Music Player Daemon (MPD)` +This means must also run as user process, as described in `documentation/builders/system.md #Music Player Daemon (MPD)` Misc diff --git a/src/jukebox/run_configure_audio.py b/src/jukebox/run_configure_audio.py index 6bb0e70f6..c3c1168a4 100755 --- 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 :ref:`userguide/audio:Audio Configuration`. +For more information see `documentation/builders/audio.md`. """ import os import argparse diff --git a/src/jukebox/run_jukebox.py b/src/jukebox/run_jukebox.py index 0735e2b8e..8cb0e6fa8 100755 --- a/src/jukebox/run_jukebox.py +++ b/src/jukebox/run_jukebox.py @@ -5,11 +5,11 @@ Usually this runs as a service, which is started automatically after boot-up. At times, it may be necessary to restart the service. For example after a configuration change. Not all configuration changes can be applied on-the-fly. -See :ref:`userguide/configuration:Jukebox Configuration`. +See `documentation/builders/configuration.md`. For debugging, it is usually desirable to run the Jukebox directly from the console rather than as service. This gives direct logging info in the console and allows changing command line parameters. -See :ref:`userguide/troubleshooting:Troubleshooting`. +See `documentation/builders/troubleshooting.md`. """ import os.path import argparse diff --git a/src/jukebox/run_register_rfid_reader.py b/src/jukebox/run_register_rfid_reader.py index 3aa69735e..1560e1801 100755 --- 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 :ref:`rfid/rfid:RFID Readers`. +the settings. For more information see `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). Any manual modifications to the settings will have to be re-applied From b0093fcd5d282bf552ed099dc1d2bd386b6dba6f Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Sun, 10 Dec 2023 01:20:47 +0100 Subject: [PATCH 4/8] updated coreapps doc and references --- documentation/builders/audio.md | 6 +++--- documentation/builders/concepts.md | 4 ++-- documentation/builders/rpc-commands.md | 2 +- documentation/developers/coreapps.md | 19 ++++++++----------- documentation/developers/rfid/basics.md | 4 ++-- documentation/developers/rfid/genericusb.md | 2 +- documentation/developers/rfid/mfrc522_spi.md | 2 +- .../developers/rfid/template_reader.md | 2 +- 8 files changed, 19 insertions(+), 22 deletions(-) diff --git a/documentation/builders/audio.md b/documentation/builders/audio.md index 2cf36dad9..0bb5a7163 100644 --- a/documentation/builders/audio.md +++ b/documentation/builders/audio.md @@ -10,14 +10,14 @@ Stream transfer happens on user input or automatically on the connection of an a This is mainly targeted at Bluetooth Headsets/Speakers. Audio outputs run via PulseAudio and the basic configuration should be easy. -There is a [configuration tool](../developers/coreapps.md#run_configure_audio.py), +There is a [configuration tool](../developers/coreapps.md#Audio), to setup the configuration for the Jukebox Core App. To set up the audio 1. Follow the setup steps according to your sound card 2. Check that the sound output works [as described below](audio.md#checking-system-sound-output) -3. Run the [audio configuration tool](../developers/coreapps.md#run_configure_audio.py) +3. Run the [audio configuration tool](../developers/coreapps.md#Audio) 4. [Fine-tune audio parameters](audio.md#additional-options) ## Checking system sound output @@ -134,4 +134,4 @@ You are, of course, free to modify the PulseAudio configuration to your needs. R 1. [PulseAudio Documentation](https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User) 2. [PulseAudio Examples](https://wiki.archlinux.org/title/PulseAudio/Examples) -In this case, run the [audio configuration tool](../developers/coreapps.md#run_configure_audio.py) with the parameter `--ro_pulse` to avoid touching the PulseAudio configuration file. +In this case, run the [audio configuration tool](../developers/coreapps.md#Audio) with the parameter `--ro_pulse` to avoid touching the PulseAudio configuration file. diff --git a/documentation/builders/concepts.md b/documentation/builders/concepts.md index a14592d75..37c13db89 100644 --- a/documentation/builders/concepts.md +++ b/documentation/builders/concepts.md @@ -16,10 +16,10 @@ The Remote Procedure Call (RPC) server allows remotely triggering actions (e.g., Why should you care? Because we use the same protocol when triggering actions from other inputs like a card swipe, a GPIO button press, etc. How that works is described in [RPC Commands](rpc-commands.md). -We also have a [tool to send RPC commands](../developers/coreapps.md#run_rpc_tool.py) to the running Jukebox application. +We also have a [tool to send RPC commands](../developers/coreapps.md#RPC) to the running Jukebox application. ## Publishing Message Queue The Publishing Message Queue is the complementary part to the RPC where the core application publishes its status and status updates. As a user, you need not worry about it. -If you want to interact with the Jukebox from your own application, this is where you get the current state from. Details about the protocol can be found here (TBD). A [sniffer tool](../developers/coreapps.md#run_publicity_sniffer.py) exists which listens and prints the incoming status messages. +If you want to interact with the Jukebox from your own application, this is where you get the current state from. Details about the protocol can be found here (TBD). A [sniffer tool](../developers/coreapps.md#Publicity-Sniffer) exists which listens and prints the incoming status messages. diff --git a/documentation/builders/rpc-commands.md b/documentation/builders/rpc-commands.md index fa367f588..f98da8cb4 100644 --- a/documentation/builders/rpc-commands.md +++ b/documentation/builders/rpc-commands.md @@ -107,6 +107,6 @@ You will find some more examples the configuration of the [Card Database](card-d ## For developers -To send RPC commands for testing and debugging purpose you can use the [CLI Tool](../developers/coreapps.md#run_rpc_tool.py). +To send RPC commands for testing and debugging purpose you can use the [CLI Tool](../developers/coreapps.md#RPC). Also here is a ready-to-use decoding functions which decodes an RPC command (with or without alias) from a YAML entry:func:`jukebox.utils.decode_rpc_command`. diff --git a/documentation/developers/coreapps.md b/documentation/developers/coreapps.md index 9023a5e6f..35568e3eb 100644 --- a/documentation/developers/coreapps.md +++ b/documentation/developers/coreapps.md @@ -10,8 +10,6 @@ $ ./run_python.sh ./src/jukebox/ -h ## Jukebox Core -### `run_jukebox.py` - [run_jukebox.py](../../src/jukebox/run_jukebox.py) This is the main app and starts the Jukebox Core. @@ -26,9 +24,9 @@ For debugging, it is usually desirable to run the Jukebox directly from the cons Before running the configuration tools, stop the Jukebox Core service. See [Best practice procedure](../builders/configuration.md#best-practice-procedure). -### `run_configure_audio.py` +### Audio -[run_configure_audio.py](../../src/jukebox/run_configure_audio.py) +Scriptname: [run_configure_audio.py](../../src/jukebox/run_configure_audio.py) Setup tool to register the PulseAudio sinks as primary and secondary audio outputs. @@ -36,9 +34,9 @@ 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). -### `run_register_rfid_reader.py` +### RFID Reader -[run_register_rfid_reader.py](../../src/jukebox/run_register_rfid_reader.py) +Scriptname: [run_register_rfid_reader.py](../../src/jukebox/run_register_rfid_reader.py) Setup tool to configure the RFID Readers. @@ -50,9 +48,9 @@ Run this once to register and configure the RFID readers with the Jukebox. Can b ## Developer Tools -### `run_rpc_tool.py` +### RPC -[run_rpc_tool.py](../../src/jukebox/run_rpc_tool.py) +Scriptname: [run_rpc_tool.py](../../src/jukebox/run_rpc_tool.py) Command Line Interface to the Jukebox RPC Server. @@ -62,9 +60,8 @@ The tool features auto-completion and command history. The list of available commands is fetched from the running Jukebox service. +### Publicity Sniffer -### `run_publicity_sniffer.py` - - [run_publicity_sniffer.py](../../src/jukebox/run_publicity_sniffer.py) +Scriptname: [run_publicity_sniffer.py](../../src/jukebox/run_publicity_sniffer.py) 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/documentation/developers/rfid/basics.md b/documentation/developers/rfid/basics.md index 078340236..7d557ed06 100644 --- a/documentation/developers/rfid/basics.md +++ b/documentation/developers/rfid/basics.md @@ -35,7 +35,7 @@ Readers operate on one of two different frequencies: 125kHz or 13.56 MHz. Make s ## Reader Configuration During the installation process, you can already configure a RFID -reader. To manually configure RFID reader(s) run the [RFID reader configuration tool](../coreapps.md#run_register_rfid_reader.py). +reader. To manually configure RFID reader(s) run the [RFID reader configuration tool](../coreapps.md#RFID-Reader). It will generate a reader configuration file at `shared/settings/rfid.yaml`. You can re-run the tool to change the @@ -66,7 +66,7 @@ Indicates the Python package used for this reader. Filled by the RFID configurat #### config: -Filled by the [RFID reader configuration tool](../coreapps.md#run_register_rfid_reader.py) based on default values and user input. After running the tool, you may manually change some settings here, as not everything can be configured through the tool. Note that re-running the tool will completely rewrite the configuration file. +Filled by the [RFID reader configuration tool](../coreapps.md#RFID-Reader) based on default values and user input. After running the tool, you may manually change some settings here, as not everything can be configured through the tool. Note that re-running the tool will completely rewrite the configuration file. #### same_id_delay: float \| integer diff --git a/documentation/developers/rfid/genericusb.md b/documentation/developers/rfid/genericusb.md index 924550f8f..544f0245c 100644 --- a/documentation/developers/rfid/genericusb.md +++ b/documentation/developers/rfid/genericusb.md @@ -4,7 +4,7 @@ This module covers all types of USB-based RFID input readers. If you plan to connect multiple USB-based RFID readers to the Jukebox, make -sure to connect all of them before running the [RFID reader configuration tool](../coreapps.md#run_register_rfid_reader.py). +sure to connect all of them before running the [RFID reader configuration tool](../coreapps.md#RFID-Reader). > [!NOTE] > The user needs to be part of the group \'input\' for evdev to work. This should usually be the case. However, a user can be added with: diff --git a/documentation/developers/rfid/mfrc522_spi.md b/documentation/developers/rfid/mfrc522_spi.md index d8cb4fd26..5dc46aab6 100644 --- a/documentation/developers/rfid/mfrc522_spi.md +++ b/documentation/developers/rfid/mfrc522_spi.md @@ -6,7 +6,7 @@ RC522 RFID reader via SPI connection. ## Installation -Run the [RFID reader configuration tool](../coreapps.md#run_register_rfid_reader.py) for guided +Run the [RFID reader configuration tool](../coreapps.md#RFID-Reader) for guided installation. ## Options diff --git a/documentation/developers/rfid/template_reader.md b/documentation/developers/rfid/template_reader.md index 541b20a00..6a7a8b0c3 100644 --- a/documentation/developers/rfid/template_reader.md +++ b/documentation/developers/rfid/template_reader.md @@ -9,7 +9,7 @@ This template provides the skeleton API for a new Reader. If you follow the conventions outlined below, your new reader will be picked up automatically There is no extra need to register the reader module with -the Phoniebox. Just re-run [RFID reader configuration tool](../coreapps.md#run_register_rfid_reader.py). +the Phoniebox. Just re-run [RFID reader configuration tool](../coreapps.md#RFID-Reader). Follow the instructions in [template_new_reader.py](../../../src/jukebox/components/rfid/hardware/template_new_reader/template_new_reader.py) From 04e7d153557be92372e3c3400d8c8cbb25278e3e Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Sun, 10 Dec 2023 01:31:26 +0100 Subject: [PATCH 5/8] make script executable --- run_python.sh | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 run_python.sh diff --git a/run_python.sh b/run_python.sh old mode 100644 new mode 100755 index 530851039..7c6cf1252 --- a/run_python.sh +++ b/run_python.sh @@ -6,4 +6,5 @@ SOURCE=${BASH_SOURCE[0]} SCRIPT_DIR="$(dirname "$SOURCE")" source ${SCRIPT_DIR}/.venv/bin/activate || { echo "ERROR: Failed to activate virtual environment"; exit 1; } +#Run commands given as paramter $@ From 708b9059ed974f282b34ab1ee652a3efa15b5fef Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Sun, 10 Dec 2023 01:39:34 +0100 Subject: [PATCH 6/8] revert script changes for github workflow. updated doc --- .githooks/pre-commit | 2 +- CONTRIBUTING.md | 4 ++-- run_flake8.sh | 2 +- run_pytest.sh | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 95901bcda..a1c06c0a6 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -21,7 +21,7 @@ if [[ -n $PY_FILES ]]; then echo -e "\n**************************************************************" echo "Modified Python source files. Running flake8 ... " echo -e "**************************************************************\n" - ./run_flake8.sh $PY_FILES + ./run_python.sh ./run_flake8.sh $PY_FILES flake8_code=$? echo "Flake8 return code: $flake8_code" fi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dbf12f84d..341e0bc4a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -123,7 +123,7 @@ It contains out setup file. ~~~bash cd ~/RPi-Jukebox-RFID -./run_flake8.sh +./run_python.sh ./run_flake8.sh ~~~ If you are convinced some issue should not apply to your case or would require extensive re-coding, that could be OK. @@ -136,7 +136,7 @@ them. ~~~bash cd ~/RPi-Jukebox-RFID/ -./run_pytest.sh +./run_python.sh ./run_pytest.sh ~~~ ## Submitting Changes diff --git a/run_flake8.sh b/run_flake8.sh index e1b671200..a9ec73285 100755 --- a/run_flake8.sh +++ b/run_flake8.sh @@ -10,4 +10,4 @@ SCRIPT_DIR="$(dirname "$SOURCE")" cd "$SCRIPT_DIR" || (echo "Could not change to top-level project directory" && exit 1) # Run flake8 -./run_python.sh flake8 --config .flake8 "$@" +flake8 --config .flake8 "$@" diff --git a/run_pytest.sh b/run_pytest.sh index 32c4a9914..a3cbd8df6 100755 --- a/run_pytest.sh +++ b/run_pytest.sh @@ -10,4 +10,4 @@ SCRIPT_DIR="$(dirname "$SOURCE")" cd "$SCRIPT_DIR" || (echo "Could not change to top-level project directory" && exit 1) # Run pytest -./run_python.sh pytest -c pytest.ini +pytest -c pytest.ini From b0c76a54c7dfe19dffd24057a9194f7e82c13217 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Sun, 10 Dec 2023 02:06:25 +0100 Subject: [PATCH 7/8] fix execution docs for run_jukebox.py --- documentation/builders/configuration.md | 6 ++++-- documentation/builders/troubleshooting.md | 10 ++++++---- documentation/developers/coreapps.md | 3 ++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/documentation/builders/configuration.md b/documentation/builders/configuration.md index d7b7206c8..96869fef1 100644 --- a/documentation/builders/configuration.md +++ b/documentation/builders/configuration.md @@ -24,7 +24,8 @@ $ systemctl --user stop jukebox-daemon $ nano ./shared/settings/jukebox.yaml # Start Jukebox in console and check the log output (optional) -$ ./run_python.sh ./src/jukebox/run_jukebox.py +$ cd src/jukebox +$ ../../run_python.sh ./run_jukebox.py # and if OK, press Ctrl-C and restart the service # Restart the service @@ -36,5 +37,6 @@ 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 -$ ./run_python.sh ./src/jukebox/run_jukebox.py --conf path/to/custom/config.yaml +$ cd src/jukebox +$ ../../run_python.sh ./run_jukebox.py --conf path/to/custom/config.yaml ``` diff --git a/documentation/builders/troubleshooting.md b/documentation/builders/troubleshooting.md index 59bb028f7..0af219ca5 100644 --- a/documentation/builders/troubleshooting.md +++ b/documentation/builders/troubleshooting.md @@ -63,11 +63,12 @@ on the console log. $ systemctl --user stop jukebox-daemon # Start the Jukebox in debug mode: -# with default logger: -$ ./run_python.sh ./src/jukebox/run_jukebox.py +$ cd src/jukebox +# with default logger: +$ ../../run_python.sh ./run_jukebox.py # or with custom logger configuration: -$ ./run_python.sh ./src/jukebox/run_jukebox.py --logger path/to/custom/logger.yaml +$ ../../run_python.sh ./run_jukebox.py --logger path/to/custom/logger.yaml ``` ### Fallback configuration @@ -77,7 +78,8 @@ Attention: This only emits messages to the console and does not write to the log This is more a fallback features: ``` bash -$ ./run_python.sh ./src/jukebox/run_jukebox.py -vv +$ cd src/jukebox +$ ../../run_python.sh ./run_jukebox.py -vv ``` ### Extreme cases diff --git a/documentation/developers/coreapps.md b/documentation/developers/coreapps.md index 35568e3eb..1b9828870 100644 --- a/documentation/developers/coreapps.md +++ b/documentation/developers/coreapps.md @@ -4,7 +4,8 @@ The Jukebox\'s core apps are located in `src/jukebox`. Run the following command to learn more about each app and its parameters: ``` bash -$ ./run_python.sh ./src/jukebox/ -h +$ cd src/jukebox +$ ../../run_python.sh ./ -h ``` From a88f01ec9ad11df6c5ccc7246eaec18af2962617 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Sun, 10 Dec 2023 02:10:18 +0100 Subject: [PATCH 8/8] fix flake8 --- .../components/rfid/hardware/generic_usb/generic_usb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jukebox/components/rfid/hardware/generic_usb/generic_usb.py b/src/jukebox/components/rfid/hardware/generic_usb/generic_usb.py index 0bf84012b..195e8ad40 100755 --- a/src/jukebox/components/rfid/hardware/generic_usb/generic_usb.py +++ b/src/jukebox/components/rfid/hardware/generic_usb/generic_usb.py @@ -82,7 +82,8 @@ def query_customization() -> dict: print(f" {Colors.lightgreen}ID{Colors.reset}: " f"{Colors.lightgreen}isKey{Colors.reset}: {Colors.lightcyan}Name{Colors.reset}") if len(devices) == 0: - logger.error("USB device list is empty. Make sure USB RFID reader is connected. Then re-run RFID reader configuration tool") + logger.error("USB device list is empty. Make sure USB RFID reader is connected." + "Then re-run RFID reader configuration tool") return {'device_name': '__error_empty_device_list__'} for idx, (dev, key) in enumerate(zip(devices, devices_is_key)): print(f" {Colors.lightgreen}{idx:2d}{Colors.reset}:"