View Single Post
Old 13-06-2016, 19:42   #6667
- Lke -
Senior Member
 
Iscritto dal: Nov 2006
Messaggi: 489
Quote:
Originariamente inviato da Intel-Inside Guarda i messaggi
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
__________________
AsRock Z77 Extreme4 | Intel i7-3770 cooled with Cooler Master Hyper 412s | Corsair Vengeance Blue DDR3 2x8GB | Sapphire Radeon HD 7870 | Tagan PipeRock 600W
Fractal Design Define R4 windowed | Crucial M4 128GB | WD Caviar Green 1.5TB | Dell U2412M & Samsung SyncMaster T200 | Razer DeathAdder LE


Ultima modifica di - Lke - : 13-06-2016 alle 19:51.
- Lke - è offline   Rispondi citando il messaggio o parte di esso