<?xml version="1.0" encoding="utf-8"?> 
<rss version="2.0"
  xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
  xmlns:atom="http://www.w3.org/2005/Atom">

<channel>

<title>Balyn Omavel: заметки с тегом homelab</title>
<link>https://omavel.in/tags/homelab/</link>
<description>Balyn Omavel</description>
<author></author>
<language>ru</language>
<generator>Aegea 11.2 (v4116)</generator>

<itunes:subtitle>Balyn Omavel</itunes:subtitle>
<itunes:image href="" />
<itunes:explicit></itunes:explicit>

<item>
<title>Minisforum MS-01 — enabling voltage and fan metrics (Nuvoton NCT6798D)</title>
<guid isPermaLink="false">18</guid>
<link>https://omavel.in/all/ms-01-voltage-and-fan-metrics/</link>
<pubDate>Sat, 20 Sep 2025 23:46:35 +0400</pubDate>
<author></author>
<comments>https://omavel.in/all/ms-01-voltage-and-fan-metrics/</comments>
<description>
&lt;p&gt;By default, on Proxmox kernel 6.8.12-15-pve, only CPU/NVMe temperatures are available. &lt;i&gt;sensors-detect —auto&lt;/i&gt; finds only coretemp, no Super I/O support. The hardware (Nuvoton NCT6798D) requires the NCT6775 driver, which is not included in this kernel build.&lt;/p&gt;
&lt;h2&gt;Driver patching and installation&lt;/h2&gt;
&lt;ol start="1"&gt;
&lt;li&gt;Install build tools and kernel headers&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;sudo apt update
sudo apt install build-essential
sudo apt install proxmox-headers-$(uname -r)&lt;/code&gt;&lt;/pre&gt;&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;Preparing to unpack .../proxmox-headers-6.8.12-15-pve_6.8.12-15_amd64.deb ...
Unpacking proxmox-headers-6.8.12-15-pve (6.8.12-15) ...
Setting up proxmox-headers-6.8.12-15-pve (6.8.12-15) ...&lt;/code&gt;&lt;/pre&gt;&lt;ol start="2"&gt;
&lt;li&gt;Download the NCT6775 driver&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;⚠️ Do not use the abandoned killghost fork.&lt;br /&gt;
Instead, use the damix1/nct6775 repo, which can be patched for newer chips.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;git clone https://github.com/damix1/nct6775.git /root/nct6775
cd /root/nct6775&lt;/code&gt;&lt;/pre&gt;&lt;ol start="3"&gt;
&lt;li&gt;Patch for Nuvoton NCT6798D support&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Edit &lt;i&gt;nct6775.c&lt;/i&gt;. Extend the enum:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;enum kinds { nct6106, nct6775, nct6776, nct6779,
             nct6791, nct6792, nct6793, nct6795,
             nct6796, nct6798 };&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Add names:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;static const char * const nct6775_device_names[] = {
    &amp;quot;nct6106&amp;quot;, &amp;quot;nct6775&amp;quot;, &amp;quot;nct6776&amp;quot;, &amp;quot;nct6779&amp;quot;,
    &amp;quot;nct6791&amp;quot;, &amp;quot;nct6792&amp;quot;, &amp;quot;nct6793&amp;quot;, &amp;quot;nct6795&amp;quot;,
    &amp;quot;nct6796&amp;quot;, &amp;quot;nct6798&amp;quot;,
};

