Quote:
Originariamente inviato da Intel-Inside
Sto diventando matto... c'è un modo (Python) per avere la notifica su telegram se la temperatura della board super una certa soglia?
cat /sys/class/thermal/thermal_zone0/temp
/opt/vc/bin/vcgencmd measure_temp
Grazie
|
Ciao, cosa ti risulta difficile in particolare? Non ho esperienza diretta in merito, ma non dovrebbe essere troppo complesso. Potrebbe essere un bell'esercizio.
Roba tipo
questa l'hai già letta?
Edit: Basandoti su questo script dovresti semplificarti abbastanza la vita
Quote:
#!/usr/bin/python
fo = open("/sys/class/thermal/thermal_zone0/temp") # opens the file
rawTemp = fo.read(); # reads contents to string
fo.close() # cleans up our file handler
# To get temperature in Celsius we must divide value by 1000
tempInC = int(rawTemp)/1000 # casts raw data to Integer, then divides by 1000
#print(tempInC); # out puts data, uncomment to debug.
if tempInC < 40:
print "Below 40 degrees, turning fan off. Current Temp: " +str(tempInC)
# code to turn fan off
elif tempInC > 50:
print "Above 50 degrees, turning fan on. Current Temp: " +str(tempInC)
# code to turn fan on
|
Source:
https://www.raspberrypi.org/forums/v...46842&p=368545