-->

hobby music, self_hosting, navidrome, substreamer

Even though streaming services provide great convenience to their users, there is still value in owning your music. At the very least, you have full control over your own music. You can have unlimited downloads, devices etc., free of extra charge once you’ve set up your system. In this post, we will look into building a music server with Navidrome using Raspberry Pi.

Installation

As a fan of Docker and containers, I first checked if they support Docker and happily found out that they do. They also have a multi-architecture image, so it runs on Raspberry Pi too.

To install it on your Pi, run the following commands:

cd {root of your music server}
mkdir navidrome
cd navidrome
mkdir music
mkdir data

I like to set up slowly with full control over how things are going so instead of pointing to an existing folder with music in it. So I prefer to create an empty one and slowly migrate whatever I want to. You can choose a different approach.

In the Navidrome folder, create a new file by running

touch docker-compose.yaml

and edit the file by running

nano docker-compose.yaml

and paste the following code:

version: "3"
services:
  navidrome:
    image: deluan/navidrome:latest
    user: 1000:1000 
    ports:
      - "4533:4533"
    restart: unless-stopped
    environment:
      ND_SCANSCHEDULE: 1h
      ND_LOGLEVEL: info  
    volumes:
      - "/path/to/data:/data"
      - "/path/to/your/music/folder:/music:ro"

Replace /path/to/data and /path/to/your/music/folder with /{Your music server root}/navidrome/data and /{Your music server root}/navidrome/music, respectively.

Then start the service:

docker-compose up

Since this is the first time you’re running the service, I’d recommend not running with the -d flag so that you can see the detailed logs on your terminal easily:

navidrome startup logs in the terminal

As specified in the docker-compose file, the default port is 4533. Now visit http://{IP address of your Raspberry Pi}:4533, and you should see something like this:

Navidrome default admin creation screen

Pick a username and a strong password and click Create Admin.

You should now see your dashboard:

Navidrome dashboard

It’s best to see another user who is not an admin just to consume the music.

Click on your profile account at the top right and select Users.

Admin menu showing users selected

Create a new user by clicking the Create button. Leave Is Admin checkbox unchecked.

New user creation screen

Uploading Music

Now you need some music to test your server. There is a lot of free content on the Internet. For this article, I picked Pixabay and downloaded this song.

Drag this song and drop it into your music folder.

Since Navidrome runs scheduled scans, it’s not going to pick this song up immediately. Stop the service by running Ctrl + C. Then run it again by running the previous command.

You should now see that Navidrome discovered the new song in your archive:

Dashboard showing new song

Set Up Client

Client-side depends on your devices, so it’s a crowded space. It’s hard to recommend an app for everyone, but I can recommend my choice on iOS: Substreamer.

Substreamer is a free iOS app, and it’s very straightforward to use. Install it from the Apple App Store and run it. You see a login screen that looks like this:

Substreamer login page

Enter your server URL as {IP}:4533. Then use the user account credentials you created.

You should now see the song you uploaded earlier:

Substreamer overview screen showing the song

If you click on the song, you can see more details, play it and download it to make it available offline.

Now that everything is running smoothly, stop the server by pressing Ctrl + C and run it as a background service by running:

docker-compose up -d

Conclusion

I hope this article has been useful to you in getting your own music server started. If you already have music, you can now migrate it to your server or start finding the music you like so that you can have access online (in your local network) or offline by downloading it to your device.

hobby raspberry_pi, dymo, label_printer, print_server

Raspberry Pi is a low-powered computer, making it great for always-on jobs such as running a print server. In this tutorial, we will add a Dymo LabelWriter 450 printer to a Raspberry Pi and use it as a server on the local network.

Step 1: Ensure the CUPS server is installed on the Raspberry Pi. If it’s not installed, run the following command:

sudo apt install cups

Step 2: Connect to the admin page. By default, you cannot access the admin page over the network. To change this, SSH into the Pi and edit cupsd.conf:

sudo nano /etc/cups/cupsd.conf

a. Update Listen line to

Listen 0.0.0.0:631

b. Update the restrictions to look like this:

# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
  Allow all
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
</Location>

c. Restart the service

sudo service cups restart

Now to go http://{IP OF THE PI}:631/admin

Step 3: Click Add Printer

Select DYMO LabelWriter 450 from your local printers list

Step 4: Update the name if you like, set a location and check the Share This Printer option.

Step 5: Review the settings and click Add Printer again.

Step 6: Add the printer to your computer’s printer utility.

Step 7: Open the DYMO Label Utility, and you should see your printer in the printer list.

Step 8: Print!

That’s it! Now you can have your printer available all the time over the network.

hobby kodi

If you followed the previous post and started using Kodi, you might be wondering what else you can do with it other than sharing videos over the network. Kodi has great community support and offers many add-ons. One of those add-ons is for YouTube. The setup process can be tricky for some users, so I’d recommend reviewing the pros & cons at the end of the article. Also, skim through the steps involved before you start to have a good idea of what you are getting into.

Let’s get started with the installation.

Part 1: Install YouTube Add-On on Kodi

Step 1: Select Add-ons on the left menu.

Kodi add-ons screen

Step 2: Click the Enter add-on browser button in the middle of the screen.

Add-ons showing the menu

Step 3: Scroll down and click on the YouTube add-on.

Video add-ons with YouTube selected

Step 4: Click the Install button at the bottom right of the screen.

YouTube add-on properties with Install button highlighted

Step 5: If prompted to install additional add-ons such as InputStream Helper, click OK.

Dialog box asking to install additional add-ons

Step 6: Wait for the installation to complete.

YouTube installation in progress

