Follow by Email

Blog Archive

Search This Blog

Get all information about your Raspberry Pi

Get system information Reinstall vcgencmd information about the processor information about the RAM information about the SD memory card Identify Linux distribution and release
Share it:
Raspberry Pi Get information

Get system information
On the command line you can read system values and hardware information. Unfortunately, there is no tool that combines all the information about the system. For this, the information in the system is available at various points. Sometimes you need tools to read this information.
Which Raspberry Pi model?
The following command indicates which model is used exactly.
cat / sys / firmware / devicetree / base / model
If you want to know the model and revision number of the board, the following command is suitable. As a rule you can not do much with the output code.
cat / proc / cmdline | awk -v RS = "" -F = '/ boardrev / {print $ 2}'
Read out activated video codecs
Especially those who want to run Raspberry Pi as a media center is important to know which video codecs are unlocked.
vcgencmd codec_enabled {CODEC}
For "codec_enabled" there are the following parameters: H264, MPG2, WVC1, MPG4, MJPG and WMV9.

Determine hardware information
To get extensive hardware information is the tool "lshw" that you usually have to install later.
sudo apt-get install lshw
The complete list of hardware information or page-by-page presentation:
sudo lshw
sudo lshw | less
Which Raspberry Pi is used?
sudo lshw | grep "product:" -m 1
Information about the network interface:
sudo lshw | tail -n 9 | grep -iE "size | capacity | capabilities | speed"
Read system values with "vcgencmd"
The firmware installed for Raspberry Pi comes with a small program called "vcgencmd". This allows system values and hardware information to be read from the command line. The tool does not provide comprehensive information, but mainly information about the processor. Let's look at what you can experience with this little helper.
vcgencmd commands
Since one can not do anything with the individual commands, we then go through some of them in turn.

The current configuration can be displayed as follows.
vcgencmd get_config int
The current firmware version:
vcgencmd version
Information about the boot configuration
The boot configuration of Raspberry Pi is located in the file /boot/config.txt.
cat /boot/config.txt

Here you should only change something, if you really know what you are doing. Misconfigurations can cause Raspberry Pi to become unusable.
Information about running processes
Display the own processes that have been started in the current terminal:
ps
Show all processes running in the background:
ps aux
ps auxw
This command shows the processes of all users (a), with name (u), also the processes that are not bound to a terminal (x) and uses the full width (w).

Variant in the tree view, in order to be able to recognize the dependencies of the processes:
ps axjf
Provides a clearer presentation with less details:
 pstree

View a specific user's process:
ps -fu {USERNAME}
Further system information
There are other commands and tools that can be used to read system values.
Reinstall vcgencmd
The firmware of Raspberry Pi is equipped with "vcgencmd", a tool that can be read on the command line system values and hardware information. "vcgencmd" should be present at an official distribution of Raspbian.

It may be that the command "vcgencmd" does not exist for some reason ("vcgencmd: command not found" or "vcgencmd: command not found"). In such a case you have to install it later. 
But that's not so easy, because it is a tool that comes with the firmware. One would have to install so the current firmware. That's what you do with "rpi-update". The experienced Raspberry Pi user will have a hard time swallowing this thought. Because the command "rpi-update" is to be treated with caution. With that you can shoot your system. A "rpi-udpate" may be playing an unstable firmware version that is malfunctioning.
Those who follow the step-by-step instructions below will reduce the risk of having an unusable system afterwards.

First, we recommend to do an update & upgrade:
sudo apt-get update
sudo apt-get upgrade

Then look at the information about the current firmware:

apt-cache policy libraspberrypi-bin
The version numbers behind "Installed" and "Installer Candidate" should be the same. This means that you would play in a "rpi-update" the currently installed firmware version. There is no change made to the firmware. The data loaded would still be written to the SD card. Among other things, the tool "vcgencmd".

If the version numbers are not identical, then you should refrain from a "rpi-update". Only if the version numbers are identical, nothing speaks against a "rpi update" to carry out, if one wants to install "vcgencmd" afterwards.
sudo rpi update
The initiated firmware update may take a few minutes. After that, a restart is due.
sudo reboot
In general, the restart will go through without any problems. Then the command "vcgencmd" is available again on the command line.
vcgencmd version

