Skip to content

Commit

Permalink
Merge branch 'future3/develop' of https://github.com/MiczFlor/RPi-Juk…
Browse files Browse the repository at this point in the history
…ebox-RFID into future3/develop
  • Loading branch information
s-martin committed Nov 16, 2023
2 parents b7480b8 + 26ca404 commit d62de5f
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 117 deletions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at <[email protected]>. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

Expand Down
4 changes: 2 additions & 2 deletions documentation/content/developers/developer-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ Not enough memory for Node

Prior to building set the node memory environment variable.

1. Make sure the value is less than the total available space on the
1. Make sure the value is less than the total available space on the
system, or you may run into the next issue. (Not always though!)
Check memory availability with `free -mt`.
2. We also experience trouble, when the space is set too small a
2. We also experience trouble, when the space is set too small a
value. 512 always works, 256 sometimes does, sometimes does not.
If your free memory is small, consider increasing the swap size of
your system!
Expand Down
18 changes: 9 additions & 9 deletions documentation/content/developers/development-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,35 @@ We recommend to use at least a Pi 3 or Pi Zero 2 for development. This
hardware won\'t be needed in production, but it can be slow while
developing.

1. Install the latest Pi OS on a SD card.
2. Boot up your Raspberry Pi.
3. [Install](../userguide/installation.md) the Jukebox software as if you were building a
1. Install the latest Pi OS on a SD card.
2. Boot up your Raspberry Pi.
3. [Install](../userguide/installation.md) the Jukebox software as if you were building a
Phoniebox. You can install from your own fork and feature branch if
you wish which can be changed later as well. The original repository
will be set as `upstream`.
4. Once the installation has successfully ran, reboot your Pi.
5. Due to some resource constraints, the Webapp does not build the
4. Once the installation has successfully ran, reboot your Pi.
5. Due to some resource constraints, the Webapp does not build the
latest changes and instead consumes the latest official release. To
change that, you need to install NodeJS and build the Webapp
locally.
6. Install NodeJS using the existing installer
6. Install NodeJS using the existing installer

``` bash
cd ~/RPi-Jukebox-RFID/installation/routines; \
source setup_jukebox_webapp.sh; \
_jukebox_webapp_install_node
```

7. To free up RAM, reboot your Pi.
8. Build the Webapp using the existing build command. If the build
7. To free up RAM, reboot your Pi.
8. Build the Webapp using the existing build command. If the build
fails, you might have forgotten to reboot.

``` bash
cd ~/RPi-Jukebox-RFID/src/webapp; \
./run_rebuild.sh -u
```

9. The Webapp should now be updated.
9. The Webapp should now be updated.
10. To continuously update Webapp, pull the latest changes from your
repository and rerun the command above.

Expand Down
57 changes: 30 additions & 27 deletions documentation/content/developers/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ need to adapt some of those commands to your needs.

## Prerequisites

