Pi 5

From Wildsong
Jump to navigationJump to search

Overview

I have two Pi 5s now, "pi5" and "asl". I started out setting up All Star Link on ASL, hence its name. It's not there right now. It's just Bookworm.

I put a reservation for both 5s for addresses on Wenda DHCP and into pihole on Bellman.

Getting an operating system onto the NVME is a trick. You install a full GUI onto an SD card and then run the Raspberry Pi Imager and target the NVME. This is the easiest way, really. It's a squeeze to get an SD card into the Pi when it has the NVME adapter installed because the ribbon cable gets in the way. You can set the Pi to boot first from the NVME or the SD, so it's possible to just leave the SD card in there "for next time" or as a rescue disk.

WiFi did not get set up during installation. I did it with command line, like this

sudo nmcli d wifi connect "wildsong" password "YOUR SECRET HERE" ifname wlan0

Disable ipv6 by adding this to /etc/sysctl.conf

# Disabling the IPv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.wlan0.disable_ipv6 = 1

NVME

I added the Pimroni NVME interface and wanted to start again.

I did not want to have to mess around with taking the NVME card out to rewrite it so I downloaded the OS image, then used the SD card image to write to it, like this

wget https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz
sudo rpi-imager --cli *xz /dev/nvme0n1

I set the boot order with raspi-config to be NVME first, then SD card.

I had to edit the config.txt to add these lines to get UART access.

enable_uart=1 
dtoverlay=disable-bt
dtparam=uart0=on

This ends up not setting up an account though, it's back to logging in as "pi". This was a minor problem since I was never able to set the password and so the system was useless. I disconnected the NMVE, booted from SD, set it to boot from SD, reconnected NVME, booted from SD, used commands to mount the NVME, and manually edited passwd, shadow, and group. Then set it to boot from NVME again and finally I am back in business.

Testing speed

Now that I have the NVME installed I need to know about speed.

https://linuxconfig.org/how-to-test-sd-card-speed-on-raspberry-pi

Write a 1GB file

dd if=/dev/zero of=./TestingFile bs=100M count=10 oflag=direct

Read the file

dd if=./TestingFile of=/dev/zero bs=100M count=10 oflag=dsync

Results

32GB SD card

write: 1048576000 bytes (1.0 GB, 1000 MiB) copied, 35.41 s, 29.6 MB/s
read: 1048576000 bytes (1.0 GB, 1000 MiB) copied, 11.7282 s, 89.4 MB/s

NVME

read: 1048576000 bytes (1.0 GB, 1000 MiB) copied, 3.13241 s, 335 MB/s
write: 1048576000 bytes (1.0 GB, 1000 MiB) copied, 2.36035 s, 444 MB/s

NVME with pcie gen 3 enabled

read: 1048576000 bytes (1.0 GB, 1000 MiB) copied, 2.81857 s, 372 MB/s
write:1048576000 bytes (1.0 GB, 1000 MiB) copied, 1.46088 s, 718 MB/s

Overclocking

https://www.tomshardware.com/how-to/overclock-raspberry-pi-5

I set it to 3000 for the CPU and 1000 for the GPU and set turbo mode on and now the system won't boot. :-) Okay. Now how do I get it running again. I guess I should be doing the SD card to test overclocking. Or perhaps I don't care about overclocking right now.

Boot order

To recover more easily I need it to boot from the SD card first and the NVME second, so that I can pop in the SD card when I make NVME unbootable.

For now I have no choice but to unplug the NVME cable again.

I think I'd like the order to be (1) SD card (2) USB (3) NVME.

Sound card set up

I am using a USB card for audio. Ha! I just noticed there is no headphone jack on the Pi5, what a kick. Well, the audio on the earlier Pi's was known to be inadequate. The selection for audio includes my USB card and the two HDMI outputs. Huh, can I disable HDMI in config.txt? I have no need for it.

cat /proc/asound/cards
0 [Device         ]: USB-Audio - USB PnP Sound Device
                     C-Media Electronics Inc. USB PnP Sound Device at usb-xhci-hcd.1-2, full speed
1 [vc4hdmi0       ]: vc4-hdmi - vc4-hdmi-0
                     vc4-hdmi-0
2 [vc4hdmi1       ]: vc4-hdmi - vc4-hdmi-1
                     vc4-hdmi-1

If you use alsamixer you should be able to see the USB card and adjust it. You should be able to play a sound file, for example, these commands work.

aplay /usr/share/sounds/alsa/Front_Center.wav
speaker-test -c2 -t wav

Confirmed, works! So easy after messing with setup for audio on a Pi 4.

Networking

Okay, I want to haul the Pi 5 around as a development system, and when it wants Internet, it will use WiFi. The 10BT port will be for talking to the laptop, Murre.

I need DHCP and a place to plug in two computers, the Pi 5 and Murre. Easy peasy, I have a Mango router. I set it to be an access point and set both ethernet ports to be LAN.


Internet <--> Wifi <--> Murre -> LAN port -------> Mango

asl (pi5) -> WAN port ---> Mango