1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

個人的raspberry pi ネットワーク設定

Last updated at Posted at 2021-06-13

サーバーの書き込みの設定

  • Read Onlyでロック
  • Read Writeでロック解除
  • Overlayは常にDisabledにすべき
  • 設定変更後、再起動することで反映される
    image.png

サーバーSSID変更

  • コマンドラインで、sudo nano /etc/hostapd/hostapd.confと入力
  • SSID= 設定したいSSID に変更
  • ctrl+Xを入力後、Yを入力しEnterで最初のコマンドラインの画面に戻る。
  • sudo reboot と入力し再起動、再起動後任意のSSIDで起動する。

image.png

子機の書き込みの設定

  • 子機起動後、コマンドラインで以下のコマンドを入力
  • 再起動後、設定が反映される

書き込み許可


# !/bin/sh

if [ -e /mnt/boot-ro/config.txt ]; then
    sudo mount -o remount,rw /dev/mmcblk0p1
    sudo grep -v initramfs /mnt/boot-ro/config.txt >/tmp/config.txt
    sudo cp /tmp/config.txt /mnt/boot-ro/config.txt
    sudo reboot
else
    echo Already write enabled
fi

書き込み禁止

  • 書き込み禁止にする際はPythonのコードを起動時に実行するように保存したおいたら便利
cd ../ 
cd ../ 
sudo cp home/pi/Desktop/test.py opt/test.py

# !/bin/sh

if [ -e /mnt/boot-ro/config.txt ]; then
    echo Already write protected
else
    sudo grep -v initramfs /boot/config.txt >/tmp/config.txt
    sudo echo initramfs initrd.gz >> /tmp/config.txt
    sudo cp /tmp/config.txt /boot/config.txt
    sudo reboot
fi

子機の接続先SSID変更

  • コマンドラインでsudo nano /etc/wpa_supplicant/wpa_supplicant.confと入力
  • SSIDの箇所を接続したいSSIDに変更
  • ctrl+Xを入力後、Yを入力しEnterで最初のコマンドラインの画面に戻る。
  • sudo reboot と入力し再起動、再起動後任意のSSIDに接続する。

image.png

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?