I have KDE Desktop running on a Raspberry Pi2B
for good performance you need an mmc 16GB Class 10
install Raspbian Stretch Lite
sudo aptitude update
sudo aptitude upgrade
reboot
check your logfiles and make sure there are no errors after initial running
sudo raspi-config
Advanced options
- opengl
- G1 GL (Full KMS) OpenGL desktop driver with full KMS
- in case the filesystem has not been expanded automatically(default) do it now.
- No Memory Split
- No Overclocking
after
sudo raspi-config
verify with
sudo nano /boot/config.txt that
there is a hash before gpu #gpu-mem=xx
you can use
dtoverlay=vc4-fkms-v3d instead of
dtoverlay=vc4-kms-v3d
now install bc, mc (midnight-commander is not required but allows easy editing, copying. moving etc.)
sudo aptitude install bc mc
install zram
look here for details: https://hackaday.io/project/29898-boost-your-raspberry-pi-in-minutes/details
sudo wget -O /usr/bin/zram.sh https://raw.githubusercontent.com/novaspirit/rpi_zram/master/\zram.sh
sudo chmod +x /usr/bin/zram.sh
I recommend a dry run of /usr/bin/zram.sh with disabled commands,
because some bash-versions are not calculating as needed.
Test it!
My testfile is /usr/bin/zramtest.sh:
#!/bin/bash
#/usr/bin/zramtest.sh
# echo "original calculation"
cores=$(nproc --all)
# modprobe zram num_devices=$cores
# swapoff -a
totalmem=`free | grep -e "^Mem:" | awk '{print $2}'`
mem=$(( ($totalmem / $cores)* 1024 ))
core=0
counter=0
# I added a counter here just for the case that bash cannot execute 'let'.
# that would cause a never ending loop, which is being prevented after 4 cycles
while [ $core -lt $cores ]; do
echo "mem: $mem"
# echo $mem > /sys/block/zram$core/disksize
# mkswap /dev/zram$core
# swapon -p 5 /dev/zram$core
let core=core+1
counter=$((counter+1))
if [ $counter -gt 4 ];then
break
fi
done
echo "---------------------"
echo "modified calculation"
cores=$(nproc --all)
echo $cores
# modprobe zram num_devices=$cores
#swapoff -a
tot=`free | grep -e "^Mem:" | awk '{print $2}'`
memex=$(echo "scale=0;1*($tot/$cores)" | bc)
echo "total: $tot"
echo "memex:" $memex
core=0
while [ $core -lt $cores ]; do
echo "core: $core"
echo $memex
core=$((core+1))
done
This is what I am currently using.
Zram size for KDE works well if it is 2 x free memory
#!/bin/bash
# /usr/bin/zram.sh
cores=$(nproc --all)
modprobe zram num_devices=$cores
swapoff -a
totalmem=`free | grep -e "^Mem:" | awk '{print $2}'`
mem=$(echo "scale=0;2048*($totalmem/$cores)" | bc)
core=0
while [ $core -lt $cores ]; do
echo $mem > /sys/block/zram$core/disksize
mkswap /dev/zram$core
swapon -p 5 /dev/zram$core
core=$((core+1))
# let core=core+1
done
After verifying the proper working of memory-calculation in zram.sh you
- add /us/bin/zram.sh as the forelast line in /etc/rc.local
- comment all in /etc/dphys-swapfile
- remove /etc/init.d/dphys-swapfile
reboot
doublechecking with
sudo fdisk -l | grep zram
Disk /dev/zram0: 463.4 MiB, 485863424 bytes, 118619 sectors
Disk /dev/zram1: 463.4 MiB, 485863424 bytes, 118619 sectors
Disk /dev/zram2: 463.4 MiB, 485863424 bytes, 118619 sectors
Disk /dev/zram3: 463.4 MiB, 485863424 bytes, 118619 sectors
Get the KDE Desktop
see https://www.rootusers.com/install-kde-gui-debian-9-linux/
sudo aptitude install ~t^desktop$ ~t^kde-desktop$
now you can walk your dog!
sudo aptitude update
sudo aptitude upgrade
Have a cup of covfefe ;-)!
after installing KDE modify
sudo nano /etc/X11/Xsession
look for
exec >>"$ERRFILE" 2>&1
and change it to
exec >"$ERRFILE" 2>&1
The command exec >>"$ERRFILE" 2>&1 appends by default setting unbelievable lots of information
and is writing to ~/user/.xsession-errors. That will grow fast and makes the system hang soon. It contains many unsolvable errors since the Raspberry is not 100% compatible to all checks KDE is executing. This modification prevents appending and just causes rewriting of that file, it does not exceed 40kB on my system
You can't use all graphical KDE effects on the Raspberry!
It will cause a lot of trouble if you enable the compositor. The DisplayManager will continuously restart.
After the KDE-Desktop started, go to
System-Settings
Display and Monitor
Compositor
and in case it is enabled untick "Enable compositor on startup"
Disable with sudo systemctl all services you don't need
Do not use the Package-Manager. It will look for updates every minute and block your system
My Raspberry Pi2 is currently 24/7 connected to an internet Hotspot by USB Dongle,
is
- AP by 2nd USB Dongle
- Server, Samba Server
- connected via ethernet to a further Raspberry B+
- Router
- accessible via TeamViewer and VNC
- sharing my kontact mail-archive, located on a USB-Drive, all network
computers with kontact installed can access the mail archive by
mounting this drive via sshfs
uses
- Chromium-Browser as default
- Raspicomm for 2 outputs and RTC
runs
- MySql + phpmyadmin
plays
- video with a compiled older VLC version
it's a lot of fun!
update June 2020
Internet via Huawei Router "Humax" by True Thailand.
Raspberry 2B replaced with Raspberry 3B+ (Raspberry 2B misses 2 gpio's but is still going strong, doing other tasks)
Raspberry 2B SD-Card moved to Raspberry 3B+ without major problems.
Criteria:
IP address must always be the same, since this is a server for mysql, nfs
Issues
At start no wifi, Wlan0 accessible in Bash but not recognized by KDE.
Steps
Setting a reserved IP Address had no effect.
Setting a static IP address in /etc/dhcpcd.conf helped.
With that there was connectivity, so that apt-get, git etc could be used via wifi.
But the Network-Manager-Applet in KDE was still showing a red icon and clicking on it produced an empty window.
Digging deeper I learnt that the Mac-Address changed with every boot.
I followed the hints on
Network-Manager
Mac Address
in order to keep one Mac-Address and have the Network-Manager working.
I stopped and disabled the dhcpcd.service, restarted wpa_supplicant.service and network-manager.service.
After that the icon of Network-Manager changed and I could see several networks and connect to the router.
In Wpa_supplicant.conf the password had been replaced with a link to a password-file. To make auto-connect work the link (not the password) needs to be used as passphrase in the Network-Manager
The difference between Raspberry 2B and Raspberry 3B+ is striking when using Chrome.
For me less important since I am using this computer mostly heaadless but there is a visible clear improvement in overall performance.
There were some interesting reactions to my report about Raspberry 2B
Some experts were telling me that it is not possible to run this KDE software on Raspberry 2B.
That is funny. I still keep using it. All Computers in my network are using the same ui.
Kontact archives located on a USB-drive are accessible from every PC in the network.
There are more benefits.
Cheers
update November 2020
My ISP TRUE-Thailand replaced the Huawei-router with a SKYWORTH GN542VF
Chromium-browser Version 84.0.4147.141 (Official Build) frequently caused crashes, remedy:
zram.sh removed, replaced with zramswap
settings:
Allocated 1536Mb, Priority 25
Solved, no more crashes so far.
Home-automation functions extended, switching off battery-charging and water-heater when off-grid (running on 3000 VA inverter), using ESP32 WiFi controllers w. Mosquitto,
Occasionally occurring undervoltage issues solved by connecting Pins 30 & 34 to GND terminal
KDE Desktop fully functional, including KDE Connect.
cmake .
?