User Tools

Site Tools


Mini PC T9Plus with D4-300 TerraMaster DAS

In March 2024 I decided to assemble an home server to be run 24h, 7/7, the system is intended to replace an old Dell PowerEdge T110, which served my house for the past 14 years without any issue. The main reason for the switch is power consumption and the fear of old hardware wear.

I discovered that a new generation of Mini PCs based on the Intel Alder Lake N95 processor outperform the old Intel Xeon @ 3.0 GHz. The site scores a CPU Mark 5391 versus 1070, respectively. Because sometimes I use the home server to encode large video files (using ffmpeg), I was even more pushed to change the hardware.

My home server is acting also as a domestic firewall (running Debian GNU/Linux), so I opted for a dual LAN Mini-PC. Obviously the only problem is the storage: the embedded SDD disk is not sufficient for my media library, so I opted for an esternal USB Direct Attached Storage. The choice was a D4-300 TerraMaster DAS which will host two 4 Tb 3.5 inches drives (leaving two empty slots).

Mini PC T9Plus
CPU Intel(R) N95, 4 Cores
RAM 16 Gb
HDD NS512GSSD330 512 Gb Solid State Disk
Ethernet 2 x PCI Express Gigabit Realtek RTL8111/8168/8411
WiFi Realtek RTL8852BE PCIe 802.11ax
Video Intel Alder Lake-N UHD Graphics
D4-300 TerraMaster DAS
Disk Slot Number 4
Compatible Disk Types 3.5“ SATA HDD
USB USB3.1 Type-C gen1 x 1

Installing Debian GNU/Linux

It seems that Linux kernel 6.1.0 (as shipped with Debian 12 Bookworm) still does not support the WiFi adapter RTL8852BE.

The RGB rainbow LEDs

The T9Plus Mini PC has a strip of RGB LEDs all around the case; the default behaviour is to play a circular rainbow effect, rather nice the first time that you see it, but utterly annoing after a couple of hours!

You can program the LEDs with several visual effects, brigthness and speed by sending some specific commands to the USB serial adapter exposed to the operating system. The manufacturer provides a Windows program to configure the LEDs, but several users on the internet reported that the program (named LedControl.exe) is detected as a malware by several antivirus software. I never run MS-Windows on this PC because I booted and installed Debian GNU/Linux since the very first boot, so I cannot give any insight on it.

Fortunately enough, someone made the reverse engineering of the serial protocol required by the LEDs controller and published a working code. Then I wrote a Python program to make the programming: Mini PC T9Plus RGB LED Control Program.

In Debian GNU/Linux 12 it is possibile to run the script at bootstrap; just add a Systemd unit creating the file /etc/systemd/system/t9plus-leds.service with:

# /etc/systemd/system/t9plus-leds.service
ExecStart=/usr/local/bin/t9plus-leds -m Off

Run and enable the service issuing the command:

systemctl daemon-reload
systemctl enable t9plus-leds.service --now

Always on

Press Del at bootstrap time to enter the BIOS settings, go to the Boot page and set State After G3S0 State.

The ACPI power states are:

  • S0: Normal Powered-On state (system working)
  • S1: Standby
  • S3: Suspend to Ram
  • S4: Suspend to Disk
  • S5: Shutdown state (soft off: some devices are still powered-on)
  • G3: Mechanical off state

Reboot problem

Sometimes (randomly, about 50% of the time) the reboot command does not work. The shutdown process seems to proceed well and the PC seems to begin the reboot process, but the video signal does not switch-on and the host remains frozen.

The D4-300 USB attacched storage

Outpt of the lsusb command:

Bus 002 Device 004: ID 174c:55aa ASMedia Technology Inc.
  ASM1051E SATA 6Gb/s bridge,
  ASM1053E SATA 6Gb/s bridge,
  ASM1153 SATA 3Gb/s bridge,
  ASM1153E SATA 6Gb/s bridge
Bus 002 Device 003: ID 174c:55aa ASMedia Technology Inc.
  ASM1051E SATA 6Gb/s bridge,
  ASM1053E SATA 6Gb/s bridge,
  ASM1153 SATA 3Gb/s bridge,
  ASM1153E SATA 6Gb/s bridge

Outpt of the lsusb -t command:

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
        |__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=uas, 5000M
        |__ Port 4: Dev 4, If 0, Class=Mass Storage, Driver=uas, 5000M


Power management

Monitoring SMART with Nagios/Icinga

Unfortunately the check_ide_smart Nagios plugin provided by the Debian 12 package monitoring-plugins-basic 2.3.3-5+deb12u2, is unable to scan the SMART attributes of the SATA drives through the Terramaster Direct Attached Storage. As reported into the Nagios-plugins issue #16, the check_ide_smart plugin should be phased out in favor of check_scsi_smart.

We compiled the plugin binary from the sources (using the master branch 064a9fd) and now we can check the SMART attributes of each disk into the DAS:

check_scsi_smart -d /dev/sdb
OK: prdfail 0, advisory 0, critical 0, warning 0, logs 0 | 1_read_error_rate=0;;;; 3_spin_up_time=3883;;;; 4_start_stop_count=26;;;; 5_reallocated_sectors_count=0;;;; 7_seek_error_rate=0;;;; 9_power_on_hours=19301;;;; 10_spin_retry_count=0;;;; 11_recalibration_retries=0;;;; 12_power_cycle_count=17;;;; 192_power_off_retract_count=5;;;; 193_load_cycle_count=49;;;; 194_temperature=32;;;; 196_reallocation_event_count=0;;;; 197_current_pending_sector_count=0;;;; 198_uncorrectable_sector_count=0;;;; 199_ultradma_crc_error_count=0;;;; 200_multi_zone_error_rate=0;;;;

To integrate the SMART checks for all the devices into a single Nagios check and to have a more terse output, we created the following script check_scsi_smart_all:

if [ "$#" -lt "1" ]; then
    echo "Usage: $(basename $0) sda [sdb ...]"
    exit 1
for DEV in $@; do
    OUT="$(/usr/local/sbin/check_scsi_smart -d /dev/$DEV)"
    if [ $RET -gt $STATE ]; then
    if [ "$RET" -eq "0" ]; then
        # Get only the short status, e.g. "OK".
        OUT="$(echo "$OUT" | cut -f1 -d':')"
        # Get the summary, e.g. "OK: prdfail 0, advisory 0, critical 0, warning 0, logs 1 "
        OUT="$(echo "$OUT" | cut -f1 -d'|' | sed 's/[[:space:]]\+$//')"
    test -n "$OUTPUT" && OUTPUT="${OUTPUT}; "
    OUTPUT="${OUTPUT}${DEV}: ${OUT}"
case $STATE in
        OUTPUT="OK: $OUTPUT"
echo "$OUTPUT"
exit $STATE

Finally we defined the NRPE Nagios check with a line into /etc/nagios/nrpe_local.cfg:

command[check_scsi_smart]=/usr/bin/sudo /usr/local/sbin/check_scsi_smart_all sda sdb sdc

Web References

doc/appunti/hardware/mini_pc_with_das.txt · Last modified: 2024/04/29 11:55 by niccolo