Raspberry reinstall

Exactly two months ago, on 23 August I posted about munin not creating html pages and that I had to reinstall libxrender1, because the file libXrender.so.1.3.0 was corrupt, but I have not checked the root cause. Well, I should have gone deeper into it, because it turned out that the flash drive was about to break down. So at the end I had to reinstall the whole system. It was not a big deal, but here is how I did it for future reference:

I did a normal install on an SD Card. Then I took a new flash drive, created a single ext4 partition, and read out the DOS disklabel (it has a DOS disklabel, not a GPT) with fdisk -l. The installation creates two partitions on the SD Card, a boot and a root, so I just copied the content of root over to the flashdrive. One last thing to make the system use the flashdrive as root partition is to update /cmdline.txt on the boot partition:

// DOS Disklabel of the flash drive: 0xabcd1234
// Partition number of the root partion on the flash drive: 01
// this needs to be added to the root= parameter
console=serial0,115200 console=tty1 root=PARTUUID=abcd1234-01 rootfstype=ext4 fsck.repair=yes rootwait

During the installation I chose minimal, I also enabled ssh, set the password, and the IP address is assigned via DHCP, so after these steps, I had the basic working setup. I just needed a few more things to have my monitoring stuff with munin. Luckily the old flash drive was not completely broken, so I could save munin configuration (/etc/munin) my custom scripts and plugins (/usr/local/bin and /usr/local/lib/munin) as well as the RRDtool database files (/var/lib/munin), so I copied them onto the new root filesystem before installing munin.

To get munin up and running, I just needed to install lighttpd and munin, and as I read the heating system data via the ModBus protocol, also a small tool called mbpoll. Furthermore, lighttpd needed two lines in the config:

alias.url += ("/munin-static" => "/etc/munin/static" )
alias.url += ("/munin"        => "/var/cache/munin/www/" )

Also for convenience I also installed vim and mc. That’s it.

First steps with the breadboard

The packages that I ordered arrived fairly quickly. First the breadboards from the Netherlands then the components from Germany. As Ben recommended the BusBoard BB830, this is what I have ordered, 3 of them and an additional BB830-KIT. It comes with an additional battery box, jumper wires and an LED plus resistor for a simple test. I find the battery box quite useful, because it is mobile so you can take your assembled circuit for example to show off in front of your family or colleagues.

Breadboard test

With my son we decided to start with the clock module first and to build an astable timer based on the 555 chip following the video from Ben Eater: https://www.youtube.com/watch?v=kRlSFm519Bo

Ben was using the Texas Instruments LM555 timer, but as it was out of stock, I have ordered the TLC555, which should work in the same way and to my understanding it might even have a better performance. Just to understand the price range, we are talking about a 0.96€ component.

Another difference is that we used a 1 MΩ resistor and not a 100 kΩ, because that’s what I have ordered, but that was not a problem, it just meant that the blinking was slower. Anyway the idea was to replace it with a potentiometer so that we can change the resistance up to 2 MΩ. Also we realized that the white stripe on the capacitor marks the negative contact, not the positive as in the video.

Assembling the 555 circuit

So we put together the circuit as shown in the video, turned it on, aaaand…. it almost worked. The LED turned on, and then after a while it turned off and remained so. But a quick check on the data sheet revealed the problem: the pin 4, which Ben has not connected (at least not in the first 20 minutes) is the reset pin. It is active low, so we connected it to +5V to avoid the 555 resetting, and voilá, the circuit was working as expected.

What we did not do is the check with the oscilloscope, because I don’t have one, but maybe if I’m becoming more experienced and turning into a hobby HW engineer, I might get one.

New project: learning about electronics

Recently I have stumbled upon some videos from Ben Eater showing and explaining some interesting projects on breadboards. For example building a computer based on the 6502 CPU: https://www.youtube.com/watch?v=LnzuMJLZRdU

I have never heard about breadboards before, unfortunately. As a child I was interested in electronics, but I was not very keen on soldering stuff, and I didn’t have tools or knowledge. So it’s my second chance to start experimenting, so I decided to follow Ben Eater’s videos and build stuff. I have even found a partner for it: my son.

I have ordered some stuff yesterday afternoon. I have found the breadboards suggested by Ben Eater in a dutch online shop, eleshop.eu, much cheaper than on amazon. They are now on the way, expected to arrive on Thursday. The rest I have ordered on reichelt.de, but there you cannot pay with credit card, so I had to transfer the money from our bank account. And as today was a public holiday in Germany, I expect the transfer and the delivery taking a bit more time.

Munin stopped creating html pages and graphs

Last night munin stopped updating the graphs around 2:30 am. A quick check showed that the rrd files are being updated, meaning the data collection was ok. Also looking at the html and png files one could see that they were not changed since 2:30 am. Actually, this is a lesser problem, as the data was still being collected. Honestly, I hate gaps in the graphs. 😀

