furuhashilab / Tochizi-hai-OpenDataHackathon

都知事杯 オープンデータハッカソンのリポジトリ
https://furuhashilab.github.io/Tochizi-hai-OpenDataHackathon/
1 stars 0 forks source link

古橋のUNVT Portable 動作確認MEMO 2022-01-15 #29

Open mapconcierge opened 2 years ago

mapconcierge commented 2 years ago

RaspberryPi OS Lite (32bit) をインストール

Raspberry Pi OS 1.6.2 のインストーラ使用

インストール前に、SSHとWi-Fi設定を変更しておく

スクリーンショット 2022-01-15 9 38 47

MicroSD カードにインストール

スクリーンショット 2022-01-15 9 43 30

SDカードを自身のPCに接続させてboot直下に"ssh"というファイルを置いてみましょう。

image

GUIでsshファイルを作成すると、2回目以降のssh接続の際に作成したsshファイルが消えるバグが発生しました。 以下のコマンドを叩いてCUIでsshファイルを作成することをおすすめします。

cd /Volumes/boot  ## bootへ移動
touch ssh ## sshファイルを作成
ls  ## sshファイルがあるかを確認
image

Raspberry Piに給電できているか確認

Raspberry Piに赤いランプが点灯しているか確認しましょう。ケーブルが古い等などの理由で給電できていない場合があります。赤ランプが点灯していない状態だとssh接続はできないので、要確認。

WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! というエラーがでた人へ

image

OSを入れ直す作業を複数回行っている人はこのようなエラーが出ると思います。 これは、以前設定したホスト名と同じホスト名で再設定すると発生するエラーのようです。 上記のエラーが出た際は以下のコマンドを実行してみましょう。

 ssh-keygen -R "設定したいホスト名"  ##上記のマニュアルだとunvtportable.local となります。

参考資料: https://ryjkmr.com/ssh-warning/ https://blog.janjan.net/2021/04/08/raspberry-os-ssh-error-connect-to-host-port-22-connection-refused/

mapconcierge commented 2 years ago

インストール済み MicroSDカード を RaspberryPi 端末に差し込み起動

パスワードは unvt にしてある

taichi@DRONEBIRD ~ % ssh pi@unvtportable.local
The authenticity of host 'unvtportable.local (fe80::a01:7bba:ad88:7326%en1)' can't be established.
ECDSA key fingerprint is SHA256:Ne6ZQio+CBMdBHB7Rw1BA27l0xtp6oqfJOBGilmTUwQ.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'unvtportable.local,fe80::a01:7bba:ad88:7326%en1' (ECDSA) to the list of known hosts.
pi@unvtportable.local's password: 
Linux unvtportable 5.10.63-v7l+ #1459 SMP Wed Oct 6 16:41:57 BST 2021 armv7l

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.
pi@unvtportable:~ $
スクリーンショット 2022-01-15 10 09 48
mapconcierge commented 2 years ago

環境設定

APTのアップデート

% sudo apt update -y

pi@unvtportable:~ $ sudo apt update -y
Get:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease [15.0 kB]
Get:2 http://archive.raspberrypi.org/debian bullseye InRelease [23.5 kB]
Get:3 http://archive.raspberrypi.org/debian bullseye/main armhf Packages [246 kB]
Get:4 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages [13.2 MB]
Fetched 13.5 MB in 8s (1,604 kB/s)                                                                                                                         
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
44 packages can be upgraded. Run 'apt list --upgradable' to see them.
N: Repository 'http://archive.raspberrypi.org/debian bullseye InRelease' changed its 'Suite' value from 'unstable' to 'stable'
pi@unvtportable:~ $ 
スクリーンショット 2022-01-15 10 15 38

インストール対象のパッケージリスト

Apatch2 インストール

% sudo apt install -y apache2

pi@unvtportable:~ $ sudo apt install -y apache2
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  apache2-bin apache2-data apache2-utils file libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.3-0 libmagic-mgc libmagic1 mailcap
  mime-support ssl-cert
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils file libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.3-0 libmagic-mgc libmagic1
  mailcap mime-support ssl-cert
