neofetch is a Terminal-based tools to displays information about your operating system, software and hardware in visual way.
To install neofetch to Raspberry Pi OS, enter the command:
$ sudo apt install neofetch
neofetch is a Terminal-based tools to displays information about your operating system, software and hardware in visual way.
To install neofetch to Raspberry Pi OS, enter the command:
$ sudo apt install neofetch
iPerf3 is a tool for active measurements of the maximum achievable bandwidth on IP networks. It supports tuning of various parameters related to timing, buffers and protocols (TCP, UDP, SCTP with IPv4 and IPv6). For each test it reports the bandwidth, loss, and other parameters.
This post show how to run iPerf3 on two Raspberry Pi to check the network speed between.
On both Raspberry Pi, install iPerf3 by entering command in Terminal:
$ sudo apt install iperf3
$ iperf3 -s
$ iperf3 -c <server ip>
import os
import matplotlib.pyplot as plt
from drawnow import *
# Run on Raspberry Pi 2
# 4 CPUs
cpu0Freq = []
cpu1Freq = []
cpu2Freq = []
cpu3Freq = []
plt.ion()
cnt=0
def plotCpuFreq():
plt.ylim(0,1500000)
plt.title('Raspberry Pi 2 CPUs Frequency')
plt.grid(True)
plt.ylabel('KHz')
plt.plot(cpu0Freq, 'r^-', label='cpu0')
plt.plot(cpu1Freq, 'c>-', label='cpu1')
plt.plot(cpu2Freq, 'bv-', label='cpu2')
plt.plot(cpu3Freq, 'm<-', label='cpu3')
plt.legend(loc='upper right')
#pre-load dummy data
for i in range(0,100):
cpu0Freq.append(0)
cpu1Freq.append(0)
cpu2Freq.append(0)
cpu3Freq.append(0)
while True:
cpu0 = os.popen("awk '{print $1}' /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq").readline()
cpu1 = os.popen("awk '{print $1}' /sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq").readline()
cpu2 = os.popen("awk '{print $1}' /sys/devices/system/cpu/cpu2/cpufreq/scaling_cur_freq").readline()
cpu3 = os.popen("awk '{print $1}' /sys/devices/system/cpu/cpu3/cpufreq/scaling_cur_freq").readline()
print(cpu0 + " " + cpu1 + " " + cpu2 + " " + cpu3)
cpu0Freq.append(cpu0)
cpu0Freq.pop(0)
cpu1Freq.append(cpu1)
cpu1Freq.pop(0)
cpu2Freq.append(cpu2)
cpu2Freq.pop(0)
cpu3Freq.append(cpu3)
cpu3Freq.pop(0)
drawnow(plotCpuFreq)
plt.pause(1)
import os
import matplotlib.pyplot as plt
from drawnow import *
# Run on Dual Core Atom
# with 2 CPU
cpu0Freq = []
cpu1Freq = []
plt.ion()
cnt=0
def plotCpuFreq():
plt.ylim(0,2000000)
plt.title('Dual Core CPUs Frequency')
plt.grid(True)
plt.ylabel('KHz')
plt.plot(cpu0Freq, 'r^-', label='cpu0')
plt.plot(cpu1Freq, 'c>-', label='cpu1')
plt.legend(loc='upper right')
#pre-load dummy data
for i in range(0,100):
cpu0Freq.append(0)
cpu1Freq.append(0)
while True:
cpu0 = os.popen("awk '{print $1}' /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq").readline()
cpu1 = os.popen("awk '{print $1}' /sys/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq").readline()
print(cpu0 + " " + cpu1)
cpu0Freq.append(cpu0)
cpu0Freq.pop(0)
cpu1Freq.append(cpu1)
cpu1Freq.pop(0)
drawnow(plotCpuFreq)
plt.pause(1)
#Linux command free - Display amount of free and used memory in the system
# Example:
#pi@raspberrypi ~ $ free -h
# total used free shared buffers cached
#Mem: 863M 272M 591M 0B 19M 174M
#-/+ buffers/cache: 77M 785M
#Swap: 99M 0B 99M
#
# This sample run "free -h" in Python and get the result
import os
def getFreeDescription():
free = os.popen("free -h")
i = 0
while True:
i = i + 1
line = free.readline()
if i==1:
return(line.split()[0:7])
def getFree():
free = os.popen("free -h")
i = 0
while True:
i = i + 1
line = free.readline()
if i==2:
return(line.split()[0:7])
# Disk information
description = getFreeDescription()
mem = getFree()
print(description)
print(mem)
print(description[0] + " : " + mem[1])
print(description[1] + " : " + mem[2])
print(description[2] + " : " + mem[3])
print(description[3] + " : " + mem[4])
print(description[4] + " : " + mem[5])
print(description[5] + " : " + mem[6])
![]() |
| UNIX Tutorial for Beginners |