Browse code

revisions 2018-07-24

fractalxaos authored on 07/24/2018 19:19:53
Showing 3 changed files
... ...
@@ -121,7 +121,7 @@
121 121
  The following defines how often the system clock gets synchronized
122 122
  to network time.
123 123
 */
124
-#define NET_SYNCH_INTERVAL 21600 //number in seconds
124
+#define NET_SYNCH_INTERVAL 43200 //number in seconds
125 125
 /*
126 126
  The following defines the size of the buffer space required for the
127 127
  serial data string from the Mighty Ohm Geiger counter.  The serial
... ...
@@ -191,8 +191,6 @@ boolean bUseStaticIP;
191 191
  Create and initialize global arrays to hold the current IP address
192 192
  and the NTP server IP address.
193 193
 */
194
-//byte ipAddr[4] = {};
195
-//byte ntpIpAddr[4] = {};
196 194
 byte ipAddr[4];
197 195
 byte ntpIpAddr[4];
198 196
 
... ...
@@ -440,7 +438,7 @@ void listenForEthernetClients()
440 438
         transmitErrorPage(client);
441 439
     }
442 440
 
443
-    Serial.println(mightOhmData);
441
+    //Serial.println(mightOhmData);
444 442
     // give the web browser time to receive the data
445 443
     delay(10);
446 444
     // close the connection:
... ...
@@ -480,7 +478,7 @@ void transmitWebPage(EthernetClient client) {
480 478
                  "h2 {font: 24px arial, sans-serif;}</style>" \
481 479
                  "</head><body><h2>Radiation Monitor</h2>" \
482 480
                  "<p><a href=\"http://intravisions.com/radmon/\">" \
483
-                 "<i>IntraVisions.com/radmon</i></a></p>" \
481
+                 "<i>intravisions.com/radmon</i></a></p>" \
484 482
                  "<hr>"));
485 483
   /* Data Items */             
486 484
   client.print(F("<pre>UTC &#9;"));
487 485
Binary files a/DIY Radmon Project Description.pdf and b/DIY Radmon Project Description.pdf differ
488 486
old mode 100644
489 487
new mode 100755
... ...
@@ -24,16 +24,21 @@
24 24
 #    along with this program.  If not, see http://www.gnu.org/license.
25 25
 #
26 26
 # Revision History
27
-#   * v10 released 15 Sep 2015 by J L Owrey
27
+#   * v11 released 24 Jul 2018 by J L Owrey
28 28
 #
29
+# Example of rrdtool command line executed by this program:
30
+#
31
+#   rrdtool create radmonData.rrd --step 30 DS:CPM:GAUGE:60:U:U
32
+#   DS:SvperHr:GAUGE:60:U:U RRA:LAST:0.5:1:2880 RRA:LAST:0.5:30:35520
33
+#
34
+
29 35
 import os
30
-import time
31 36
 import subprocess
32 37
 
33 38
     ### DEFINE FILE LOCATIONS ###
34 39
 
35 40
 _USER = os.environ['USER']
36
-_RRD_FILE = "/home/%s/database/radmonData.rrd" % _USER  # the file that stores the data
41
+_RRD_FILE = "/home/%s/database/radmonData.rrd" % _USER  # rrd database file
37 42
 _RRD_SIZE_IN_DAYS = 370 # days
38 43
 _1YR_RRA_STEPS_PER_DAY = 96
39 44
 _DATABASE_UPDATE_INTERVAL = 30
... ...
@@ -51,7 +56,8 @@ def createRrdFile():
51 56
      ## Calculate database size
52 57
  
53 58
     heartBeat = 2 * _DATABASE_UPDATE_INTERVAL
54
-    rra1yrNumPDP =  int(round(86400 / (_1YR_RRA_STEPS_PER_DAY * _DATABASE_UPDATE_INTERVAL)))
59
+    rra1yrNumPDP =  int(round(86400 / (_1YR_RRA_STEPS_PER_DAY * \
60
+                        _DATABASE_UPDATE_INTERVAL)))
55 61
     rrd24hrNumRows = int(round(86400 / _DATABASE_UPDATE_INTERVAL))
56 62
     rrd1yearNumRows = _1YR_RRA_STEPS_PER_DAY * _RRD_SIZE_IN_DAYS
57 63
        
... ...
@@ -69,8 +75,7 @@ def createRrdFile():
69 75
         subprocess.check_output(strCmd, stderr=subprocess.STDOUT, \
70 76
                                 shell=True)
71 77
     except subprocess.CalledProcessError, exError:
72
-        print "%s rrdtool create failed: %s" % \
73
-                            (getTimeStamp(), exError.output)
78
+        print "rrdtool create failed: %s" % (exError.output)
74 79
         return False
75 80
     return True
76 81
 ##end def