I tried to generate the files manually and I got the following response:

# su - munin --shell=/bin/bash -c "/usr/share/munin/munin-graph --debug"
Can't load '/usr/lib/arm-linux-gnueabihf/perl5/5.32/auto/RRDs/RRDs.so' for module RRDs: /lib/arm-linux-gnueabihf/libXrender.so.1: unsupported version 0 of Verneed record at /usr/lib/arm-linux-gnueabihf/perl-base/DynaLoader.pm line 187.
 at /usr/share/perl5/Munin/Master/GraphOld.pm line 46.
Compilation failed in require at /usr/share/perl5/Munin/Master/GraphOld.pm line 46.
BEGIN failed--compilation aborted at /usr/share/perl5/Munin/Master/GraphOld.pm line 46.
Compilation failed in require at /usr/share/munin/munin-graph line 49.
BEGIN failed--compilation aborted at /usr/share/munin/munin-graph line 49.

So I have checked libXrender.so.1, it is a symlink to libXrender.so.1.3.0:

# file /lib/arm-linux-gnueabihf/libXrender.so.1.3.0
/lib/arm-linux-gnueabihf/libXrender.so.1.3.0: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, missing section headers

# dpkg -S libXrender.so.1.3.0
libxrender1:armhf: /usr/lib/arm-linux-gnueabihf/libXrender.so.1.3.0

# apt-get install --reinstall libxrender1
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 26 not upgraded.
Need to get 29.9 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://mirror.as43289.net/raspbian/raspbian bullseye/main armhf libxrender1 armhf 1:0.9.10-1 [29.9 kB]
Fetched 29.9 kB in 2s (16.1 kB/s)
(Reading database … 115977 files and directories currently installed.)
Preparing to unpack …/libxrender1_1%3a0.9.10-1_armhf.deb …
Unpacking libxrender1:armhf (1:0.9.10-1) over (1:0.9.10-1) …
Setting up libxrender1:armhf (1:0.9.10-1) …
Processing triggers for libc-bin (2.31-13+rpt2+rpi1+deb11u5) …
Segmentation fault

The message “missing section headers” sounds strange, also the Segmentation fault at the end, so some more investigation might be needed. However, after reinstall the .so looks better:

# file /lib/arm-linux-gnueabihf/libXrender.so.1.3.0
/lib/arm-linux-gnueabihf/libXrender.so.1.3.0: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=24fb04ae1904cc7b7d4f2407d0e62bdedcf7af46, stripped

Unfortunately I have not saved the old libXrender.so.1.3.0 so I cannot check the difference. I wonder what happened to it. Nevertheless munin works again.

Yealink vs. Entega MediaNet

My impression is that in Germany the standard router brand is FritzBox! These routers have also analogue phone sockets, so analogue phones can still be used even if Deutsche Telecom upgraded all lines to IP phone (SIP). I wanted to use my own router, which has no analogue phone connectors. So we bought an IP phone: the Yealink T41. It took some time to make it work, e.g. in the first step I set up SIP client on the PC, to see if, what and how it works, and then tried to set up the same on the phone.

But it works now, so here are the settings for future reference.

Account settings:

  • Label: the local phone number (without prefix)
  • Display Name: empty
  • Register Name: full phone number starting with the land prefix: 49606…
  • Username: the same as the Register Name
  • Password: the one provided by Entega MediaNet
  • Server Host: voip.entega-medianet.de Port: 5060
  • Transport: UDP

Network settings:

  • To be on the safe side IPv4 only
  • DHCP
  • NAT: everything is disabled (Manual NAT, ICE, STUN, TURN)

However, as it is a private network behind the router, on the router I also had to change a setting:

  • SIP ALG (application level gateway): enabled

Debian update – continued

Since I was already updating the server, I though I’d install munin as well. I have used munin 20 years ago at the dormitory and I realized, why I liked it. 🙂 Anyway, while I was installing, and checking, I saw that apache started to max out the CPU. After experimenting with it for a while, it turned out that somehow it is related to HTTPs and mod_gnutls. It turned out that I was not the only one with this problem:

Debian Bug report logs – #942737
libapache2-mod-gnutls: mod_gnutls consumes 100% cpu

So one more thing in the server maintenance backlog…

Debian update

Finally I found some time to update the vanyi.org server. The first step: move from Debian Stretch, before the support expires in June 2022 to Buster. The update was quite uneventful:
# apt-get update
# apt-get dist-upgrade

I’m still checking, but it looks like only 3 things needed manual update in configuration:

  • dovecot (IMAP server)
  • apache
  • ejabberd

