Raspberry Pi 1 Model B
2022/05/11 Linux raspberr 5.15.32+ #1538 Thu Mar 31 19:37:58 BST 2022 armv6l GNU/Linux Raspbian GNU/Linux 11
- インストール
- Imager(imager_1.7.2.exe)をダウンロード、PCにインストール
- 「Raspberry Pi OS (other)」→「Raspberry Pi OS Lite (32-bit)」を選択
- 歯車→詳細な設定
- ホスト名:raspberr
- SSHを有効化する
- パスワード認証を使う
- ユーザー名とパスワードを設定する
- ユーザー名:pi
- パスワード:xxx
- Wi-Fiを設定する
- SSID:xxx
- パスワード:xxx
- Wifiをる使う国:JP
- ロケールを設定する
- タイムゾーン:Asia/Tokyo
- キーボードレイアウト:jp
- SDに書き込み
- RaspBerry Piを起動
- IPアドレスの設定
- /etc/dhcpcd.conf
interface wlan0 static ip_address=192.168.1.70/24 static routers=192.168.1.1 static domain_name_servers=192.168.1.1 interface eth0 static ip_address=192.168.0.1/24
- 無線LANのSSIDとパスフレーズを設定するとき
- 以下を実行して
wpa_passphrase SSID "Pre shared key"
- /etc/wpa_supplicant/wpa_supplicant.confのpsk=の行(平文)を書き換える
pi@raspberr:~ $ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf country=JP ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev ap_scan=1 update_config=1 network={ ssid="XXX" psk=bd...7c }
- OSのアップデート
- sudo apt update
- sudo apt full-upgrade
- sudo apt autoremove
- 電源スイッチをつける
- "C13"(GND)とその対(GPIO7)にスイッチを差し込む
- /boot/config.txtに追記
dtoverlay=gpio-shutdown,gpio_pin=7
- DHCPサーバ
- sudo apt install isc-dhcp-server
- /etc/dhcp/dhcpd.confを編集
#option domain-name "example.org"; #option domain-name-servers ns1.example.org, ns2.example.org; authoritative; subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.101 192.168.0.110; # option routers 192.168.0.1; # option domain-name-servers 192.168.0.1; option broadcast-address 192.168.0.255; }
- /etc/default/isc-dhcp-serverを編集
INTERFACESv4="eth0" INTERFACESv6=""
- 書き換える(暫定的)/usr/lib/ntp/ntp-systemd-wrapper(/lib/systemd/system/ntp.serviceから実行されるファイル)
#if [ -e /run/ntp.conf.dhcp ]; then # NTPD_OPTS="$NTPD_OPTS -c /run/ntp.conf.dhcp" #fi
- sambaサーバ
- パッケージ
sudo apt install samba
- "DHCP から WINS 設定を使うよう smb.conf を変更しますか?"→いいえ
- 公開ディレクトリ
sudo mkdir /share sudo chmod a+w /share
- 設定ファイル
cd /etc/samba cp smb.conf ~/smb.conf_org vi smb.conf
- 結果的にこうなった(何が効いているか不明)
- 最終的にLANMAN1が効いた
- サーバー名は8文字までのようだ
[global] unix charset = UTF-8 dos charset = CP932 ntlm auth = yes hide dot files = No # max protocol = SMB2 # server min protocol = NT1 server min protocol = LANMAN1 lanman auth = yes # encrypt passwords = no client lanman auth = yes # mangle prefix = 6 netbios name = RASPBERR lm announce = yes lm interval = 30
[share] path = /share writable = yes guest ok = yes guest only = yes force create mode = 777 force directory mode = 777
[printer][print$]はコメントアウト
- GPSモジュール
「GPS受信機キット 1PPS出力付き 「みちびき」3機受信対応」
- シリアルコンソール無効化
sudo raspi-config 3 Interface Options Configure connections to peripherals I6 Serial Port Enable/disable shell messages on the serial connection Would you like a login shell to be accessible over serial? → No Would you like the serial port hardware to be enabled? → Yes
- /boot/cmdline.txt(シリアルを削除) → されてた?
#console=serial0,115200 console=tty1 root=PARTUUID=7b83344a-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles console=tty1 root=PARTUUID=7b83344a-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
- /boot/config.txt
enable_uart=1 dtoverlay=pps-gpio,gpiopin=18,assert_falling_edge=true
- /etc/modules
pps-gpio
- パッケージ
sudo apt install gpsd pps-tools
- /etc/default/gpsd
DEVICES="/dev/ttyAMA0 /dev/pps0" GPSD_OPTIONS="-n"
- 動作確認
gpsmon cgps
など
- NTPデーモン(GPS対応)
- パッケージ
sudo apt install ntp
- /etc/ntp.conf
残ったもの。
driftfile /var/lib/ntp/ntp.drift leapfile /usr/share/zoneinfo/leap-seconds.list statistics loopstats peerstats clockstats filegen loopstats file loopstats type day enable filegen peerstats file peerstats type day enable filegen clockstats file clockstats type day enable server 127.127.22.0 minpoll 4 maxpoll 4 fudge 127.127.22.0 refid PPS stratum 0 flag3 1 flag4 1 time1 0.1 server 127.127.28.2 minpoll 3 maxpoll 3 prefer fudge 127.127.28.2 refid SHM2 stratum 1 time1 0.1 restrict 127.0.0.1 restrict ::1 restrict 192.168.0.0 mask 255.255.255.0 nomodify notrap restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
- enable
sudo systemctl enable gpsd.service
- TP-Link AC600 Archer T2U Nano
pi@raspberr:~ $ lsusb Bus 001 Device 004: ID 2357:011e TP-Link AC600 wireless Realtek RTL8811AU [Archer T2U Nano]
https://qiita.com/theshibadog/items/84a8d6bc1911b32a915e
https://askubuntu.com/questions/1419652/archer-t2u-nano-won-t-work-no-matter-what
- このページの通りに実行(リポジトリは変えている)
sudo apt install build-essential git dkms sudo apt install raspberrypi-kernel-headers # されてた? cd /usr/src # sudo ln -s linux-headers-4.14.79-v7+ linux # これはしていない sudo git clone https://github.com/morrownr/8821au-20210708 sudo mv 8821au-20210708 rtl8812AU-4.3.20 sudo vi rtl8812AU-4.3.20/Makefile --- CONFIG_PLATFORM_I386_PC = n CONFIG_PLATFORM_ARM_RPI = y --- DRV_NAME=rtl8812AU DRV_VERSION=4.3.20 sudo dkms add -m ${DRV_NAME} -v ${DRV_VERSION} sudo dkms build -m ${DRV_NAME} -v ${DRV_VERSION} sudo dkms install -m ${DRV_NAME} -v ${DRV_VERSION}
- SSDを追加
- /etc/fstab
UUID=2c4e61d9-90b7-46b5-9a54-bce35206a04d /share ext4 defaults,noatime 0 0