@@ -7,7 +7,7 @@ Software License: BSD-3.
77 Copyright (c) 2017, Stroud Water Research Center (SWRC)
88 and the EnviroDIY Development Team
99
10- This example sketch is written for ModularSensors library version 0.23.11
10+ This example sketch is written for ModularSensors library version 0.23.13
1111
1212This sketch is an example of logging data to an SD card and sending only a
1313portion of that data to the EnviroDIY data portal.
@@ -42,7 +42,7 @@ THIS CODE IS PROVIDED "AS IS" - NO WARRANTY IS GIVEN.
4242// Data Logger Settings
4343// ==========================================================================
4444// The library version this example was written for
45- const char *libraryVersion = " 0.23.11 " ;
45+ const char *libraryVersion = " 0.23.13 " ;
4646// The name of this file
4747const char *sketchName = " data_saving.ino" ;
4848// Logger ID, also becomes the prefix for the name of the data file on SD card
@@ -511,24 +511,17 @@ void setup()
511511
512512 // Note: Please change these battery voltages to match your battery
513513 // Check that the battery is OK before powering the modem
514- if (getBatteryVoltage () > 3.7 )
514+ if (getBatteryVoltage () > 3.55 || !loggerAllVars. isRTCSane () )
515515 {
516516 modem.modemPowerUp ();
517517 modem.wake ();
518518 modem.setup ();
519519
520- // At very good battery voltage, or with suspicious time stamp, sync the clock
521- // Note: Please change these battery voltages to match your battery
522- if (getBatteryVoltage () > 3.8 ||
523- loggerAllVars.getNowEpoch () < 1546300800 || /* Before 01/01/2019*/
524- loggerAllVars.getNowEpoch () > 1735689600 ) /* After 1/1/2025*/
520+ // Synchronize the RTC with NIST
521+ Serial.println (F (" Attempting to connect to the internet and synchronize RTC with NIST" ));
522+ if (modem.connectInternet (120000L ))
525523 {
526- // Synchronize the RTC with NIST
527- Serial.println (F (" Attempting to connect to the internet and synchronize RTC with NIST" ));
528- if (modem.connectInternet (120000L ))
529- {
530- loggerAllVars.setRTClock (modem.getNISTTime ());
531- }
524+ loggerAllVars.setRTClock (modem.getNISTTime ());
532525 }
533526 }
534527
@@ -595,7 +588,7 @@ void loop()
595588 // NOTE: if the modemPowerUp function is not run before the completeUpdate
596589 // function is run, the modem will not be powered and will not return
597590 // a signal strength readign.
598- if (getBatteryVoltage () > 3.7 )
591+ if (getBatteryVoltage () > 3.55 )
599592 modem.modemPowerUp ();
600593
601594 // Start the stream for the modbus sensors
@@ -633,7 +626,7 @@ void loop()
633626
634627 // Connect to the network
635628 // Again, we're only doing this if the battery is doing well
636- if (getBatteryVoltage () > 3.7 )
629+ if (getBatteryVoltage () > 3.55 )
637630 {
638631 if (modem.connectInternet ())
639632 {
0 commit comments