piKVM is amazing. I had one controlling an old desktop of mine for over 18 months with no issues. I decided to update its software and ran into some problems.
The first problem was pacman was returning a 404 when trying to update. I guess in the last year and a half the repository URL had changed. I had to edit
/etc/pacman.conf and update the URL:
Server = https://files.pikvm.org/repos/arch/rpi4
SigLevel = Required DatabaseOptional
After fixing that, running pacman -Syu and answering yes, I rebooted, but found that kvmd would not start. The first symptom: HTTP 500 from nginx. Digging in I found that two services were failing to start: kvmd-tc358743.service and kvm-otg.service.
v4l2-ctl: Cannot open device /dev/kvmd-video, exiting
kvmd-otg: RuntimeError: Can't find any UDC
With these two services bailing the web UI wouldn’t start. I checked the kernel log and the tc358743 device was not detected at all. I was about to give up and just reflash the device when I noticed two files in /boot: cmdline.txt.pacsave and config.txt.pacsave. I know from my experience in arch that it means I had some configurations get clobbered. Running a diff between the two I found some very important lines omitted:
I restored the .pacsave files and rebooted, and it worked! Everything came back.
Next time I won’t wait so long between software updates.
I’ve had an issue where I wasn’t sure if my dynamic DNS provider registered properly. I then realized that I have a piKVM attached to one of my servers that boots on powerup, even if the server does not. I could utilize this piKVM to help me out.
Thanks to inspiration from Chris Dzombak I was able to whip up a little script that runs on startup. This script waits 5 minutes to allow for my firewall and modem to boot up, then sends a pushover notification to let me know the piKVM is online and what its external IP address is.
To get it working on the piKVM I had to enter into RW mode, write and save the script, add execute permissions to the script, then configure a systemd service to run the script at startup.
Here is the script, saved under /root/boot-pushover.sh
#Wait 5 minutes to allow router bootup
MESSAGE="$(hostname) is online. External IP: $EXTERNAL_IP"
#Send pushover command to alert it's up and send its external IP
curl -s \
--form-string "token=$TOKEN" \
--form-string "user=$USER" \
--form-string "message=$MESSAGE" \
chmod +x /root/boot-pushover.sh
Here is the systemd service, saved under /etc/systemd/system/boot-pushover-notification.service
Reload daemons & enable startup:
systemctl enable boot-pushover-notification.service
Test by exiting rw mode and rebooting the piKVM:
It works really well!