pikvm/xh_hk4401/index.html

3083 lines
71 KiB
HTML

<!DOCTYPE html><html lang="en" class="no-js"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="description" content="KVM over IP on Raspberry Pi">
<meta name="author" content="Maxim Devaev">
<link rel="canonical" href="https://pikvm.github.io/pikvm/xh_hk4401/">
<link rel="icon" href="../_assets/favicon.ico">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.22">
<title>XH-HK4401 4-port HDMI USB KVM Switch - PiKVM Handbook</title>
<link rel="stylesheet" href="../assets/stylesheets/main.84d31ad4.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=arial,+sans-serif:300,300i,400,400i,700,700i%7Cmonospace:400,400i,700,700i&amp;display=fallback">
<style>:root{--md-text-font:"arial, sans-serif";--md-code-font:"monospace"}</style>
<link rel="stylesheet" href="../_assets/user.css">
<script>__md_scope=new URL("..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
<link href="../assets/stylesheets/glightbox.min.css" rel="stylesheet"><script src="../assets/javascripts/glightbox.min.js"></script><style id="glightbox-style">
html.glightbox-open { overflow: initial; height: 100%; }
.gslide-title { margin-top: 0px; user-select: text; }
.gslide-desc { color: #666; user-select: text; }
.gslide-image img { background: white; }
.gscrollbar-fixer { padding-right: 15px; }
.gdesc-inner { font-size: 0.75rem; }
body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color); }
body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color); }
body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color); }
</style></head>
<body dir="ltr">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#xh-hk4401-4-port-hdmi-usb-kvm-switch" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header md-header--shadow" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href=".." title="PiKVM Handbook" class="md-header__button md-logo" aria-label="PiKVM Handbook" data-md-component="logo">
<img src="../_assets/logo.png" alt="logo">
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"></path></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
PiKVM Handbook
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
XH-HK4401 4-port HDMI USB KVM Switch
</span>
</div>
</div>
</div>
<script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"></path></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"></path></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"></path></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<a href="javascript:void(0)" class="md-search__icon md-icon" title="Share" aria-label="Share" data-clipboard data-clipboard-text="" data-md-component="search-share" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9a3 3 0 0 0-3 3 3 3 0 0 0 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.15c-.05.21-.08.43-.08.66 0 1.61 1.31 2.91 2.92 2.91s2.92-1.3 2.92-2.91A2.92 2.92 0 0 0 18 16.08"></path></svg>
</a>
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"></path></svg>
</button>
</nav>
<div class="md-search__suggest" data-md-component="search-suggest"></div>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header__source">
<a href="https://github.com/pikvm/pikvm" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M439.6 236.1 244 40.5c-5.4-5.5-12.8-8.5-20.4-8.5s-15 3-20.4 8.4L162.5 81l51.5 51.5c27.1-9.1 52.7 16.8 43.4 43.7l49.7 49.7c34.2-11.8 61.2 31 35.5 56.7-26.5 26.5-70.2-2.9-56-37.3L240.3 199v121.9c25.3 12.5 22.3 41.8 9.1 55-6.4 6.4-15.2 10.1-24.3 10.1s-17.8-3.6-24.3-10.1c-17.6-17.6-11.1-46.9 11.2-56v-123c-20.8-8.5-24.6-30.7-18.6-45L142.6 101 8.5 235.1C3 240.6 0 247.9 0 255.5s3 15 8.5 20.4l195.6 195.7c5.4 5.4 12.7 8.4 20.4 8.4s15-3 20.4-8.4l194.7-194.7c5.4-5.4 8.4-12.8 8.4-20.4s-3-15-8.4-20.4"></path></svg>
</div>
<div class="md-source__repository">
pikvm/pikvm
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href=".." title="PiKVM Handbook" class="md-nav__button md-logo" aria-label="PiKVM Handbook" data-md-component="logo">
<img src="../_assets/logo.png" alt="logo">
</a>
PiKVM Handbook
</label>
<div class="md-nav__source">
<a href="https://github.com/pikvm/pikvm" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M439.6 236.1 244 40.5c-5.4-5.5-12.8-8.5-20.4-8.5s-15 3-20.4 8.4L162.5 81l51.5 51.5c27.1-9.1 52.7 16.8 43.4 43.7l49.7 49.7c34.2-11.8 61.2 31 35.5 56.7-26.5 26.5-70.2-2.9-56-37.3L240.3 199v121.9c25.3 12.5 22.3 41.8 9.1 55-6.4 6.4-15.2 10.1-24.3 10.1s-17.8-3.6-24.3-10.1c-17.6-17.6-11.1-46.9 11.2-56v-123c-20.8-8.5-24.6-30.7-18.6-45L142.6 101 8.5 235.1C3 240.6 0 247.9 0 255.5s3 15 8.5 20.4l195.6 195.7c5.4 5.4 12.7 8.4 20.4 8.4s15-3 20.4-8.4l194.7-194.7c5.4-5.4 8.4-12.8 8.4-20.4s-3-15-8.4-20.4"></path></svg>
</div>
<div class="md-source__repository">
pikvm/pikvm
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_1">
<label class="md-nav__link" for="__nav_1" id="__nav_1_label" tabindex="">
<span class="md-ellipsis">
Device guides
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_1_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_1">
<span class="md-nav__icon md-icon"></span>
Device guides
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../v4/" class="md-nav__link">
<span class="md-ellipsis">
PiKVM V4 Mini &amp; Plus
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../v3/" class="md-nav__link">
<span class="md-ellipsis">
PiKVM V3
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../switch/" class="md-nav__link">
<span class="md-ellipsis">
PiKVM Switch
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../v2/" class="md-nav__link">
<span class="md-ellipsis">
DIY PiKVM V2
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../v1/" class="md-nav__link">
<span class="md-ellipsis">
DIY PiKVM V1
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_2">
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="">
<span class="md-ellipsis">
Getting started
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
Getting started
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../cheatsheet/" class="md-nav__link">
<span class="md-ellipsis">
Cheat Sheet
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../webui/" class="md-nav__link">
<span class="md-ellipsis">
Web UI Overview
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../config/" class="md-nav__link">
<span class="md-ellipsis">
Configuring PiKVM
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../auth/" class="md-nav__link">
<span class="md-ellipsis">
Authentication &amp; 2FA
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../faq/" class="md-nav__link">
<span class="md-ellipsis">
FAQ &amp; Troubleshooting
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../flashing_os/" class="md-nav__link">
<span class="md-ellipsis">
Flashing OS
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_3">
<label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="">
<span class="md-ellipsis">
Networking
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Networking
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_3_1">
<label class="md-nav__link" for="__nav_3_1" id="__nav_3_1_label" tabindex="0">
<span class="md-ellipsis">
Internet access
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_3_1_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3_1">
<span class="md-nav__icon md-icon"></span>
Internet access
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../port_forwarding/" class="md-nav__link">
<span class="md-ellipsis">
Port forwarding
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../reverse_proxy/" class="md-nav__link">
<span class="md-ellipsis">
Reverse proxy
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../tailscale/" class="md-nav__link">
<span class="md-ellipsis">
Tailscale VPN
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../cloudflared/" class="md-nav__link">
<span class="md-ellipsis">
Cloudflare Tunnel
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../wifi/" class="md-nav__link">
<span class="md-ellipsis">
Setting up Wi-Fi
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../modem/" class="md-nav__link">
<span class="md-ellipsis">
Setting up 3G/4G/LTE modem
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../letsencrypt/" class="md-nav__link">
<span class="md-ellipsis">
Let's Encrypt certificates
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_4">
<label class="md-nav__link" for="__nav_4" id="__nav_4_label" tabindex="">
<span class="md-ellipsis">
Video
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_4">
<span class="md-nav__icon md-icon"></span>
Video
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../video/" class="md-nav__link">
<span class="md-ellipsis">
Video modes (WebRTC, Direct)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../webrtc_config/" class="md-nav__link">
<span class="md-ellipsis">
WebRTC configuration
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../edid/" class="md-nav__link">
<span class="md-ellipsis">
Tuning HDMI EDID
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../pass/" class="md-nav__link">
<span class="md-ellipsis">
HDMI passthrough
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_5">
<label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="">
<span class="md-ellipsis">
Peripheral devices
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5">
<span class="md-nav__icon md-icon"></span>
Peripheral devices
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../atx_board/" class="md-nav__link">
<span class="md-ellipsis">
ATX board
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../usb/" class="md-nav__link">
<span class="md-ellipsis">
USB configuration
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../usb_pass/" class="md-nav__link">
<span class="md-ellipsis">
USB passthrough
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../audio/" class="md-nav__link">
<span class="md-ellipsis">
Audio / Microphone
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_5_5">
<label class="md-nav__link" for="__nav_5_5" id="__nav_5_5_label" tabindex="0">
<span class="md-ellipsis">
Keyboard &amp; mouse
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_5_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5_5">
<span class="md-nav__icon md-icon"></span>
Keyboard &amp; mouse
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../mouse/" class="md-nav__link">
<span class="md-ellipsis">
Mouse modes
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../mouse_jiggler/" class="md-nav__link">
<span class="md-ellipsis">
Mouse jiggler
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../pico_hid/" class="md-nav__link">
<span class="md-ellipsis">
Pico HID (USB, PS/2)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../bluetooth_hid/" class="md-nav__link">
<span class="md-ellipsis">
Bluetooth HID
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../msd/" class="md-nav__link">
<span class="md-ellipsis">
Mass Storage Drive
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../usb_ethernet/" class="md-nav__link">
<span class="md-ellipsis">
Ethernet-over-USB
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../usb_serial/" class="md-nav__link">
<span class="md-ellipsis">
Serial-over-USB
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../gpio/" class="md-nav__link">
<span class="md-ellipsis">
GPIO (pins, relays, lamps, etc)
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_6">
<label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="">
<span class="md-ellipsis">
Advanced usage
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_6">
<span class="md-nav__icon md-icon"></span>
Advanced usage
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../auth_advanced/" class="md-nav__link">
<span class="md-ellipsis">
Advanced authentication
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../id/" class="md-nav__link">
<span class="md-ellipsis">
PiKVM identification
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../on_boot_config/" class="md-nav__link">
<span class="md-ellipsis">
On-boot configuration
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../auto_snapshots/" class="md-nav__link">
<span class="md-ellipsis">
Automatic snapshots
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../vnc/" class="md-nav__link">
<span class="md-ellipsis">
Using VNC
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../multiport/" class="md-nav__link">
<span class="md-ellipsis">
Multiport KVM-over-IP
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../wol/" class="md-nav__link">
<span class="md-ellipsis">
Wake-on-LAN the server
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../ipmi/" class="md-nav__link">
<span class="md-ellipsis">
IPMI &amp; Redfish integration
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../pst/" class="md-nav__link">
<span class="md-ellipsis">
Persistent storage
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../prometheus/" class="md-nav__link">
<span class="md-ellipsis">
Prometheus monitoring
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_7">
<label class="md-nav__link" for="__nav_7" id="__nav_7_label" tabindex="">
<span class="md-ellipsis">
Development
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_7">
<span class="md-nav__icon md-icon"></span>
Development
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../api/" class="md-nav__link">
<span class="md-ellipsis">
HTTP API reference
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../building_os/" class="md-nav__link">
<span class="md-ellipsis">
Building PiKVM OS
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../3d_printing/" class="md-nav__link">
<span class="md-ellipsis">
Cases for 3D printing
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_8">
<label class="md-nav__link" for="__nav_8" id="__nav_8_label" tabindex="">
<span class="md-ellipsis">
Legacy
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_8">
<span class="md-nav__icon md-icon"></span>
Legacy
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../arduino_hid/" class="md-nav__link">
<span class="md-ellipsis">
Arduino HID
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../msd_legacy/" class="md-nav__link">
<span class="md-ellipsis">
Big DVD images on old PiKVM
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_9">
<label class="md-nav__link" for="__nav_9" id="__nav_9_label" tabindex="">
<span class="md-ellipsis">
PiKVM Info
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_9_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_9">
<span class="md-nav__icon md-icon"></span>
PiKVM Info
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../compliance/" class="md-nav__link">
<span class="md-ellipsis">
Compliance
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_9_2">
<div class="md-nav__link md-nav__container">
<a href="../blog/" class="md-nav__link ">
<span class="md-ellipsis">
Blog &amp; News
</span>
</a>
<label class="md-nav__link " for="__nav_9_2" id="__nav_9_2_label" tabindex="0">
<span class="md-nav__icon md-icon"></span>
</label>
</div>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_9_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_9_2">
<span class="md-nav__icon md-icon"></span>
Blog &amp; News
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_9_2_2">
<label class="md-nav__link" for="__nav_9_2_2" id="__nav_9_2_2_label" tabindex="0">
<span class="md-ellipsis">
Archive
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="3" aria-labelledby="__nav_9_2_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_9_2_2">
<span class="md-nav__icon md-icon"></span>
Archive
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../blog/archive/2025/" class="md-nav__link">
<span class="md-ellipsis">
2025
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../blog/archive/2024/" class="md-nav__link">
<span class="md-ellipsis">
2024
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../blog/archive/2023/" class="md-nav__link">
<span class="md-ellipsis">
2023
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../blog/archive/2022/" class="md-nav__link">
<span class="md-ellipsis">
2022
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../blog/archive/2021/" class="md-nav__link">
<span class="md-ellipsis">
2021
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../blog/archive/2020/" class="md-nav__link">
<span class="md-ellipsis">
2020
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_9_2_3">
<label class="md-nav__link" for="__nav_9_2_3" id="__nav_9_2_3_label" tabindex="0">
<span class="md-ellipsis">
Categories
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="3" aria-labelledby="__nav_9_2_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_9_2_3">
<span class="md-nav__icon md-icon"></span>
Categories
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../blog/category/development/" class="md-nav__link">
<span class="md-ellipsis">
Development
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../blog/category/products/" class="md-nav__link">
<span class="md-ellipsis">
Products
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../blog/category/releases/" class="md-nav__link">
<span class="md-ellipsis">
Releases
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#connections" class="md-nav__link">
<span class="md-ellipsis">
Connections
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#rs-232-control-cable" class="md-nav__link">
<span class="md-ellipsis">
RS-232 control cable
</span>
</a>
<nav class="md-nav" aria-label="RS-232 control cable">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#inverting-usb-uart-adapter-ft-232-the-easy-way" class="md-nav__link">
<span class="md-ellipsis">
Inverting USB UART adapter (FT-232) - The easy way
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#linux-instructions" class="md-nav__link">
<span class="md-ellipsis">
Linux Instructions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#windows-instructions" class="md-nav__link">
<span class="md-ellipsis">
Windows Instructions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#ftdi-terminal-configuration" class="md-nav__link">
<span class="md-ellipsis">
FTDI Terminal Configuration
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#an-inverter-circuit-the-cheap-way" class="md-nav__link">
<span class="md-ellipsis">
An inverter circuit - The cheap way
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#adding-ui-elements-to-control-the-kvm-switch" class="md-nav__link">
<span class="md-ellipsis">
Adding UI elements to control the KVM switch
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#switching-between-hosts-in-the-ui" class="md-nav__link">
<span class="md-ellipsis">
Switching between hosts in the UI
</span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<div><h1 id="xh-hk4401-4-port-hdmi-usb-kvm-switch">XH-HK4401 4-port HDMI USB KVM Switch<a class="headerlink" href="#xh-hk4401-4-port-hdmi-usb-kvm-switch" title="Permanent link"></a></h1>
<div class="admonition warning">
<p class="admonition-title">This document was supplied by a community member, thus it is not officially endorsed or supported.</p>
</div>
<div class="admonition info">
<p class="admonition-title">PiKVM + Multiport Switches compatibility</p>
<p>Please note that this switch requires a USB port for control. The following devices can provide this:</p>
<ul>
<li><strong>PiKVM V3</strong> &amp; <strong>V4 Plus</strong>.</li>
<li><strong>DIY</strong> devices based on <strong>Raspberry Pi 2</strong>, <strong>3</strong> and <strong>4</strong>.</li>
</ul>
<p>The following devices are not compatible:</p>
<ul>
<li><strong>PiKVM V4 Mini</strong> - it doesn't have a USB host port and cannot control switches, it's a single-host device.</li>
<li><strong>DIY</strong> based on Raspberry Pi Zero 2 W - it doesn't have USB host port too.</li>
</ul>
</div>
<p><a class="glightbox" data-type="image" data-width="95%" data-height="auto" href="xh-hk4401.jpg" data-desc-position="bottom"><img src="xh-hk4401.jpg" alt="drawing" width="300"></a></p>
<p>This KVM is <a href="https://www.aliexpress.com/item/4000849336545.html">sold</a> under many names, and comes in two versions.
The only way these two versions differ is that one has one of its USB ports replaced with a PS/2 port. The
identifying feature is that they come with a small external control unit with 4 buttons. This controller is
connected to the main KVM via a micro USB cable, however this is <strong>NOT</strong> as USB connection.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Audio was not tested, it is assumed to be non-functional</p>
</div>
<h2 id="connections">Connections<a class="headerlink" href="#connections" title="Permanent link"></a></h2>
<ol>
<li>
<p>Connect the USB-A cable from the Raspberry Pi OTG port to to any of the USB ports on the XH-HK4401 switch. All 3/4 USB ports work exactly the same, internally they are just connected to a USB HUB.</p>
</li>
<li>
<p>Connect the HDMI out from the XH-HK4401 switch to the Raspberry Pi CSI-2 to HDMI input.</p>
</li>
<li>
<p>Connect host USB and HDMI cables from the XH-HK4401 switch to the machines to be managed per the switch instructions.</p>
</li>
<li>
<p>Finally see below for details about connecting to the control micro USB port. <strong>This it not a normal USB micro port.</strong></p>
</li>
</ol>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>There is a limitation in the underlying PiKVM software related to plugging video cables from a host which is already powered and connected to a monitor to a Raspberry Pi HDMI-CSI bridge. These limitations apply equally when using the XH-HK4401 KVM switch. If video is not present in PiKVM, try keeping all host machines off and connecting them directly to the XH-HK4401 switch before powering the hosts on.</p>
</div>
<h2 id="rs-232-control-cable">RS-232 control cable<a class="headerlink" href="#rs-232-control-cable" title="Permanent link"></a></h2>
<p>The control unit communicates to the KVM using the RS-232 protocol (at 5v) not USB, and one of the following
solutions must be used.</p>
<h3 id="inverting-usb-uart-adapter-ft-232-the-easy-way">Inverting USB UART adapter (FT-232) - The easy way<a class="headerlink" href="#inverting-usb-uart-adapter-ft-232-the-easy-way" title="Permanent link"></a></h3>
<p>Some USB UART adapters have the rare feature to invert the logic level of the RX/TX signals. For example the FTDI FT232 can
be configured via the FTDI configuration GUI to do this. With such an adapter, the circuit above is not required. All you
need is to connect it to a micro-USB connector.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>These options will only work on UART adapters with <strong>genuine</strong> FTDI chips. There are a lot of cheap fakes on the
market that either lack this option, or will prevent you from changing the settings. To avoid getting a fake
ensure you always purchase from a reputable store and brand (Adafruit, Sparkfun, etc.), Amazon <strong>is not</strong> a
reputable store.</p>
</div>
<h3 id="linux-instructions">Linux Instructions<a class="headerlink" href="#linux-instructions" title="Permanent link"></a></h3>
<details class="note">
<summary>References I used to get my FTDIs working:</summary>
<ul>
<li><a href="https://waterpigs.co.uk/articles/ftdi-configure-mac-linux/">https://waterpigs.co.uk/articles/ftdi-configure-mac-linux/</a></li>
<li><a href="https://manpages.debian.org/testing/ftdi-eeprom/ftdi_eeprom.1.en.html">https://manpages.debian.org/testing/ftdi-eeprom/ftdi_eeprom.1.en.html</a></li>
<li><a href="https://manpages.ubuntu.com/manpages/bionic/man1/ftdi_eeprom.1.html">https://manpages.ubuntu.com/manpages/bionic/man1/ftdi_eeprom.1.html</a></li>
<li><a href="http://developer.intra2net.com/git/?p=libftdi;a=blob;f=src/ftdi.h">http://developer.intra2net.com/git/?p=libftdi;a=blob;f=src/ftdi.h</a></li>
<li><a href="http://developer.intra2net.com/git/?p=libftdi;a=blob;f=src/ftdi.c">http://developer.intra2net.com/git/?p=libftdi;a=blob;f=src/ftdi.c</a></li>
<li><a href="http://developer.intra2net.com/git/?p=libftdi;a=tree;f=ftdi_eeprom">http://developer.intra2net.com/git/?p=libftdi;a=tree;f=ftdi_eeprom</a></li>
<li><a href="http://developer.intra2net.com/git/?p=libftdi;a=blob;f=ftdi_eeprom/example.conf">http://developer.intra2net.com/git/?p=libftdi;a=blob;f=ftdi_eeprom/example.conf</a></li>
<li><a href="http://developer.intra2net.com/git/?p=libftdi;a=blob;f=ftdi_eeprom/main.c">http://developer.intra2net.com/git/?p=libftdi;a=blob;f=ftdi_eeprom/main.c</a></li>
</ul>
</details>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>Steps were performed on Debian-like installation (Pop!_OS 21.10)</p>
</div>
<p>This workflow has worked for a self-described NON-genuine FTDI FT232RL chip. The other MAY be genuine, but it is also working.</p>
<p>Neither of the following FTDI UART adapters are recommended. Purchasing both chips was an error (only 1 intended). However, having two (potentially non-genuine) FTDI UART adapters helped to create these instructions.</p>
<ul>
<li>
<p><a href="https://amazon.com/dp/B07BBPX8B8">Possibly genuine, but working regardless, (DSD TECH) FTDI</a></p>
</li>
<li>
<p><a href="https://amazon.com/dp/B00IJXZQ7C">Not genuine (HiLetGo) FTDI</a></p>
</li>
</ul>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The HiLetGo UART adapter comes with a USB MINI female connector and necessitates another adapter/cable for interfacing with the Pi.</p>
</div>
<ol>
<li>
<details class="note">
<summary>Get info from FTDI</summary>
<ul>
<li>Plug the FTDI into a USB port on your Linux device and run <code>lsusb</code> to verify that the device is found
<div class="highlight"><pre><span></span><code>lsusb
</code></pre></div></li>
<li>Ensure the device is recognized as FTDI
<div class="highlight"><pre><span></span><code>sudo lshw | grep -B 10 ftdi
</code></pre></div></li>
<li>Record hardware information (not sure if needed, but was saved to prevent overwriting critical data in the EEPROM)</li>
</ul>
</details>
</li>
<li>
<details class="note">
<summary>Blacklist ftdi_sio kernel module</summary>
<ul>
<li>The kernel module ==ftdi_sio== is currently enabled (and how you saw the device in the previous step). We need to disable this module to read/write to the EEPROM.</li>
<li>The following command creates a file to blacklist the ==ftdi_sio== module.
<div class="highlight"><pre><span></span><code>echo "blacklist ftdi_sio" | sudo tee /etc/modprobe.d/bl-ftdi.conf &gt; /dev/null
</code></pre></div></li>
</ul>
</details>
</li>
<li>
<details class="note">
<summary>Reboot machine</summary>
<ul>
<li>We need to reboot into an environment without ftdi_sio active.
<div class="highlight"><pre><span></span><code>shutdown -r 0
</code></pre></div></li>
</ul>
</details>
</li>
<li>
<details class="note">
<summary>Install ftdi_eeprom if not already installed</summary>
<ul>
<li>Install ==ftdi_eeprom== with the following command.
<div class="highlight"><pre><span></span><code>sudo apt install ftdi_eeprom
</code></pre></div></li>
</ul>
</details>
</li>
<li>
<details class="note">
<summary>Make a folder to work from and change it to our working directory</summary>
<div class="highlight"><pre><span></span><code>mkdir ./ftdi_config
cd ./ftdi_config
</code></pre></div>
</details>
</li>
<li>
<details class="note">
<summary>Create a valid FTDI configuration file for ftdi_eeprom consumption</summary>
<ul>
<li>The below command (copy/paste all lines) will create a valid configuration file. Change parameters as required.
<div class="highlight"><pre><span></span><code>tee ./ftdi.conf &gt; /dev/null &lt;&lt;EOF
filename=eeprom.bin
vendor_id=0x0403
product_id=0x6001
manufacturer="FTDI"
product="FT232 Serial (UART)"
serial="SERIAL"
use_serial=true
max_power=500
self_powered=false
invert_txd=true
invert_rxd=true
cha_type="UART"
EOF
</code></pre></div></li>
<li>This configuration is trimmed from the example due to size of the EEPROM on the FTDIs used.</li>
<li>The example configuration at ==/usr/share/doc/ftdi-eeprom/example.conf== describes possible configuration options for the FTDI and is well-documented.</li>
<li>The above configuration worked for the mentioned devices. The ==filename==, ==vendor_id==, ==product_id==, ==invert_txd==, and ==invert_rxd== variables are required. The others might not be, but seemed applicable.</li>
<li>If you're using a different FTDI chip than used here, please update that in the above configuration. Ensure that vendor_id and product_id are what was obtained from the output of the initial <code>lsusb</code> command.</li>
<li>==max_power==, ==serial==, and ==product== were updated to reflect the output of the initial <code>lshw</code>. These updates may not be required and were done to avoid overwriting anything important. ==cha_type== was updated to ==UART== where both of the devices were originally designated as FIFO.</li>
</ul>
</details>
</li>
<li>
<details class="note">
<summary>Test the configuration and read the eeprom initially before flashing</summary>
<ul>
<li>Read the EEPROM with the following command
<div class="highlight"><pre><span></span><code>sudo ftdi_eeprom --read-eeprom ./ftdi.conf
</code></pre></div></li>
<li>If you get an error here, there's something wrong with your configuration. Check that the device is properly identified and try again.</li>
</ul>
</details>
</li>
<li>
<details class="note">
<summary>Rename/preserve and review the contents of the binary read from the EEPROM</summary>
<ul>
<li>First, rename the output binary file so we don't overwrite it when we flash (flashing writes the flashed binary to the ==filename== path)
<div class="highlight"><pre><span></span><code>mv ./eeprom.bin ./original_eeprom.bin
</code></pre></div></li>
<li>Then, display the outputs of the binary
<div class="highlight"><pre><span></span><code>hexdump -C original_eeprom.bin
</code></pre></div></li>
<li>You can rename the binary in the configuration file by editing the ==filename== variable. If you can't be bothered to edit the file, rename it as detailed above.</li>
</ul>
</details>
</li>
<li>
<details class="note">
<summary>Flash the configuration</summary>
<ul>
<li>Run the following command to flash the EEPROM of the FTDI
<div class="highlight"><pre><span></span><code>sudo ftdi_eeprom --flash-eeprom ./ftdi.conf
</code></pre></div></li>
<li>Optional: compare the flashed configuration to the initial configuration with the below command. If there is no output, the files are the same. You will likely need to re-flash.
<div class="highlight"><pre><span></span><code>diff &lt;(xxd original_eeprom.bin) &lt;(xxd eeprom.bin)
</code></pre></div></li>
<li>Alternatively, you can manually compare the files by running <code>hexdump -C original_eeprom.bin</code> and <code>hexdump -C eeprom.bin</code></li>
</ul>
</details>
</li>
<li>
<details class="success">
<summary>Your FTDI should be flashed and working to control the KVM!</summary>
<ul>
<li>Plug it into one of the Pi's USB slots (if not already), and it's good to go.</li>
<li>The KVM will sink power from the FTDI (Pi) if Vcc is connected. If Vcc is disconnected, ensure that grounds between the Pi and KVM are tied.</li>
</ul>
</details>
</li>
<li>
<details class="note">
<summary>Clean up the ftdi blacklist to reenable the ftdi_sio module</summary>
<ul>
<li>Comment out the line but leave the file with the following command:
<div class="highlight"><pre><span></span><code>sudo sed -i 's/blacklist ftdi_sio/#blacklist ftdi_sio/g' /etc/modprobe.d/bl-ftdi.conf
</code></pre></div></li>
<li>If you'd need to read/flash FTDI EEPROM in the future, you can use the following command (followed by a reboot) to blacklist the ==ftdi_sio== module again.
<div class="highlight"><pre><span></span><code>sudo sed -i 's/#blacklist ftdi_sio/blacklist ftdi_sio/g' /etc/modprobe.d/bl-ftdi.conf
</code></pre></div></li>
<li>If you want to wash your hands of FTDI flashing, then delete the blacklist file with the following command:
<div class="highlight"><pre><span></span><code>sudo rm /etc/modprobe.d/bl-ftdi.conf
</code></pre></div></li>
</ul>
</details>
</li>
<li>
<details class="note">
<summary>Reboot the machine to reset to initial state (with ftdi_sio loaded)</summary>
<ul>
<li>==ftdi_sio== should reload as the driver, and the FTDI should be able to be seen with <code>lshw</code> / <code>dmesg</code> once again. If you tried to run either command while ==ftdi_sio== was blacklisted, you probably would have come up empty.</li>
</ul>
</details>
</li>
</ol>
<h3 id="windows-instructions">Windows Instructions<a class="headerlink" href="#windows-instructions" title="Permanent link"></a></h3>
<p>In order to invert the RX/TX signals, you can use <a href="https://ftdichip.com/utilities/#ft_prog">ft_prog</a> and set the
following settings:</p>
<p><a class="glightbox" data-type="image" data-width="95%" data-height="auto" href="ft232_config.png" data-desc-position="bottom"><img src="ft232_config.png"></a></p>
<p>Once the UART is configured, please fully disconnect it and connect it back to the computer. Relaunch <code>ft_prog</code> and ensure the settings are still set. If they are not, you have a <em>fake</em> FTDI chip.</p>
<h3 id="ftdi-terminal-configuration">FTDI Terminal Configuration<a class="headerlink" href="#ftdi-terminal-configuration" title="Permanent link"></a></h3>
<p>Finally, you will need to connect it to the micro USB port (<strong>This it not a normal USB micro port.</strong>)
like so:</p>
<table>
<thead>
<tr>
<th>Signal</th>
<th>Colour</th>
<th>FT232 Pin</th>
</tr>
</thead>
<tbody>
<tr>
<td>Vbus</td>
<td>Red</td>
<td>5v (if you want to power the KVM from the Pi's USB)</td>
</tr>
<tr>
<td>D-</td>
<td>White</td>
<td>RX</td>
</tr>
<tr>
<td>D+</td>
<td>Green</td>
<td>TX</td>
</tr>
<tr>
<td>Gnd</td>
<td>Black</td>
<td>GND</td>
</tr>
</tbody>
</table>
<h3 id="an-inverter-circuit-the-cheap-way">An inverter circuit - The cheap way<a class="headerlink" href="#an-inverter-circuit-the-cheap-way" title="Permanent link"></a></h3>
<p>For this you will need:</p>
<ul>
<li>1x 74HC14</li>
<li>1x USB A socket, or sacrificial micro USB cable</li>
<li>Optional 1x Diode - If you want to power the KVM from the Raspberry Pi</li>
<li>1x 5-pin header</li>
<li>5x Female - Female jumper cables</li>
</ul>
<p><a class="glightbox" data-type="image" data-width="95%" data-height="auto" href="xh-hk4401_circuit.png" data-desc-position="bottom"><img src="xh-hk4401_circuit.png"></a></p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Please search online for USB pinouts to ensure you connect it properly.</p>
</div>
<h2 id="adding-ui-elements-to-control-the-kvm-switch">Adding UI elements to control the KVM switch<a class="headerlink" href="#adding-ui-elements-to-control-the-kvm-switch" title="Permanent link"></a></h2>
<p>The UI can be updated to add buttons to switch between KVM inputs and indicators for which input is currently selected. The instructions below will make these available in the PiKVM UI after clicking the "GPIO" menu button in the KVM view.</p>
<ol>
<li>
<p>SSH into PiKVM</p>
</li>
<li>
<p>Enable read-write mode on the sd card via <code>rw</code></p>
</li>
<li>
<p>Edit the <code>/etc/kvmd/override.yaml</code> file and include the following. </p>
</li>
</ol>
<table>
<thead>
<tr>
<th>Method</th>
<th>Device</th>
</tr>
</thead>
<tbody>
<tr>
<td>FT-232</td>
<td><code>/dev/ttyUSB0</code></td>
</tr>
<tr>
<td>Inverter</td>
<td><code>/dev/ttyAMA0</code></td>
</tr>
</tbody>
</table>
<div class="highlight"><pre><span></span><code><span class="nt">kvmd</span><span class="p">:</span>
<span class="w"> </span><span class="nt">gpio</span><span class="p">:</span>
<span class="w"> </span><span class="nt">drivers</span><span class="p">:</span>
<span class="w"> </span><span class="nt">hk</span><span class="p">:</span>
<span class="w"> </span><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">xh_hk4401</span>
<span class="w"> </span><span class="nt">device</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">/dev/ttyUSB0</span>
<span class="w"> </span><span class="nt">scheme</span><span class="p">:</span>
<span class="w"> </span><span class="nt">ch0_led</span><span class="p">:</span>
<span class="w"> </span><span class="nt">driver</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">hk</span>
<span class="w"> </span><span class="nt">pin</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">0</span>
<span class="w"> </span><span class="nt">mode</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">input</span>
<span class="w"> </span><span class="nt">ch1_led</span><span class="p">:</span>
<span class="w"> </span><span class="nt">driver</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">hk</span>
<span class="w"> </span><span class="nt">pin</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1</span>
<span class="w"> </span><span class="nt">mode</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">input</span>
<span class="w"> </span><span class="nt">ch2_led</span><span class="p">:</span>
<span class="w"> </span><span class="nt">driver</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">hk</span>
<span class="w"> </span><span class="nt">pin</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">2</span>
<span class="w"> </span><span class="nt">mode</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">input</span>
<span class="w"> </span><span class="nt">ch3_led</span><span class="p">:</span>
<span class="w"> </span><span class="nt">driver</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">hk</span>
<span class="w"> </span><span class="nt">pin</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3</span>
<span class="w"> </span><span class="nt">mode</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">input</span>
<span class="w"> </span><span class="nt">ch0_button</span><span class="p">:</span>
<span class="w"> </span><span class="nt">driver</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">hk</span>
<span class="w"> </span><span class="nt">pin</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">0</span>
<span class="w"> </span><span class="nt">mode</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">output</span>
<span class="w"> </span><span class="nt">switch</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">false</span>
<span class="w"> </span><span class="nt">ch1_button</span><span class="p">:</span>
<span class="w"> </span><span class="nt">driver</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">hk</span>
<span class="w"> </span><span class="nt">pin</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">1</span>
<span class="w"> </span><span class="nt">mode</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">output</span>
<span class="w"> </span><span class="nt">switch</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">false</span>
<span class="w"> </span><span class="nt">ch2_button</span><span class="p">:</span>
<span class="w"> </span><span class="nt">driver</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">hk</span>
<span class="w"> </span><span class="nt">pin</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">2</span>
<span class="w"> </span><span class="nt">mode</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">output</span>
<span class="w"> </span><span class="nt">switch</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">false</span>
<span class="w"> </span><span class="nt">ch3_button</span><span class="p">:</span>
<span class="w"> </span><span class="nt">driver</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">hk</span>
<span class="w"> </span><span class="nt">pin</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">3</span>
<span class="w"> </span><span class="nt">mode</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">output</span>
<span class="w"> </span><span class="nt">switch</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">false</span>
<span class="w"> </span><span class="nt">view</span><span class="p">:</span>
<span class="w"> </span><span class="nt">table</span><span class="p">:</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="s">"#Input</span><span class="nv"> </span><span class="s">1"</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="nv">ch0_led</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="nv">ch0_button</span><span class="p p-Indicator">]</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="s">"#Input</span><span class="nv"> </span><span class="s">2"</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="nv">ch1_led</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="nv">ch1_button</span><span class="p p-Indicator">]</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="s">"#Input</span><span class="nv"> </span><span class="s">3"</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="nv">ch2_led</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="nv">ch2_button</span><span class="p p-Indicator">]</span>
<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="p p-Indicator">[</span><span class="s">"#Input</span><span class="nv"> </span><span class="s">4"</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="nv">ch3_led</span><span class="p p-Indicator">,</span><span class="w"> </span><span class="nv">ch3_button</span><span class="p p-Indicator">]</span>
</code></pre></div>
<ol>
<li>
<p>Return to read-only mode for the sd card via <code>ro</code></p>
</li>
<li>
<p>Restart the kvmd service: <code>systemctl restart kvmd</code></p>
</li>
</ol>
<h2 id="switching-between-hosts-in-the-ui">Switching between hosts in the UI<a class="headerlink" href="#switching-between-hosts-in-the-ui" title="Permanent link"></a></h2>
<p>To switch between hosts, enter the KVM UI and click the "GPIO" menu. You should see 4 inputs, one of which will have a green circle indicating it is currently selected. Click the other inputs to change the selected host.</p>
<p>Please review this latest <a href="https://github.com/pikvm/pikvm/issues/1306">issue</a> for an update to the existing instructions</p></div>
</article>
</div>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
<button type="button" class="md-top md-icon" data-md-component="top" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"></path></svg>
Back to top
</button>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
<div class="md-copyright__highlight">
Copyright © 2018-2025 Maxim Devaev
</div>
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "..", "features": ["navigation.indexes", "navigation.sections", "navigation.top", "navigation.expand", "search.highlight", "search.share", "search.suggest", "content.code.copy"], "search": "../assets/javascripts/workers/search.973d3a69.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
<script src="../assets/javascripts/bundle.f55a23d4.min.js"></script>
<script src="../_assets/add_paragraphs.js"></script>
<script src="../_assets/scroll_to_summary.js"></script>
<script id="init-glightbox">const lightbox = GLightbox({"touchNavigation": false, "loop": false, "zoomable": true, "draggable": true, "openEffect": "zoom", "closeEffect": "zoom", "slideEffect": "slide"});
document$.subscribe(()=>{ lightbox.reload(); });
</script></body></html>