Skip to content

Commit 45f128a

Browse files
authored
Merge pull request #296 from EnviroDIY/develop
Develop
2 parents 1bcd611 + 88daf88 commit 45f128a

38 files changed

+387
-340
lines changed

examples/DRWI_CitSci/DRWI_CitSci.ino

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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
1212
This sketch is an example of logging data to an SD card and sending the data to
1313
both the EnviroDIY data portal as should be used by groups involved with
@@ -40,7 +40,7 @@ THIS CODE IS PROVIDED "AS IS" - NO WARRANTY IS GIVEN.
4040
// Data Logger Settings
4141
// ==========================================================================
4242
// The library version this example was written for
43-
const char *libraryVersion = "0.23.11";
43+
const char *libraryVersion = "0.23.13";
4444
// The name of this file
4545
const char *sketchName = "DWRI_CitSci.ino";
4646
// Logger ID, also becomes the prefix for the name of the data file on SD card
@@ -291,28 +291,21 @@ void setup()
291291

292292
// Note: Please change these battery voltages to match your battery
293293
// Check that the battery is OK before powering the modem
294-
if (getBatteryVoltage() > 3.7)
294+
if (getBatteryVoltage() > 3.55 || !dataLogger.isRTCSane())
295295
{
296296
modem.modemPowerUp();
297297
modem.wake();
298298
modem.setup();
299299

300-
// At very good battery voltage, or with suspicious time stamp, sync the clock
301-
// Note: Please change these battery voltages to match your battery
302-
if (getBatteryVoltage() > 3.8 ||
303-
dataLogger.getNowEpoch() < 1546300800 || /*Before 01/01/2019*/
304-
dataLogger.getNowEpoch() > 1735689600) /*After 1/1/2025*/
300+
// Synchronize the RTC with NIST
301+
Serial.println(F("Attempting to connect to the internet and synchronize RTC with NIST"));
302+
if (modem.connectInternet(120000L))
305303
{
306-
// Synchronize the RTC with NIST
307-
Serial.println(F("Attempting to connect to the internet and synchronize RTC with NIST"));
308-
if (modem.connectInternet(120000L))
309-
{
310-
dataLogger.setRTClock(modem.getNISTTime());
311-
}
312-
else
313-
{
314-
Serial.println(F("Could not connect to internet for clock sync."));
315-
}
304+
dataLogger.setRTClock(modem.getNISTTime());
305+
}
306+
else
307+
{
308+
Serial.println(F("Could not connect to internet for clock sync."));
316309
}
317310
}
318311

examples/DRWI_CitSci/platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ build_flags =
2222
-DSDI12_EXTERNAL_PCINT
2323
-DNEOSWSERIAL_EXTERNAL_PCINT
2424
lib_deps =
25-
EnviroDIY_ModularSensors@0.23.11
25+
EnviroDIY_ModularSensors@0.23.13
2626
; ^^ Use this when working from an official release of the library
2727
; https://github.com/EnviroDIY/ModularSensors.git#develop
2828
; ^^ Use this when if you want to pull from the develop branch

examples/DRWI_LTE/DRWI_LTE.ino

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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
1212
This sketch is an example of logging data to an SD card and sending the data to
1313
both the EnviroDIY data portal as should be used by groups involved with
@@ -40,7 +40,7 @@ THIS CODE IS PROVIDED "AS IS" - NO WARRANTY IS GIVEN.
4040
// Data Logger Settings
4141
// ==========================================================================
4242
// The library version this example was written for
43-
const char *libraryVersion = "0.23.11";
43+
const char *libraryVersion = "0.23.13";
4444
// The name of this file
4545
const char *sketchName = "DRWI_LTE.ino";
4646
// Logger ID, also becomes the prefix for the name of the data file on SD card
@@ -295,28 +295,21 @@ void setup()
295295

296296
// Note: Please change these battery voltages to match your battery
297297
// Check that the battery is OK before powering the modem
298-
if (getBatteryVoltage() > 3.7)
298+
if (getBatteryVoltage() > 3.55 || !dataLogger.isRTCSane())
299299
{
300300
modem.modemPowerUp();
301301
modem.wake();
302302
modem.setup();
303303

304-
// At very good battery voltage, or with suspicious time stamp, sync the clock
305-
// Note: Please change these battery voltages to match your battery
306-
if (getBatteryVoltage() > 3.8 ||
307-
dataLogger.getNowEpoch() < 1546300800 || /*Before 01/01/2019*/
308-
dataLogger.getNowEpoch() > 1735689600) /*After 1/1/2025*/
304+
// Synchronize the RTC with NIST
305+
Serial.println(F("Attempting to connect to the internet and synchronize RTC with NIST"));
306+
if (modem.connectInternet(120000L))
309307
{
310-
// Synchronize the RTC with NIST
311-
Serial.println(F("Attempting to connect to the internet and synchronize RTC with NIST"));
312-
if (modem.connectInternet(120000L))
313-
{
314-
dataLogger.setRTClock(modem.getNISTTime());
315-
}
316-
else
317-
{
318-
Serial.println(F("Could not connect to internet for clock sync."));
319-
}
308+
dataLogger.setRTClock(modem.getNISTTime());
309+
}
310+
else
311+
{
312+
Serial.println(F("Could not connect to internet for clock sync."));
320313
}
321314
}
322315

