HOW TO: Display RPI's Temperature & Restart/ Shutdown RPI from Blynk

@ram1505 do you have java skills (I don’t know the first thing about java)?

touch temp.txt
awk ‘{printf("\nrPI Temperature = %.1f °C\n\n",$1/1e3)}’ /sys/class/thermal/thermal_zone0/temp > temp.txt

this will create a text file of the temperature and you could set up cron to repeat at requested intervals.

Then you need java to read characters 19 to 22 of the file (again at requested intervals) and have Blynk display the result on a ValueDisplay.

1 Like