Skip to main content
  1. Notes/

Raspberry Pi

Activity LED codes #

Up to Raspberry Pi 3 models #

Actual models #

LED ActivityDescription
3 flashesstart.elf not found
4 flashesstart.elf not launch-able (corrupt)
7 flasheskernel.img not found
8 flashesSDRAM not recognized. You need a newer bootcode.bin/start.elf firmware, or your SDRAM is damaged

Older models up to Raspberry Pi 3 #

LED ActivityDescription
3 flashesloader.bin not found
4 flashesloader.bin not launch-able (corrupt)
5 flashesstart.elf not found
6 flashesstart.elf not launch-able
7 flasheskernel.img not found

Raspberry Pi 4 #

Long flashesShort flashesDescription
03Generic failure to boot
04start*.elf not found
07Kernel image not found
08SDRAM failure
09Insufficient SDRAM
010In HALT state
21Partition not FAT
22Failed to read from partition
23Extended partition not FAT
24File signature/hash mismatch - Pi 4
44Unsupported board type
45Fatal firmware error
46Power failure type A
47Power failure type B

Freeze a package with apt/apt-get #

Raspberry Pi 4 #

4GB version, if that information is of any use.

WiFi setup #

Run wifi-menu. It does not survice a reboot though!

I prefer iwctl or NetworkManager, so what I do:

# pacman -S networkmanager

No network after boot #

Sometimes I make mistakes in my initial wpa_supplicant.conf file (that I’d place on the boot partition of the new Raspberry Pi SDcard). Recently my wpa_supplicant.conf file was totally messed up (a bracket too much I think).

So there is a quick way to connect to a WiFi network with the use of nmcli (NetworkManager).

$ sudo nmcli device wifi connect [ssid] password [password]

You can view networks with (no need for sudo):

$ nmcli device wifi list

Moving to testing (from bookworm) #

Why would you want to do that in the first place? Well, most packages on debian stable are quite old – hence the name stable.

If you need newer packages, you should consider moving to the testing branch. I moved my Raspberry Pi 4 to testing because of the starship prompt that I use on my computers – it needed a newer version of the rustc package.

First of all, upgrade to the latest packages.

$ sudo apt update && sudo apt upgrade

Now change the release name (e.g. bookworm) to testing in /etc/apt/sources.list:

deb testing main contrib non-free non-free-firmware
deb testing-security main contrib non-free non-free-firmware
deb testing-updates main contrib non-free non-free-firmware

Then update step by step.

$ sudo apt update
$ sudo apt upgrade

Restart services during package upgrades without asking?

Answer with Yes.

Finish the update:

$ sudo apt full-upgrade
$ sudo reboot

Python 3 #

Installing non-packaged modules #

I could not find aprslib as a package, so I had to install this myself. Debian did not allow the installation as it did before, so I had to create a virtual environment. And it went like this:

$ python -m venv ~/.env
$ source ~/.env/bin/activate
$ pip install aprslib
$ deactivate

I now have a similar line in my crontab:

3 * * * * /home/dominic/.env/bin/python /home/dominic/bin/

We could also create virtual environments per application, module, package etc.

Raspberry Pi 3 #

UPS Plus #

An uninterruptible power supply (UPS) is very useful if you have your own servers at home. I’ve been using one with my old DiskStation (NAS1) but I got rid of the DiskStation at the end of 2023. I got the UPS Plus for the Raspberry Pi now for a while but never tested all its features yet (well, I haven’t used it much to be honest).

Though, I have some quick notes to remember:

Some software is needed to get status information about the batteries (which are of type 18650).

$ python3 -m venv .
$ curl -LsO
$ bash

Any errors can be resolved by installing by hand. In my notes I thought that info is enough, so here we are 😉

We may have to edit our crontab:

* * * * * /home/dr/bin/python3 /home/dr/bin/ > /tmp/upsPlus.log
* * * * * /home/dr/bin/python3 /home/dr/bin/ > /tmp/upsPlus_iot.log

Getting information:

$ python3 bin/
------Current information of the detected Raspberry Pi------
Raspberry Pi Supply Voltage: 5.028 V
Raspberry Pi Current Current Consumption: 571.068 mA
Raspberry Pi Current Power Consumption: 2570.227 mW
-------------------Batteries information-------------------
Voltage of Batteries: 4.208 V
Battery Current (Charging) Rate: 30.000 mA
Current Battery Power Supplement: 263.415 mW
Successfully set the protection voltage to: 3700 mV
Currently charging via Type C Port.

The Raspberry Pi will continue to work if you remove the power cable.

Raspberry Pi 2 #

WiFi adapter #

The Raspberry Pi 2 does not have any WiFi capabilities so an adapter is needed to make use of your local WiFi network. I found this small adapter and can confirm it as a working unit.

picture of the small Edimax EW-7811UN wireless adapter
It is not available on Amazon any more, but they suggest another device as its successor. I can only speak for the one that I own: Edimax EW-7811Un

Raspberry Pi Pico W #

Using MicroPython #

I did the dumb thing and made the file break which led to an endless loop showing me only the Error code and restarting…

I was able to stop the script by quickly pressing CTRL+D, CTRL+C on the serial console but never was able to update the broken file without it doing a soft-reboot which loads again instantly…

After some research I was glad I found pico-nuke.

Boot into uf2 loading (pressing BOOTSEL while power on) and place the correct .uf file (pico_nuke_pico_w-1.1.uf2) on the mounted device.

On OpenBSD there is no response but you can see the filesystem unmounted/removed. Unplug the USB and plug it in again booting into uf2 loading, copying over the MicroPython uf2 file again.