examples/DRWI_LTE/platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ lib_ignore = RTCZero
2121
build_flags =
2222
-DSDI12_EXTERNAL_PCINT
2323
lib_deps =
24-
EnviroDIY_ModularSensors@0.23.11
24+
EnviroDIY_ModularSensors@0.23.13
2525
; ^^ Use this when working from an official release of the library
2626
; https://github.com/EnviroDIY/ModularSensors.git#develop
2727
; ^^ Use this when if you want to pull from the develop branch

examples/DRWI_NoCellular/DRWI_NoCellular.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
1212
This sketch is an example of logging data to an SD card as should be used by
1313
groups involved with The William Penn Foundation's Delaware River Watershed
@@ -34,7 +34,7 @@ THIS CODE IS PROVIDED "AS IS" - NO WARRANTY IS GIVEN.
3434
// Data Logger Settings
3535
// ==========================================================================
3636
// The library version this example was written for
37-
const char *libraryVersion = "0.23.11";
37+
const char *libraryVersion = "0.23.13";
3838
// The name of this file
3939
const char *sketchName = "DRWI_NoCellular.ino";
4040
// Logger ID, also becomes the prefix for the name of the data file on SD card

examples/DRWI_NoCellular/platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ build_flags =
2222
-DSDI12_EXTERNAL_PCINT
2323
-DNEOSWSERIAL_EXTERNAL_PCINT
2424
lib_deps =
25-
EnviroDIY_ModularSensors@0.23.11
25+
EnviroDIY_ModularSensors@0.23.13
2626
; ^^ Use this when working from an official release of the library
2727
; https://github.com/EnviroDIY/ModularSensors.git#develop
2828
; ^^ Use this when if you want to pull from the develop branch

examples/baro_rho_correction/baro_rho_correction.ino

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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
1212
This sketch is an example of logging data to an SD card and sending the data to
1313
the EnviroDIY data portal.
@@ -43,7 +43,7 @@ THIS CODE IS PROVIDED "AS IS" - NO WARRANTY IS GIVEN.
4343
// Data Logger Settings
4444
// ==========================================================================
4545
// The library version this example was written for
46-
const char *libraryVersion = "0.23.11";
46+
const char *libraryVersion = "0.23.13";
4747
// The name of this file
4848
const char *sketchName = "baro_rho_correction.ino";
4949
// Logger ID, also becomes the prefix for the name of the data file on SD card
@@ -407,28 +407,21 @@ void setup()
407407

408408
// Note: Please change these battery voltages to match your battery
409409
// Check that the battery is OK before powering the modem
410-
if (getBatteryVoltage() > 3.7)
410+
if (getBatteryVoltage() > 3.55 || !dataLogger.isRTCSane())
411411
{
412412
modem.modemPowerUp();
413413
modem.wake();
414414
modem.setup();
415415

416-
// At very good battery voltage, or with suspicious time stamp, sync the clock
417-
// Note: Please change these battery voltages to match your battery
418-
if (getBatteryVoltage() > 3.8 ||
419-
dataLogger.getNowEpoch() < 1546300800 || /*Before 01/01/2019*/
420-
dataLogger.getNowEpoch() > 1735689600) /*After 1/1/2025*/
416+
// Synchronize the RTC with NIST
417+
Serial.println(F("Attempting to connect to the internet and synchronize RTC with NIST"));
418+
if (modem.connectInternet(120000L))
421419
{
422-
// Synchronize the RTC with NIST
423-
Serial.println(F("Attempting to connect to the internet and synchronize RTC with NIST"));
424-
if (modem.connectInternet(120000L))
425-
{
426-
dataLogger.setRTClock(modem.getNISTTime());
427-
}
428-
else
429-
{
430-
Serial.println(F("Could not connect to internet for clock sync."));
431-
}
420+
dataLogger.setRTClock(modem.getNISTTime());
421+
}
422+
else
423+
{
424+
Serial.println(F("Could not connect to internet for clock sync."));
432425
}
433426
}
434427

examples/baro_rho_correction/platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ build_flags =
2323
-DSDI12_EXTERNAL_PCINT
2424
-DNEOSWSERIAL_EXTERNAL_PCINT
2525
lib_deps =
26-
EnviroDIY_ModularSensors@0.23.11
26+
EnviroDIY_ModularSensors@0.23.13
2727
; ^^ Use this when working from an official release of the library
2828
; https://github.com/EnviroDIY/ModularSensors.git#develop
2929
; ^^ Use this when if you want to pull from the develop branch

examples/cuahsi_workshop/cuahsi_workshop.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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
1212
This shows most of the standard functions of the library at once.
1313
@@ -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
4747
const char *sketchName = "cuahsi_workshop.ino";
4848
// Logger ID, also becomes the prefix for the name of the data file on SD card
@@ -429,8 +429,8 @@ void setup()
429429
// At very good battery voltage, or with suspicious time stamp, sync the clock
430430
// Note: Please change these battery voltages to match your battery
431431
if (getBatteryVoltage() > 3.8 ||
432-
dataLogger.getNowEpoch() < 1546300800 || /*Before 01/01/2019*/
433-
dataLogger.getNowEpoch() > 1735689600) /*After 1/1/2025*/
432+
dataLogger.getNowEpoch() < 1546300800 || /*Before September 01, 2019*/
433+
dataLogger.getNowEpoch() > 1735689600) /*After January 1, 2025*/
434434
{
435435
// Synchronize the RTC with NIST
436436
Serial.println(F("Attempting to connect to the internet and synchronize RTC with NIST"));

examples/data_saving/data_saving.ino

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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
1212
This sketch is an example of logging data to an SD card and sending only a
1313
portion 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
4747
const 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

Comments
 (0)