Raspberry Pi: Get information about the processor
On the command line you can read processor information. Unfortunately, there is no tool that combines all the information about the processor. For this, the information in the system is available at various points. Sometimes you need tools to read this information.

General processor information
The following command displays information about the CPU being used. Depending on the system you get here more or less useful information.
cat / proc / cpuinfo
Here you get information about the model and the hardware name of the manufacturer. Here is the information that it is for example an ARMv6 or ARMv7 compatible processor.

Number of processor cores:
cat / proc / cpuinfo | grep processor | wc -l
Another command that gives information about the CPU:
lscpu
Temperature of the processor
Current temperature of the SoC in Celsius:
vcgencmd measure_temp
Current temperature:
cat / sys / class / thermal / thermal_zone0 / temp
Voltage and clock frequency
Clock frequency support:
dmesg | grep -i bcm2835-cpufreq
Current voltage of the processor:
vcgencmd measure_volts
Current frequency of the processor:
vcgencmd measure_clock arm
Clock frequencies and utilization (statistical values)
Further processor information can be displayed with the command "cpufreq-info", which is part of the "cpufrequtils". 
Unfortunately, "cpufrequtils" installs itself as a service, which you do not necessarily want. It is recommended that you uninstall these tools when not in use to save disk space and processing power.

Install tools:
sudo apt-get install cpufrequtils
Uninstall Tool:
sudo apt-get purge cpufrequtils
A nice overview of the clock frequencies of the processor cores:
cpufreq-info
The ad can be somewhat limited and thus clearer:
cpufreq-info | grep -iE "analyze | possible clock frequencies | statistics"
Processor usage
The command "top" gives information about the load of the processor:
Top
A table with all currently running processes is displayed. Most of them will currently consume little processor power (in the table column% CPU). 
The current total load can be read in the second line of the output. There the line starts with "% Cpu". The sum of "us" and "sy" gives the total CPU utilization.
"Shift + M" sorts the list according to the memory usage. With "Ctrl + C" you end "top".

Raspberry Pi: Get information about the RAM
Sometimes it's not the processor if a Raspberry Pi is slow. This can also be due to the low memory. When it gets so crowded, data is swapped into the swap file, which automatically slows down the system. 
In the productive use of Raspberry Pi one should be able to check the utilization of the main memory.
Task
  • What is the memory usage?
  • What is the current memory usage of individual programs and processes?
  • How to get detailed information about memory usage and swap behavior?
  • How is shared memory distributed?
Solution: Free and used space
The command "free" provides information about the working memory:
free
The values are output in bytes.

                           totally used free shared buffers cached
   Mem: 447996 409400 38596 0 45148 302192
   - / + buffers / cache: 62060 385936
   Swap: 102396 0 102396
If you want the values in MByte right away:
free -m -t
                          totally used free shared buffers cached
   Mem: 437 400 37 0 44 295
   - / + buffers / cache: 60 376
   Swap: 99 0 99
   Total: 537 400 137
The interesting information can be found in the line with "Mem". This refers to the main memory / main memory. The total is 437 MB (total), of which 37 MB (free) are free. 
It is important to remember that these values represent a snapshot and can change at any time. 
Actually one expects a main memory of 512 MByte (model B). For this you have to know that a few megabytes are diverted to the graphics memory. In this case 64 MB.
Explanation of the information of "free"
Solution: Memory usage by programs
The command "top" gives information about the load of the processor:
Top
A table with all currently running processes is displayed. With "Shift + M" one sorts the list according to the memory allocation. With "Ctrl + C" you end "top".

Solution: Memory usage and swap behavior
Learn more about memory usage and swap behavior
cat / proc / meminfo
In contrast to "free" you get even more information about the space allocation. Here you can see if there is enough memory. This is the case when no or little swap space is occupied. That the "free memory" is displayed with almost zero is normal on Linux.
Solution: Distribution of shared memory
Raspberry Pi needs to share the available RAM for the memory of the processor and the GPU. The distribution is obtained with the following command:
vcgencmd get_mem arm && vcgencmd get_mem gpu
The output takes place in MByte.
Raspberry Pi: Get information about the SD memory card
Usually you know how much capacity an SD memory card has. Is finally printed on the top. But how much is still free? This is an interesting question in particular if software has already been installed several times and new data is constantly being saved.