Step 7: When prompted to Execute setup-wizard, select Yes.

Dialog box asking to execute setup wizard

  • Select your language and region
  • Decide if you want to perform geolocation. This is used in My Location settings.

Step 8: You should see a checkmark next to the YouTube add-on indicating that it has been successfully installed.

YouTube installation complete

Step 9: Test your installation by clicking on Add-ons on the left menu and YouTube add-on. You should see a home screen like this:

YouTube add-on main screen

Now that you have the YouTube add-on running on your Kodi let’s set up your Google account to generate API keys.

Part 2: Create YouTube API Keys

YouTube add-on requires you to enter your own API keys. This way, all the API calls the add-on makes will be made with your keys.

Step 1: Sign in to Google Cloud Platform with your Google account (If this is your first time, agree to the Terms and Conditions and continue).

Google Cloud Terms of Service agreement screen

Step 2: Click the Create Project button at the top right:

Create Project in Google Cloud

Step 3: Give your project a descriptive name and click Create.

Enter a Project Name

Step 4: Click APIs & ServicesLibrary on the left menu

Step 5: Search YouTube Data API in the API Library and select the first item in the auto-complete (youtube data api v3 in this example)

Search YouTube Data API

Step 6: Click on YouTube Data API v3 again

Select YouTube Data API v3

Step 7: Click the Enable button

Enable YouTube API

Step 8: Click Credentials on the left menu

Step 9: Click Create Credentials and select API key

Create API key

Step 10: Note down your API key and click the Edit API key button.

Write down API key

Step 11: As per the warning above, the key is unrestricted by default. Click on Restrict key option, select YouTube Data API v3 and click Save

Restrict API usage yo YouTube

Step 12: Click OAuth consent screen on the left menu

Step 13: Select External and click Create.

OAuth consent screen

Step 14: Give a descriptive name to the app, such as Kodi YouTube AddOn and select your email as the User support email.

App name

Then scroll down to the bottom and enter your email address again as Developer contact information, and click Save and Continue.

Developer contact information

Step 14: Click Save and Continue on the Scopes and Test users pages and click the Back to dashboard button on the Summary page.

Step 15: Click Credentials again and Create Credentials. This time select OAuth client ID from the menu.

Create OAuth Client ID

Step 16: Select TVs and Limited Input Devices from the list. give it a name (such as your Kodi instance name) and click Create.

Select application type and name

Step 17: Note down your client ID and client secret. Then, click OK.

Write down OAuth client ID and secret

The next step is to enter the API key and the OAuth credentials in your YouTube Add-On. Since the add-on is running on your Raspberry Pi, entering these long random values is not easy. The easiest way to do that is to enter it by using the HTTP server. In the next part, you will configure your add-on and set up your user.

Part 3: Configure YouTube Add-On

Step 1: Enable the API configuration page by turning it on Settings → API

Enable API configuration page

Step 2: Then, click HTTP server and note the port it’s running on.

HTTP server settings

Step 3: On your computer, go to the URL: http://{Kodi IP}:{HTTP Server Port}/api

You should see a page like this:

API key page

Enter your API key, client ID (as API Id) and client secret (as API secret). Then, click Save.

Success message

Make sure to turn off the Enable API configuration page after you’ve entered your credentials.

Step 4: Now, go back to your Kodi instance and open the add-on. Click Sign In.

Kodi main screen

Step 5: As the message says, you must sign in twice. Click OK to dismiss the message.

Log in twice message

Step 6: You should see a code on your Kodi screen.

Authorization code

Go to google.com/device and enter the code on your computer.

Connect a device screen

Step 7: Select the account to use

Select account to use

Step 8: Click Allow

Allow access

Step 9: You should see a successful connection message

Successful connection message

Step 10: You should see a new code on your Kodi screen. Repeat steps 6 - 9 to authorize the app again. If all goes well, you should now see more items in the YouTube menu, such as My Subscriptions. You can now browse your videos, channels etc. 🎉

Kodi main screen with logged in user

Troubleshooting Second Authorization: 403 Access Denied Error

If you got an error during the 2nd authorization that looks like this

403 access denied error

Then, you have to follow the steps below:

Step 1: Click APIs & ServicesOAuth Consent Screen. Your app should be in Testing status.

Publishing status showing Testing

Step 2: Click Publish App and confirm when asked to Push to Production

Confirmation to push to production

Step 3: Go to google.com/device and enter the code again.

Step 4: You will see a warning message saying Google hasn’t verified this app. Click the Advanced link.

"Google hasn't verified this app" warning

Step 5: Click Go to {YOUR APP NAME} (unsafe) link

Go to app link showing

You should now see on your Kodi screen that you are logged in and see My Subscriptions in the menu.

Part 4: Usage and Review

Congratulations on completing a lengthy setup. See below a list of pros and cons based on the setup and initial usage experience:

Pros & Cons

✅ Pros

❌ Cons

  • Setup is cumbersome
  • User experience could be better

Even though the user experience feels a bit different initially, I hope it will grow on me.

👍 Multiple Users

You can create multiple users and easily switch between the users. You can create a new user by clicking Settings → Users → Add a user. Adding a new user involves Steps 4 - 10 of Part 3.

Add a user screen

Then, you can easily switch between accounts by using the Switch User option.

Switch user menu

Even though you sign in to a different YouTube account, it still uses the same API key to fetch your content, so you won’t have to generate new keys.

Conclusion

Setting up a home lab requires some work and maintenance, but in the end, it’s rewarding as well. In this tutorial, you learned how to install the YouTube add-on on Kodi and how to configure Google API to access your YouTube account. I hope you enjoyed it. See you in the next post.