0 upgraded, 15 newly installed, 0 to remove and 44 not upgraded.
Need to get 2,724 kB of archives.
After this operation, 14.1 MB of additional disk space will be used.
Get:1 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libapr1 armhf 1.7.0-6+deb11u1 [87.1 kB]
Get:2 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf libaprutil1 armhf 1.6.1-5 [81.2 kB]
Get:3 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf libaprutil1-dbd-sqlite3 armhf 1.6.1-5 [17.5 kB]
Get:4 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf libaprutil1-ldap armhf 1.6.1-5 [16.5 kB]
Get:5 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf liblua5.3-0 armhf 5.3.3-1.1+b1 [95.0 kB]
Get:6 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf apache2-bin armhf 2.4.52-1~deb11u2 [1,217 kB]
Get:7 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf apache2-data all 2.4.52-1~deb11u2 [160 kB]
Get:8 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf apache2-utils armhf 2.4.52-1~deb11u2 [256 kB]                                           
Get:9 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf mailcap all 3.69 [31.7 kB]                                                 
Get:10 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf mime-support all 3.66 [10.9 kB]                                           
Get:11 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf apache2 armhf 2.4.52-1~deb11u2 [272 kB]                                                
Get:12 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf libmagic-mgc armhf 1:5.39-3 [273 kB]                                      
Get:13 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf libmagic1 armhf 1:5.39-3 [117 kB]                                         
Get:14 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf file armhf 1:5.39-3 [68.0 kB]                                             
Get:15 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf ssl-cert all 1.1.0+nmu1 [21.0 kB]                                                      
Fetched 2,724 kB in 14s (196 kB/s)                                                                                                                         
Preconfiguring packages ...
Selecting previously unselected package libapr1:armhf.
(Reading database ... 40796 files and directories currently installed.)
Preparing to unpack .../00-libapr1_1.7.0-6+deb11u1_armhf.deb ...
Unpacking libapr1:armhf (1.7.0-6+deb11u1) ...
Selecting previously unselected package libaprutil1:armhf.
Preparing to unpack .../01-libaprutil1_1.6.1-5_armhf.deb ...
Unpacking libaprutil1:armhf (1.6.1-5) ...
Selecting previously unselected package libaprutil1-dbd-sqlite3:armhf.
Preparing to unpack .../02-libaprutil1-dbd-sqlite3_1.6.1-5_armhf.deb ...
Unpacking libaprutil1-dbd-sqlite3:armhf (1.6.1-5) ...
Selecting previously unselected package libaprutil1-ldap:armhf.
Preparing to unpack .../03-libaprutil1-ldap_1.6.1-5_armhf.deb ...
Unpacking libaprutil1-ldap:armhf (1.6.1-5) ...
Selecting previously unselected package liblua5.3-0:armhf.
Preparing to unpack .../04-liblua5.3-0_5.3.3-1.1+b1_armhf.deb ...
Unpacking liblua5.3-0:armhf (5.3.3-1.1+b1) ...
Selecting previously unselected package apache2-bin.
Preparing to unpack .../05-apache2-bin_2.4.52-1~deb11u2_armhf.deb ...
Unpacking apache2-bin (2.4.52-1~deb11u2) ...
Selecting previously unselected package apache2-data.
Preparing to unpack .../06-apache2-data_2.4.52-1~deb11u2_all.deb ...
Unpacking apache2-data (2.4.52-1~deb11u2) ...
Selecting previously unselected package apache2-utils.
Preparing to unpack .../07-apache2-utils_2.4.52-1~deb11u2_armhf.deb ...
Unpacking apache2-utils (2.4.52-1~deb11u2) ...
Selecting previously unselected package mailcap.
Preparing to unpack .../08-mailcap_3.69_all.deb ...
Unpacking mailcap (3.69) ...
Selecting previously unselected package mime-support.
Preparing to unpack .../09-mime-support_3.66_all.deb ...
Unpacking mime-support (3.66) ...
Selecting previously unselected package apache2.
Preparing to unpack .../10-apache2_2.4.52-1~deb11u2_armhf.deb ...
Unpacking apache2 (2.4.52-1~deb11u2) ...
Selecting previously unselected package libmagic-mgc.
Preparing to unpack .../11-libmagic-mgc_1%3a5.39-3_armhf.deb ...
Unpacking libmagic-mgc (1:5.39-3) ...
Selecting previously unselected package libmagic1:armhf.
Preparing to unpack .../12-libmagic1_1%3a5.39-3_armhf.deb ...
Unpacking libmagic1:armhf (1:5.39-3) ...
Selecting previously unselected package file.
Preparing to unpack .../13-file_1%3a5.39-3_armhf.deb ...
Unpacking file (1:5.39-3) ...
Selecting previously unselected package ssl-cert.
Preparing to unpack .../14-ssl-cert_1.1.0+nmu1_all.deb ...
Unpacking ssl-cert (1.1.0+nmu1) ...
Setting up libmagic-mgc (1:5.39-3) ...
Setting up libmagic1:armhf (1:5.39-3) ...
Setting up libapr1:armhf (1.7.0-6+deb11u1) ...
Setting up file (1:5.39-3) ...
Setting up ssl-cert (1.1.0+nmu1) ...
Setting up liblua5.3-0:armhf (5.3.3-1.1+b1) ...
Setting up apache2-data (2.4.52-1~deb11u2) ...
Setting up mailcap (3.69) ...
Setting up libaprutil1:armhf (1.6.1-5) ...
Setting up mime-support (3.66) ...
Setting up libaprutil1-ldap:armhf (1.6.1-5) ...
Setting up libaprutil1-dbd-sqlite3:armhf (1.6.1-5) ...
Setting up apache2-utils (2.4.52-1~deb11u2) ...
Setting up apache2-bin (2.4.52-1~deb11u2) ...
Setting up apache2 (2.4.52-1~deb11u2) ...
Enabling module mpm_event.
Enabling module authz_core.
Enabling module authz_host.
Enabling module authn_core.
Enabling module auth_basic.
Enabling module access_compat.
Enabling module authn_file.
Enabling module authz_user.
Enabling module alias.
Enabling module dir.
Enabling module autoindex.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module filter.
Enabling module deflate.
Enabling module status.
Enabling module reqtimeout.
Enabling conf charset.
Enabling conf localized-error-pages.
Enabling conf other-vhosts-access-log.
Enabling conf security.
Enabling conf serve-cgi-bin.
Enabling site 000-default.
Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /lib/systemd/system/apache2.service.
Created symlink /etc/systemd/system/multi-user.target.wants/apache-htcacheclean.service → /lib/systemd/system/apache-htcacheclean.service.
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.31-13+rpt2+rpi1) ...
pi@unvtportable:~ $ 
スクリーンショット 2022-01-15 10 18 16

