|
| 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.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-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 2023-12-11-raspios-bookworm-arm64-lite.img.xz |
| 21 | +sudo dd if=2023-12-11-raspios-bookworm-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/firmware/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 0 |
| 77 | +} |
| 78 | +ctl.!default { |
| 79 | + type hw card 0 |
| 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. |
0 commit comments