24.03.2024
Extra subpage for
Getting started with Raspberry PI5 8GB
Keep updated, for a major update (debian) you need to reinstall
> sudo apt update > sudo apt -y full-upgrade > sudo apt -y clean > sudo apt -y autoremoveAutomatic updates, see elektronik-kompendium.de
> sudo apt-get install unattended-upgrades # installation > sudo vi /etc/apt/apt.conf.d/20auto-upgrades # created at installation "1" means daily > sudo vi /etc/apt/apt.conf.d/50unattended-upgrades # created at installation uncommend: "origin=Debian,codename=${distro_codename}-updates"; > sudo dpkg-reconfigure -plow unattended-upgrades # activate with Yes > sudo unattended-upgrades --dry-run # simulate > sudo vi /var/log/unattended-upgrades/unattended-upgrades.log # log file
If you need just a console via HDMI, install default desktop for raspberry.
This uses wayland for debaian bookworm and PIXEL for older versions.
> sudo apt install raspberrypi-ui-mods > sudo raspi-config > System Options > S5 Boot / Auto Login > B3 or B4 to use desktop #use to switch to desktp mode
The console display is controlled via cmdline.txt.
Notes:
> kmsprint | grep Connector # find out which hdmi port is used, you need HDMI-A-1 > sudo vi /boot/firmware/cmdline.txt # edit as ONE line ! append in first line " video=HDMI-A-1:1920x1080M@60,rotate=90" # rotation happens anti-clockwise
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).
Component | Default Max Speed |
---|---|
USB 3.0 (5Gbps) | 625 MB/s |
PCIe 1.0 x1 | 250 MB/s |
PCIe 2.0 x1 | 500 MB/s <= default on PI5 |
PCIe 3.0 x1 | 970 MB/s <= can be enabled |
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 seems 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)", which worked flawlessly.
sudo apt-get install gnome-disk-utilityAfter that you have following at your desktop:
My results:
Device | Read MB/s | Write MB/s | Access ms | |
---|---|---|---|---|
USB Seagate Expansion Desk 5TB | 134,7-135,4 | 44,8 | 16,22-17,05 | |
USB IcyBox 366-C31 2TB | 36,4 | 30,2 | 14,61 | |
m2 Samsung SSD 990 Pro 4TB | 471,1 | 339,6 | 0,09 | PCI 2 |
m2 Samsung SSD 990 Pro 4TB | 923,1 | 430,5 | 0,06 | PCI 3 |
> sudo apt-get install hdparm > sudo hdparm -Tt /dev/nvme0n1 /dev/nvme0n1: Timing cached reads: 5433.18 MB/sec Timing buffered disk reads: 884.73 MB/s
> sudo blkid # get PARTUUID > lsblk -f # list devices > df -h # check size > fdisk --list # list all devices > cat /sys/class/block/sdb/device/{model,vendor} # show model+vendor > lsblk -S # show models of sd* > lsusb # usb devices info > usb-devices # detailed usb devices info change label for ext4: > sudo e2label /dev/sda1 seagate > sudo e2label /dev/sdb1 icybox
> 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
> sudo shred -vzu -n0 /dev/nvme0n1
> sudo apt install nvme-cli > nvme format --help > sudo nvme list > sudo nvme format -s2 /dev/nvme0n1
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 -aIf 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!
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".
>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 = markusWrite permissions on windows are shared on Linux level:
> sudo chmod a+rwx /mediaLinux Commands
> 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
or just the device to see all shares
\\raspberrypi5
> vcgencmd measure_volts => volt = 0,7200VI used a smart power adapter from Gosund to check:
Temperature
You can use Linux for checking that:
> sudo cat /sys/class/thermal/thermal_zone0/tempSome Linux background about temperatures:
file | description | value |
---|---|---|
type | Type of the thermal zone | cpu-thermal |
temp | Current temperature | 56,0 - 60,5 °C without fan in arcyl case (sdCard side open) |
mode | Working mode of the thermal zone | enabled |
policy | Thermal governor used for this zone | step_wise |
available_policies | Available thermal governors for this zone | step_wise |
trip_points | temp=temperature/type=type/hyst=Hysteresis value for this trip point | 0 critical / 110 °C / 0 |
1 active / 50 °C / 5 | ||
2 active / 60 °C / 5 | ||
3 active / 67,5 / 5 | ||
4 active / 75 °C / 5 | ||
slope | Slope constant applied as linear extrapolation | -550 |
sustainable_power | Sustainable dissipatable power | 0 |
k_po | Proportional term during temperature overshoot | 0 |
k_pu | Proportional term during temperature undershoot | 0 |
k_i | PID's integral term in the power allocator gov | 0 |
k_d | PID's derivative term in the power allocator | 0 |
integral_cutoff | Offset above which errors are accumulated | 0 |
offset | Offset constant applied as linear extrapolation | 450000 |
Current CPU frequency
> cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq => 15000000 > vcgencmd measure_clock arm => frequency(0)=1500004352
sudo apt install minidlna sudo service minidlna restart > minidlnad -h > sudo minidlnad -R > sudo service minidlna restart > sudo rm /var/cache/minidlna/files.db # purge media database > sudo netstat -ntpl # check port 8200
config
vi /etc/default/minidlna vi /etc/minidlna.conf # <= edit here
VNC - Virtual Network Computing (Remote Framebuffer Protocol)
Raspberry comes with realvncserver by default (alternative tightvncserver)
Enable WayVNC
> sudo raspi-config > Interface options > VNC > Enable On Windows install [TigerVNC|https://github.com/TigerVNC/tigervnc/releases] > Binary Relases > tigervnc64-1.14.1.exe Run "TigerVNC Viewer" Options > Input > Enable "Show dot when no cursor" Enter IP address > Connect
> sudo apt-get install feh > feh -g 640x480 -d -S filename /path/to/directory > feh --start-at ./foo.jpg /path/to/directoryShortcuts
-Z =auto zoom -x = borderless -F = fullscreen -S name =sorting > feh -ZxF -S name --start-at /mnt/m2/photos
> 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 restartNote: you can customize/add network and service monitoring for example at files
#daemon.noserver=1
> 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 listDisable 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
sudo vi /boot/firmware/config.txt
# added Markus EDIT for HDMI sound output in browser on TV hdmi_drive=2 hdmi_force_hotplug=2
journalctlError monitor.c:222: warn: WARNING: Inotify
sudo sysctl fs.inotify.max_user_instances=8192 sudo sysctl fs.inotify.max_user_watches=524288 sudo sysctl -p
> sudo lsblk -f # check partition usage > df # check where partition is used > sudo du -h -d 1 # check all folder's usage in current folderSolution: with du I could identify that minidlna log captured everything at /var/log/minidlna