Skip to content

Commit c3fb18f

Browse files
committed
Update tutorials for the latest 2022 branch
1 parent 4b62909 commit c3fb18f

5 files changed

+144
-2
lines changed

_posts/2016-01-12-setup-a-radio-pi.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: Setup a RadioPi
44
category: tutorial
55
---
66

7+
THIS IS OUTDATET CHECKOUT THE UPDATED GUIDE [HERE]( /2022-11-20-setup-a-radio-pi )
8+
79
First of all I build it with a [Raspberry Pi 3]( https://www.raspberrypi.org/products/raspberry-pi-3-model-b/ ) and the
810
[HiFiBerry DAC+]( https://www.hifiberry.com/dacplus/ ) but if you use other hardware like a USB sound card
911
you can easily adapt most of this tutorial. Goal of this article is that you have a running Radio Pi at the end.

_posts/2016-01-13-setup-a-radio-pi-software.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: Get the software running
44
category: tutorial
55
---
66

7+
THIS IS OUTDATET CHECKOUT THE UPDATED GUIDE [HERE]( /2022-11-26-setup-a-radio-pi-software )
8+
79
This post is asuming that you have setup your Raspberry Pi
810
and your audio interface. If not check out the blog post: [here]( /2016-01-12-setup-a-radio-pi )
911

_posts/2022-11-20-setup-a-radio-pi.md

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
layout: post
3+
title: Setup a RadioPi
4+
category: tutorial
5+
---
6+
7+
The hardware I used for this tutorial is the [Raspberry Pi 4 B]( https://www.raspberrypi.com/products/raspberry-pi-4-model-b/ )
8+
and the [HiFiBerry DAC+]( https://www.hifiberry.com/dacplus/ ).
9+
If you use other hardware like a USB sound card you might need to adapt parts of this tutorial.
10+
Goal of this tutorial is that you have a running Radio Pi at the end.
11+
12+
## Raspberry up and running
13+
14+
The first step is to download the latest [Raspberry Pi OS Lite image](https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2022-09-26/2022-09-22-raspios-bullseye-arm64-lite.img.xz).
15+
After that unpack the image and copy it to the SD card.
16+
17+
Please make sure /dev/sdX is the correct device!
18+
19+
```
20+
unxz 2022-09-22-raspios-bullseye-arm64-lite.img.xz
21+
sudo dd if=2022-09-22-raspios-bullseye-arm64-lite.img of=/dev/sdX
22+
```
23+
24+
Connect a monitor, a keyboard and network and start your Raspberry Pi.
25+
To login use the user account just created.
26+
To setup the next steps start ssh and enable it on startup.
27+
28+
```
29+
sudo systemctl enable ssh
30+
sudo systemctl start ssh
31+
```
32+
33+
### Static IP
34+
35+
It is recommended to configure a static IP address to be able to connect to the RadioPi Raspberry Pi.
36+
(It is recommend to install your favorite editor).
37+
38+
This is my config you can just change the address, gateway and netmask to match your network.
39+
40+
```
41+
$ cat /etc/network/interfaces.d/eth0
42+
auto eth0
43+
iface eth0 inet static
44+
address 192.168.17.190
45+
netmask 255.255.255.0
46+
gateway 192.168.17.1
47+
dns-nameservers 192.168.17.5
48+
```
49+
50+
Restart networking and check with `ip` if your configuration worked.
51+
52+
```
53+
sudo systemctl restart networking.service
54+
ip a
55+
```
56+
57+
58+
# HiFiBerry
59+
60+
HiFiBerry has done a pretty good job in documenting what you should do to get there hardware running.
61+
Here just a TL:DR and the link to [there documentation]( https://www.hifiberry.com/docs/software/configuring-linux-3-18-x/ ).
62+
63+
Replace in `/boot/config.txt` the `dtparam=audio=on` with the one matching your HiFiBerry.
64+
And disable `force_eeprom_read` see [Configuration changes in Linux 5.4](https://www.hifiberry.com/blog/configuration-changes-in-linux-5-4/).
65+
In my case:
66+
67+
```
68+
dtoverlay=hifiberry-dacplus
69+
force_eeprom_read=0
70+
```
71+
72+
Create /etc/asound.conf with
73+
74+
```
75+
pcm.!default {
76+
type hw card 2
77+
}
78+
ctl.!default {
79+
type hw card 2
80+
}
81+
```
82+
83+
It is possible that the HiFiBerry HAT shows up as a different card,
84+
the id can be checked with `aplay -l` adjust the configuration accordingly.
85+
86+
Now you can reboot it and re-login on your new static IP.
87+
To test the sound with use `speaker-test -c2 -t wav`.
88+
The Raspberry Pi is now ready for the software installation which is covered in an other tutorial.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
layout: post
3+
title: Get the software running
4+
category: tutorial
5+
---
6+
7+
This post assumes that you have setup your Raspberry Pi and your audio interface.
8+
If not check out the tutorial post: [here]( /2022-11-20-setup-a-radio-pi )
9+
10+
# App Backend
11+
12+
The installation process right now is still very manual,
13+
and involves a handful of steps which can be copy pasted.
14+
15+
Install [VLC](https://www.videolan.org/vlc/) which is used a player to play the audio streams.
16+
17+
```
18+
sudo apt install vlc
19+
```
20+
21+
Install the required tools: Python, virtualenv and git with apt-get.
22+
23+
```
24+
sudo apt install python3 python3-dev virtualenv git
25+
```
26+
27+
Get the source:
28+
29+
```
30+
sudo git clone https://github.com/radio-pi/python-websocket-backend.git /usr/local/src/radiopi
31+
sudo chown -R $USER /usr/local/src/radiopi
32+
```
33+
34+
Create the environment and install the dependency.
35+
36+
```
37+
virtualenv --python=python3 /usr/local/src/radiopi/env
38+
source /usr/local/src/radiopi/env/bin/activate
39+
pip install /usr/local/src/radiopi/
40+
pip install uvicorn
41+
```
42+
43+
Copy the systemd service to `/lib/systemd/system/` reload it and enable it to run on startup.
44+
45+
```
46+
sudo cp /usr/local/src/radiopi/radiopi.service /lib/systemd/system/
47+
sudo systemctl daemon-reload
48+
sudo systemctl enable radiopi
49+
sudo systemctl start radiopi
50+
```

tutorials.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: Tutorials
55

66

77
<div style="width:49%; float:left">
8-
<a href="/2016-01-12-setup-a-radio-pi">
8+
<a href="/2022-11-20-setup-a-radio-pi">
99
<h3>Assemble the hardware</h3>
1010
<img class="projectIMG" src="/img/hardware.jpg">
1111
</a>
@@ -14,7 +14,7 @@ title: Tutorials
1414
<div style="width:2%; float:left">&nbsp;</div>
1515

1616
<div style="width:49%; float:left">
17-
<a href="/2016-01-13-setup-a-radio-pi-software">
17+
<a href="/2022-11-26-setup-a-radio-pi-software">
1818
<h3>Install the software</h3>
1919
<img class="projectIMG" src="/img/software.png">
2020
</a>

0 commit comments

Comments
 (0)