hostapd のインストール

% sudo apt install -y hostapd

pi@unvtportable:~ $ sudo apt install -y hostapd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  hostapd
0 upgraded, 1 newly installed, 0 to remove and 44 not upgraded.
Need to get 665 kB of archives.
After this operation, 1,817 kB of additional disk space will be used.
Get:1 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf hostapd armhf 2:2.9.0-21 [665 kB]
Fetched 665 kB in 1s (672 kB/s) 
Selecting previously unselected package hostapd.
(Reading database ... 41576 files and directories currently installed.)
Preparing to unpack .../hostapd_2%3a2.9.0-21_armhf.deb ...
Unpacking hostapd (2:2.9.0-21) ...
Setting up hostapd (2:2.9.0-21) ...
Created symlink /etc/systemd/system/multi-user.target.wants/hostapd.service → /lib/systemd/system/hostapd.service.
Job for hostapd.service failed because the control process exited with error code.
See "systemctl status hostapd.service" and "journalctl -xe" for details.
Created symlink /etc/systemd/system/hostapd.service → /dev/null.
Processing triggers for man-db (2.9.4-2) ...
pi@unvtportable:~ $ 
スクリーンショット 2022-01-15 10 20 51

dnsmasq のインストール

% sudo apt install dnsmasq

pi@unvtportable:~ $ sudo apt install dnsmasq
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  dns-root-data dnsmasq-base libnetfilter-conntrack3 libnfnetlink0
The following NEW packages will be installed:
  dns-root-data dnsmasq dnsmasq-base libnetfilter-conntrack3 libnfnetlink0
