Skip to content

Commit

Permalink
Merge pull request #296 from EnviroDIY/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
SRGDamia1 authored Sep 19, 2019
2 parents 1bcd611 + 88daf88 commit 45f128a
Show file tree
Hide file tree
Showing 38 changed files with 387 additions and 340 deletions.
29 changes: 11 additions & 18 deletions examples/DRWI_CitSci/DRWI_CitSci.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Software License: BSD-3.
Copyright (c) 2017, Stroud Water Research Center (SWRC)
and the EnviroDIY Development Team
This example sketch is written for ModularSensors library version 0.23.11
This example sketch is written for ModularSensors library version 0.23.13
This sketch is an example of logging data to an SD card and sending the data to
both the EnviroDIY data portal as should be used by groups involved with
Expand Down Expand Up @@ -40,7 +40,7 @@ THIS CODE IS PROVIDED "AS IS" - NO WARRANTY IS GIVEN.
// Data Logger Settings
// ==========================================================================
// The library version this example was written for
const char *libraryVersion = "0.23.11";
const char *libraryVersion = "0.23.13";
// The name of this file
const char *sketchName = "DWRI_CitSci.ino";
// Logger ID, also becomes the prefix for the name of the data file on SD card
Expand Down Expand Up @@ -291,28 +291,21 @@ void setup()

