Skip to content

Instantly share code, notes, and snippets.

@roana0229
Last active October 3, 2024 07:46
Show Gist options
  • Save roana0229/cae859d551336f39522a9ed30125eab7 to your computer and use it in GitHub Desktop.
Save roana0229/cae859d551336f39522a9ed30125eab7 to your computer and use it in GitHub Desktop.
Raspberry Pi Zero W をHID化する

Raspberry Pi Zero W をHID化する

  1. https://www.raspberrypi.org/software/ からOSインストーラーをダウンロード
  2. Raspberry Pi OS (other) > Raspberry Pi OS Lite (32-bit)を選択し、SDカードにOSを書き込む
  3. https://mascii.github.io/wpa-supplicant-conf-tool/ に接続するネットワークの情報を入れ追加 > wpa_supplicant.conf,ssh.txtをダウンロード
  4. 3でダウンロードした2つのファイルを2で書き込んだSDカードのrootにコピーする(SDカードの準備完了)
  5. 本体にSDカードを入れ、USBポート(not 電源ポート)をキーボードとして利用したいPCへ接続する
  6. しばらくするとssh [email protected]で接続できるようになるため、ssh接続する
  7. 下記コマンドを実行し、HID化する
ssh [email protected]
> password: 初期設定されているパスワードを入力

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git

git clone https://github.com/c4software/pi-as-keyboard.git
cd pi-as-keyboard
sudo ./setup.sh
sudo reboot
  1. 再起動後、ssh接続しテストコマンドを実行して、キーボード入力が行われれば完了
ssh [email protected]
> password: 初期設定されているパスワードを入力

cd pi-as-keyboard
sudo ./test.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment