24.03.2024

Extra subpage for

Getting started with Raspberry PI5 8GB

Case and PCIe#

Update 02.10.2024 I bought the Argon NEO 5 M.2 NVMe PCIE case, which has an integrated PWM fan. This box is perfect for th PI5 and has a adapter for a PCIe m.2 NVMe (not m.2 SATA!).

OLD: I used the case "Raspberry PI5 Case Acryl with FAN" from mindfactory. There seems to be many different "acryl cases" in the market, e.g. you cannot expect to get the same everywhere. My fan in this package had a two pin adapter only, which you can apply to the GPIO pins 4+5 but then the fans runs always, which is too loud. You should use the official 4 pin fan connector, e.g. buy a package with a proper fan! I guess with the 4 pins it is with PWM signal that allows the computer to change the speed of the fan.
Finally I disabled the fan as I have only max 60°C only (see Temparature below).

Storage#

What is fastest?#

Component Speed
USB 3.0 (5Gbps) 625 MB/s
PCIe 2.0 x1 250 MB/s
Gigabit Ethernet 125 MB/s

As my case offers a PCIe M.2 NVMe slot I added a SSD 4TB Lexar NM790 M.2 2280 PCIe. This had frequently "input/output error", which could be resolved via reboot only. There seesm to be an issue at the kernel, see here Anyway, I returned this device and bought a "4TB Samsung 990 PRO M.2 2280 PCIe 4.0 x4 3D-NAND TLC (MZ-V9P4T0BW)".

Drive Info#

> sudo blkid    # get PARTUUID
> lsblk -f      # list devices
> df -h         # check size
> fdisk --list  # list all devices
> lsblk -o PATH,FSTYPE,MOUNTPOINT /dev/nvme0n1p1

Format #

> sudo fdisk /dev/nvme0n1
delete partition
> d
create GPT partition table
> g
create partition
> n  (use defaults)
write changes
> w
create ext4 filesystem
sudo mkfs -t ext4 /dev/nvme0n1p1

Secure purge#

> sudo shred -vzu -n0 /dev/nvme0n1
> sudo apt install nvme-cli
> nvme format --help
> sudo nvme list
> sudo nvme format -s2 /dev/nvme0n1

Mount#

create folder as mountpoint
> sudo mkdir /mnt/m2
mount via PARTUUID (blkid) or /dev/xxx, note: multiple USB device may switch at /dev/xxx after restart, e.g. better to use UUID !!!
add entry in fstab
> sudo vi /etc/fstab
 add line
 # file_system         mount_point         type  options                      dump pass
 /dev/nvme0n1p1        /mnt/m2             ext4  defaults,auto,users,nofail   0    2
 /dev/sda1             /mnt/usb            auto  defaults,nofail              0    2
reload and check
> sudo systemctl daemon-reload
> sudo mount -a
If you add an USB drive in fstab, make sure to use option nofail, because system will enter emergency mode (leave with Ctrl+D) if USB drive is turned off otherwise!
change label for ext4
> sudo e2label /dev/sda1 seagate
> sudo e2label /dev/sdb1 icybox

OS and update#

I installed Raspberry PI 5 / Raspberry PI OS 64bit on 128GB microSD via Imager Software
Note: Settings has three tabs !
  • name = raspberrypi5
  • Enable SSH !
  • Enable WLAN

Update:

sudo apt-get update
sudo apt-get upgrade
sudo reboot
sudo raspi-config
??? sudo apt install apt-transport-https <- no need for https ???

The Squeezebox Radio needs an IP address (see below), so I activated in FritzBox to give the same IP always to "raspberrypi5".

Samba#

Add samba service to share with windows
>sudo apt-get install samba
# Samba user, same password:
> sudo smbpasswd -a <user>
> sudo mkdir /var/log/samba
}}
> sudo vi /etc/samba/smb.conf
add something like:
[global]
 workgroup = WORKGROUP
# MARKUS ADDED
 netbios name = LINUXSERVER
 lanman auth = no
 ntlm auth = yes
 client lanman auth = no
 wins support = yes
 local master = yes
 preferred master = yes

# MARKUS ADDED
[Musik]
 comment=Raspberry Pi Share
 path = /media
 browseable = yes
 writeable = yes
 read only = no
 only guest = no
 create mask = 0775
 directory mask = 0755
 public = no
 force user = markus
Write permissions on windows are shared on Linux level:
> sudo chmod a+rwx /media
Linux Commands
note: you see the shares used only if some user uses currently, otherwise check config
> sudo service smbd restart
> sudo smbcontrol all reload-config
> samba --version => Version 4.17.12-Debian
> systemctl status smbd
> sudo smbstatus
> sudo smbstatus --shares
> sudo pdbedit -L -v
> cat /var/log/samba/log.smbd

In Windows use
\\raspberrypi5\Musik => Anmelden

Temperature and Power#

