The choice for a Single Board Computer (SBC)

So I decided I'd get a raspberry PI 4b to port the ~~jilendar~~ tasker server over there (30$/mo doing pretty much nothing on AWS at the moment), and maybe start writing.

raspberry pi 4b screenshot

but they currently ship for several hundreds of CA$, if you can even find one. Thanks but no thanks. Looking at alternatives, I liked the idea behind the potato

le potato screenshot

but I ended up falling for the OrangePi 5b

orange pi 5b screenshot

which, in addition to being 2 to 4 times faster than the rpi4b, is also... available. While waiting for the board to be delivered I started building my set of sbc-oriented multi with subs like r/orangepi and r/SBCs, thinking about all the fun I'd have on the opi.

Little did I know, the opi5 comes with android pre-installed on the emmc memory.

Obstacle #1: it's in chinese. Easy enough, using the menu icons from my android phone to navigate to the language settings.

Obstacle #2: it's not running Debian.

Fortunately many OS'es have support for it (more like the other way around, with prebaked images available on the constructor's website). Unfortunately, the setup is not 100% straightforward for an SBC noob like myself. On to the solutions!

Setup

emmc

Problem: the emmc is not detected by the OS loaded from the SD card.

Solution:
Starting from this post, I read a little about dts/dtb, this is a good resource, but TLDR dts stands for device tree source and dtb for device tree blob. The former compiles into the latter, and armbianEnv.txt wants the blob, not the source (could compile on demand? who am I to judge). The dts for the 5b is somewhere out there to be compiled into the dtb, but since I knew I had the orangePI debian working, I searched for the dtb there first, and found it. I copied is over to a freshly compiled image, pointed the boot record to it, and was able to make it all work. Here are a few commands.

I first mounted Orangepi5_1.1.4_debian_bullseye_desktop_kde-plasma_linux5.10.110.img on my own machine (not the pi):

$ fdisk -l Orangepi5_1.1.4_debian_bullseye_desktop_kde-plasma_linux5.10.110.img
Disk Orangepi5_1.1.4_debian_bullseye_desktop_kde-plasma_linux5.10.110.img: 8.06 GiB, 8657043456 bytes, 16908288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 374A4FF6-BE0C-1344-B979-362F7CB96E76

Device                                                                Start   End      Sectors  Size Type
Orangepi5_1.1.4_debian_bullseye_desktop_kde-plasma_linux5.10.110.img1   61440  2158591  2097152   1G Linux extended boot
Orangepi5_1.1.4_debian_bullseye_desktop_kde-plasma_linux5.10.110.img2 2158592 16908254 14749663   7G Linux filesystem

# 512B block size * partition 1 located at 61440=31457280
$ sudo mount -o loop,offset=31457280 Orangepi5_1.1.4_debian_bullseye_desktop_kde-plasma_linux5.10.110.img /media/cdrom
$ cp /media/cdrom/dtb-5.10.110-rockchip-rk3588/rockchip/rk3588s-orangepi-5b.dtb /tmp/

Now the dtb fiel is extracted.

Then boot up Armbian_23.5.0-trunk.140_Orangepi5_lunar_legacy_5.10.110_xfce_desktop.img on the pi and and scp the blob there:

$ scp /tmp/rk3588s-orangepi-5b.dtb root@192.168.1.14:/boot/dbt/rockchip/

then edit /boot/armbianEnv/txt to have this line:

ftdfile=rockchip/rk3588s-orangepi-5b.dtb

reboot, you should see the emmc. On to install this system to it.

Installed gparted, deleted everything from the emmc and formatted it to ext4. Then run nand-sata-install and chose the option boot+system on emmc, let it finish, quick sync;poweroff, then unplug the power cord, remove the sd card, plug the cord it back, it boots 😎

X forwarding

Issue when running ssh -X to the opi and trying to run graphic apps as root:

(gpartedbin:8071): Gtk-WARNING **: 01:53:00.158: cannot open display: localhost:11.0

Solution: Run this on the opi whenever you need to sudo use a graphic app.

sudo cp ~/.Xauthority /root/

You can also link /root/.Xauthority to the one of the user you usually log in as, but I guess that's a security concern so you're responsible for whatever falls down on you if you do that.

Shutdown Button

This enables the power off button.

# as root
$ apt-get install -y acpid
cat <<EOF > /etc/acpi/events/button_power
event=button/power
action=/sbin/shutdown -h now
EOF
chmod +x /etc/acpi/events/button_power
/etc/init.d/acpid restart

Taken from there.

Avahi

From the debian wiki:

Avahi technology is dependent on the mDNS and DNS-SD protocols and allows machines to - publish services and hosts running on a local network, and - discover services and hosts running on a local network.

apt-get install avahi-daemon avahi-utils
service avahi start

By now the pi should be advertised in the LAN under `hostname`.local, in my case orangepi5.local


[1] Single Board Computer


Published

Category

blog

Tags