Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #230805

Re: What is the command to access the temp sensors in a rpi4?

From "007@caiway.net" <007@caiway.net>
Newsgroups linux.debian.user
Subject Re: What is the command to access the temp sensors in a rpi4?
Date 2021-01-18 21:10 +0100
Message-ID <ByJ0B-xZ-11@gated-at.bofh.it> (permalink)
References <ByuEh-8i-1@gated-at.bofh.it>
Organization 007

Show all headers | View raw


On Sun, 17 Jan 2021 23:47:48 -0500
Gene Heskett <gheskett@shentel.net> wrote:

> Greetings all;

> Cheers, Gene Heskett

cpu=$(</sys/class/thermal/thermal_zone0/temp) ; echo -e "CPU
temperature: $((cpu/100)) Celsius"   | sed 's/\B[0-9]\{1\}\>/,&/'

This oneliner works on pi3 and pi4


I use this oneliner for some color:
cpu=$(</sys/class/thermal/thermal_zone0/temp) ; echo -e "CPU
temperature: \e[31m  $((cpu/100)) Celsius \e[0m"   | sed
's/\B[0-9]\{1\}\>/,&/'

Or in a script:

#!/bin/bash
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo -e "CPU temperatuur: \e[31m  $((cpu/100)) Celsius \e[0m" | sed
's/\B[0-9]\{1\}\>/,&/' 
#eof

hope this helps

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

What is the command to access the temp sensors in a rpi4? Gene Heskett <gheskett@shentel.net> - 2021-01-18 05:50 +0100
  Re: What is the command to access the temp sensors in a rpi4? deloptes <deloptes@gmail.com> - 2021-01-18 09:20 +0100
    Re: What is the command to access the temp sensors in a rpi4? Gene Heskett <gheskett@shentel.net> - 2021-01-18 10:40 +0100
      Re: What is the command to access the temp sensors in a rpi4? deloptes <deloptes@gmail.com> - 2021-01-18 12:20 +0100
  Re: What is the command to access the temp sensors in a rpi4? Anssi Saari <as@sci.fi> - 2021-01-18 16:40 +0100
  Re: What is the command to access the temp sensors in a rpi4? Stefan Monnier <monnier@iro.umontreal.ca> - 2021-01-18 18:20 +0100
    Re: What is the command to access the temp sensors in a rpi4? Gene Heskett <gheskett@shentel.net> - 2021-01-18 19:40 +0100
      Re: What is the command to access the temp sensors in a rpi4? Gene Heskett <gheskett@shentel.net> - 2021-01-18 19:50 +0100
        Re: What is the command to access the temp sensors in a rpi4? Stefan Monnier <monnier@iro.umontreal.ca> - 2021-01-18 23:50 +0100
      Re: What is the command to access the temp sensors in a rpi4? Stefan Monnier <monnier@iro.umontreal.ca> - 2021-01-18 19:50 +0100
      Re: What is the command to access the temp sensors in a rpi4? Eduardo M KALINOWSKI <eduardo@kalinowski.com.br> - 2021-01-18 20:20 +0100
        Re: What is the command to access the temp sensors in a rpi4? "Miguel A. Vallejo" <ea4eoz@gmail.com> - 2021-01-18 20:30 +0100
        Re: What is the command to access the temp sensors in a rpi4? Gene Heskett <gheskett@shentel.net> - 2021-01-18 21:10 +0100
  Re: What is the command to access the temp sensors in a rpi4? "007@caiway.net" <007@caiway.net> - 2021-01-18 21:10 +0100
    Re: What is the command to access the temp sensors in a rpi4? Gene Heskett <gheskett@shentel.net> - 2021-01-18 21:20 +0100

csiph-web