AALBox is a music management system for Raspberry pi that allows users to add, and remove to/form database, play songs using NFC interactions. The project is structured into different packages, each responsible for a specific functionality.
- Play Songs: Play a song associated with a specific word or NFC tag.
- Manage Songs: Add or remove songs from the database.
- NFC Integration: Listen for NFC tags and play the associated song.
- Go (version 1.16 or higher)
- Docker
- PostgreSQL Docker Image
- mpg123 (for playing songs)
- NFC Reader compatible with the
clausecker/nfc/v2
library
Before starting the application, you need to set up the PN532 NFC module on your Raspberry Pi. Follow the steps from this article to get it up and running.
-
Clone the repository:
git clone https://github.com/adelbables/AALBox.git
-
Navigate to the project directory:
cd AALBox
-
Install mpg123:
sudo apt-get install mpg123
-
Set up the PostgreSQL Docker container:
docker run --name postgres -e POSTGRES_HOST_AUTH_METHOD=trust -p 5432:5432 -d postgres
-
Install the required Go packages:
cd src && go build -o AALBox
Use the CLI to manage and play songs:
-
To play a song:
AALBox play <tag_id>
-
To add a new song to the database:
AALBox add <tag_id> <path_to_song>
-
To remove a song from the database:
AALBox remove <tag_id>
-
To start the NFC listener:
AALBox start-nfc
- controller: Manages songs and NFC interactions.
- repo: Handles database interactions for song management.
- view: Provides functionalities to play songs.
- chip: Manages NFC interactions.
Low Sound Volume on Raspberry Pi Zero with USB Audio Card
If you are using a Raspberry Pi Zero and a USB audio card, you might experience issues with low sound volume. To resolve this, follow the steps below:
-
Install alsamixer:
sudo apt-get install alsamixer
-
Adjust the Sound Volume: Open alsamixer:
alsamixer
Use the arrow keys to adjust the volume level to your preference.
-
Save Your Settings: After adjusting the volume, save your settings to ensure they persist after a reboot:
sudo alsactl store
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY