[Git][NTPsec/ntpsec][master] makeheat: stabilize temp of your RasPi.

Gary E. Miller gitlab at mg.gitlab.com
Sat Jan 28 03:27:37 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
d1ac5a80 by Gary E. Miller at 2017-01-27T19:27:26-08:00
makeheat: stabilize temp of your RasPi.

- - - - -


2 changed files:

- contrib/README
- + contrib/makeheat


Changes:

=====================================
contrib/README
=====================================
--- a/contrib/README
+++ b/contrib/README
@@ -26,3 +26,8 @@ zone-temp-log reads /sys/class/thermal/thermal_zone*/temp to find the CPU
 temperature.  Writes all temperatures found to stdout on one line, preceded by
 the Unix UTC time in seconds.  This is useful on any Linux system that
 supports the /sys/class/thermal/thermal_zone*/temp interface.
+
+makeheat is a program to exercise a CPU until the CPU reachs a certain
+temperature.  The idea if to get the temperature around the system
+oscillator to be near the zero TC point.  Tested on RasPi wrapped
+in bubble wrap.


=====================================
contrib/makeheat
=====================================
--- /dev/null
+++ b/contrib/makeheat
@@ -0,0 +1,34 @@
+#!/usr/bin/env python
+#
+# generate some heat!
+# 
+# Wrap your RasPi in bubble wrap.  Then run makeheat in the background.
+# It will try to stabilize the CPU temperature at 60C.
+
+import hashlib
+import time
+
+zone0 = '/sys/class/thermal/thermal_zone0/temp'
+cnt = 0
+
+m = hashlib.md5()
+temp = 0
+while True:
+    # on a RasPi 3, 200,000 of the m.update() can be one second
+    if 60 > temp:
+        m.update("Nobody inspects the spammish repetition")
+    else:
+        cnt = 25000
+        time.sleep(0.125)
+
+    cnt += 1
+    if 25000 < cnt:
+        cnt = 0
+
+        zone_data = open(zone0, 'r')
+        for line in zone_data:
+            temp = float(line) / 1000
+
+        zone_data.close()
+        if 60 < temp:
+            time.sleep(0.125)



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/d1ac5a801edd7767c40d9525751279caf7efa888
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170128/7e2de657/attachment.html>


More information about the vc mailing list