// Note: Please change these battery voltages to match your battery
// Check that the battery is OK before powering the modem
if (getBatteryVoltage() > 3.7)
if (getBatteryVoltage() > 3.55 || !dataLogger.isRTCSane())
{
modem.modemPowerUp();
modem.wake();
modem.setup();

// At very good battery voltage, or with suspicious time stamp, sync the clock
// Note: Please change these battery voltages to match your battery
if (getBatteryVoltage() > 3.8 ||
dataLogger.getNowEpoch() < 1546300800 || /*Before 01/01/2019*/
dataLogger.getNowEpoch() > 1735689600) /*After 1/1/2025*/
// Synchronize the RTC with NIST
Serial.println(F("Attempting to connect to the internet and synchronize RTC with NIST"));
if (modem.connectInternet(120000L))
{
// Synchronize the RTC with NIST
Serial.println(F("Attempting to connect to the internet and synchronize RTC with NIST"));
if (modem.connectInternet(120000L))
{
dataLogger.setRTClock(modem.getNISTTime());
}
else
{
Serial.println(F("Could not connect to internet for clock sync."));
}
dataLogger.setRTClock(modem.getNISTTime());
}
else
{
Serial.println(F("Could not connect to internet for clock sync."));
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/DRWI_CitSci/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ build_flags =
-DSDI12_EXTERNAL_PCINT
-DNEOSWSERIAL_EXTERNAL_PCINT
lib_deps =
[email protected].11
[email protected].13
; ^^ Use this when working from an official release of the library
; https://github.com/EnviroDIY/ModularSensors.git#develop
; ^^ Use this when if you want to pull from the develop branch
29 changes: 11 additions & 18 deletions examples/DRWI_LTE/DRWI_LTE.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Software License: BSD-3.
Copyright (c) 2017, Stroud Water Research Center (SWRC)
and the EnviroDIY Development Team
This example sketch is written for ModularSensors library version 0.23.11
This example sketch is written for ModularSensors library version 0.23.13
This sketch is an example of logging data to an SD card and sending the data to
both the EnviroDIY data portal as should be used by groups involved with
Expand Down Expand Up @@ -40,7 +40,7 @@ THIS CODE IS PROVIDED "AS IS" - NO WARRANTY IS GIVEN.
// Data Logger Settings
// ==========================================================================
// The library version this example was written for
const char *libraryVersion = "0.23.11";
const char *libraryVersion = "0.23.13";
// The name of this file
const char *sketchName = "DRWI_LTE.ino";
// Logger ID, also becomes the prefix for the name of the data file on SD card
Expand Down Expand Up @@ -295,28 +295,21 @@ void setup()

// Note: Please change these battery voltages to match your battery
// Check that the battery is OK before powering the modem
if (getBatteryVoltage() > 3.7)
if (getBatteryVoltage() > 3.55 || !dataLogger.isRTCSane())
{
modem.modemPowerUp();
modem.wake();
modem.setup();

// At very good battery voltage, or with suspicious time stamp, sync the clock
// Note: Please change these battery voltages to match your battery
if (getBatteryVoltage() > 3.8 ||
dataLogger.getNowEpoch() < 1546300800 || /*Before 01/01/2019*/
dataLogger.getNowEpoch() > 1735689600) /*After 1/1/2025*/
// Synchronize the RTC with NIST
Serial.println(F("Attempting to connect to the internet and synchronize RTC with NIST"));
if (modem.connectInternet(120000L))
{
// Synchronize the RTC with NIST
Serial.println(F("Attempting to connect to the internet and synchronize RTC with NIST"));
if (modem.connectInternet(120000L))
{
dataLogger.setRTClock(modem.getNISTTime());
}
else
{
Serial.println(F("Could not connect to internet for clock sync."));
}
dataLogger.setRTClock(modem.getNISTTime());
}
else
{
Serial.println(F("Could not connect to internet for clock sync."));
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/DRWI_LTE/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ lib_ignore = RTCZero
build_flags =
-DSDI12_EXTERNAL_PCINT
lib_deps =
[email protected].11
[email protected].13
; ^^ Use this when working from an official release of the library
; https://github.com/EnviroDIY/ModularSensors.git#develop
; ^^ Use this when if you want to pull from the develop branch
4 changes: 2 additions & 2 deletions examples/DRWI_NoCellular/DRWI_NoCellular.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Software License: BSD-3.
Copyright (c) 2017, Stroud Water Research Center (SWRC)
and the EnviroDIY Development Team
This example sketch is written for ModularSensors library version 0.23.11
This example sketch is written for ModularSensors library version 0.23.13
This sketch is an example of logging data to an SD card as should be used by
groups involved with The William Penn Foundation's Delaware River Watershed
Expand All @@ -34,7 +34,7 @@ THIS CODE IS PROVIDED "AS IS" - NO WARRANTY IS GIVEN.
// Data Logger Settings
// ==========================================================================
// The library version this example was written for
const char *libraryVersion = "0.23.11";
const char *libraryVersion = "0.23.13";
// The name of this file
const char *sketchName = "DRWI_NoCellular.ino";
// Logger ID, also becomes the prefix for the name of the data file on SD card
Expand Down
2 changes: 1 addition & 1 deletion examples/DRWI_NoCellular/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ build_flags =
-DSDI12_EXTERNAL_PCINT
-DNEOSWSERIAL_EXTERNAL_PCINT
lib_deps =
[email protected].11
[email protected].13
; ^^ Use this when working from an official release of the library
; https://github.com/EnviroDIY/ModularSensors.git#develop
; ^^ Use this when if you want to pull from the develop branch
29 changes: 11 additions & 18 deletions examples/baro_rho_correction/baro_rho_correction.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Software License: BSD-3.
Copyright (c) 2017, Stroud Water Research Center (SWRC)
and the EnviroDIY Development Team
This example sketch is written for ModularSensors library version 0.23.11
This example sketch is written for ModularSensors library version 0.23.13
This sketch is an example of logging data to an SD card and sending the data to
the EnviroDIY data portal.
Expand Down Expand Up @@ -43,7 +43,7 @@ THIS CODE IS PROVIDED "AS IS" - NO WARRANTY IS GIVEN.
// Data Logger Settings
// ==========================================================================
// The library version this example was written for
const char *libraryVersion = "0.23.11";
const char *libraryVersion = "0.23.13";
// The name of this file
const char *sketchName = "baro_rho_correction.ino";
// Logger ID, also becomes the prefix for the name of the data file on SD card
Expand Down Expand Up @@ -407,28 +407,21 @@ void setup()

// Note: Please change these battery voltages to match your battery
// Check that the battery is OK before powering the modem
if (getBatteryVoltage() > 3.7)
if (getBatteryVoltage() > 3.55 || !dataLogger.isRTCSane())
{
modem.modemPowerUp();
modem.wake();
modem.setup();

// At very good battery voltage, or with suspicious time stamp, sync the clock
// Note: Please change these battery voltages to match your battery
if (getBatteryVoltage() > 3.8 ||
dataLogger.getNowEpoch() < 1546300800 || /*Before 01/01/2019*/
dataLogger.getNowEpoch() > 1735689600) /*After 1/1/2025*/
// Synchronize the RTC with NIST
Serial.println(F("Attempting to connect to the internet and synchronize RTC with NIST"));
if (modem.connectInternet(120000L))
{
// Synchronize the RTC with NIST
Serial.println(F("Attempting to connect to the internet and synchronize RTC with NIST"));
if (modem.connectInternet(120000L))
{
dataLogger.setRTClock(modem.getNISTTime());
}
else
{
Serial.println(F("Could not connect to internet for clock sync."));
}
dataLogger.setRTClock(modem.getNISTTime());
}
else
{
Serial.println(F("Could not connect to internet for clock sync."));
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/baro_rho_correction/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ build_flags =
-DSDI12_EXTERNAL_PCINT
-DNEOSWSERIAL_EXTERNAL_PCINT
lib_deps =
[email protected].11
[email protected].13
; ^^ Use this when working from an official release of the library
; https://github.com/EnviroDIY/ModularSensors.git#develop
; ^^ Use this when if you want to pull from the develop branch
8 changes: 4 additions & 4 deletions examples/cuahsi_workshop/cuahsi_workshop.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Software License: BSD-3.
Copyright (c) 2017, Stroud Water Research Center (SWRC)
and the EnviroDIY Development Team
This example sketch is written for ModularSensors library version 0.23.11
This example sketch is written for ModularSensors library version 0.23.13
This shows most of the standard functions of the library at once.
Expand Down Expand Up @@ -42,7 +42,7 @@ THIS CODE IS PROVIDED "AS IS" - NO WARRANTY IS GIVEN.
// Data Logger Settings
// ==========================================================================
// The library version this example was written for
const char *libraryVersion = "0.23.11";
const char *libraryVersion = "0.23.13";
// The name of this file
const char *sketchName = "cuahsi_workshop.ino";
// Logger ID, also becomes the prefix for the name of the data file on SD card
Expand Down Expand Up @@ -429,8 +429,8 @@ void setup()
// At very good battery voltage, or with suspicious time stamp, sync the clock
// Note: Please change these battery voltages to match your battery
if (getBatteryVoltage() > 3.8 ||
dataLogger.getNowEpoch() < 1546300800 || /*Before 01/01/2019*/
dataLogger.getNowEpoch() > 1735689600) /*After 1/1/2025*/
dataLogger.getNowEpoch() < 1546300800 || /*Before September 01, 2019*/
dataLogger.getNowEpoch() > 1735689600) /*After January 1, 2025*/
{
// Synchronize the RTC with NIST
Serial.println(F("Attempting to connect to the internet and synchronize RTC with NIST"));
Expand Down
25 changes: 9 additions & 16 deletions examples/data_saving/data_saving.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Software License: BSD-3.
Copyright (c) 2017, Stroud Water Research Center (SWRC)
and the EnviroDIY Development Team
This example sketch is written for ModularSensors library version 0.23.11
This example sketch is written for ModularSensors library version 0.23.13
This sketch is an example of logging data to an SD card and sending only a
portion of that data to the EnviroDIY data portal.
Expand Down Expand Up @@ -42,7 +42,7 @@ THIS CODE IS PROVIDED "AS IS" - NO WARRANTY IS GIVEN.
// Data Logger Settings
// ==========================================================================
// The library version this example was written for
const char *libraryVersion = "0.23.11";
const char *libraryVersion = "0.23.13";
// The name of this file
const char *sketchName = "data_saving.ino";
// Logger ID, also becomes the prefix for the name of the data file on SD card
Expand Down Expand Up @@ -511,24 +511,17 @@ void setup()

// Note: Please change these battery voltages to match your battery
// Check that the battery is OK before powering the modem
if (getBatteryVoltage() > 3.7)
if (getBatteryVoltage() > 3.55 || !loggerAllVars.isRTCSane())
{
modem.modemPowerUp();
modem.wake();
modem.setup();

// At very good battery voltage, or with suspicious time stamp, sync the clock
// Note: Please change these battery voltages to match your battery
if (getBatteryVoltage() > 3.8 ||
loggerAllVars.getNowEpoch() < 1546300800 || /*Before 01/01/2019*/
loggerAllVars.getNowEpoch() > 1735689600) /*After 1/1/2025*/
// Synchronize the RTC with NIST
Serial.println(F("Attempting to connect to the internet and synchronize RTC with NIST"));
if (modem.connectInternet(120000L))
{
// Synchronize the RTC with NIST
Serial.println(F("Attempting to connect to the internet and synchronize RTC with NIST"));
if (modem.connectInternet(120000L))
{
loggerAllVars.setRTClock(modem.getNISTTime());
}
loggerAllVars.setRTClock(modem.getNISTTime());
}
}

Expand Down Expand Up @@ -595,7 +588,7 @@ void loop()
// NOTE: if the modemPowerUp function is not run before the completeUpdate
// function is run, the modem will not be powered and will not return
// a signal strength readign.
if (getBatteryVoltage() > 3.7)
if (getBatteryVoltage() > 3.55)
modem.modemPowerUp();

// Start the stream for the modbus sensors
Expand Down Expand Up @@ -633,7 +626,7 @@ void loop()

// Connect to the network
// Again, we're only doing this if the battery is doing well
if (getBatteryVoltage() > 3.7)
if (getBatteryVoltage() > 3.55)
{
if (modem.connectInternet())
{
Expand Down
2 changes: 1 addition & 1 deletion examples/data_saving/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ build_flags =
-DSDI12_EXTERNAL_PCINT
-DNEOSWSERIAL_EXTERNAL_PCINT
lib_deps =
[email protected].11
[email protected].13
; ^^ Use this when working from an official release of the library
; https://github.com/EnviroDIY/ModularSensors.git#develop
; ^^ Use this when if you want to pull from the develop branch
Expand Down
4 changes: 2 additions & 2 deletions examples/double_logger/double_logger.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Software License: BSD-3.
Copyright (c) 2017, Stroud Water Research Center (SWRC)
and the EnviroDIY Development Team
This example sketch is written for ModularSensors library version 0.23.11
This example sketch is written for ModularSensors library version 0.23.13
This sketch is an example of logging data from different variables at two
different logging intervals. This example uses more of the manual functions
Expand All @@ -29,7 +29,7 @@ THIS CODE IS PROVIDED "AS IS" - NO WARRANTY IS GIVEN.
// Data Logger Settings
// ==========================================================================
// The library version this example was written for
const char *libraryVersion = "0.23.11";
const char *libraryVersion = "0.23.13";
// The name of this file
const char *sketchName = "double_logger.ino";
// Logger ID - we're only using one logger ID for both "loggers"
Expand Down
2 changes: 1 addition & 1 deletion examples/double_logger/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ build_flags =
-DSDI12_EXTERNAL_PCINT
-DNEOSWSERIAL_EXTERNAL_PCINT
lib_deps =
[email protected].11
[email protected].13
; ^^ Use this when working from an official release of the library
; https://github.com/EnviroDIY/ModularSensors.git#develop
; ^^ Use this when if you want to pull from the develop branch
Loading

0 comments on commit 45f128a

Please sign in to comment.