樹莓派查看型號的小技巧

樹莓派是一款來源於英國慈善組織“Raspberry Pi 基金會”的卡片電腦,至今已經發行在售了 9 個型號:

  • Pi 4 Model B
  • Pi 3 Model A+
  • Pi 3 Model B+
  • Pi 3 Model B
  • Pi 2 Model B
  • Pi 1 Model B+
  • Pi 1 Model A+
  • Pi Zero W
  • Pi Zero

不同型號之間的功能和性能都有比較大的差別。

通常,我們可以從樹莓派板卡外觀直接分辨型號,但是有些型號外觀差異比較小,不是特別容易區分,比如 3B+ 和 3B:

樹莓派查看型號的小技巧

從外觀區分不出來,或者接觸不到樹莓派真實板卡(比如遠程登錄)的情況下,官方介紹了一種命令行方法,可以非常精確地知道板卡信息。

在命令行中輸入:

<code>cat /proc/cpuinfo/<code>

會打印類似下面的信息:

<code>Revision    : a03111Model: Raspberry Pi 4 Model B Rev 1.1/<code>

Revision 是板卡型號編碼,Model 是型號名稱。編碼對應表如下:

樹莓派查看型號的小技巧

這裡貼一張我的樹莓派的 /proc/cpuinfo 信息截圖(正在遠程登錄中):

樹莓派查看型號的小技巧

注意事項

cat /proc/cpuinfo 打印的信息裡面,包含 Hardware: BCM2835 硬件架構碼,但這並不是 CPU 型號,而是 Linux 內核內置的,代表樹莓派系列的硬件架構碼。

這個官方也解釋過了:

Why does cpuinfo report I have a BCM2835? The upstream Linux kernel developers had decided that all models of Raspberry Pi return bcm2835 as the SoC name. At Raspberry Pi we like to use as much upstream kernel code as possible, as it makes software maintenance much easier, so we use this code. Unfortunately it means that cat /proc/cpuinfo is inaccurate for the Raspberry Pi 2, Raspberry Pi 3 and Raspberry Pi 4, which use the bcm2836/bcm2837, bcm2837 and bcm2711 respectively. You can use cat /proc/device-tree/model to get an accurate description of the SoC on your Raspberry Pi model.

FAQs - Raspberry Pi Documentation

  • RPi HardwareHistory - eLinux.org
  • Buy a Raspberry Pi – Raspberry Pi
  • FAQs - Raspberry Pi Documentation
  • cat /proc/cpuinfo | grep Hardware on a Pi 4 returns BCM2835, should be BCM2711? · Issue #3022 · raspberrypi/linux
  • Raspberry Pi revision codes - Raspberry Pi Documentation


分享到:


相關文章: