Get Spotify on that old Hi-Fi

A hassle-free DIY Sonos speaker made with Balena, a Raspberry Pi 4 and a HifiBerry DAC

Raspberry Pi 4 and its DAC hat from HifiBerry

It also works with Apple Airplay and even as a "simple" Bluetooth speaker!

What is Balena?

From my understanding it is mainly three services.

Balena OS: an operating system tailored for embedded devices, such as the Raspberry Pi 4, with a focus on running Docker containers.

Balena Engine: a Docker compatible container engine.

Balena Cloud: a platform to deploy, manage and monitor IoT applications.

What is a DAC?

A DAC or digital-to-analog converter is the device that converts our digital music files into analog signals for our Hi-Fi amplifier.

Prerequisites

Services

Hardware

Instructions

Create a balenaCloud application, set the Application Name to sound2, and set the Default Device Type to Raspberry Pi 4.

Create a balenaCloud application

Add a device and download the customized image.

Add a device and download the customized image

Flash this image to the SD card with Etcher.

Flash this image to the SD card with Etcher

Raspberry Pi setup:

Get the Balena CLI tools

If you have node:

npm install balena-cli -g --production

If not, see alternatives.

Fetch and deploy the code

git clone git@github.com:balenalabs/balena-sound.git
cd balena-sound
balena push sound2

Configuration in the Balena Dashboard

Result

The dasboard is features rich: live logs, terminal session to the host machine, service status, environment variables and so on.

The Balena dashboard

The setup is running smoothly for a couple of weeks now. The experiment is a success and the feeling is really good. For me, hardware experiments are tedious at best but mainly just painful, this time it was different.

Kudos to Balena for making hardware felt like software, I was at home 🙂.

Source

This is a washed-out version of this article from Balena.

Mastodon