You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2128 lines
49 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="Open and cheap DIY IP-KVM on Raspberry Pi">
<meta name="author" content="Maxim Devaev">
<link rel="canonical" href="https://pikvm.github.io/pikvm/pico_hid/">
<link rel="prev" href="../mouse_jiggler/">
<link rel="next" href="../bluetooth_hid/">
<link rel="icon" href="../_assets/favicon.ico">
<meta name="generator" content="mkdocs-1.6.0, mkdocs-material-9.5.27">
<title>Pico HID (USB, PS/2) - PiKVM Handbook</title>
<link rel="stylesheet" href="../assets/stylesheets/main.6543a935.min.css">
<link rel="stylesheet" href="../assets/stylesheets/palette.06af60db.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&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>
</head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="pink">
<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="#the-pico-hid" 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 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></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">
Pico HID (USB, PS/2)
</span>
</div>
</div>
</div>
<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.516 6.516 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 5Z"/></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.516 6.516 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 5Z"/></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 11h12Z"/></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-.7 0-.24-.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.91 1.61 0 2.92-1.3 2.92-2.91A2.92 2.92 0 0 0 18 16.08Z"/></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 12 19 6.41Z"/></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 6.5.2 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 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></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 6.5.2 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 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></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">
Getting started
</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>
Getting started
</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_1_1" >
<label class="md-nav__link" for="__nav_1_1" id="__nav_1_1_label" tabindex="0">
<span class="md-ellipsis">
Device guides
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_1_1_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_1_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 & Plus
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../v3/" class="md-nav__link">
<span class="md-ellipsis">
PiKVM V3 HAT
</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">
<a href="../first_steps/" class="md-nav__link">
<span class="md-ellipsis">
First steps
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../auth/" class="md-nav__link">
<span class="md-ellipsis">
Authentication
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../faq/" class="md-nav__link">
<span class="md-ellipsis">
FAQ & Troubleshooting
</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">
Networking
</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>
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_2_1" >
<label class="md-nav__link" for="__nav_2_1" id="__nav_2_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_2_1_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_2_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="../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="../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_3" >
<label class="md-nav__link" for="__nav_3" id="__nav_3_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_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3">
<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="../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>
<li class="md-nav__item">
<a href="../webrtc/" class="md-nav__link">
<span class="md-ellipsis">
H.264 / WebRTC
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../video/" class="md-nav__link">
<span class="md-ellipsis">
Working with video
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../audio/" class="md-nav__link">
<span class="md-ellipsis">
HDMI audio
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4" checked>
<label class="md-nav__link" for="__nav_4" id="__nav_4_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_4_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_4">
<span class="md-nav__icon md-icon"></span>
Peripheral devices
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_4_1" checked>
<label class="md-nav__link" for="__nav_4_1" id="__nav_4_1_label" tabindex="0">
<span class="md-ellipsis">
Keyboard & mouse
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_4_1_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_4_1">
<span class="md-nav__icon md-icon"></span>
Keyboard & 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 md-nav__item--active">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
<span class="md-ellipsis">
Pico HID (USB, PS/2)
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
<span class="md-ellipsis">
Pico HID (USB, PS/2)
</span>
</a>
<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="#making-the-pico-hid" class="md-nav__link">
<span class="md-ellipsis">
Making the Pico HID
</span>
</a>
<nav class="md-nav" aria-label="Making the Pico HID">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#ps2-keyboard-mouse" class="md-nav__link">
<span class="md-ellipsis">
PS/2 Keyboard &amp; Mouse
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#configuring-the-hid-modes" class="md-nav__link">
<span class="md-ellipsis">
Configuring the HID modes
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#flashing-the-firmware" class="md-nav__link">
<span class="md-ellipsis">
Flashing the firmware
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#the-final-steps" class="md-nav__link">
<span class="md-ellipsis">
The final steps
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#replacing-the-arduino-hid" class="md-nav__link">
<span class="md-ellipsis">
Replacing the Arduino HID
</span>
</a>
</li>
</ul>
</nav>
</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="../usb_dynamic/" class="md-nav__link">
<span class="md-ellipsis">
Dynamic USB configuration
</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_5" >
<label class="md-nav__link" for="__nav_5" id="__nav_5_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_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5">
<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="../on_boot_config/" class="md-nav__link">
<span class="md-ellipsis">
On-boot configuration
</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 & 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_6" >
<label class="md-nav__link" for="__nav_6" id="__nav_6_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_6_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_6">
<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_7" >
<label class="md-nav__link" for="__nav_7" id="__nav_7_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_7_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_7">
<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>
</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="#making-the-pico-hid" class="md-nav__link">
<span class="md-ellipsis">
Making the Pico HID
</span>
</a>
<nav class="md-nav" aria-label="Making the Pico HID">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#ps2-keyboard-mouse" class="md-nav__link">
<span class="md-ellipsis">
PS/2 Keyboard &amp; Mouse
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#configuring-the-hid-modes" class="md-nav__link">
<span class="md-ellipsis">
Configuring the HID modes
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#flashing-the-firmware" class="md-nav__link">
<span class="md-ellipsis">
Flashing the firmware
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#the-final-steps" class="md-nav__link">
<span class="md-ellipsis">
The final steps
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#replacing-the-arduino-hid" class="md-nav__link">
<span class="md-ellipsis">
Replacing the Arduino HID
</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="the-pico-hid">The Pico HID<a class="headerlink" href="#the-pico-hid" title="Permanent link"></a></h1>
<div class="admonition tip">
<p class="admonition-title">A fast way to get PS/2 on PiKVM V2+</p>
<p>If you need PS/2 keyboard &amp; mouse on <a href="../v2/">PiKVM V2</a>, <a href="../v3/">V3</a> and <a href="../v4/">V4 Plus</a>
(but not V4 Mini or DIY based on Zero 2 W boards),
you can use a faster and easier way: <a href="../pico_hid_bridge/">The Pico HID Bridge</a>.</p>
</div>
<p>The Pico HID is a part of <a href="../v1/">DIY PiKVM V1</a> platform that performs keyboard and mouse emulation.
It has excellent compatibility, and emulates USB by default, including two mouse modes: absolute and relative.</p>
<p>Full list of features:</p>
<table>
<thead>
<tr>
<th>Feature</th>
<th>Enabled by default</th>
</tr>
</thead>
<tbody>
<tr>
<td>USB Keyboard, absolute &amp; relative mouse</td>
<td>Yes</td>
</tr>
<tr>
<td>USB Absolute Mouse for Windows 95</td>
<td>No</td>
</tr>
<tr>
<td>PS/2 Keyboard &amp; mouse</td>
<td>No</td>
</tr>
</tbody>
</table>
<p>The scope of the Pico HID is not limited to <a href="../v1/">V1</a> platform, it can also be used with <a href="../v2/">V2</a> and <a href="../v3/">V3</a>,
if you need to emulate a PS/2 keyboard and mouse or use a <a href="https://github.com/pikvm/pikvm/issues/7">legacy multiport KVM switch</a>
which does not fully support USB standards.</p>
<p>This page explains how to build, connect and use all the features of the Pico HID.</p>
<div class="admonition note">
<p class="admonition-title">Software requirements</p>
<p>KVMD &gt;= 3.241 is required for the Pico HID.
For new builds, this will be the case, but if you want to use the Pico HID on the old PiKVM, you will need to update OS.</p>
</div>
<hr>
<h2 id="making-the-pico-hid">Making the Pico HID<a class="headerlink" href="#making-the-pico-hid" title="Permanent link"></a></h2>
<p>If you are building <a href="../v1/">PiKVM V1</a>, then the hardware should already be assembled. Skip this step unless you need PS/2 support.</p>
<p>But if you are making the Pico HID for <a href="../v2/">V2</a> or <a href="../v3/">V3</a>, then follow this guide:</p>
<details class="example">
<summary>The Pico HID from scratch</summary>
<p>Parts list:</p>
<ul>
<li>
<p><em>x1</em> <a href="https://www.raspberrypi.com/products/raspberry-pi-pico/">Raspberry Pi Pico board</a> with soldered pins.</p>
</li>
<li>
<p><em>x1</em> USB-A to Micro-USB cable.</p>
</li>
<li>
<p><em>x10</em> dupont wires female-female.</p>
</li>
<li>
<p><em>x1</em> 1N5819 diode. It's optional but strongly recommended. Any similar one will do.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>The diode is needed to provide power to the Pico HID regardless of the target host state,
which prevents the backpowering problem. It will allow you to keep the keyboard buttons pressed
during the target host power cycle, which is, for example, important for MacOS to get into the boot menu.</p>
<p>Do not connect the red wire (the <code>VSYS (Pico) -&gt; 5V (Pi)</code> line) without a diode.
If you can't find a diode, don't connect this wire at all.</p>
</div>
</li>
</ul>
<p>Connect all the parts according to this scheme:</p>
<details class="example">
<summary>Simple wiring diagram</summary>
<p><img src="basic_breadboard.png"></p>
</details>
<details class="example">
<summary>Electrical schematic diagram for advanced users</summary>
<p><img src="basic_scheme.png"></p>
</details>
</details>
<h3 id="ps2-keyboard-mouse">PS/2 Keyboard &amp; Mouse<a class="headerlink" href="#ps2-keyboard-mouse" title="Permanent link"></a></h3>
<details class="example">
<summary>Additional steps for PS/2 support</summary>
<p>If you need PS/2 keyboard and mouse support, you will need a few additional components.
Soldering skills will also come in handy.</p>
<ul>
<li><em>x1</em> 3.3V/5V bi-directional logic level shifter <a href="https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide/">like this</a>.</li>
<li><em>x2</em> PS/2 cable with male connector (can be salvaged from the an keyboard or mouse).</li>
</ul>
<p>Make sure that the level shifter pinout matches the scheme, and connect everything according to the <a href="https://pico.pinout.xyz">Pico pinout</a>.</p>
<div class="highlight"><pre><span></span><code> _________________
| |
Pico GP11 ______| LV1 HV1 |______ PS/2 keyboard data
Pico GP12 ______| LV2 HV2 |______ PS/2 keyboard clock
Pico GP13 ______| LV HV |______ PS/2 5V
Pico GND ______| GND GND |______ PS/2 GND
Pico GP14 ______| LV3 HV3 |______ PS/2 mouse data
Pico GP15 ______| LV4 HV4 |______ PS/2 mouse clock
|_________________|
</code></pre></div>
<p>You can take the 5V power line from one of the PS/2, for example from the keyboard,
or from both at once, but use a multimeter to make sure that both PS/2 female
connectors have the same line.</p>
<p><img src="ps2_pinout.png"></p>
<p>PS/2 female socket pinout on the motherboard is the same for the keyboard and the mouse.
A purple socket usually corresponds to the keyboard, and a green one to the mouse.
If your motherboard only has one port, it's probably universal and can be used for both
the keyboard and the mouse. Most likely, it will be painted both colors.</p>
<p>Use a multimeter to determine the purpose of the wires in your PS/2 cables.</p>
<p>A good idea is to mount the level shifter on top of the Pico, as in this photo:</p>
<p><img src="ps2_level_shifter_soldering.png" width="300"></p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Don't forget to enable PS/2 mode support as described in the next paragraph</p>
</div>
</details>
<hr>
<h2 id="configuring-the-hid-modes">Configuring the HID modes<a class="headerlink" href="#configuring-the-hid-modes" title="Permanent link"></a></h2>
<p>By default, Pico HID emulates a USB keyboard and an absolute or relative mouse
(read <a href="../mouse/">here</a> about the difference between mouse modes).
For most cases, nothing needs to be changed here. However, if you need something special
(like Windows 98 support), you can do it without reflashing the current firmware.</p>
<p>To achieve this, the Pico HID uses a runtime configuration, which is set by connecting
some GPIOs with Ground (<code>GND</code>) lines.</p>
<table>
<thead>
<tr>
<th>Pin name on the Pico board</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>GP2</code></td>
<td>Enable PS/2 keyboard &amp; mouse support (see below).</td>
</tr>
<tr>
<td><code>GP3</code></td>
<td>Prefer the PS/2 keyboard over USB when turning on the HID (if PS/2 is enabled).</td>
</tr>
<tr>
<td><code>GP4</code></td>
<td>Prefer the PS/2 mouse over USB (if PS/2 is enabled)</td>
</tr>
<tr>
<td><code>GP6</code></td>
<td>Disable USB keyboard &amp; mouse support. This is useful if you only want to use PS/2.</td>
</tr>
<tr>
<td><code>GP7</code></td>
<td>Enable the special USB absolute mouse for Windows 98.</td>
</tr>
<tr>
<td><code>GP8</code></td>
<td>Prefer the relative USB mouse over the absolute one.</td>
</tr>
<tr>
<td><code>GP9</code></td>
<td>Prefer the Windows 98 USB absolute mouse over the regular absolute one (if enabled).</td>
</tr>
</tbody>
</table>
<div class="admonition example">
<p class="admonition-title">Example</p>
<p>To enable Windows 98 absolute mouse, just connect pin <code>GP9</code> to any <code>GND</code> <a href="https://pico.pinout.xyz">on the Pico</a>.</p>
</div>
<hr>
<h2 id="flashing-the-firmware">Flashing the firmware<a class="headerlink" href="#flashing-the-firmware" title="Permanent link"></a></h2>
<p>To upload the firmware to Pico HID, you can use any computer with a USB port.</p>
<ol>
<li><a href="https://github.com/pikvm/kvmd/releases">Download</a> the latest release of the firmware. The file is called <code>pico-hid.uf2</code>.</li>
<li>Press and hold the white button on the Pico board.</li>
<li>While still holding the button, plug it in the computer using a USB cable.</li>
<li>Release the button.</li>
<li>The Pico board appears as a flash drive on your computer.</li>
<li>Copy the <code>pico-hid.uf2</code> file to this flash drive.</li>
<li>Safely eject the USB device.</li>
</ol>
<hr>
<h2 id="the-final-steps">The final steps<a class="headerlink" href="#the-final-steps" title="Permanent link"></a></h2>
<p>Connect the Pico HID to the target host using the USB cable.</p>
<p>If you are building PiKVM <a href="../v1/">V1</a>, no further action with the Pico HID is required.</p>
<p>If you are making the Pico HID for <a href="../v2/">V2</a> or <a href="../v3/">V3</a>, add the following lines to the PiKVM configuration and reboot it:</p>
<ul>
<li>
<p><code>/boot/config.txt</code>
</p><div class="highlight"><pre><span></span><code><span class="na">dtoverlay</span><span class="o">=</span><span class="s">spi0-1cs</span>
</code></pre></div>
</li>
<li>
<p><code>/etc/kvmd/override.yaml</code>:
</p><div class="highlight"><pre><span></span><code><span class="nt">kvmd</span><span class="p">:</span>
<span class="w"> </span><span class="nt">hid</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">spi</span>
<span class="w"> </span><span class="nt">chip</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">bus</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">sw_cs_pin</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">7</span>
<span class="w"> </span><span class="nt">sw_cs_per_byte</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
<span class="w"> </span><span class="nt">reset_pin</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">25</span>
<span class="w"> </span><span class="nt">reset_inverted</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
<span class="w"> </span><span class="nt">reset_self</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
<span class="w"> </span><span class="nt">power_detect_pin</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">16</span>
<span class="w"> </span><span class="nt">power_detect_pull_down</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
</code></pre></div>
</li>
</ul>
<hr>
<h2 id="replacing-the-arduino-hid">Replacing the Arduino HID<a class="headerlink" href="#replacing-the-arduino-hid" title="Permanent link"></a></h2>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p><strong>This section is intended for advanced users of the <a href="../arduino_hid/">legacy Arduino HID</a>.</strong></p>
<p>It may seem tempting, but <strong>don't to use the Arduino HID for new PiKVM builds</strong>
just because you have it at your fingertips. Connecting and flashing Arduino
is much more time consuming than Pico. In addition, different Arduino board work
with different voltages, they may or may not have SPI (for the Pico, we use SPI to
free up the UART on Raspberry Pi for the console and other useful things), etc.</p>
<p>Using the Pico HID is the recommended fast and standard way in the PiKVM world.</p>
</div>
<p>The Pico HID can be used to replace the <a href="../arduino_hid/">legacy Arduino HID</a>.
It can use both Serial (UART) port and the SPI. The connection scheme is also much simpler,
getting rid of the transistor for the Reset line and the level shifter for RX/TX (MOSI/MISO).</p>
<details class="example">
<summary>For the Arduino HID over SPI</summary>
<p>Throw away the Reset transistor and level shifter, and follow this guide
from the very beginning, as if you were connecting Pico HID to PiKVM <a href="../v2/">V2</a> or <a href="../v3/">V3</a>.</p>
</details>
<details class="example">
<summary>For the classic Serial (UART) HID</summary>
<p>Get rid of the transistor and level shifter, and follow this guide
from the very beginning, but the schemes and configs will be slightly different.</p>
<ul>
<li>
<p>The <code>GP22</code> on the Pico is connected directly to the <code>GND</code>. This enables UART mode instead of the default SPI.</p>
</li>
<li>
<p>In the good old PiKVM V0, <code>GPIO4</code> <a href="https://pinout.xyz">on the Raspberry Pi</a> was used for the Reset line.
Now we recommend to use <code>GPIO25</code> for consistency reasons.
However, you can use <code>GPIO4</code> by changing the <code>reset_pin</code> value in the config example below.
On the scheme, this is a yellow wire, the <code>RUN (Pico) -&gt; GPIO25 (Pi)</code> line.</p>
</li>
</ul>
<details class="example">
<summary>Simple wiring diagram</summary>
<p><img src="serial_breadboard.png"></p>
</details>
<details class="example">
<summary>Electrical schematic diagram</summary>
<p><img src="serial_scheme.png"></p>
</details>
<details class="example">
<summary>Configs</summary>
<ul>
<li>
<p>Don't add line <code>dtoverlay=spi0-1cs</code> to the <code>/boot/config.txt</code> file. It's only needed for SPI.</p>
</li>
<li>
<p><code>/etc/kvmd/override.yaml</code>:
</p><div class="highlight"><pre><span></span><code><span class="nt">kvmd</span><span class="p">:</span>
<span class="w"> </span><span class="nt">hid</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">serial</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/kvmd-hid</span>
<span class="w"> </span><span class="nt">reset_pin</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">25</span>
<span class="w"> </span><span class="nt">reset_inverted</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
<span class="w"> </span><span class="nt">reset_self</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
<span class="w"> </span><span class="nt">power_detect_pin</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">16</span>
<span class="w"> </span><span class="nt">power_detect_pull_down</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">true</span>
</code></pre></div>
</li>
</ul>
</details>
</details></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 8v12Z"/></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 &copy; 2018-2022 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.tracking", "navigation.expand", "search.highlight", "search.share", "search.suggest"], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "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"}}</script>
<script src="../assets/javascripts/bundle.ad660dcc.min.js"></script>
</body>
</html>