1. Install required software
1. Install required software
* Linux
* [Docker](https://docs.docker.com/engine/install/debian/)
* [Compose](https://docs.docker.com/compose/install/)
Expand All @@ -26,19 +26,22 @@ need to adapt some of those commands to your needs.
* [pulseaudio (Windows)](https://www.freedesktop.org/wiki/Software/PulseAudio/Ports/Windows/Support/)

2. Pull the Jukebox repository:
```

```bash
$ git clone https://github.com/MiczFlor/RPi-Jukebox-RFID.git
``````
```

3. Create a jukebox.yaml file
* Copy the `./resources/default-settings/jukebox.default.yaml` to `./shared/settings` and rename the file to `jukebox.yaml`.
```

```bash
$ cp ./resources/default-settings/jukebox.default.yaml ./shared/settings/jukebox.yaml
```

* 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 `./RPi-Jukebox-RFID/shared/audiofolders`
and copy a set of MP3 files into this folder (for more fun when
testing).

Expand All @@ -54,7 +57,7 @@ They can be run individually or in combination. To do that, we use
Make sure you don\'t use `sudo` to run your `docker-compose`. Check out
Docker\'s [post-installation guide](https://docs.docker.com/engine/install/linux-postinstall/) for more information.

``` bash
```bash
// Build Images
$ docker-compose -f docker/docker-compose.yml -f docker/docker-compose.linux.yml build
Expand Down Expand Up @@ -104,29 +107,29 @@ $ docker-compose -f docker/docker-compose.yml -f docker/docker-compose.mac.yml d

### Windows

1. Download
1. Download
[pulseaudio](https://www.freedesktop.org/wiki/Software/PulseAudio/Ports/Windows/Support/)

2. Uncompress somewhere in your user folder
2. Uncompress somewhere in your user folder

3. Edit `$INSTALL_DIR/etc/pulse/default.pa`
3. Edit `$INSTALL_DIR/etc/pulse/default.pa`

4. Add the following line
4. Add the following line

``` bash
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1
```

5. Edit `$INSTALL_DIR/etc/pulse//etc/pulse/daemon.conf`, find the
5. Edit `$INSTALL_DIR/etc/pulse//etc/pulse/daemon.conf`, find the
following line and change it to:

``` bash
exit-idle-time = -1
```

6. Execute `$INSTALL_DIR/bin/pulseaudio.exe`
6. Execute `$INSTALL_DIR/bin/pulseaudio.exe`

7. Run `cocker-compose`
7. Run `docker-compose`

``` bash
// Build Images
Expand Down Expand Up @@ -237,29 +240,29 @@ $ docker run -it --rm \

**Mac**

- <https://stackoverflow.com/questions/54702179/how-to-access-mac-os-x-microphone-inside-docker-container>
- <https://stackoverflow.com/questions/40136606/how-to-expose-audio-from-docker-container-to-a-mac>
- <https://github.com/jessfraz/dockerfiles/blob/master/pulseaudio/Dockerfile>
* <https://stackoverflow.com/questions/54702179/how-to-access-mac-os-x-microphone-inside-docker-container>
* <https://stackoverflow.com/questions/40136606/how-to-expose-audio-from-docker-container-to-a-mac>
* <https://github.com/jessfraz/dockerfiles/blob/master/pulseaudio/Dockerfile>

**Windows**

- <https://stackoverflow.com/questions/52890474/how-to-get-docker-audio-and-input-with-windows-or-mac-host#>
- <https://arnav.jain.se/2020/enable-audio--video-in-docker-container/>
- <https://x410.dev/cookbook/wsl/enabling-sound-in-wsl-ubuntu-let-it-sing/>
- <https://research.wmz.ninja/articles/2017/11/setting-up-wsl-with-graphics-and-audio.html>
* <https://stackoverflow.com/questions/52890474/how-to-get-docker-audio-and-input-with-windows-or-mac-host#>
* <https://arnav.jain.se/2020/enable-audio--video-in-docker-container/>
* <https://x410.dev/cookbook/wsl/enabling-sound-in-wsl-ubuntu-let-it-sing/>
* <https://research.wmz.ninja/articles/2017/11/setting-up-wsl-with-graphics-and-audio.html>

**Audio**

- <https://github.com/mviereck/x11docker/wiki/Container-sound:-ALSA-or-Pulseaudio>
- <https://mpd.fandom.com/wiki/PulseAudio>
- <https://stmllr.net/blog/streaming-audio-with-mpd-and-icecast2-on-raspberry-pi/>
* <https://github.com/mviereck/x11docker/wiki/Container-sound:-ALSA-or-Pulseaudio>
* <https://mpd.fandom.com/wiki/PulseAudio>
* <https://stmllr.net/blog/streaming-audio-with-mpd-and-icecast2-on-raspberry-pi/>

**MPD**

- <https://stmllr.net/blog/streaming-audio-with-mpd-and-icecast2-on-raspberry-pi/>
- <https://github.com/Tob1asDocker/rpi-mpd>
- <https://github.com/vimagick/dockerfiles/tree/master/mpd>
* <https://stmllr.net/blog/streaming-audio-with-mpd-and-icecast2-on-raspberry-pi/>
* <https://github.com/Tob1asDocker/rpi-mpd>
* <https://github.com/vimagick/dockerfiles/tree/master/mpd>

**ZMQ**

- <https://codeblog.dotsandbrackets.com/using-zeromq-with-docker/>
* <https://codeblog.dotsandbrackets.com/using-zeromq-with-docker/>
3 changes: 2 additions & 1 deletion documentation/content/developers/rfid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
* [MFRC522 SPI Reader](mfrc522_spi.md)
* [PN532 I2C Reader](pn532_i2c.md)
* [Mock Reader](mock_reader.md)
* [Template Reader](template_reader.md)
* [Template Reader](template_reader.md)

9 changes: 4 additions & 5 deletions documentation/content/developers/rfid/mfrc522_spi.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ The SPI Bus ID. The default bus is 0. For other bus IDs, the RPi also needs to r

SPI chip enable pin. On default SPI bus 0, this can be

- 0 = GPIO8 (Pin 24)
- 1 = GPIO7 (Pin 26)
- 0 = GPIO8 (Pin 24)
- 1 = GPIO7 (Pin 26)

For other SPI buses refer to RPi documentation.

Expand All @@ -39,8 +39,8 @@ Mandatory IRQ pin. This can be any GPIO pin.

Reset pin for hardware reset. This is an optional pin. If not used,

- hardware reset will only be performed by power-on-reset. This has been tested on works fine.
- you **must** tie the reset pin of the MFRC522 board **high**!
- hardware reset will only be performed by power-on-reset. This has been tested on works fine.
- you **must** tie the reset pin of the MFRC522 board **high**!

#### mode_legacy *(default=false)*

Expand Down Expand Up @@ -68,7 +68,6 @@ The following pin-out is for the default SPI Bus 0 on Raspberry Pins.
|IRQ GND |IRQ |GPIO24 |18 |
|RST 3.3V |RST |GPIO25 |22 |


Some RC522 boards use reversed labeling for MOSI and MISO pins. The good
thing is, no harm is done to the card reader when incorrectly connected.
In case no cards are read, try swapping the connections for MOSI and
Expand Down
41 changes: 1 addition & 40 deletions documentation/content/developers/rfid/template_reader.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,2 @@
# Template Reader

*Template for creating and integrating a new RFID Reader*

> [!NOTE]
> For developers only
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 [run_register_rfid_reader.py](../coreapps.md#run_register_rfid_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

## File structure

Your new reader is a python subpackage with these three mandatory files

``` bash
components/rfid/hardware/awesome_reader/
+- awesome_reader.py <-- The actual reader module
+- description.py <-- A description module w/o dependencies. Do not change the filename!
+- README.rst <-- The Readme
```

The module documentation must go into a separate file, called README.ME.

## Conventions

- Single reader per directory / subpackage
- reader module directory name and reader module file name must be
identical
- Obviously awesome_reader will be replaced with something more
descriptive. The naming scheme for the subpackage is
- \<type_of_reader\>\_\<io_bus\>\_\<other_specials_like_special_lib\>
- e.g. generic_usb/generic_usb.py
- e.g. pn532_spi/pn532_spi.py
- ...
For documentation see [src/jukebox/components/rfid/hardware/template_new_reader/README.md](../../../../src/jukebox/components/rfid/hardware/template_new_reader/README.md).
44 changes: 23 additions & 21 deletions documentation/content/developers/status.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Feature Status
# Feature Status

**This is where we are in a nutshell:** Playing music from local folders via RFID trigger. We also built a new WebUI to control the Jukebox from a browser.

Expand All @@ -12,26 +12,28 @@ Topics marked _in progress_ are already in the process of implementation by comm

## Table of Contents

- [Jukebox Core App](#jukebox-core-app)
- [Base](#base)
- [Via RPC](#via-rpc)
- [Config handler](#config-handler)
- [ZMQ Publisher](#zmq-publisher)
- [Playback](#playback)
- [MPD Player](#mpd-player)
- [RFID](#rfid)
- [Cards](#cards)
- [Timer](#timer)
- [Volume](#volume)
- [GPIO](#gpio)
- [WLAN](#wlan)
- [Spotify](#spotify)
- [Others](#others)
- [Start-up stuff](#start-up-stuff)
- [Debug Tools](#debug-tools)
- [WebUI](#webui)
- [Installation Procedure](#installation-procedure)
- [Documentation](#documentation)
- [Feature Status](#feature-status)
- [Table of Contents](#table-of-contents)
- [Jukebox Core App](#jukebox-core-app)
- [Base](#base)
- [Via RPC](#via-rpc)
- [Config handler](#config-handler)
- [ZMQ Publisher](#zmq-publisher)
- [Playback](#playback)
- [MPD Player](#mpd-player)
- [RFID](#rfid)
- [Cards](#cards)
- [Timer](#timer)
- [Volume](#volume)
- [GPIO](#gpio)
- [WLAN](#wlan)
- [Spotify](#spotify)
- [Others](#others)
- [Start-up stuff](#start-up-stuff)
- [Debug Tools](#debug-tools)
- [WebUI](#webui)
- [Installation Procedure](#installation-procedure)
- [Documentation](#documentation)

## Jukebox Core App

Expand Down
1 change: 0 additions & 1 deletion documentation/content/userguide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@
* [Feature Status](../developers/status.md)
* [Known Issues](../developers/known-issues.md)
* [Developer Reference](../developers)

4 changes: 2 additions & 2 deletions documentation/content/userguide/audio.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Audio
# Audio

## Configuration

Expand Down Expand Up @@ -101,10 +101,10 @@ For other audio configuration options, please look at the `jukebox.yaml` for now

Directly edit `jukebox.yaml` following the steps: [Best practice procedure](configuraton.md#best-practice-procedure).


## Developer Information

The optional processing stages *Equalizer* and *Mono down mix* are realized by PulseAudio plugins. The processing chain is

```
player --> mono mix --> equalizer --> hardware sink
```
Expand Down
6 changes: 3 additions & 3 deletions documentation/content/userguide/autohotspot.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ The whole hotspot configuration can be found at

The following parameters are relevant:

- `ssid` for the displayed hotspot name
- `wpa_passphrase` for the password of the hotspot
- `country_code` the country you are currently in
- `ssid` for the displayed hotspot name
- `wpa_passphrase` for the password of the hotspot
- `country_code` the country you are currently in

``` bash
$ cat /etc/hostapd/hostapd.conf
Expand Down
8 changes: 3 additions & 5 deletions documentation/content/userguide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ Before you can install the Phoniebox software, you need to prepare your Raspberr
* Set locale settings
* Switch to the `Services` tab. Enable SSH with "Use password authentication"
* Click `Save`
6. In the same dialog, click `Yes`
7. Confirm the next warning about erasing the SD card with `Yes`
8. Wait for the imaging process to be finished (it'll take a few minutes)
7. In the same dialog, click `Yes`
8. Confirm the next warning about erasing the SD card with `Yes`
9. Wait for the imaging process to be finished (it'll take a few minutes)

<details>

Expand All @@ -43,7 +43,6 @@ You will need a terminal, like PuTTY for Windows or the Terminal app for Mac to
$ touch ssh
```


5. Set up your Wifi connection.

*Mac*
Expand Down Expand Up @@ -100,7 +99,6 @@ This will switch directly to the specified feature branch during installation.
> [!NOTE]
> For all branches *except* the current Release, you will need to build the Web App locally on the Pi. This is not part of the installation process due to memory limitation issues. See [Steps to install](../developers/development-environment.md#steps-to-install)
If you suspect an error you can monitor the installation-process with
```bash
Expand Down

0 comments on commit d62de5f

Please sign in to comment.