Raspberry Pi Model: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
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>
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>
<pre> cat /proc/device-tree/model </pre>
= Deprecated =
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>
Line 10: Line 15:
#!/bin/bash
#!/bin/bash


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


Line 16: Line 21:
serial=${serial##*: }
serial=${serial##*: }


if [ $model = "0002" ]
echo -e '\n'
echo '-----------------------------------'
 
if [ "$model" = "0002" ]
then
  echo "Model B Revision 1.0, 256MB RAM"
fi
 
if [ "$model" = "0003" ]
then
then
   echo "Model B Revision 1.0"
   echo "Model B Revision 1.0 + ECN0001 (no fuses, D14 removed), 256MB RAM"
fi
fi


if [ $model = "0003" ]
if [ "$model" = "0004" ] || [ "$model" = "0005" ] || [ "$model" = "0006" ]
then
then
   echo "Model B Revision 1.0 + ECN0001 (no fuses, D14 removed)"
   echo "Model B Revision 2.0 Mounting holes, 256 MB RAM"
fi
fi


if [ $model = "0004" ] || [ $model = "0005" ] || [ $model = "0006" ]
if [ "$model" = "0007" ] || [ "$model" = "0008" ] || [ "$model" = "0009" ]
then
then
   echo "Model B Revision 2.0 Mounting holes"
   echo "Model A Mounting holes, 256 MB RAM"
fi
fi


if [ $model = "0007" ] || [ $model = "0008" ] || [ $model = "0009" ]
if [ "$model" = "000d" ] || [ "$model" = "000e" ] || [ "$model" = "000f" ]
then
then
   echo "Model A Mounting holes"
   echo "Model B Revision 2.0 with Mounting holes, 256 MB RAM"
fi
fi


if [ $model = "000d" ] || [ $model = "000e" ] || [ $model = "000f" ]
if [ "$model" = "0010" ] || [ "$model" = "0013" ] || [ "$model" = "900032" ]
then
then
   echo "Model B Revision 2.0 with Mounting holes"
   echo "Model B+, 512 MB RAM"
fi
fi


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


if [ $model = "0011" ]
if [ "$model" = "0012" ]
then
then
   echo "compute Module"
   echo "Model A+, 256MB RAM"
fi
fi


if [ $model = "0012" ]
if [ "$model" = "0014" ]
then
then
   echo "Model A+"
   echo "Compute Module, Embest, china, 256 MB RAM"
fi
fi


if [ $model = "a01041" ]
if [ "$model" = "0015" ]
then
then
   echo "P2 Model B, Sony UK Built"
   echo "Module A+, Embest, China, 256 or 512 MB RAM"
fi
fi


if [ $model = "a21041" ]
if [ "$model" = "a01041" ]
then
then
   echo "P2 Model B, Embest China Built"
   echo "P2 Model B V1.1, 1GB RAM, Sony UK Built"
fi
fi


if [ $model = "900092" ]
if [ "$model" = "a21041" ]
then
  echo "P2 Model B V1.1, 1GB RAM, Embest China Built"
fi
 
if [ "$model" = "a22042" ]
then
  echo "P2 Model B V1.2, 1GB RAM"
fi
 
if [ "$model" = "900092" ]
then
then
   echo "PiZero"
   echo "PiZero"
fi
fi


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


if [ $model = "a22082" ]
if [ "$model" = "a22082" ]
then
then
   echo "Pi 3 Model B, Embest China Built"
   echo "Pi 3 Model B, Embest China Built"
fi
fi
if [ "$model" = "a020d3" ]
then
  echo "Pi 3 Model B+, Sony UK"
fi
if [ "$model" = "a03111" ]
then
  echo "Pi 4 rev 1.1, 1GB RAM, Sony UK"
fi
if [ "$model" = "b03111" ]
then
  echo "Pi 4 rev 1.1, 2GB RAM, Sony UK"
fi
if [ "$model" = "b03112" ]
then
  echo "Pi 4 rev 1.2, 2GB RAM, Sony UK"
fi
if [ "$model" = "c03111" ]
then
  echo "Pi 4 rev 1.1, 4GB RAM, Sony UK"
fi
if [ "$model" = "c03112" ]
then
  echo "Pi 4 rev 1.2, 4GB RAM, Sony UK"
fi
if [ "$model" = "c03130" ]
then
  echo "Pi 400 rev 1.0, 4GB RAM, Sony UK"
fi


echo Serial Number : $serial
echo Serial Number : $serial
echo '-----------------------------------'
echo -e '\n'
</pre>
</pre>
<pre>
<pre>
chmod +x /usr/bin/model
chmod +x /usr/bin/model
</pre>
</pre>
[[Category : Raspberry Pi]]

Latest revision as of 04:51, 20 June 2023

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

 cat /proc/device-tree/model 

Deprecated

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  "Revi")
model=${model##*: }

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

echo -e '\n'
echo '-----------------------------------'

if [ "$model" = "0002" ]
then
   echo "Model B Revision 1.0, 256MB RAM"
fi

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

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

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

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

if [ "$model" = "0010" ] || [ "$model" = "0013" ] || [ "$model" = "900032" ]
then
   echo "Model B+, 512 MB RAM"
fi

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

if [ "$model" = "0012" ]
then
   echo "Model A+, 256MB RAM"
fi

if [ "$model" = "0014" ]
then
   echo "Compute Module, Embest, china, 256 MB RAM"
fi

if [ "$model" = "0015" ]
then
   echo "Module A+, Embest, China, 256 or 512 MB RAM"
fi

if [ "$model" = "a01041" ]
then
   echo "P2 Model B V1.1, 1GB RAM, Sony UK Built"
fi

if [ "$model" = "a21041" ]
then
   echo "P2 Model B V1.1, 1GB RAM, Embest China Built"
fi

if [ "$model" = "a22042" ]
then
   echo "P2 Model B V1.2, 1GB RAM"
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

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

if [ "$model" = "a03111" ]
then
   echo "Pi 4 rev 1.1, 1GB RAM, Sony UK"
fi

if [ "$model" = "b03111" ]
then
   echo "Pi 4 rev 1.1, 2GB RAM, Sony UK"
fi

if [ "$model" = "b03112" ]
then
   echo "Pi 4 rev 1.2, 2GB RAM, Sony UK"
fi

if [ "$model" = "c03111" ]
then
   echo "Pi 4 rev 1.1, 4GB RAM, Sony UK"
fi

if [ "$model" = "c03112" ]
then
   echo "Pi 4 rev 1.2, 4GB RAM, Sony UK"
fi

if [ "$model" = "c03130" ]
then
   echo "Pi 400 rev 1.0, 4GB RAM, Sony UK"
fi


echo Serial Number : $serial

echo '-----------------------------------'
echo -e '\n'
chmod +x /usr/bin/model