Raspberry Pi Model: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
Created page with "To display the model of the Raspberry Pi run the following script. <pre> vi /usr/bin/model </pre> Add the following lines. <pre> #!/bin/bash model=$(cat /proc/cpuinfo | gre..."
 
No edit summary
Line 1: Line 1:
The script is based on the page [http://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/ Checking Your Raspberry Pi Board Version]<br><br>
To display the model of the Raspberry Pi run the following script.
To display the model of the Raspberry Pi run the following script.
<pre>
<pre>

Revision as of 03:26, 15 May 2016

The script is based on the page Checking Your Raspberry Pi Board Version

To display the model of the Raspberry Pi run the following script.

vi /usr/bin/model

Add the following lines.

#!/bin/bash

model=$(cat /proc/cpuinfo | grep  "Rev")
model=${model##*: }

if [ $model = "0002" ]
then
   echo "Model B Revision 1.0"
fi

if [ $model = "0003" ]
then
   echo "Model B Revision 1.0 + ECN0001 (no fuses, D14 removed"
fi

if [ $model = "0004" ] || [ $model = "0005" ] || [ $model = "0006" ]
then
   echo "Model B Revision 2.0 Mounting holes"
fi

if [ $model = "0007" ] || [ $model = "0008" ] || [ $model = "0009" ]
then
   echo "Model A Mounting holes"
fi

if [ $model = "000d" ] || [ $model = "000e" ] || [ $model = "000f" ]
then
   echo "Model B Revision 2.0 with Mounting holes"
fi

if [ $model = "0010" ]
then
   echo "Model B+"
fi

if [ $model = "0011" ]
then
   echo "compute Module"
fi

if [ $model = "0012" ]
then
   echo "Model A+"
fi

if [ $model = "a01041" ]
then
   echo "P2 Model B, Sony UK Built"
fi

if [ $model = "a21041" ]
then
   echo "P2 Model B, Embest China Built"
fi

if [ $model = "900092" ]
then
   echo "PiZero"
fi

if [ $model = "a02082" ]
then
   echo "Pi 3 Model B, Sony UK Built"
fi

if [ $model = "a22082" ]
then
   echo "Pi 3 Model B, Embest China Built"
fi
chmod +x /usr/bin/model