Dovecot replaced ssl_parameters with ssl_dh. To fix the configuration I just followed this page. Actually quite simple. First create a dh.pem (can take several minutes, which was at least half an hour in my case);
# openssl dhparam -out /etc/dovecot/dh.pem 4096
Then you need to update /etc/dovecot/dovecot.conf:
ssl_dh=</etc/dovecot/dh.pem
After a restart dovecot works again.

For apache it is even easier, as it is documented on this page. Just enable the socache_dbm module:
# a2enmod socache_dbm

For ejabberd I have not had the time yet.

Running Viber on Debian 10

Usually I work, browse, email on a PC and not on a smartphone. However I use viber and I had it only on the phone. As there is a PC version, I thought I give it a try. On the download page there is of course the windows version, but there are also two packages for linux: one .deb for Ubuntu and .rpm for Fedora. I tried to install the .deb, but it has some dependencies on an older libssl. So what I did, I just unpacked it with
dpkg -x viber.deb out/
and then manually moved to /opt. When trying to start I got some error message that I could not interpret, but using strace to figure out, what was going on, I saw that some libraries were missing. Installing them solved the issue:
apt-get install libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xkb1 libxkbcommon-x11-0
Now it runs, and seems to be working.

Debian Linux on a HP 250 G7

After several years the time has come to replace our aging Thinkpad Edge330. Our choice was a HP 250 G7 with Core i7, 512GB SSD and 16GB RAM. Regarding the OS, there was no question: Debian. At the time of installing it was Debian 10 (“buster”). Below some points regarding the installation:

  1. Installation worked out of the box, even with SecucreBoot enabled, no problems with the netinst image, with two exceptions:
    • Wireless LAN is not working (Realtek RTL8821CE)
    • Brightness control keys are not working
  2. There is a solution for the wireless driver, works as described on several forums:
    • install the tools:
      apt-get install git dkms build-essential
    • get the source:
      git clone https://github.com/tomaspinho/rtl8821ce
    • build the kernel module:
      cd rtl8821ce
      chmod +x dkms-install.sh
      chmod +x dkms-remove.sh
      ./dkms-install.sh
  3. To keep using SecureBoot the driver must be signed as described on https://wiki.debian.org/SecureBoot. Otherwise you get the following error message:
    Apr 24 22:58:55 hp250 kernel: [ 3762.662396] Lockdown: Loading of unsigned modules is restricted; see https://wiki.debian.org/SecureBoot
    You can disable SecureBoot so it will work with the following warning in the kernel log:
    Apr 25 13:22:40 hp250 kernel: [ 3.402154] 8821ce: loading out-of-tree module taints kernel.
    Apr 25 13:22:40 hp250 kernel: [ 3.402917] 8821ce: module verification failed: signature and/or required key missing - tainting kernel

    I suggest to sign the driver, it can be done quickly based on the instructions in the Debian Wiki.
  4. Brightness control works via power settings, or via the battery icon, for the keys I’m looking for a solution. In the kernel log I see these error messages:

Some further notes:
$lspci
00:00.0 Host bridge: Intel Corporation Device 3e34 (rev 0c)
00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (Whiskey Lake) (rev 02)
00:04.0 Signal processing controller: Intel Corporation Skylake Processor Thermal Subsystem (rev 0c)
00:08.0 System peripheral: Intel Corporation Skylake Gaussian Mixture Model
00:12.0 Signal processing controller: Intel Corporation Cannon Point-LP Thermal Controller (rev 30)
00:14.0 USB controller: Intel Corporation Cannon Point-LP USB 3.1 xHCI Controller (rev 30)
00:14.2 RAM memory: Intel Corporation Cannon Point-LP Shared SRAM (rev 30)
00:16.0 Communication controller: Intel Corporation Cannon Point-LP MEI Controller (rev 30)
00:17.0 RAID bus controller: Intel Corporation 82801 Mobile SATA Controller [RAID mode] (rev 30)
00:1d.0 PCI bridge: Intel Corporation Cannon Point-LP PCI Express Root Port (rev f0)
00:1d.1 PCI bridge: Intel Corporation Device 9db1 (rev f0)
00:1d.4 PCI bridge: Intel Corporation Device 9db4 (rev f0)
00:1f.0 ISA bridge: Intel Corporation Cannon Point-LP LPC Controller (rev 30)
00:1f.3 Audio device: Intel Corporation Cannon Point-LP High Definition Audio Controller (rev 30)
00:1f.4 SMBus: Intel Corporation Cannon Point-LP SMBus Controller (rev 30)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Cannon Point-LP SPI Controller (rev 30)
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
02:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8821CE 802.11ac PCIe Wireless Network Adapter
03:00.0 Non-Volatile memory controller: Sandisk Corp WD Black 2018/PC SN520 NVMe SSD (rev 01)