Show temperature of Rasp Pi:
$ cat /sys/class/thermal/thermal_zone0/temp
53692
- This means 53.6 degC : i.e. you have to divide by 1000 to get the temp in degC :
BOB=`cat /sys/class/thermal/thermal_zone0/temp`
expr $BOB / 1000 # divide by 1000
to use ‘sar’ for recording system performance:
# apt install sysstat
- (optional) set it to run every 5min instead of 10min in
/etc/cron.d/sysstat - change
ENABLED="false"to “true” in/etc/default/sysstat
# systemctl enable sysstat
# systemctl start sysstat
- Then use
sar -uor similar , to check it’s working
to use Pi’s serial port :
- enable Pi’s UART :
- remove the phrase
console=serial0,115200from /boot/cmdline.txt - add
enable_uart=1to /boot/config.txt and reboot Pi.
apt install screen
$ screen /dev/serial0 115200
- Ctl-A then k to quit
- to scroll back : Ctl-A then Esc ; then use Up and Down arrows to scroll
to find device name of USB stick:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 29.8G 0 disk
└─sda1 8:1 0 7G 0 part /media/pi/rootfs
mmcblk0 179:0 0 29.7G 0 disk
├─mmcblk0p1 179:1 0 256M 0 part /boot
└─mmcblk0p2 179:2 0 29.5G 0 part /
- mmcblk0 is the Pi’s SD card, so the USB stick is /dev/sda