0 upgraded, 5 newly installed, 0 to remove and 44 not upgraded.
Need to get 498 kB of archives.
After this operation, 1,159 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf dns-root-data all 2021011101 [5,524 B]
Get:2 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libnfnetlink0 armhf 1.0.1-3+b1 [12.4 kB]
Get:3 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf libnetfilter-conntrack3 armhf 1.0.8-3 [32.5 kB]
Get:4 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf dnsmasq-base armhf 2.85-1 [416 kB]
Get:5 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf dnsmasq all 2.85-1 [32.0 kB]
Fetched 498 kB in 3s (148 kB/s)   
Selecting previously unselected package dns-root-data.
(Reading database ... 41605 files and directories currently installed.)
Preparing to unpack .../dns-root-data_2021011101_all.deb ...
Unpacking dns-root-data (2021011101) ...
Selecting previously unselected package libnfnetlink0:armhf.
Preparing to unpack .../libnfnetlink0_1.0.1-3+b1_armhf.deb ...
Unpacking libnfnetlink0:armhf (1.0.1-3+b1) ...
Selecting previously unselected package libnetfilter-conntrack3:armhf.
Preparing to unpack .../libnetfilter-conntrack3_1.0.8-3_armhf.deb ...
Unpacking libnetfilter-conntrack3:armhf (1.0.8-3) ...
Selecting previously unselected package dnsmasq-base.
Preparing to unpack .../dnsmasq-base_2.85-1_armhf.deb ...
Unpacking dnsmasq-base (2.85-1) ...
Selecting previously unselected package dnsmasq.
Preparing to unpack .../dnsmasq_2.85-1_all.deb ...
Unpacking dnsmasq (2.85-1) ...
Setting up dns-root-data (2021011101) ...
Setting up libnfnetlink0:armhf (1.0.1-3+b1) ...
Setting up libnetfilter-conntrack3:armhf (1.0.8-3) ...
Setting up dnsmasq-base (2.85-1) ...
Setting up dnsmasq (2.85-1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/dnsmasq.service → /lib/systemd/system/dnsmasq.service.
Processing triggers for libc-bin (2.31-13+rpt2+rpi1) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for dbus (1.12.20-2) ...
pi@unvtportable:~ $ 
スクリーンショット 2022-01-15 10 26 57

isc-dhcp-server

% sudo apt install -y isc-dhcp-server

pi@unvtportable:~ $ sudo apt install -y isc-dhcp-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libirs-export161 libisccfg-export163 policycoreutils selinux-utils
Suggested packages:
  isc-dhcp-server-ldap
The following NEW packages will be installed:
  isc-dhcp-server libirs-export161 libisccfg-export163 policycoreutils selinux-utils
0 upgraded, 5 newly installed, 0 to remove and 44 not upgraded.
Need to get 1,592 kB of archives.
After this operation, 6,258 kB of additional disk space will be used.
Get:1 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libisccfg-export163 armhf 1:9.11.19+dfsg-2.1 [263 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libirs-export161 armhf 1:9.11.19+dfsg-2.1 [243 kB]
Get:3 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf isc-dhcp-server armhf 4.4.1-2.3 [463 kB]
Get:4 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf selinux-utils armhf 3.1-3 [135 kB]
Get:5 http://ftp.tsukuba.wide.ad.jp/Linux/raspbian/raspbian bullseye/main armhf policycoreutils armhf 3.1-3 [488 kB]
Fetched 1,592 kB in 3s (493 kB/s)        
Preconfiguring packages ...
Selecting previously unselected package libisccfg-export163.
(Reading database ... 41690 files and directories currently installed.)
Preparing to unpack .../libisccfg-export163_1%3a9.11.19+dfsg-2.1_armhf.deb ...
Unpacking libisccfg-export163 (1:9.11.19+dfsg-2.1) ...
Selecting previously unselected package libirs-export161.
Preparing to unpack .../libirs-export161_1%3a9.11.19+dfsg-2.1_armhf.deb ...
Unpacking libirs-export161 (1:9.11.19+dfsg-2.1) ...
Selecting previously unselected package isc-dhcp-server.
Preparing to unpack .../isc-dhcp-server_4.4.1-2.3_armhf.deb ...
Unpacking isc-dhcp-server (4.4.1-2.3) ...
Selecting previously unselected package selinux-utils.
Preparing to unpack .../selinux-utils_3.1-3_armhf.deb ...
Unpacking selinux-utils (3.1-3) ...
Selecting previously unselected package policycoreutils.
Preparing to unpack .../policycoreutils_3.1-3_armhf.deb ...
Unpacking policycoreutils (3.1-3) ...
Setting up selinux-utils (3.1-3) ...
Setting up policycoreutils (3.1-3) ...
Setting up libisccfg-export163 (1:9.11.19+dfsg-2.1) ...
Setting up libirs-export161 (1:9.11.19+dfsg-2.1) ...
Setting up isc-dhcp-server (4.4.1-2.3) ...
Generating /etc/default/isc-dhcp-server...
Job for isc-dhcp-server.service failed because the control process exited with error code.
See "systemctl status isc-dhcp-server.service" and "journalctl -xe" for details.
invoke-rc.d: initscript isc-dhcp-server, action "start" failed.
● isc-dhcp-server.service - LSB: DHCP server
     Loaded: loaded (/etc/init.d/isc-dhcp-server; generated)
     Active: failed (Result: exit-code) since Sat 2022-01-15 10:31:45 JST; 46ms ago
       Docs: man:systemd-sysv-generator(8)
    Process: 2492 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)
        CPU: 80ms

Jan 15 10:31:43 unvtportable dhcpd[2507]: before submitting a bug.  These pages explain the proper
Jan 15 10:31:43 unvtportable dhcpd[2507]: process and the information we find helpful for debugging.
Jan 15 10:31:43 unvtportable dhcpd[2507]: 
Jan 15 10:31:43 unvtportable dhcpd[2507]: exiting.
Jan 15 10:31:45 unvtportable isc-dhcp-server[2492]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ...
Jan 15 10:31:45 unvtportable isc-dhcp-server[2512]:  failed!
Jan 15 10:31:45 unvtportable isc-dhcp-server[2513]:  failed!
Jan 15 10:31:45 unvtportable systemd[1]: isc-dhcp-server.service: Control process exited, code=exited, status=1/FAILURE
Jan 15 10:31:45 unvtportable systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
Jan 15 10:31:45 unvtportable systemd[1]: Failed to start LSB: DHCP server.
Processing triggers for libc-bin (2.31-13+rpt2+rpi1) ...
Processing triggers for man-db (2.9.4-2) ...
pi@unvtportable:~ $ 
スクリーンショット 2022-01-15 10 33 13

Generating /etc/default/isc-dhcp-server... Job for isc-dhcp-server.service failed because the control process exited with error code.

というエラーがでてきたが無視して続ける

rng-tools

% sudo apt install -y rng-tools

pi@unvtportable:~ $ sudo apt install -y rng-tools
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
rng-tools is already the newest version (5migrate1).
0 upgraded, 0 newly installed, 0 to remove and 44 not upgraded.
pi@unvtportable:~ $ 
スクリーンショット 2022-01-15 10 35 07
mapconcierge commented 2 years ago

Wi-Fiクライアントとしての設定を無効化

wpa_supplicantを止める

sudo systemctl stop wpa_supplicant
sudo systemctl disable wpa_supplicant
pi@unvtportable:~ $ sudo systemctl stop wpa_supplicant
pi@unvtportable:~ $ sudo systemctl disable wpa_supplicant
Removed /etc/systemd/system/dbus-fi.w1.wpa_supplicant1.service.
Removed /etc/systemd/system/multi-user.target.wants/wpa_supplicant.service.
pi@unvtportable:~ $ 
スクリーンショット 2022-01-15 10 38 39

dhcpcdの設定を固定IPに変える

基本戦略

/etc/dhcpcd.conf をエディタで設定書き換える。

pi@unvtportable:/etc $ pwd
/etc
pi@unvtportable:/etc $ vi dhcpcd.conf 
# UNVT Portable settings
# denyinterfaces wlan0
interface wlan0
static ip_address=192.168.10.10/24

# denyinterfaces wlan0 とコメントアウトする!

dhcpcd を再起動

% sudo systemctl restart dhcpcd

スクリーンショット 2022-01-15 10 54 50

hostapdの設定

/etc/hostapd/hostapd.conf の編集

interface=wlan0
driver=nl80211
hw_mode=g
channel=3
ssid=dronebird
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_passphrase=dronebird ##パスワードは8文字以上にしないとエラーがでるよ
rsn_pairwise=CCMP
スクリーンショット 2022-01-15 11 03 55

↑ viエディタの場合

hostapdをデーモンとして動かすときに hostapd.conf を読むように、/etc/default/hostapd を編集

DAEMON_CONF="/etc/hostapd/hostapd.conf"

スクリーンショット 2022-01-15 11 08 04 スクリーンショット 2022-01-15 11 07 40

デーモンを有効化

sudo systemctl unmask hostapd
sudo systemctl enable hostapd
sudo systemctl start hostapd
pi@unvtportable:/etc/default $ sudo systemctl unmask hostapd
Removed /etc/systemd/system/hostapd.service.
pi@unvtportable:/etc/default $ sudo systemctl enable hostapd
Synchronizing state of hostapd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable hostapd
pi@unvtportable:/etc/default $ sudo systemctl start hostapd
pi@unvtportable:/etc/default $ 
スクリーンショット 2022-01-15 11 10 50

isc-dhcp-serverの設定

subnet 192.168.10.0 netmask 255.255.255.0 {
  range 192.168.10.5 192.168.10.200;
  option broadcast-address 192.168.10.255;
  default-lease-time 600;
  max-lease-time 7200;
}
pi@unvtportable:/etc/dhcp $ pwd
/etc/dhcp
pi@unvtportable:/etc/dhcp $ sudo vi dhcpd.conf 
pi@unvtportable:/etc/dhcp $ 
スクリーンショット 2022-01-15 11 22 07

デーモンを起動

sudo systemctl enable isc-dhcp-server
sudo systemctl restart isc-dhcp-server
pi@unvtportable:/etc/dhcp $ sudo systemctl enable isc-dhcp-server
isc-dhcp-server.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable isc-dhcp-server
pi@unvtportable:/etc/dhcp $ sudo systemctl restart isc-dhcp-server
Job for isc-dhcp-server.service failed because the control process exited with error code.
See "systemctl status isc-dhcp-server.service" and "journalctl -xe" for details.
pi@unvtportable:/etc/dhcp $ 
スクリーンショット 2022-01-15 11 26 48
mapconcierge commented 2 years ago

RaspberryPi を電源落として再起動

Wi-Fi 接続

image SSID と WPAパスワード設定は機能している。

DHCP 設定

image

mapconcierge commented 2 years ago

すべての設定を反映させて再起動

sudo systemctl stop wpa_supplicant
sudo systemctl disable wpa_supplicant
sudo systemctl restart dhcpcd
sudo systemctl enable rng-tools
sudo systemctl restart rng-tools
sudo systemctl enable hostapd
sudo systemctl restart hostapd
sudo systemctl enable isc-dhcp-server
sudo systemctl restart isc-dhcp-server
mapconcierge commented 2 years ago

ホスティングしたいデータの FTP転送

/var/www の Permission を一時的に 777 に変更

pi@unvtportable:/var/www $ sudo chmod 777 -R .
pi@unvtportable:/var/www $ ls -al
total 12
drwxrwxrwx  3 root root 4096 Jan 15 10:16 .
drwxr-xr-x 12 root root 4096 Jan 15 10:16 ..
drwxrwxrwx  2 root root 4096 Jan 15 10:16 html

CyberduckでSFTPデータ転送

Cyberduck を使って SFTP (ポート番号22) で

スクリーンショット 2022-01-15 12 17 14