Power
You cannot properly messure power consumption in PI, app "powertop" cannot be used due to missing batterie.
 > vcgencmd measure_volts => volt = 0,7200V
I used a smart power adapter from Gosund to check:
  • 3,0 - 3,4W while idle/streaming
  • 3,6 - 3,9W while copying files via Samba

Temperature
You can use Linux for checking that:

 > sudo cat /sys/class/thermal/thermal_zone0/temp
Some Linux background about temperatures:
see folder /sys/class/thermal/
=> zones, PI5 has one only = thermal_zone0
note: values like 60050 = 60,05°C
filedescriptionvalue
typeType of the thermal zonecpu-thermal
tempCurrent temperature56,0 - 60,5 °C without fan in arcyl case (sdCard side open)
modeWorking mode of the thermal zoneenabled
policyThermal governor used for this zonestep_wise
available_policiesAvailable thermal governors for this zonestep_wise
trip_pointstemp=temperature/type=type/hyst=Hysteresis value for this trip point0 critical / 110 °C / 0
1 active / 50 °C / 5
2 active / 60 °C / 5
3 active / 67,5 / 5
4 active / 75 °C / 5
slopeSlope constant applied as linear extrapolation-550
sustainable_powerSustainable dissipatable power0
k_poProportional term during temperature overshoot0
k_puProportional term during temperature undershoot0
k_iPID's integral term in the power allocator gov0
k_dPID's derivative term in the power allocator0
integral_cutoffOffset above which errors are accumulated0
offsetOffset constant applied as linear extrapolation450000

Current CPU frequency

 > cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq => 15000000
 > vcgencmd measure_clock arm => frequency(0)=1500004352

UPnP/DLNA Streaming Server - minidlna#

Notes
  • This is for all media, musik is already available with LMS.
  • KODI etc is running as app, e.g. you need to connect HDMI from Raspberry to TV !
sudo apt install minidlna
sudo service minidlna restart

Standard share is at /var/lib/minidlna/

config

vi /etc/default/minidlna 
vi /etc/minidlna.conf

Software / Use Cases#

Image viewer feh#

> sudo apt-get install feh
> feh -g 640x480 -d -S filename /path/to/directory
> feh --start-at ./foo.jpg /path/to/directory
Shortcuts
You can reset/overwride with file ~/.config/feh/keys
Use feh:
  • in terminal, navigate to folder with fotos and > feh
  • run for dedicated folder:
man feh
-Z =auto zoom
-x = borderless
-F = fullscreen
-S name =sorting
> feh -ZxF -S name --start-at /mnt/m2/photos

Monitoring with RPi Monitor#

help1 | help2
> gpg --no-default-keyring --keyserver keyserver.ubuntu.com --recv-keys 2C0D3C0F
> sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 2C0D3C0F
> sudo wget http://goo.gl/vewCLL -O /etc/apt/sources.list.d/rpimonitor.list
> sudo apt update && sudo apt install rpimonitor
> sudo /etc/init.d/rpimonitor install_auto_package_status_update
> sudo /etc/init.d/rpimonitor restart
Note: you can customize/add network and service monitoring for example at files
  • /etc/rpimonitor/daemon.conf
  • /etc/rpimonitor/template/network.conf
  • ...
Web GUI at http://raspberrypi5:8888 Note: you can also use your own web server
#daemon.noserver=1

wifi / wlan#

If you connect via cable, you do not need wlan
Check WLAN
> ifconfig  > find "wlan0"
> dmesg   	> find "WLAN Adapter"
(sudo dmesg -c   clear messages)
> sudo iwconfig  <========= find "Mode:Managed Access Point"
	> sudo iwgetid
	> sudo apt-get install iw
	> iwconfig  find "IEEE 802.11bgn"
	> iwlist chan
	> iw list
Disable wlan
> sudo vi /boot/firmware/config.txt
add after [all]
dtoverlay=disable-wifi
> rfkill
> rfkill block wifi
> rfkill unblock wifi
> sudo ip link set wlan0 down

Issues#

No sound over HDMI (Browser Streaming)#

Solution at tecchannel

sudo vi /boot/firmware/config.txt

# added Markus EDIT for HDMI sound output in browser on TV
hdmi_drive=2
hdmi_force_hotplug=2

Error message "Cannot open access to console, the root acccount is locked"#

Solution at github
=> turn on external harddisk while booting, you can turn off afterwards again

Raspberry not accessible now and then#

Unsolved, please check
journalctl
Error monitor.c:222: warn: WARNING: Inotify max_user_watches [63376] is low or close to the number of used watches [29] and I do not have permission to increase this limit. Please do so manually by writing a higher value into /proc/sys/fs/inotify/max_user_watches.
sudo sysctl fs.inotify.max_user_instances=8192
sudo sysctl fs.inotify.max_user_watches=524288
sudo sysctl -p