お気持ちの表明

思考を雑に外出していきます

Raspberry Pi Zero W を USB OTGではなくSDカードをいじってのセットアップをしたときのメモ

mac OS(10.15.6)の環境で Raspberry Pi Zero W を USB OTGでセットアップしようとしたが、RNDIS/Ethernet Gadgetが出てこずに泣いた。 以下を参考にHoRNDISを入れてみたりもしたが、解決せず。

というわけで、USB OTG以前ではSDカードをいじってセットアップしてたのを思い出したので、忘備録として残しとく

目次的な

  • OSを書き込む
  • SSHを有効にする
  • wifiの設定をする
  • Raspberry Pi Zero Wの電源を入れる
  • SSHできることを確認する

OSを書き込む

最近はRaspberry Pi Imagerというツールがあって便利らしく、これをつかって書き込んだ

SSHを有効にする

SDのrootにsshという命名の空ファイルを置くことで有効になる

$ touch /Volume/boot/ssh

wifiの設定をする

SDのrootにwpa_supplicant.confという命名のファイルを置くことでwifiを設定できる

country=JP
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
  ssid="<SSID名>"
  psk="<WiFiパスワード>"
}

自分が微妙にハマったのだが、サポートしているWiFiの帯域はb/g/nなのに、aの帯域のSSIDを設定しまってWiFiつながらんぞ!!!!と時間溶かしてしまった😷

802.11 b/g/n wireless LAN Buy a Raspberry Pi Zero W – Raspberry Pi

Raspberry Pi Zero Wの電源を入れる

USB OTGは使わないので、普通に電源のところにつなぐ

SSHできることを確認する

初期パスワードはraspberryなので、あとで編集しときましょうね

➜  ~ ssh pi@raspberrypi.local
The authenticity of host 'raspberrypi.local (fe80::34d5:cf1a:4534:33ea%en0)' can't be established.
ECDSA key fingerprint is SHA256:FoiespN6d+3HSSRRMqLFouVbDVuaUkeHiHeGOSE5iT4.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'raspberrypi.local,fe80::34d5:cf1a:4534:33ea%en0' (ECDSA) to the list of known hosts.
pi@raspberrypi.local's password:
Linux raspberrypi 4.19.118+ #1311 Mon Apr 27 14:16:15 BST 2020 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.

pi@raspberrypi:~ $

参考