LoginSignup
15
3

More than 3 years have passed since last update.

Raspberry Pi 3B/3B+/4Bの機種判別(Raspbian Buster)

Last updated at Posted at 2019-12-06

Raspberry Pi 3B/3B+の機種判別(Raspbian Buster)

ぱっと、インターネットを調べたところ誰も書いていなかったので記述。(RaspberryPi公式フォーラムのQAにはRaspberryPi2シリーズの出力例載っていたが、3は載っていなかった。。。)

SBC(シングルボードコンピュータ)愛好家であれば、Raspberry Pi3Bと3B+が混在環境を自宅に持っている!!という方も意外と多いのではないかと思います(???)

この機種判別が何の役に立つか?

  1. Wi-Fi設定の使い分けなどに使えるかも。(3Bだと2.4GHz、3B+だと5GHzに自動接続するようにするなど。)
  2. ~/.bashrcPS1=に追加して誤操作防止に役立てる。
  3. その他、きっと何かあるはず。きっと。

判別方法

/proc/device-tree/modelにモデル名が記述されています。3B+はモデル名に「Plus」が入る点、Revが「1.3」になっている点が異なります。

Raspberry Pi 3B

$ cat /proc/device-tree/model 
Raspberry Pi 3 Model B Rev 1.2

Raspberry Pi 3B+

$ cat /proc/device-tree/model
Raspberry Pi 3 Model B Plus Rev 1.3

Raspberry Pi 4B

$ cat /proc/device-tree/model
Raspberry Pi 4 Model B Rev 1.2

正規表現

3B+に引っ掛けるとするとこんな感じ。

^Raspberry Pi 3 Model B Plus Rev \d+(?:\.\d+)?$
15
3
2

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
15
3