static const char * const nct6775_sio_names[] __initconst = {
    &amp;quot;NCT6106D&amp;quot;, &amp;quot;NCT6775F&amp;quot;, &amp;quot;NCT6776D/F&amp;quot;, &amp;quot;NCT6779D&amp;quot;,
    &amp;quot;NCT6791D&amp;quot;, &amp;quot;NCT6792D&amp;quot;, &amp;quot;NCT6793D&amp;quot;, &amp;quot;NCT6795D&amp;quot;,
    &amp;quot;NCT6796D&amp;quot;, &amp;quot;NCT6798D&amp;quot;,
};&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Add detection case:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;switch (val &amp;amp; SIO_ID_MASK) {
    ...
    case 0xd42:   /* NCT6798D */
        sio_data-&amp;gt;kind = nct6798;
        break;
}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This minimal patch makes the driver recognize NCT6798D.&lt;/p&gt;
&lt;ol start="4"&gt;
&lt;li&gt;Build and install&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;make clean
make&lt;/code&gt;&lt;/pre&gt;&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;CC [M]  /root/nct6775/nct6775.o
/root/nct6775/nct6775.c: In function 'is_word_sized':
/root/nct6775/nct6775.c:1335:9: warning: enumeration value 'nct6798' not handled in switch [-Wswitch]
 1335 |         switch (data-&amp;gt;kind) {
      |         ^~~~~~
/root/nct6775/nct6775.c: In function 'nct6775_update_pwm_limits':
/root/nct6775/nct6775.c:1706:17: warning: enumeration value 'nct6798' not handled in switch [-Wswitch]
 1706 |                 switch (data-&amp;gt;kind) {
      |                 ^~~~~~
/root/nct6775/nct6775.c: In function 'store_auto_pwm':
/root/nct6775/nct6775.c:3137:17: warning: enumeration value 'nct6798' not handled in switch [-Wswitch]
 3137 |                 switch (data-&amp;gt;kind) {
      |                 ^~~~~~
/root/nct6775/nct6775.c: In function 'nct6775_probe':
/root/nct6775/nct6775.c:4322:9: warning: enumeration value 'nct6798' not handled in switch [-Wswitch]
 4322 |         switch (data-&amp;gt;kind) {
      |         ^~~~~~
/root/nct6775/nct6775.c:4355:17: warning: enumeration value 'nct6798' not handled in switch [-Wswitch]
 4355 |                 switch (data-&amp;gt;kind) {
      |                 ^~~~~~
/root/nct6775/nct6775.c: In function 'pwm_update_registers':
/root/nct6775/nct6775.c:2633:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
 2633 |                 nct6775_write_value(data, data-&amp;gt;REG_TARGET[nr],
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2634 |                                     data-&amp;gt;target_temp[nr]);
      |                                     ~~~~~~~~~~~~~~~~~~~~~~
/root/nct6775/nct6775.c:2636:9: note: here
 2636 |         default:
      |         ^~~~~~~
  MODPOST /root/nct6775/Module.symvers
  CC [M]  /root/nct6775/nct6775.mod.o
  LD [M]  /root/nct6775/nct6775.ko
  BTF [M] /root/nct6775/nct6775.ko
Skipping BTF generation for /root/nct6775/nct6775.ko due to unavailability of vmlinux&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Then:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;make install&lt;/code&gt;&lt;/pre&gt;&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;cp nct6775.ko /lib/modules/6.8.12-15-pve/kernel/drivers/hwmon
depmod -a -F /boot/System.map-6.8.12-15-pve 6.8.12-15-pve&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;It copies nct6775.ko into hwmon/ so the kernel can autoload it.&lt;/p&gt;
&lt;p&gt;Then:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;depmod -a
modprobe nct6775&lt;/code&gt;&lt;/pre&gt;&lt;ol start="5"&gt;
&lt;li&gt;After loading the module, verify with &lt;i&gt;sensors&lt;/i&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;nct6798-isa-0a20
Adapter: ISA adapter
in0:                   400.00 mV (min =  +0.00 V, max =  +1.74 V)
in1:                     1.05 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in2:                     3.34 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in3:                     3.34 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in4:                     1.09 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:                   152.00 mV (min =  +0.00 V, max =  +0.00 V)
in6:                   136.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in7:                     3.34 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in8:                     3.14 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in9:                     1.02 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in10:                  160.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in11:                  128.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in12:                  1000.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in13:                  152.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in14:                    1.27 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
fan1:                  2205 RPM  (min =    0 RPM)
fan2:                  1732 RPM  (min =    0 RPM)
fan3:                     0 RPM  (min =    0 RPM)
fan4:                     0 RPM  (min =    0 RPM)
fan5:                     0 RPM  (min =    0 RPM)
fan7:                     0 RPM  (min =    0 RPM)
...&lt;/code&gt;&lt;/pre&gt;&lt;ol start="6"&gt;
&lt;li&gt;Add the driver to /etc/modules so it loads automatically on reboot&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;echo nct6775 | tee -a /etc/modules&lt;/code&gt;&lt;/pre&gt;&lt;ol start="7"&gt;
&lt;li&gt;Regenerate the initramfs images&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;update-initramfs -u -k all&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Handling secure boot (if enabled)&lt;/h2&gt;
&lt;p&gt;Unsigned modules will fail with &lt;i&gt;modprobe: ERROR: could not insert ’nct6775’: Key was rejected by service.&lt;/i&gt;&lt;/p&gt;
&lt;ol start="1"&gt;
&lt;li&gt;Generate your own MOK key&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;openssl req -new -x509 -newkey rsa:2048 \
  -keyout /root/MOK.priv -outform DER -out /root/MOK.der \
  -nodes -days 36500 -subj &amp;quot;/CN=MyKernelModule/&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;ol start="2"&gt;
&lt;li&gt;Sign the module&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;/usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 \
  /root/MOK.priv /root/MOK.der \
  /lib/modules/$(uname -r)/kernel/drivers/hwmon/nct6775.ko&lt;/code&gt;&lt;/pre&gt;&lt;ol start="3"&gt;
&lt;li&gt;Import the key and reboot&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;mokutil --import /root/MOK.der
reboot&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;⚠️ On reboot the blue MOK Manager screen will appear → Enroll MOK → Continue → enter password.&lt;/p&gt;
&lt;ol start="4"&gt;
&lt;li&gt;Validation&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;modinfo nct6775 | grep signer
signer: MyKernelModule&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Post scriptum&lt;/h2&gt;
&lt;p&gt;Node Exporter (should be runned with &lt;i&gt;—collector.hwmon&lt;/i&gt;) will expose new metrics as:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;node_hwmon_in_volts{chip=&amp;quot;nct6798-isa-0a20&amp;quot;,sensor=&amp;quot;in1&amp;quot;}
node_hwmon_fan_rpm{chip=&amp;quot;nct6798-isa-0a20&amp;quot;,sensor=&amp;quot;fan1&amp;quot;}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;a href="https://grafana.com/grafana/dashboards/12950-hwmon/"&gt;Grafana hwmon dashboard&lt;/a&gt; should catch these metrics automatically.&lt;/p&gt;
</description>
</item>


</channel>
</rss>