task
What is the total storage space on the SD memory card?
How big is the free storage capacity?
Solution: Free and used storage capacity
On Linux, the df tool (for disk free) displays the total, used, and free disk space of drives. The information is in kByte.
df
It becomes easier to read (rounded values) with additional parameters.
df -h
Here are several drives. The most important drive can be recognized by the "/" in the column "Mounted on" or "Mounted on". 
The first column tells you how big the storage space is. The second column says how much is occupied and the third how much is left.

Raspberry Pi: Identify Linux distribution and release
To use a Raspberry Pi, Raspbian should be used as a Linux distribution. But for some solutions, another Linux distribution is better. For example, RaspBMC, OpenElec, Pidora, Risc OS, Arch Linux or maybe even Kali Linux. From the outside you can not see a Linux, which Linux is installed.

But if you do not already know a system, it is good to know which Linux distribution and which release it is. And maybe even which Linux kernel is installed. Especially with Raspberry Pi, the firmware version is still interesting.
Task
  • Which Linux distribution and release is installed?
  • Which kernel version is installed?
  • Which firmware version is installed?
Solution: Read Linux distribution and release
The information about the installed Linux distribution and the release can be found in the file "/ etc / os-release".
cat / etc / os-release
Example output for the Linux distribution Raspbian with the release Wheezy.
PRETTY_NAME = "Raspbian GNU / Linux 7 (wheezy)"

NAME = "Raspbian GNU / Linux"
VERSION_ID = "7"
VERSION = "7 (wheezy)"
ID = raspbian
ID_LIKE = debian
ANSI_COLOR = "1 31"
HOME_URL = "http://www.raspbian.org/"
SUPPORT_URL = "http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL = "http://www.raspbian.org/RaspbianBugs"
Example output for the Linux distribution Raspbian with the release Jessie.
PRETTY_NAME = "Raspbian GNU / Linux 8 (jessie)"
NAME = "Raspbian GNU / Linux"
VERSION_ID = "8"
VERSION = "8 (jessie)"
ID = raspbian
ID_LIKE = debian 
HOME_URL = "http: //www.raspbian. org / "
SUPPORT_URL =" http://www.raspbian.org/RaspbianForums "
BUG_REPORT_URL =" http://www.raspbian.org/RaspbianBugs "
A comparable information you get with:
cat / etc / issue
Solution: Read Linux kernel version
In general, the distribution is independent of the Linux kernel. That is, the distribution release does not support the kernel. If you want to know exactly, then "uname" helps.
uname -a
The command line gives something like this:
Linux raspi 3.12.22+ # 691 PREEMPT Wed Jun 18 18:29:58 BST 2014 armv6l GNU / Linux
or
Linux jessie 4.1.7-v7 + # 817 SMP PREEMPT Sat Sep 19 15:32:00 BST 2015 armv7l GNU / Linux
Two things are interesting here. Once the version number of the Linux kernel that comes in third place. And the processor architecture on which Raspberry Pi runs. Recognizable by "armv61" and "armv71". The second edition is a Raspberry Pi version 2. The previous edition is from the previous version.

If you only want the kernel version:
uname -r
A little more detailed, but less clear is:
cat / proc / version
Solution: Read the firmware version of Raspberry Pi
Sometimes you want to know which firmware version is installed on the SD memory card that runs Raspberry Pi. For this, the tool "vcgencmd" has an output parameter on the command line.
vcgencmd version
The command line gives something like this:
Sep 23 2015 12:12:01 
Copyright (c) 2012 Broadcom 
version c156d00b148c30a3ba28ec376c9c01e95a77d6d5 (clean) (release)
Here the date is interesting and the version number in hexadecimal notation.

Solution: Everything at a glance
To get system information you have to enter several commands. The following command collects the most important information at once: host name, operating system, kernel version, and hardware architecture.
hostnamectl


Share it:

Raspberry Pi

Post A Comment:

0 comments: