Raspberry Pi® Logo
Valid Generic HTML
SPDX-License-Identifier
CC-BY-SA-4.0

Raspberry Pi 4B
Planning

Jim Carter, 2023-08-17

Why Upgrade the Raspberry Pi 3B?

I use my own Wi-Fi access point, because I want my firewall and other security features, and making them happen on a commercial appliance was not possible. However, I have a mysterious symptom on my host(s) that run hostapd. For years the AP will run without problems, but then it gets into a mode where every few days the CPU freezes, with these details:

When does it freeze, and when not?

The consensus of forum discussions is that there is a memory issue and kswapd gets into a high CPU utilization state. Jimc says:

One user had the problem on a RPi 3B+ with hostapd. He upgraded to a RPi 4B with 4Gb RAM, and the problem went away. Jimc says: more likely, the problem occurred less frequently because of more available memory. Although it's conceivable that the culprit program actually uses a lot of memory and a leak is not involved.

I'm also annoyed with my RPi 3B's because:

Specifications of Raspberry Pi 4B

Note: these specs were extracted around 2023-08-17. On 2023-09-28 the Raspberry Pi 5 was announced. I'm considering upgrading one or both RPi 3B's to RPi 4B's, but I'll seriously consider the RPi 5 instead.

For the graphics software: I'm using the aarch64 (ARM) port of OpenSuSE Tumbleweed. Installed means this package was either originally part of the then-current Tumbleseed RPi image, or was obtained from Packman, and it was updated at the time of writing to the indicated version through SuSE's normal processes. No license fee was required. The packages are also available in the RaspberryPi OS images and updates; and Ubuntu equivalents are mentioned in forum posts.

Components Needed

These are what I want. Whether I will be able to get them is another matter.

Choosing a SD Card

