Categories
Raspberry Pi

PiBox and KubeSail Are No More

Unfortunately PiBox and KubeSail ended operations in September 2025. I had not used my PiBox too much, just as a scratchpad for WordPress. I decided to reflash it with Raspbian. Below are the steps that I took to reuse my PiBox.

Oddly, the only post that I could find about it was at https://lemmy.world/post/38039322. I did go to the PiBox and KubeSail websites and they appear to be gone.

Flashing Raspbian

I’m using a Windows PC to flash the PiBox. I followed the directions at https://docs.kubesail.com/guides/pibox/rpiboot/. One thing that was not clear is that rpiboot.exe should be run before plugging the PiBox into the PC. It looked like there were errors but it still works. The errors are about optional files for configuring the connection, so they may be ignored. The connection is slow even with a high quality USB-C to USB-C cable.

  1. Remove the cover from the PiBox and move the internal switch from “normal” to “rpiboot”.
  2. Remove the carrier board from the backplane
  3. Run rpiboot.exe on the PC.
  4. Plug the PiBox into the PC using a USB-C Cable.
  5. Open Raspberry Pi Imager.
  6. Click Storage and make certain that the PiBox is showing as “RPi-MSD- 0001”.
  7. Click “Choose Device” and select “No filtering”.
  8. Click Operating System and select the 64-bit version you wish to install.
  9. Click the “Next” button to write the image to the PiBox.
  10. Once the image is written and verified, unplug the PiBox from the PC.
  11. Move the internal switch from “rpiboot” to “normal”.
  12. Reassemble the PiBox.

Updating Raspbian

If SSH is enabled and the Wi-Fi settings are configured or it is connected via ethernet , you may open an SSH session to run commands. If not, you may need to connect a monitor and keyboard to continue.

sudo apt update
sudo apt upgrade

Setup SSD Drives

I have two 1TB Samsung SSDs installed. I wanted to wipe them and remount them to the PiBox. Below are the steps that I followed.

/dev/sda

  1. Run the parted tool
    sudo parted /dev/sda
  2. Change the units used by parted
    unit s
  3. Delete the existing partitions
    • Run the print command to list all the partitions.
      print
    • Remove each partition (Repeat if more than one partition is present.)
      rm 1
  4. Create a single partition for the whole drive
    mkpart primary ext4 0% 100%
  5. Exit parted
    quit
  6. Format the partition
    sudo mkfs.ext4 -L data1 /dev/sda1
  7. Create a mounts point for the drive (The rancher mount point is only so it will display on the LCD display.)
    sudo mkdir -p /var/lib/rancher

/dev/sdb

  1. Run the parted tool
    sudo parted /dev/sdb
  2. Change the units used by parted
    unit s
  3. Delete the existing partitions
    • Run the print command to list all the partitions.
      print
    • Remove each partition (Repeat if more than one partition is present.)
      rm 1
  4. Create a single partition for the whole drive
    mkpart primary ext4 0% 100%
  5. Exit parted
    quit
  6. Format the partition
    sudo mkfs.ext4 -L data2 /dev/sdb1
  7. Create a mount point for the drive
    sudo mkdir -p /mnt/data2

Update fstab

  1. Open text editor to edit fstab
    sudo nano /etc/fstab
  2. Add the following lines
    /dev/sda1 /var/lib/rancher ext4 defaults,nofail,noatime,discard,errors=remount-ro 0 0

    /dev/sdb1 /mnt/data2 ext4 defaults,nofail,noatime,discard,errors=remount-ro 0 0

Enabling PWM Fan Support

  1. Clone the PiBox OS Scripts
    git clone https://github.com/kubesail/pibox-os.git
  2. Change to the Fan folder
    cd pibox-os/pwm-fan
  3. Uncompress the Fan scripts
    tar zxvf bcm2835-1.68.tar.gz
  4. Change to the Fan scripts folder
    cd bcm2835-1.68
  5. Run the make command
    ./configure && make && sudo make install
  6. Go to the parent folder
    cd ..
  7. Make and run the installation
    make && sudo make install
  8. The fan should run quieter now.

Optimize system for EMMC

  1. Store system logs in memory, instead of writing to disk, and lower log verbosity
    sudo sed -i "s/#Storage.*/Storage=volatile/" /etc/systemd/journald.conf

    sudo sed -i 's/.MaxLevelStore.*/MaxLevelStore=info/' /etc/systemd/journald.conf

    sudo sed -i 's/.MaxLevelSyslog.*/MaxLevelSyslog=info/' /etc/systemd/journald.conf

    sudo systemctl restart systemd-journald.service
  2. Disable swapfile
    sudo swapoff -a
    sudo dphys-swapfile swapoff
  3. Mount /var/tmp as tmpfs filesystems to extend EMMC lifetime
    echo "tmpfs /var/tmp tmpfs defaults,noatime,nosuid,nodev,noexec,mode=0755,size=1M 0 0" | sudo tee -a /etc/fstab

Enabling the 1.3” LCD display

  1. Return to the home directory
    cd ~
  2. Install additional drivers for Raspbian / Pibox-OS
    sudo apt-get install raspberrypi-kernel-headers

    pushd pibox-os/st7789_module

    make

    sudo mv fb_st7789v.ko /lib/modules/"$(uname -r)"/kernel/drivers/staging/fbtft/fb_st7789v.ko

    popd

    sudo dtc --warning no-unit_address_vs_reg -I dts -O dtb -o /boot/overlays/drm-minipitft13.dtbo pibox-os/overlays/minipitft13-overlay.dts
  3. Update config.txt
    cat <> /boot/firmware/config.txt
    dtoverlay=spi0-1cs
    # dtoverlay=dwc2,dr_mode=host
    hdmi_force_hotplug=1
    dtoverlay=drm-minipitft13,rotate=0,fps=60
    EOF
  4. Download pibox-framebuffer binary
    curl -s https://raw.githubusercontent.com/kubesail/pibox-os/main/update-framebuffer.sh | sudo bash

Optional if you want the ability to control the top RGB LED

  • Install the RPi.GPIO library.
    sudo apt install python3-RPi.GPIO
  • Open Nano to create a script file.
    nano blinkLED.py
import RPi.GPIO as GPIO
import time

# Red 17
# Green 27
# Blue 23
leds = [17, 27, 23]

GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
for led in leds:
    GPIO.setup(led, GPIO.OUT)

for led in leds:
    for i in range(3):
        GPIO.output(led, GPIO.HIGH)
        time.sleep(0.5)
        GPIO.output(led, GPIO.LOW)
        time.sleep(0.5)

# Commented next line so the LED stays off.
# Added GPIO.setwarnings(False) at the start of the script
# to hide warnings that the channel is in use on future runs.
# GPIO.cleanup()
  • Run the script and observe the top LED on the front of the PiBox.
    python ./blinkLED.py

By richteel

Software and hardware developer who likes learning new things with a passion of sharing knowledge with others.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from TeelSys

Subscribe now to keep reading and get access to the full archive.

Continue reading