0
1

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 1 year has passed since last update.

Raspberry Pi4 便利な使い方

Last updated at Posted at 2021-10-03

はじめに
Raspberry Pi4 を使うにあたり 必要になった便利な機能を書きとめる。


1:IPアドレスを得る (ip a コマンド)
  lo: (ローカル IPアドレス)
  eth:(有線LAN IPアドレス)
  wlan0:(無線LAN IPアドレス)

$ ip a
  1. lo: **********
     **************
     inet 127.0.0.1/*****
     **************

  2. eth: *********
     **************
     inet 192.x.x.x/*****
     **************

  3. wlan0: *********
     **************
     inet 192.x.x.x/*****
     **************


2:スクリーンショット (scrot -cd "time")
  ※下記は、5後にスクリーンショットがされる。
  画面は、/home/pi の直下に置かれる。

$ scrot -cd 5 

3:画面の自動オフ機能を無効にする
  [Raspberry Piの設定] 画面を開き [ディスプレイ] で [画面のブランク] を無効にする。
image.png

image.png


4:外部からのアクセスを SSH/VNC を使ってリモート接続を可能にする
[Raspberry Piの設定] 画面を開き [インターフェース] で [SSH]/[VNC] を有効にする。
※SSHは、Tera Term を用いる
※VNCのツール(ホスト側)は、ここから ダウンロードする。
※username は、[pi]  
image.png
image.png

*) 直近(2022年9月1日) NVCを使用する時、以下の事が必要 Raspberry pi 側で NVC Viewer を起動させ右上のメニューから[Option]-[Security]の項目で [Authentication] で [NVC Password] を選ぶ。[Apply]で NVC用のPassword入力を求められるので入力する

5:Raspberry Pi のピン配置確認

$ pinout

2021-10-12-120054_1920x1080_scrot.png

6:Raspberry Pi ピン配置の詳細説明は、こちらから(https://pinout.xyz/)


7:boot/config.txt の編集方法

$ sudo nano /boot/config.txt

8:GPIO の情報を得る

$ raspi-gpio get

9:UART の設定
   デフォルトでは、GPIO14がUART-TX / GPIO15がUART-RX のみとなっているが
   Config.txt を以下の様に設定すると COM ポートが 2個同時に使える。

COM Port /dev/ttyS0 : GPIO14 (UART TX) / GPIO15 (UART RX)
COM Port /dev/ttyAMA1: GPIO0 (UART TX) / GPIO1 (UART RX)

 [all]
  enable_uart=1
  dtoverlay=uart2

UARTの設定 (Port, GPIOの割振りなど) は、下記のページが非常に詳しく参考になった。
https://toki-blog.com/pi-serial/


☆2021年10月 3日(日) 午前 9時00分 初版 (Ver1.00) 作成
☆2021年10月12日(日) 午前 1時30分 v1.10作成 (項目:5, 6追加)
☆2021年11月19日(金) 午前11時35分 v1.20作成 (項目:7, 8、9追加)
☆2021年12月10日(金) 午前14時20分 v1.21作成 (項目:9修正)
☆2021年12月27日(金) 午前11時40分 v1.22作成 (項目:9修正)


0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?