What suitable SD cards are available on Amazon? Size 64Gb, micro SD form (but Amazon's searcher includes a lot of full size cards). Here's a summary list.

I'm guessing at the workload of a modern Linux OS: installing software updates is the major writing task, which will be sequential. Writing for payload tasks is a distant second, and is probably random. The biggest reading task is to get shared libraries into memory, which is done by mapping them, and then the CPU bounces randomly among short surbroutines in various libraries, whereupon individual blocks of pre-allocated memory are stuffed with code from disc. In other words, the code is read in random order. Sequential reading, e.g. from the browser cache, is in second place. A database server would read and write randomly and frequently, but none of my machines do a lot of database action.

Web articles about SD cards: Vendors seem to concentrate on cards for digital comeras, for which the most important workload is sequential writing; a card in a video camera has to keep up with the video stream, and a still camera has to snap and store images in quick succession. In second place is sequential reading, for displaying photos. Random access is irrelevant on a camera.

Types of SD Cards Explained by David Coleman, updated 2023-11-06

Kinds of SD cards, and particularly, what various speed ratings mean. UHS-I appears to be limited to 104MB/s (bytes).

Fastest Micro SD Cards by David Coleman, this data from 2023-07-04, currently last updated 2023-12-23

His speed tests and recommendations. Ranked by sequential write speed (advertised), for video cameras. I'm only including vendors I've heard of, and keeping only Micro-SD. It looks like he tested 64Gb cards. (Can a RPi 3B use these cards? Not the first two, it has a UHS-I socket, not UHS-II.)

Raspberry Pi Micro-SD Card Performance Comparison (2019) by Jeff Geerling, 2019-07-10 (4 years ago).

SD cards are mainly aimed at the camera market, for which sequential write speed is the most important. For the apps and games sector, i.e. RPi, random reads and writes dominate. Jeff ran 4 benchmarks on a bunch of cards: "hdparm" seems to test sequential reading; "dd-write" for sequential writing, "4k-read" and 4k-write" for 4k blocks in random locations. 10 top of the line cards (in 2019) were tested, all 64Gb, all on RPi-4B.

There is a rating metric, prefixed with 'A', for apps and games. In another blog post, Jeff tested some A-rated cards in his RPi's and found that they were no better than the cards represented here.

Jimc's disc tester reads the entire disc sequentially (looking for errors). Holly has a Samsung SDHC 32Gb EVO Select ($11.99 in 2018) which is not one of the tested cards. On this tester it achieved 17 MB/s. Piki's disc did 20MB/s. The cards in Jeff's blog post were over twice as fast.

So which card should I get? Let's choose between:

David Coleman tests the SanDisk Extreme Pro. Advertixed seq read 170Mb/s, seq write 90Mb/s (UHS-I <= 104MB/s) His tests: seq read 88.8, seq write 93.6, rnd read 92.4, rnd write 80.4 This is model SDSQXCZ. Also available models ending in Y G P ; the Y is actually slightly better than the Z, G and P are noticeably slower. Plus there are other SanDisk cards that are fast but not quite as fast. David says that new models are often very similar to previous, so if you can't find exactly the tested card, you're pretty safe with a neighbor. That's the case on Amazon.

Amazon product page for SanDisk 64Gb Extreme Pro MicroSD UHS-I card: Model: SDSQXCU-064G-GN6MA; Spec-oids: C10 U3 V30 A2 200MB/s read, 90MB/s write (when pigs fly, a UHS-I card upper bound is 104MB/s). $12.86 sold by MemoryWhiz fulfilled by Amazon. This is the card I ended up getting for the new RPi 4B.

Raspberry Pi Kits

I'm looking for a RPi-4B motherboard, case, thermal management, various etc items. The main item I want to get myself is the SD card. (Most kits include the SD card.)

Vilros Basic Starter Kit for Raspberry Pi 4 with Fan Cooled ABS Case, $115 - $120 - $140 for 2-4-8 Gb board. Sold by Prestige Milano fulfilled by Amazon. Free Amazon tech support included. Contents: The board. ABS transparent case. Fan. Zipper pouch. Power supply with on-off switch (on a plug strip it would cover at least 2 plugs). One adapter cable for Micro-HDMI to full size. Set of 4 heat radiators. Quick start guide. Does not include SD card, keyboard or mouse. Glowing reviews. Only complaint: the instructions for setting up the fan have an error in what pins to use (find and follow the revised instructions). Also at least some fans have low vs high speed, and high speed isn't super noisy but one reviewer mentions picking low speed because he wants it quieter.

Amazon order:

Tidbits

Witty Pi 4
  • This is an add-on multifunction board with all the features from normal desktop machines that you wish the RPi had.
  • It has a realtime clock with battery, and a power switch, and a DC-DC converter from 6-30V to 5V (or a USB connector, use one or the other). 3 amps to the RPi. I'm not sure if the USB connector is micro-USB or type C, which is what the RPi-4 has.
  • Also can shut down the RPi from software and wake on a schedule.
  • Form factor: a HAT. This is a standard size module that fits on the RPi's expansions bus.
  • Price: 27 EUR (currently 29.55 USD).
  • Available from: their site, but not seen on Amazon.
  • The Witty Pi 4 board also works on RPi-3B, same for the cases.
  • Also, clear acrylic case for RPi-3B or RPI-4B with space for one HAT such as this one. Price: 7.27 EUR = 7.96 USD. There's also a case for 2 HATs: Witty Pi and 7 port USB hub. 7.66 EUR = 8.38 USD.
  • The Witty Pi 4 is very attractive but I decided to keep things simple and defer this board.

ETL or Intertek

Intertek (formerly Edison Testing Labs, ETL) is an OHSA Nationally Recognized Testing Laboratory. They have a "global network" of testing laboratories, and are recognized by USA-OHSA, Canada, Mexico, and other countries including South America. Old world coverage: not sure. They are the same general idea as Underwriters Laboratories (UL), but with more modern product hype.

SunFounder PiPower UPS Power Supply for Raspberry Pi

$29.99 sold by SunFounder Direct fulfilled by Amazon. Battery included. It attaches under the RPi (mechanically and electrically compatible with most RPi models (not RPi 400, duh) and several other SBCs). Feed power (between outages) into the USB-C connector on the PiPower board. It charges the battery and power goes through a jumper cable (USB-A to USB-C, micro-USB also available) to the RPi. Output 5V 3A. Battery: LiIon 7.4V 2 amp hours, should run the RPi for 3-4 hours.

New Hostname

Raspberry Pi® Logo
Photo and Image Credit